diff --git a/.gitattributes b/.gitattributes index 25b46f84a6d..f5b288ab2d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,11 +21,8 @@ *.rtf diff=astextplain *.RTF diff=astextplain -autogen.sh text eol=lf -launcher.in text eol=lf -config.make.in text eol=lf +mono/launcher text eol=lf +mono/config.make text eol=lf targets.make text eol=lf -configure.ac text eol=lf -Makefile.in text eol=lf *.bsl linguist-vendored=true diff --git a/.gitignore b/.gitignore index a78b05f7c1b..39ae5993b06 100644 --- a/.gitignore +++ b/.gitignore @@ -87,10 +87,7 @@ Proto sign_temp .libs configure -launcher -autom4te.cache config.log -mono/config.make config.status *~ *.suo diff --git a/CHANGELOG.md b/CHANGELOG.md index ae6f2abea5a..372f3499871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -228,3 +228,4 @@ Includes commits up to `3385e58aabc91368c8e1f551650ba48705aaa285` [4.0.0]: http://fsharp.org [3.1.2]: http://blogs.msdn.com/b/fsharpteam/archive/2014/08/20/announcing-the-release-of-visual-f-tools-3-1-2.aspx [3.1.1]: http://blogs.msdn.com/b/fsharpteam/archive/2014/01/22/announcing-visual-f-3-1-1-and-support-for-desktop-express.aspx + diff --git a/DEVGUIDE.md b/DEVGUIDE.md index c41d635de4b..9fd93452651 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -2,22 +2,23 @@ Follow the instructions below to build and develop the F# Compiler, Core Library and tools on Windows, macOS and Linux. -* [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows) -* [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux) -* [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos) -* [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only) -* [Notes and Resources](#notes) +- [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows) +- [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux) +- [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos) +- [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only) +- [Notes and Resources](#notes) -### Developing the F# Compiler (Windows) +### Developing the F# Compiler (Windows) Install -- [.NET 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40779) -- [MSBuild 12.0](http://www.microsoft.com/en-us/download/details.aspx?id=40760) or Visual Studio 2013 (or later) +- [.NET 4.6](https://www.microsoft.com/en-gb/download/details.aspx?id=48130) **NOTE on Windows:** -1. It is recommended to run the build.cmd and the qualifiers below on a command prompt with path set to have the location of MSBuild. If we have Visual Studio, we can also run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). -2. The running command prompt must be run under Administrator right (`Run as Administrator`). + +1. It is recommended to run `build.cmd` in a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). + +2. The command prompt must have Administrator rights (`Run as Administrator`). Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: @@ -60,41 +61,65 @@ After you build the first time you can open and use this solution: or just build it directly: - msbuild FSharp.sln + msbuild FSharp.sln -Building ``FSharp.sln`` builds nearly everything. However building portable profiles of -FSharp.Core.dll is not included. If you are just developing the core compiler and library -then building the solution will be enough. +If you are just developing the core compiler and library then building ``FSharp.sln`` will be enough. -### Developing the F# Compiler (Linux) +### Developing the F# Compiler (Linux) For Linux/Mono, follow [these instructions](http://www.mono-project.com/docs/getting-started/install/linux/). Also you may need: - sudo apt-get install mono-complete autoconf libtool pkg-config make git automake + sudo apt-get install mono-complete make git Then: - - ./autoconf.sh --prefix /usr + make - make install -Full testing is not yet enabled on Linux, nor is a .NET Core build of the compiler. +Then to replace your machine-wide installation: -You can alternatively use + sudo make install - ./build.sh +Full testing is not yet enabled on Linux. -### Developing the F# Compiler (macOS) +### Developing the F# Compiler (macOS) -Install Xamarin Studio, then +Install XCode command line tools (or homebrew equivalents) and Mono or Visual Studio for Mac. + +Then: - ./autogen.sh --prefix=/Library/Frameworks/Mono.framework/Versions/Current/ make + +Then to replace your machine-wide installation: + sudo make install +Full testing is not yet enabled on macOS. + +### [Optional] Specifying the install path (Linux or macOS) + +You can specify a custom installation path using the DESTDIR shell variable + + DESTDIR=/my/path/to/fsharp make install + +### Developing the F# Compiler (Linux or macOS - .NET Core) + +Install [the latest .NET SDK](https://www.microsoft.com/net/download/). Then use + + src/buildfromsource.sh + +Outputs are placed in + + BuildFromSource/Debug/... + BuildFromSource/Release/... + +This uses an installed .NET SDK 2.0 to build the various duplicated project + +Testing the .NET Core version of the F# compiler on macOS and Linux is TBD. + ### Developing the Visual F# IDE Tools (Windows Only) To build and test Visual F# IDE Tools, install these requirements: + - [Visual Studio 2017](https://www.visualstudio.com/downloads/) - Under the "Windows" workloads, select ".NET desktop development" - Select "F# desktop language support" under the optional components @@ -108,16 +133,16 @@ Steps to build: Use ``VisualFSharp.sln`` if you're building the Visual F# IDE Tools. -Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see https://github.com/Microsoft/visualfsharp/issues/2771 and https://github.com/Microsoft/visualfsharp/pull/2773. +Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see issues [#2771](https://github.com/Microsoft/visualfsharp/issues/2771) and [#2773](https://github.com/Microsoft/visualfsharp/pull/2773). -Note: if you face this error [#2351](https://github.com/Microsoft/visualfsharp/issues/2351): +Note ([#2351](https://github.com/Microsoft/visualfsharp/issues/2351)): if you face this error: -> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe". +> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe". Or hard crash on launch ("Unknown Error"), delete these folders: -* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev` -* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)` +- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev` +- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)` #### [Optional] Install the Visual F# IDE Tools (Windows Only) @@ -131,18 +156,18 @@ 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\VisualFSharpOpenSource.vsix + VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix For **Release**, uninstall then reinstall: VSIXInstaller.exe /u:"VisualFSharp" - VSIXInstaller.exe release\net40\bin\VisualFSharpOpenSource.vsix + VSIXInstaller.exe release\net40\bin\VisualFSharpFull.vsix Restart Visual Studio, it should now be running your freshly-built Visual F# IDE Tools with updated F# Interactive. #### [Optional] F5 testing of local changes -To test your changes locally _without_ overwriting your default installed Visual F# tools, set the `VisualFSharp\Vsix\VisualFSharpOpenSource` +To test your changes locally _without_ overwriting your default installed Visual F# tools, set the `VisualFSharp\Vsix\VisualFSharpFull` project as the startup project. When you hit F5 a new instance of Visual Studio will be started in the `RoslynDev` hive with your changes, but the root (default) hive will remain untouched. You can also start this hive automatically using @@ -175,13 +200,7 @@ For **Release**: #### Windows: Links to Additional frameworks - [Git for windows](http://msysgit.github.io/) -- [.NET 3.5](http://www.microsoft.com/en-us/download/details.aspx?id=21) -- [.NET 4.5](http://www.microsoft.com/en-us/download/details.aspx?id=30653) -- [.NET 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40779) - [.NET 4.6](http://www.microsoft.com/en-us/download/details.aspx?id=48137) -- [MSBuild 12.0](http://www.microsoft.com/en-us/download/details.aspx?id=40760) -- [Windows 7 SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279) -- [Windows 8 SDK](http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx) - [Windows 8.1 SDK](http://msdn.microsoft.com/en-us/library/windows/desktop/bg162891.aspx) - [Windows 10 SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk) @@ -196,16 +215,29 @@ For **Release**: - 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 + +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. + + #### Configuring proxy server If you are behind a proxy server, NuGet client tool must be configured to use it: - .nuget\nuget.exe config -set http_proxy=proxy.domain.com:8080 -ConfigFile .nuget\NuGet.Config - .nuget\nuget.exe config -set http_proxy.user=user_name -ConfigFile .nuget\NuGet.Config - .nuget\nuget.exe config -set http_proxy.password=user_password -ConfigFile .nuget\NuGet.Config + .nuget\nuget.exe config -set http_proxy=proxy.domain.com:8080 -ConfigFile NuGet.Config + .nuget\nuget.exe config -set http_proxy.user=user_name -ConfigFile NuGet.Config + .nuget\nuget.exe config -set http_proxy.password=user_password -ConfigFile NuGet.Config 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/FSharp.Directory.Build.props b/FSharp.Directory.Build.props new file mode 100644 index 00000000000..5f8cb923c5c --- /dev/null +++ b/FSharp.Directory.Build.props @@ -0,0 +1,60 @@ + + + + + + + + Debug + $(MSBuildThisFileDirectory) + $(RepoRoot)src + $(RepoRoot)Tools + false + $(RepoRoot)Proto\net40\bin + + + + + + $(NUGET_PACKAGES) + $(MSBuildThisFileDirectory)packages + + $(NuGetPackageRoot)\ + $(NuGetPackageRoot)/ + + + + + false + true + $(FSharpSourcesRoot)\fsharp\msft.pubkey + true + true + + + + + true + + + + + false + true + + + + + portable + fs + false + true + + + + + $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets + $(ProtoFSharpTargetsShim) + + + diff --git a/FSharp.Directory.Build.targets b/FSharp.Directory.Build.targets new file mode 100644 index 00000000000..923863bb205 --- /dev/null +++ b/FSharp.Directory.Build.targets @@ -0,0 +1,41 @@ + + + + en;$(XlfLanguages) + coreclr + net40 + $(MSBuildProjectDirectory)\$(OutputPath) + $(OutputPath) + $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin + $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj + + + + + + + + + + + + + + + + + + + + + + diff --git a/FSharp.sln b/FSharp.sln index 0d41f990d73..033b789a8b0 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -31,7 +31,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Tests.FSharpSuite", EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core.UnitTests", "tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj", "{88E2D422-6852-46E3-A740-83E391DC7973}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core.UnitTests", "tests\FSharp.Core.UnitTests\FSharp.Core.Unittests.fsproj", "{88E2D422-6852-46E3-A740-83E391DC7973}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{3881429D-A97A-49EB-B7AE-A82BA5FE9C77}" EndProject @@ -39,10 +39,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{B8DDA694 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{3058BC79-8E79-4645-B05D-48CC182FA8A6}" 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}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -185,26 +181,6 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.Build.0 = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.ActiveCfg = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.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 - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.Build.0 = Debug|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|x86.ActiveCfg = Release|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.Build.0 = Release|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.ActiveCfg = Release|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.Build.0 = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.ActiveCfg = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.Build.0 = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|x86.ActiveCfg = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.Build.0 = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|x86.ActiveCfg = Release|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -221,7 +197,5 @@ Global {C163E892-5BF7-4B59-AA99-B0E8079C67C4} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} - {4239EFEA-E746-446A-BF7A-51FCBAB13946} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection EndGlobal diff --git a/Makefile b/Makefile index d955b9e7580..3d97ae5d640 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,30 @@ include $(topsrcdir)mono/config.make -.PHONY: restore +.PHONY: restore build build-proto restore: - MONO_ENV_OPTIONS=$(monoopts) mono .nuget/NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget/NuGet.Config + 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: restore +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 @@ -27,7 +38,7 @@ build: 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 + 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 diff --git a/.nuget/NuGet.Config b/NuGet.Config similarity index 83% rename from .nuget/NuGet.Config rename to NuGet.Config index 083aa0f1e43..d7b373fc4c6 100644 --- a/.nuget/NuGet.Config +++ b/NuGet.Config @@ -7,8 +7,8 @@ - - + + @@ -17,6 +17,7 @@ + diff --git a/README.md b/README.md index 617c8a4bece..93328665a13 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ For historical reasons this repository is called "visualfsharp" and currently al |**master** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part3_windows_nt/)| |**dev15.5** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part3_windows_nt/)| |**dev15.6** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part3_windows_nt/)| - +|**dev15.7** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part3_windows_nt/)| ## Help improve the Quality of the Tools by Using the Nightly Releases of Visual F# Tools To setup Visual Studio to use the latest nightly releases of the Visual F# Tools: @@ -36,6 +36,25 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for general guidelines on the contributio To contribute to the F# ecosystem more generally see the F# Software Foundation's [Community Projects](http://fsharp.org/community/projects/) pages. +## Branches + +These are the branches in use: + +* `master` = Latest branch for OSS developers and nightly users. + - Most contributions go here. + - Able to be built, installed and used in the latest public Visual Studio release. + - May contain updated F# features and logic. + - Used to build nightly VSIX (see above). + - Gets integrated into https://github.com/fsharp/fsharp to form the basis of Mono releases + - Gets integrated into https://github.com/fsharp/FSharp.Compiler.Service to form the basis of FSharp.Compiler.Service releases + +* `dev15.x` + - Latest release branch for the particular point release of Visual Studio. + - Incorporates features and fixes from master up to a particular branch point, then selective cherry-picks. + - May contain new features that depend on new things or fixes in the corresponding Visual Studio release. + - Gets integrated back into master once the corresponding Visual Studio release is made. + - Used to build Visual F# Tool updates + ### Technical Documentation @@ -62,6 +81,8 @@ To setup Visual Studio to use the latest nightly releases of the Visual F# Tools https://blogs.msdn.microsoft.com/dotnet/2017/03/14/announcing-nightly-releases-for-the-visual-f-tools/ +If you wish to set up a *Preview* nightly atop Visual Studio preview builds, you can either [download a VSIX Manually from here](https://dotnet.myget.org/feed/fsharp-preview/package/vsix/VisualFSharp) or set up a VSIX feed in visual studio from [here](https://dotnet.myget.org/F/fsharp-preview/vsix). + ### Using CI Builds To install F#, see http://fsharp.org. diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt new file mode 100644 index 00000000000..fdfd5ef905a --- /dev/null +++ b/RoslynPackageVersion.txt @@ -0,0 +1 @@ +2.6.0-vs-for-mac-62329-05 diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 4e3d82d6841..3d3a37ecdfe 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -1,11 +1,11 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27116.0 +VisualStudioVersion = 15.0.27130.2036 MinimumVisualStudioVersion = 10.0.40219.1 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("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}" +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 @@ -14,49 +14,49 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Server.Shar EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core", "src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{DED3BBD7-53F4-428A-8C9F-27968E768605}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.LanguageService", "vsintegration\src\FSharp.LanguageService\FSharp.LanguageService.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.LanguageService", "vsintegration\src\FSharp.LanguageService\FSharp.LanguageService.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.LanguageService.Base", "vsintegration\src\FSharp.LanguageService.Base\FSharp.LanguageService.Base.csproj", "{1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.LanguageService.Base", "vsintegration\src\FSharp.LanguageService.Base\FSharp.LanguageService.Base.csproj", "{1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Editor", "vsintegration\src\FSharp.Editor\FSharp.Editor.fsproj", "{65E0E82A-EACE-4787-8994-888674C2FE87}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Editor", "vsintegration\src\FSharp.Editor\FSharp.Editor.fsproj", "{65E0E82A-EACE-4787-8994-888674C2FE87}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectSystem.Base", "vsintegration\src\FSharp.ProjectSystem.Base\Project\ProjectSystem.Base.csproj", "{B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectSystem.Base", "vsintegration\src\FSharp.ProjectSystem.Base\Project\ProjectSystem.Base.csproj", "{B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}" EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "FSharp.PropertiesPages", "vsintegration\src\FSharp.ProjectSystem.PropertyPages\FSharp.PropertiesPages.vbproj", "{FCFB214C-462E-42B3-91CA-FC557EFEE74F}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ProjectSystem", "vsintegration\src\FSharp.ProjectSystem.FSharp\ProjectSystem.fsproj", "{6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ProjectSystem", "vsintegration\src\FSharp.ProjectSystem.FSharp\ProjectSystem.fsproj", "{6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProjectTemplates", "ProjectTemplates", "{C9B1D3F5-4971-4F04-9C26-37E3AC809AB4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "VisualFSharp.Salsa", "vsintegration\tests\Salsa\VisualFSharp.Salsa.fsproj", "{FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.Salsa", "vsintegration\tests\Salsa\VisualFSharp.Salsa.fsproj", "{FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "VisualFSharp.UnitTests", "vsintegration\tests\unittests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.UnitTests", "vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttribute", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj", "{DA39AD38-4A58-47BF-9215-E49768295169}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttribute", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj", "{DA39AD38-4A58-47BF-9215-E49768295169}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeFileDoesnotExist", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist\DefinitionLocationAttributeFileDoesnotExist.csproj", "{8C2439BD-0E49-4929-A8B1-29CEE228191E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeFileDoesnotExist", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist\DefinitionLocationAttributeFileDoesnotExist.csproj", "{8C2439BD-0E49-4929-A8B1-29CEE228191E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeLineDoesnotExist", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeLineDoesnotExist\DefinitionLocationAttributeLineDoesnotExist.csproj", "{F47196DC-186D-4055-BAF2-658282A12F33}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeLineDoesnotExist", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeLineDoesnotExist\DefinitionLocationAttributeLineDoesnotExist.csproj", "{F47196DC-186D-4055-BAF2-658282A12F33}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeWithSpaceInTheType", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeWithSpaceInTheType\DefinitionLocationAttributeWithSpaceInTheType.csproj", "{D4C88934-5893-467E-A55C-A11ECD6479FE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeWithSpaceInTheType", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeWithSpaceInTheType\DefinitionLocationAttributeWithSpaceInTheType.csproj", "{D4C88934-5893-467E-A55C-A11ECD6479FE}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DummyProviderForLanguageServiceTesting", "vsintegration\tests\unittests\MockTypeProviders\DummyProviderForLanguageServiceTesting\DummyProviderForLanguageServiceTesting.fsproj", "{6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DummyProviderForLanguageServiceTesting", "vsintegration\tests\MockTypeProviders\DummyProviderForLanguageServiceTesting\DummyProviderForLanguageServiceTesting.fsproj", "{6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EditorHideMethodsAttribute", "vsintegration\tests\unittests\MockTypeProviders\EditorHideMethodsAttribute\EditorHideMethodsAttribute.csproj", "{0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EditorHideMethodsAttribute", "vsintegration\tests\MockTypeProviders\EditorHideMethodsAttribute\EditorHideMethodsAttribute.csproj", "{0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EmptyAssembly", "vsintegration\tests\unittests\MockTypeProviders\EmptyAssembly\EmptyAssembly.fsproj", "{004982C6-93EA-4E70-B4F0-BE7D7219926A}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EmptyAssembly", "vsintegration\tests\MockTypeProviders\EmptyAssembly\EmptyAssembly.fsproj", "{004982C6-93EA-4E70-B4F0-BE7D7219926A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithAdequateComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithAdequateComment\XmlDocAttributeWithAdequateComment.csproj", "{243A81AC-A954-4601-833A-60EEEFB00FCD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithAdequateComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithAdequateComment\XmlDocAttributeWithAdequateComment.csproj", "{243A81AC-A954-4601-833A-60EEEFB00FCD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithEmptyComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithEmptyComment\XmlDocAttributeWithEmptyComment.csproj", "{B4595EB6-053A-400E-AA1B-7727F1BC900F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithEmptyComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithEmptyComment\XmlDocAttributeWithEmptyComment.csproj", "{B4595EB6-053A-400E-AA1B-7727F1BC900F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLocalizedComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithLocalizedComment\XmlDocAttributeWithLocalizedComment.csproj", "{A559D7E8-7EFD-473A-B618-A10B41AB523B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLocalizedComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithLocalizedComment\XmlDocAttributeWithLocalizedComment.csproj", "{A559D7E8-7EFD-473A-B618-A10B41AB523B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLongComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithLongComment\XmlDocAttributeWithLongComment.csproj", "{AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLongComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithLongComment\XmlDocAttributeWithLongComment.csproj", "{AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithNullComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithNullComment\XmlDocAttributeWithNullComment.csproj", "{956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithNullComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithNullComment\XmlDocAttributeWithNullComment.csproj", "{956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build", "src\fsharp\FSharp.Build\FSharp.Build.fsproj", "{702A7979-BCF9-4C41-853E-3ADFC9897890}" EndProject @@ -114,9 +114,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLFile", "vsintegration\It EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E1B1-4D89-9F10-F0B8AD58E71F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualFSharpOpenSource", "vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj", "{E6A45CDF-B408-420F-B475-74611BEFC52B}" +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 @@ -124,9 +122,9 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILComparer", "tests\fsharpq EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{D086C8C6-D00D-4C3B-9AB2-A4286C9F5922}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "LanguageServiceProfiling", "vsintegration\Utils\LanguageServiceProfiling\LanguageServiceProfiling.fsproj", "{E7FA3A71-51AF-4FCA-9C2F-7C853E515903}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "LanguageServiceProfiling", "vsintegration\Utils\LanguageServiceProfiling\LanguageServiceProfiling.fsproj", "{E7FA3A71-51AF-4FCA-9C2F-7C853E515903}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.UIResources", "vsintegration\src\FSharp.UIResources\FSharp.UIResources.csproj", "{C4586A06-1402-48BC-8E35-A1B8642F895B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.UIResources", "vsintegration\src\FSharp.UIResources\FSharp.UIResources.csproj", "{C4586A06-1402-48BC-8E35-A1B8642F895B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp_Analysis", "tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}" EndProject @@ -140,14 +138,10 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build.UnitTests", "t EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\fsharpqa\testenv\src\PEVerify\PEVerify.csproj", "{B0689A4E-07D8-494D-A0C8-791CB1D74E54}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "AssemblyVersionCheck", "tests\fsharpqa\testenv\src\AssemblyVersionCheck\AssemblyVersionCheck.fsproj", "{2BE9DC57-34C1-4196-9392-A5F189E6B95A}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 - Proto|Any CPU = Proto|Any CPU - Proto|x86 = Proto|x86 Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection @@ -156,10 +150,6 @@ Global {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}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.ActiveCfg = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.Build.0 = Proto|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 @@ -168,10 +158,6 @@ Global {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.Build.0 = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.ActiveCfg = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.Build.0 = Debug|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|Any CPU.Build.0 = Proto|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|x86.ActiveCfg = Proto|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|x86.Build.0 = Proto|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.ActiveCfg = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.Build.0 = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.ActiveCfg = Release|Any CPU @@ -180,10 +166,6 @@ Global {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.Build.0 = Debug|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.ActiveCfg = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.Build.0 = Proto|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.ActiveCfg = Release|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.Build.0 = Release|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|x86.ActiveCfg = Release|Any CPU @@ -192,10 +174,6 @@ Global {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.Build.0 = Debug|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|x86.ActiveCfg = Debug|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|x86.Build.0 = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.Build.0 = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|x86.ActiveCfg = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|x86.Build.0 = Proto|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg = Release|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.Build.0 = Release|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|x86.ActiveCfg = Release|Any CPU @@ -204,10 +182,6 @@ Global {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|x86.ActiveCfg = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|x86.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|x86.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|x86.Build.0 = Proto|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|Any CPU.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|x86.ActiveCfg = Release|Any CPU @@ -216,10 +190,6 @@ Global {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|x86.ActiveCfg = Debug|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|x86.Build.0 = Debug|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|Any CPU.Build.0 = Proto|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|x86.ActiveCfg = Proto|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|x86.Build.0 = Proto|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|Any CPU.Build.0 = Release|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|x86.ActiveCfg = Release|Any CPU @@ -228,10 +198,6 @@ Global {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|Any CPU.Build.0 = Debug|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|x86.ActiveCfg = Debug|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|x86.Build.0 = Debug|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|Any CPU.Build.0 = Proto|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|x86.ActiveCfg = Proto|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|x86.Build.0 = Proto|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|Any CPU.ActiveCfg = Release|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|Any CPU.Build.0 = Release|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|x86.ActiveCfg = Release|Any CPU @@ -240,10 +206,6 @@ Global {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|x86.ActiveCfg = Debug|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|x86.Build.0 = Debug|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|Any CPU.Build.0 = Proto|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|x86.ActiveCfg = Proto|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|x86.Build.0 = Proto|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|Any CPU.Build.0 = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|x86.ActiveCfg = Release|Any CPU @@ -252,10 +214,6 @@ Global {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.Build.0 = Debug|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.ActiveCfg = Debug|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.Build.0 = Debug|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.Build.0 = Proto|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.ActiveCfg = Release|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.Build.0 = Release|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.ActiveCfg = Release|Any CPU @@ -264,10 +222,6 @@ Global {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|Any CPU.Build.0 = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|x86.ActiveCfg = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|x86.Build.0 = Debug|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|Any CPU.Build.0 = Proto|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|x86.ActiveCfg = Proto|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|x86.Build.0 = Proto|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|Any CPU.ActiveCfg = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|Any CPU.Build.0 = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|x86.ActiveCfg = Release|Any CPU @@ -276,10 +230,6 @@ Global {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.ActiveCfg = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.Build.0 = Debug|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.ActiveCfg = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.Build.0 = Proto|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.Build.0 = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|x86.ActiveCfg = Release|Any CPU @@ -288,10 +238,6 @@ Global {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.ActiveCfg = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.Build.0 = Proto|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|x86.ActiveCfg = Release|Any CPU @@ -300,10 +246,6 @@ Global {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|x86.ActiveCfg = Debug|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|x86.Build.0 = Debug|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|Any CPU.Build.0 = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|x86.ActiveCfg = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|x86.Build.0 = Proto|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|Any CPU.Build.0 = Release|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|x86.ActiveCfg = Release|Any CPU @@ -312,10 +254,6 @@ Global {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|x86.ActiveCfg = Debug|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|x86.Build.0 = Debug|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|x86.ActiveCfg = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|x86.Build.0 = Proto|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|Any CPU.Build.0 = Release|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|x86.ActiveCfg = Release|Any CPU @@ -324,10 +262,6 @@ Global {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|Any CPU.Build.0 = Debug|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|x86.ActiveCfg = Debug|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|x86.Build.0 = Debug|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|Any CPU.Build.0 = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|x86.ActiveCfg = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|x86.Build.0 = Proto|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|Any CPU.ActiveCfg = Release|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|Any CPU.Build.0 = Release|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|x86.ActiveCfg = Release|Any CPU @@ -336,10 +270,6 @@ Global {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|x86.ActiveCfg = Debug|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|x86.Build.0 = Debug|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|x86.ActiveCfg = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|x86.Build.0 = Proto|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|Any CPU.Build.0 = Release|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|x86.ActiveCfg = Release|Any CPU @@ -348,10 +278,6 @@ Global {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|Any CPU.Build.0 = Debug|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|x86.ActiveCfg = Debug|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|x86.Build.0 = Debug|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|x86.ActiveCfg = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|x86.Build.0 = Proto|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|Any CPU.ActiveCfg = Release|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|Any CPU.Build.0 = Release|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|x86.ActiveCfg = Release|Any CPU @@ -360,10 +286,6 @@ Global {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|x86.ActiveCfg = Debug|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|x86.Build.0 = Debug|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|x86.ActiveCfg = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|x86.Build.0 = Proto|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|Any CPU.Build.0 = Release|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|x86.ActiveCfg = Release|Any CPU @@ -372,10 +294,6 @@ Global {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|Any CPU.Build.0 = Debug|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|x86.ActiveCfg = Debug|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|x86.Build.0 = Debug|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|Any CPU.Build.0 = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|x86.ActiveCfg = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|x86.Build.0 = Proto|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|Any CPU.ActiveCfg = Release|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|Any CPU.Build.0 = Release|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|x86.ActiveCfg = Release|Any CPU @@ -384,10 +302,6 @@ Global {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|Any CPU.Build.0 = Debug|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|x86.ActiveCfg = Debug|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|x86.Build.0 = Debug|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|Any CPU.Build.0 = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|x86.ActiveCfg = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|x86.Build.0 = Proto|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|Any CPU.ActiveCfg = Release|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|Any CPU.Build.0 = Release|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|x86.ActiveCfg = Release|Any CPU @@ -396,10 +310,6 @@ Global {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|Any CPU.Build.0 = Debug|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|x86.ActiveCfg = Debug|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|x86.Build.0 = Debug|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|x86.ActiveCfg = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|x86.Build.0 = Proto|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|Any CPU.ActiveCfg = Release|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|Any CPU.Build.0 = Release|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|x86.ActiveCfg = Release|Any CPU @@ -408,10 +318,6 @@ Global {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|Any CPU.Build.0 = Debug|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|x86.ActiveCfg = Debug|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|x86.Build.0 = Debug|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|x86.ActiveCfg = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|x86.Build.0 = Proto|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|Any CPU.Build.0 = Release|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|x86.ActiveCfg = Release|Any CPU @@ -420,10 +326,6 @@ Global {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|x86.ActiveCfg = Debug|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|x86.Build.0 = Debug|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|Any CPU.Build.0 = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|x86.ActiveCfg = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|x86.Build.0 = Proto|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|Any CPU.Build.0 = Release|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|x86.ActiveCfg = Release|Any CPU @@ -432,10 +334,6 @@ Global {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|Any CPU.Build.0 = Debug|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|x86.ActiveCfg = Debug|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|x86.Build.0 = Debug|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|x86.ActiveCfg = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|x86.Build.0 = Proto|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|Any CPU.ActiveCfg = Release|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|Any CPU.Build.0 = Release|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|x86.ActiveCfg = Release|Any CPU @@ -444,10 +342,6 @@ Global {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|Any CPU.Build.0 = Debug|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|x86.ActiveCfg = Debug|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|x86.Build.0 = Debug|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|Any CPU.Build.0 = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|x86.ActiveCfg = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|x86.Build.0 = Proto|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|Any CPU.ActiveCfg = Release|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|Any CPU.Build.0 = Release|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|x86.ActiveCfg = Release|Any CPU @@ -456,10 +350,6 @@ Global {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Any CPU.Build.0 = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|x86.ActiveCfg = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|x86.Build.0 = Debug|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.Build.0 = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|x86.ActiveCfg = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|x86.Build.0 = Proto|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.ActiveCfg = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.Build.0 = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|x86.ActiveCfg = Release|Any CPU @@ -468,10 +358,6 @@ Global {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|Any CPU.Build.0 = Debug|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|x86.ActiveCfg = Debug|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|x86.Build.0 = Debug|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|x86.ActiveCfg = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|x86.Build.0 = Proto|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|Any CPU.ActiveCfg = Release|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|Any CPU.Build.0 = Release|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|x86.ActiveCfg = Release|Any CPU @@ -480,10 +366,6 @@ Global {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|Any CPU.Build.0 = Debug|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.ActiveCfg = Debug|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.Build.0 = Debug|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.ActiveCfg = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.Build.0 = Proto|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.ActiveCfg = Release|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.Build.0 = Release|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.ActiveCfg = Release|Any CPU @@ -492,10 +374,6 @@ Global {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|Any CPU.Build.0 = Debug|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|x86.ActiveCfg = Debug|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|x86.Build.0 = Debug|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|x86.ActiveCfg = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|x86.Build.0 = Proto|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.ActiveCfg = Release|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.Build.0 = Release|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.ActiveCfg = Release|Any CPU @@ -504,10 +382,6 @@ Global {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.ActiveCfg = Debug|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.Build.0 = Debug|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|Any CPU.Build.0 = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|x86.ActiveCfg = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|x86.Build.0 = Proto|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|Any CPU.Build.0 = Release|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|x86.ActiveCfg = Release|Any CPU @@ -516,10 +390,6 @@ Global {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|x86.ActiveCfg = Debug|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|x86.Build.0 = Debug|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|x86.ActiveCfg = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|x86.Build.0 = Proto|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.Build.0 = Release|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|x86.ActiveCfg = Release|Any CPU @@ -528,10 +398,6 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|Any CPU.Build.0 = Debug|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|x86.ActiveCfg = Debug|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|x86.Build.0 = Debug|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|Any CPU.Build.0 = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|x86.ActiveCfg = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|x86.Build.0 = Proto|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.ActiveCfg = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.Build.0 = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.ActiveCfg = Release|Any CPU @@ -540,10 +406,6 @@ Global {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|Any CPU.Build.0 = Debug|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|x86.ActiveCfg = Debug|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|x86.Build.0 = Debug|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|Any CPU.Build.0 = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|x86.ActiveCfg = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|x86.Build.0 = Proto|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|Any CPU.ActiveCfg = Release|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|Any CPU.Build.0 = Release|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|x86.ActiveCfg = Release|Any CPU @@ -552,10 +414,6 @@ Global {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|x86.ActiveCfg = Debug|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|x86.Build.0 = Debug|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|Any CPU.Build.0 = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|x86.ActiveCfg = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|x86.Build.0 = Proto|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|Any CPU.Build.0 = Release|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|x86.ActiveCfg = Release|Any CPU @@ -564,10 +422,6 @@ Global {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|x86.ActiveCfg = Debug|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|x86.Build.0 = Debug|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|x86.ActiveCfg = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|x86.Build.0 = Proto|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|Any CPU.Build.0 = Release|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|x86.ActiveCfg = Release|Any CPU @@ -576,10 +430,6 @@ Global {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|Any CPU.Build.0 = Debug|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|x86.ActiveCfg = Debug|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|x86.Build.0 = Debug|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|Any CPU.Build.0 = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|x86.ActiveCfg = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|x86.Build.0 = Proto|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|Any CPU.ActiveCfg = Release|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|Any CPU.Build.0 = Release|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|x86.ActiveCfg = Release|Any CPU @@ -588,10 +438,6 @@ Global {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|Any CPU.Build.0 = Debug|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|x86.ActiveCfg = Debug|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|x86.Build.0 = Debug|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|Any CPU.Build.0 = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|x86.ActiveCfg = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|x86.Build.0 = Proto|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|Any CPU.ActiveCfg = Release|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|Any CPU.Build.0 = Release|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|x86.ActiveCfg = Release|Any CPU @@ -600,10 +446,6 @@ Global {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|x86.ActiveCfg = Debug|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|x86.Build.0 = Debug|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|x86.ActiveCfg = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|x86.Build.0 = Proto|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|Any CPU.Build.0 = Release|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|x86.ActiveCfg = Release|Any CPU @@ -612,10 +454,6 @@ Global {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|x86.ActiveCfg = Debug|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|x86.Build.0 = Debug|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|x86.ActiveCfg = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|x86.Build.0 = Proto|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|Any CPU.ActiveCfg = Release|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|Any CPU.Build.0 = Release|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|x86.ActiveCfg = Release|Any CPU @@ -624,10 +462,6 @@ Global {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|x86.ActiveCfg = Debug|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|x86.Build.0 = Debug|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|x86.ActiveCfg = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|x86.Build.0 = Proto|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|Any CPU.ActiveCfg = Release|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|Any CPU.Build.0 = Release|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|x86.ActiveCfg = Release|Any CPU @@ -636,10 +470,6 @@ Global {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|x86.ActiveCfg = Debug|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|x86.Build.0 = Debug|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|Any CPU.Build.0 = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|x86.ActiveCfg = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|x86.Build.0 = Proto|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.Build.0 = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.ActiveCfg = Release|Any CPU @@ -648,34 +478,14 @@ Global {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}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.Build.0 = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.ActiveCfg = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.Build.0 = Proto|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 - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.ActiveCfg = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.ActiveCfg = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.Build.0 = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.Build.0 = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|x86.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.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 {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.Build.0 = Debug|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|Any CPU.Build.0 = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|x86.ActiveCfg = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|x86.Build.0 = Proto|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.ActiveCfg = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.Build.0 = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.ActiveCfg = Release|Any CPU @@ -684,10 +494,6 @@ Global {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.ActiveCfg = Debug|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.Build.0 = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|x86.ActiveCfg = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|x86.Build.0 = Proto|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.Build.0 = Release|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|x86.ActiveCfg = Release|Any CPU @@ -696,10 +502,6 @@ Global {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.ActiveCfg = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.Build.0 = Debug|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.ActiveCfg = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.Build.0 = Proto|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.ActiveCfg = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.Build.0 = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|x86.ActiveCfg = Release|Any CPU @@ -708,10 +510,6 @@ Global {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|x86.ActiveCfg = Debug|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|x86.Build.0 = Debug|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|x86.ActiveCfg = Proto|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|x86.Build.0 = Proto|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|Any CPU.Build.0 = Release|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|x86.ActiveCfg = Release|Any CPU @@ -720,10 +518,6 @@ Global {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|x86.ActiveCfg = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|x86.Build.0 = Debug|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.Build.0 = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|x86.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|x86.Build.0 = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.Build.0 = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|x86.ActiveCfg = Release|Any CPU @@ -732,10 +526,6 @@ Global {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.ActiveCfg = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.Build.0 = Debug|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.ActiveCfg = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.Build.0 = Proto|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.Build.0 = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|x86.ActiveCfg = Release|Any CPU @@ -744,10 +534,6 @@ Global {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|x86.ActiveCfg = Debug|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|x86.Build.0 = Debug|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|x86.ActiveCfg = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|x86.Build.0 = Proto|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|Any CPU.ActiveCfg = Release|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|Any CPU.Build.0 = Release|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|x86.ActiveCfg = Release|Any CPU @@ -756,10 +542,6 @@ Global {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|Any CPU.Build.0 = Debug|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|x86.ActiveCfg = Debug|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|x86.Build.0 = Debug|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|Any CPU.Build.0 = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|x86.ActiveCfg = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|x86.Build.0 = Proto|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.ActiveCfg = Release|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.Build.0 = Release|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.ActiveCfg = Release|Any CPU @@ -768,26 +550,10 @@ Global {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.ActiveCfg = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.Build.0 = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.Build.0 = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.ActiveCfg = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.Build.0 = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.Build.0 = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.ActiveCfg = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.Build.0 = Release|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Debug|x86.ActiveCfg = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Debug|x86.Build.0 = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Proto|Any CPU.Build.0 = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Proto|x86.ActiveCfg = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Proto|x86.Build.0 = Debug|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Release|Any CPU.Build.0 = Release|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Release|x86.ActiveCfg = Release|Any CPU - {2BE9DC57-34C1-4196-9392-A5F189E6B95A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -840,7 +606,6 @@ Global {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} - {E6A45CDF-B408-420F-B475-74611BEFC52B} = {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} @@ -852,7 +617,6 @@ Global {0385564F-07B4-4264-AB8A-17C393E9140C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} {400FAB03-786E-40CC-85A8-04B0C2869B14} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {B0689A4E-07D8-494D-A0C8-791CB1D74E54} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} - {2BE9DC57-34C1-4196-9392-A5F189E6B95A} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index edc393b00e3..00000000000 --- a/autogen.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -which autoreconf > /dev/null || (echo "Please install autoconf" && exit 1) -autoreconf && ./configure $@ diff --git a/before_install.sh b/before_install.sh deleted file mode 100755 index d1498a55e64..00000000000 --- a/before_install.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -# OS detection - -OSName=$(uname -s) -case $OSName in - Darwin) - OS=OSX - ;; - - Linux) - OS=Linux - ;; - - *) - echo "Unsupported OS '$OSName' detected. Cannot continue with build, the scripts must be updated to support this OS." - exit 1 - ;; -esac - -# On Linux (or at least, Ubuntu), when building with Mono, need to install the mono-devel package first. -if [ $OS = 'Linux' ]; then - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list - sudo apt-get update - sudo apt-get -y install mono-devel autoconf libtool pkg-config make git -fi - -# Check if SSL certificates have been imported into Mono's certificate store. -# If certs haven't been installed, some/all of the Nuget packages will fail to restore. -# Note, the result of the certmgr and grep commands returns the number of installed X.509 certificates. -# We need to run the command twice -- on some systems (e.g. macOS) the certs are installed in the user store, -# and on other systems (e.g., Ubuntu) they're installed to the machine store. certmgr only shows what's in -# the selected store, which is why we need to check both. -if [ "$(certmgr -list -c Trust | grep -c -F "X.509")" -le 1 ] && [ "$(certmgr -list -c -m Trust | grep -c -F "X.509")" -le 1 ]; then - echo "No SSL certificates installed so unable to restore NuGet packages." >&2; - echo "Run 'mozroots --sync --import' to install certificates to Mono's certificate store." >&2; - exit 1 -fi - -# Restore NuGet packages (needed for compiler bootstrap and tests). -mono .nuget/NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget/NuGet.Config - -(if test x-$BUILD_CORECLR = x-1; then \ - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'; \ - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893; \ - sudo apt-get update; \ - sudo apt-get -y install dotnet-dev-1.0.0-preview2-003131; \ - (cd tests/fsharp; mono ../../.nuget/NuGet.exe restore project.json -PackagesDirectory ../../packages -ConfigFile ../../.nuget/NuGet.Config); \ - ./init-tools.sh; \ - echo "------ start log"; \ - cat ./init-tools.log; echo "------ end log"; \ -fi) - -(if test x-$BUILD_PROTO_WITH_CORECLR_LKG = x-1; then \ - (cd lkg/fsc && dotnet restore --packages ../packages && dotnet publish project.json -o ../Tools/lkg -r ubuntu.14.04-x64); \ - (cd lkg/fsi && dotnet restore --packages ../packages && dotnet publish project.json -o ../Tools/lkg -r ubuntu.14.04-x64); \ -fi) - -#TODO: work out how to avoid the need for this -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 - -# The FSharp.Compiler.Tools package doesn't work correctly unless a proper install of F# has been done on the machine. -# OSX can skip this because the OSX Mono installer includes F#. -if [ $OS != 'OSX' ]; then - sudo apt-get -y install fsharp -fi - -# "access to the path /etc/mono/registry/last-time is denied" -# On non-OSX systems, may need to create Mono's registry folder to avoid exceptions during builds. -# This doesn't seem to be necessary on OSX, as the folder is created by the installer. -if [ $OS != 'OSX' ]; then - # This registry folder path is correct for Linux; - # on OSX the folder is /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/registry - # and may be different for *BSD systems. - __MonoRegistryDir="/etc/mono/registry" - if [ ! -d "$__MonoRegistryDir" ]; then - echo "Mono registry directory does not exist (it may not have been created yet)." - echo "The directory needs to be created now; superuser permissions are required for this." - { sudo -- sh -c "mkdir -p $__MonoRegistryDir && chmod uog+rw $__MonoRegistryDir"; } || { echo "Unable to create/chmod Mono registry directory '$__MonoRegistryDir'." >&2; } - fi -fi diff --git a/build-everything.proj b/build-everything.proj index 5c52b99ae67..34b2eb335d8 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -35,12 +35,24 @@ + + true + true + true + true + true + + - + + + + + @@ -50,12 +62,12 @@ - + - + @@ -70,20 +82,49 @@ - - + + true + + + + true + - + + + + + + + + + + + + + + + - - + + true + + + + + + + + + + @@ -120,3 +161,4 @@ + diff --git a/build.cmd b/build.cmd index fb3a9685415..6eed22f4336 100644 --- a/build.cmd +++ b/build.cmd @@ -64,7 +64,6 @@ set BUILD_FROMSOURCE=0 set BUILD_VS=0 set BUILD_FCS=0 set BUILD_CONFIG=release -set BUILD_CONFIG_LOWERCASE=release set BUILD_DIAG= set BUILD_PUBLICSIGN=0 @@ -75,6 +74,7 @@ set TEST_NET40_FSHARPQA_SUITE=0 set TEST_CORECLR_COREUNIT_SUITE=0 set TEST_CORECLR_FSHARP_SUITE=0 set TEST_VS_IDEUNIT_SUITE=0 +set TEST_FCS=0 set INCLUDE_TEST_SPEC_NUNIT= set INCLUDE_TEST_TAGS= @@ -116,6 +116,10 @@ if /i "%_autoselect_tests%" == "1" ( set TEST_NET40_FSHARPQA_SUITE=1 ) + if /i "%BUILD_FCS%" == "1" ( + set TEST_FCS=1 + ) + if /i "%BUILD_CORECLR%" == "1" ( set TEST_CORECLR_FSHARP_SUITE=1 set TEST_CORECLR_COREUNIT_SUITE=1 @@ -236,20 +240,22 @@ REM These divide "ci" into three chunks which can be done in parallel if /i "%ARG%" == "ci_part1" ( set _autoselect=0 - REM what we do + REM what we do - build and test Visual F# Tools, including setup and nuget set BUILD_PROTO=1 + set BUILD_NUGET=1 set BUILD_NET40=1 set BUILD_NET40_FSHARP_CORE=1 set BUILD_VS=1 - set BUILD_FCS=1 set TEST_VS_IDEUNIT_SUITE=1 + set BUILD_CORECLR=1 + set BUILD_SETUP=%FSC_BUILD_SETUP% set CI=1 ) if /i "%ARG%" == "ci_part2" ( set _autoselect=0 - REM what we do + REM what we do - test F# on .NET Framework set BUILD_PROTO=1 set BUILD_NET40=1 set BUILD_NET40_FSHARP_CORE=1 @@ -263,20 +269,31 @@ if /i "%ARG%" == "ci_part2" ( if /i "%ARG%" == "ci_part3" ( set _autoselect=0 - REM what we do + REM what we do: test F# on Core CLR: nuget requires coreclr, fcs requires coreclr set BUILD_PROTO_WITH_CORECLR_LKG=1 set BUILD_PROTO=1 set BUILD_CORECLR=1 set BUILD_NET40_FSHARP_CORE=1 - set BUILD_NUGET=1 set BUILD_NET40=1 - set BUILD_VS=1 - set BUILD_SETUP=%FSC_BUILD_SETUP% set TEST_CORECLR_FSHARP_SUITE=1 set TEST_CORECLR_COREUNIT_SUITE=1 set CI=1 ) +if /i "%ARG%" == "ci_part4" ( + set _autoselect=0 + + REM what we do: test F# on Core CLR: nuget requires coreclr, fcs requires coreclr + set BUILD_PROTO_WITH_CORECLR_LKG=1 + set BUILD_PROTO=1 + set BUILD_CORECLR=1 + set BUILD_NET40_FSHARP_CORE=1 + set BUILD_NET40=1 + set BUILD_FCS=1 + set TEST_FCS=1 + set CI=1 +) + if /i "%ARG%" == "proto" ( set _autoselect=0 set BUILD_PROTO=1 @@ -335,6 +352,7 @@ if /i "%ARG%" == "test-all" ( set TEST_NET40_FSHARPQA_SUITE=1 set TEST_CORECLR_COREUNIT_SUITE=1 set TEST_VS_IDEUNIT_SUITE=1 + set TEST_FCS=1 ) if /i "%ARG%" == "test-net40-fsharpqa" ( @@ -379,6 +397,12 @@ if /i "%ARG%" == "test-net40-fsharp" ( set TEST_NET40_FSHARP_SUITE=1 ) +if /i "%ARG%" == "test-fcs" ( + set _autoselect=0 + set BUILD_FCS=1 + set TEST_FCS=1 +) + if /i "%ARG%" == "test-coreclr-fsharp" ( set _autoselect=0 set BUILD_NET40=1 @@ -419,6 +443,27 @@ if /i "%PB_SKIPTESTS%" == "true" ( set TEST_VS_IDEUNIT_SUITE=0 ) +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 ( + set BUILD_PROTO=1 +) + echo Build/Tests configuration: echo. echo BUILD_PROTO=%BUILD_PROTO% @@ -438,6 +483,7 @@ echo PB_SKIPTESTS=%PB_SKIPTESTS% echo PB_RESTORESOURCE=%PB_RESTORESOURCE% echo. echo SIGN_TYPE=%SIGN_TYPE% +echo TEST_FCS=%TEST_FCS% echo TEST_NET40_COMPILERUNIT_SUITE=%TEST_NET40_COMPILERUNIT_SUITE% echo TEST_NET40_COREUNIT_SUITE=%TEST_NET40_COREUNIT_SUITE% echo TEST_NET40_FSHARP_SUITE=%TEST_NET40_FSHARP_SUITE% @@ -557,13 +603,15 @@ 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="%~dp0.nuget\NuGet.Config" +set _nugetconfig="%~dp0NuGet.Config" if "%RestorePackages%" == "true" ( - cd fcs - .paket\paket.exe restore - cd.. - @if ERRORLEVEL 1 echo Error: Paket restore failed && goto :failure + 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% @@ -576,11 +624,6 @@ if "%RestorePackages%" == "true" ( %_nugetexe% restore packages.config !_nugetoptions! @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - if "%BUILD_VS%" == "1" ( - %_nugetexe% restore vsintegration\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 @@ -603,11 +646,16 @@ if "%RestorePackages%" == "true" ( ) ) -if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( +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 ------------- if not "%PB_PackageVersionPropsUrl%" == "" ( @@ -629,17 +677,12 @@ if not "%PB_PackageVersionPropsUrl%" == "" ( 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 +%_ngenexe% install %_fsiexe% /nologo if not exist %_nugetexe% echo Error: Could not find %_nugetexe% && goto :failure -%_ngenexe% install %_nugetexe% /nologo +%_ngenexe% install %_nugetexe% /nologo echo ---------------- Done with package restore, verify buildfrom source --------------- if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( @@ -651,14 +694,6 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( echo ---------------- Done with package restore, starting proto ------------------------ -rem Decide if Proto need building -if NOT EXIST Proto\net40\bin\fsc-proto.exe ( - set BUILD_PROTO=1 -) - -set _dotnetexe=%~dp0Tools\dotnetcli\dotnet.exe -set _architecture=win7-x64 - rem Build Proto if "%BUILD_PROTO%" == "1" ( rmdir /s /q Proto @@ -680,16 +715,24 @@ if "%BUILD_PROTO%" == "1" ( @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) - echo %_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo - %_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo + 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 ---------------- Done with proto, starting build ------------------------ +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 ---------------- Done with SDK restore, starting build ------------------------ if "%BUILD_PHASE%" == "1" ( - echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore - %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore + + echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% + %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% @@ -700,9 +743,11 @@ if "%BUILD_PHASE%" == "1" ( echo ---------------- Done with build, starting assembly version checks --------------- set asmvercheckpath=%~dp0tests\fsharpqa\testenv\src\AssemblyVersionCheck -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%" -if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure +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%" + if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure +) echo ---------------- Done with assembly version checks, starting assembly signing --------------- @@ -794,7 +839,7 @@ echo SNEXE32: %SNEXE32% echo SNEXE64: %SNEXE64% echo -if "%TEST_NET40_COMPILERUNIT_SUITE%" == "0" if "%TEST_NET40_COREUNIT_SUITE%" == "0" if "%TEST_CORECLR_COREUNIT_SUITE%" == "0" if "%TEST_VS_IDEUNIT_SUITE%" == "0" if "%TEST_NET40_FSHARP_SUITE%" == "0" if "%TEST_NET40_FSHARPQA_SUITE%" == "0" goto :success +if "%TEST_NET40_COMPILERUNIT_SUITE%" == "0" if "%TEST_FCS%" == "0" if "%TEST_NET40_COREUNIT_SUITE%" == "0" if "%TEST_CORECLR_COREUNIT_SUITE%" == "0" if "%TEST_VS_IDEUNIT_SUITE%" == "0" if "%TEST_NET40_FSHARP_SUITE%" == "0" if "%TEST_NET40_FSHARPQA_SUITE%" == "0" goto :success if "%no_test%" == "1" goto :success @@ -828,7 +873,7 @@ ECHO link_exe=%link_exe% ECHO NUNIT3_CONSOLE=%NUNIT3_CONSOLE% ECHO NUNITPATH=%NUNITPATH% -REM ---------------- net40-fsharp ----------------------- +REM ---------------- test-net40-fsharp ----------------------- if "%TEST_NET40_FSHARP_SUITE%" == "1" ( @@ -856,6 +901,32 @@ if "%TEST_NET40_FSHARP_SUITE%" == "1" ( ) ) +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 + + 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 ----------------------------------------------------------------- + goto :failure + ) +) REM ---------------- net40-fsharpqa ----------------------- set OSARCH=%PROCESSOR_ARCHITECTURE% @@ -867,6 +938,7 @@ set HOSTED_COMPILER=1 if "%TEST_NET40_FSHARPQA_SUITE%" == "1" ( + set CSC_PIPE=%~dp0packages\Microsoft.Net.Compilers.2.7.0\tools\csc.exe set FSC=!FSCBINPATH!\fsc.exe set FSCOREDLLPATH=!FSCBinPath!\FSharp.Core.dll set PATH=!FSCBINPATH!;!PATH! @@ -943,6 +1015,18 @@ if "%TEST_NET40_COREUNIT_SUITE%" == "1" ( 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! + + if errorlevel 1 ( + echo ----------------------------------------------------------------- + type "!OUTPUTFILE!" + echo ----------------------------------------------------------------- + type "!ERRORFILE!" + echo ----------------------------------------------------------------- + echo Error: Running tests net40-coreunit failed, see logs above -- FAILED + echo ----------------------------------------------------------------- + goto :failure + ) + 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! @@ -969,10 +1053,17 @@ if "%TEST_CORECLR_COREUNIT_SUITE%" == "1" ( 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! + if errorlevel 1 ( + echo ----------------------------------------------------------------- + echo Error: Running tests coreclr-coreunit failed, see logs above-- FAILED + 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 ERRORLEVEL 1 ( + if errorlevel 1 ( echo ----------------------------------------------------------------- echo Error: Running tests coreclr-coreunit failed, see logs above-- FAILED echo ----------------------------------------------------------------- diff --git a/build.sh b/build.sh index 8e3e2c9e6a9..4e78c56091c 100755 --- a/build.sh +++ b/build.sh @@ -1,818 +1,3 @@ #!/bin/sh -# Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -# Helper function to print an error message and exit with a non-zero error code. -failwith () { - printf "Error: %s\n" "$1" >&2 - exit 1 -} - -# Prints command text to stdout then runs (via eval) the command. -printeval () { - printf "%s\n" "$1" >&1 - eval "$1" -} - -# Prints build status to stdout. -build_status () { - printf "%s %s %s\n" "----------------" "$1" "-----------------" >&1 -} - -# Text for the usage message. -usage_text=" -Build and run a subset of test suites - -Usage: - -build.sh ^ - ^ - ^ - ^ - ^ - ^ - ^ - ^ - -No arguments default to 'default', meaning this (no testing) - - build.sh net40 - -Other examples: - - build.sh net40 (build compiler for .NET Framework) - build.sh coreclr (build compiler for .NET Core) - build.sh vs (build Visual Studio IDE Tools) - build.sh all (build everything) - build.sh test (build and test default targets) - build.sh net40 test (build and test net40) - build.sh coreclr test (build and test net40) - build.sh vs test (build and test net40) - build.sh all test (build and test net40) - build.sh nobuild test include Conformance (run only tests marked with Conformance category) - build.sh nobuild test include Expensive (run only tests marked with Expensive category) - -" - -# Prints usage text to stdout then exits with a non-zero exit code. -show_usage_and_exit() { - printf "%s\n" "$usage_text" - exit 1 -} - -# Check if caller specified any typical argument used to get usage/help info. -if [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ]; then - show_usage_and_exit -fi - -# Save directory of the current script -- this is used below to fix up relative paths (if needed). -# The directory should have a trailing slash like it does on Windows, to minimize differences between scripts. -_scriptdir="$( cd -P -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P )/" - -# disable setup build by setting FSC_BUILD_SETUP=0 -if [ -z "$FSC_BUILD_SETUP" ]; then - export FSC_BUILD_SETUP=0 -fi - -# by default don't build coreclr lkg. -# However allow configuration by setting (more specifically, exporting) an environment variable: export BUILD_PROTO_WITH_CORECLR_LKG = 1 -if [ -z "$BUILD_PROTO_WITH_CORECLR_LKG" ]; then - export BUILD_PROTO_WITH_CORECLR_LKG=0 -fi - -export BUILD_PROTO=0 -export BUILD_PHASE=1 -export BUILD_NET40_FSHARP_CORE=0 -export BUILD_NET40=0 -export BUILD_CORECLR=0 -export BUILD_PORTABLE=0 -export BUILD_VS=0 -export BUILD_CONFIG=release -export BUILD_CONFIG_LOWERCASE=release -export BUILD_DIAG= -export BUILD_PUBLICSIGN=0 - -export TEST_NET40_COMPILERUNIT_SUITE=0 -export TEST_NET40_COREUNIT_SUITE=0 -export TEST_NET40_FSHARP_SUITE=0 -export TEST_NET40_FSHARPQA_SUITE=0 -export TEST_CORECLR_COREUNIT_SUITE=0 -export TEST_CORECLR_FSHARP_SUITE=0 -export TEST_PORTABLE_COREUNIT_SUITE=0 -export TEST_VS_IDEUNIT_SUITE=0 -export INCLUDE_TEST_SPEC_NUNIT= -export INCLUDE_TEST_TAGS= - -# Set up variables used to determine whether we'll automatically select which -# targets to build/run/test. NOTE: These aren't exported, they're only used by this script. -no_test=0 -_autoselect=1 -_autoselect_tests=0 - -# Parse script arguments (specifying which targets to build/run/test), -# and export the corresponding environment variables to configure the build. -for arg in "$@" -do - case $arg in - "net40") - _autoselect=0 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - ;; - "coreclr") - _autoselect=0 - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_CORECLR=1 - ;; - "pcls") - _autoselect=0 - export BUILD_PORTABLE=1 - ;; - "vs") - _autoselect=0 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_VS=1 - ;; - "vstest") - export TEST_VS_IDEUNIT_SUITE=1 - ;; - "nobuild") - export BUILD_PHASE=0 - ;; - "none") - _autoselect=0 - export _buildexit=1 - export _buildexitVALUE=0 - ;; - "all") - _autoselect=0 - export BUILD_PROTO=1 - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_CORECLR=1 - export BUILD_PORTABLE=1 - export BUILD_VS=1 - export BUILD_SETUP=$FSC_BUILD_SETUP - export CI=1 - ;; - "microbuild") - _autoselect=0 - export BUILD_PROTO=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_CORECLR=1 - export BUILD_PORTABLE=1 - export BUILD_VS=1 - export BUILD_SETUP=$FSC_BUILD_SETUP - - export TEST_NET40_COMPILERUNIT_SUITE=1 - export TEST_NET40_COREUNIT_SUITE=1 - export TEST_NET40_FSHARP_SUITE=1 - export TEST_NET40_FSHARPQA_SUITE=1 - export TEST_CORECLR_COREUNIT_SUITE=0 - export TEST_CORECLR_FSHARP_SUITE=0 - export TEST_PORTABLE_COREUNIT_SUITE=1 - export TEST_VS_IDEUNIT_SUITE=1 - export CI=1 - ;; - - # These divide 'ci' into multiple chunks which can be done in parallel - "ci_part1") - _autoselect=0 - - # what we do - export BUILD_PROTO=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PORTABLE=1 - export BUILD_VS=1 - export BUILD_SETUP=$FSC_BUILD_SETUP - export TEST_NET40_COMPILERUNIT_SUITE=1 - export TEST_NET40_FSHARPQA_SUITE=1 - export TEST_VS_IDEUNIT_SUITE=1 - export CI=1 - ;; - "ci_part2") - _autoselect=0 - - # what we do - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_PROTO=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PORTABLE=1 - - export TEST_NET40_COREUNIT_SUITE=1 - export TEST_NET40_FSHARP_SUITE=1 - export TEST_PORTABLE_COREUNIT_SUITE=1 - export CI=1 - ;; - "ci_part3") - _autoselect=0 - - # what we do - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_PROTO=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_CORECLR=1 - - export TEST_CORECLR_FSHARP_SUITE=1 - export TEST_CORECLR_COREUNIT_SUITE=1 - export CI=1 - ;; - - # TEMP: The Jenkins builds currently call this script with the 'ci' target, - # but that doesn't exist even in build.cmd. It wasn't doing anything - # before anyway, so accept 'ci' but ignore it for now because the test - # suites don't build correctly on Linux/macOS yet anyway. - "ci") - # TODO: Do everything from ci_part1-3 here. - printf "The 'ci' target is currently ignored, until the test suite builds can be fixed for Linux/macOS.\n" - ;; - - "proto") - export BUILD_PROTO=1 - ;; - "diag") - export BUILD_DIAG=/v:detailed - if [ -z "$APPVEYOR" ]; then - export BUILD_LOG=fsharp_build_log.log - fi - ;; - "debug") - export BUILD_CONFIG=debug - ;; - "release") - export BUILD_CONFIG=release - ;; - "test") - _autoselect_tests=1 - ;; - "no-test") - no_test=1 - ;; - "include") - failwith "The 'include' option is not (yet) supported by this script." - #export /a counter=!counter!+1 - #if '$INCLUDE_TEST_SPEC_NUNIT' == '' ( export INCLUDE_TEST_SPEC_NUNIT=cat == $ARG2 ) else (set INCLUDE_TEST_SPEC_NUNIT=cat == $ARG2 or $INCLUDE_TEST_SPEC_NUNIT ) - #if '$INCLUDE_TEST_TAGS' == '' ( export INCLUDE_TEST_TAGS=$ARG2 ) else (set INCLUDE_TEST_TAGS=$ARG2;$INCLUDE_TEST_TAGS ) - ;; - "test-all") - _autoselect=0 - export BUILD_PROTO=1 - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_CORECLR=1 - export BUILD_PORTABLE=1 - export BUILD_VS=1 - export BUILD_SETUP=$FSC_BUILD_SETUP - - export TEST_NET40_COMPILERUNIT_SUITE=1 - export TEST_NET40_COREUNIT_SUITE=1 - export TEST_NET40_FSHARP_SUITE=1 - export TEST_NET40_FSHARPQA_SUITE=1 - export TEST_PORTABLE_COREUNIT_SUITE=1 - export TEST_CORECLR_COREUNIT_SUITE=1 - export TEST_VS_IDEUNIT_SUITE=1 - ;; - "test-net40-fsharpqa") - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PORTABLE=1 - export TEST_NET40_FSHARPQA_SUITE=1 - ;; - "test-compiler-unit") - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export TEST_NET40_COMPILERUNIT_SUITE=1 - ;; - "test-net40-coreunit") - export BUILD_NET40_FSHARP_CORE=1 - export TEST_NET40_COREUNIT_SUITE=1 - ;; - "test-coreclr-coreunit") - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_CORECLR=1 - export TEST_CORECLR_COREUNIT_SUITE=1 - ;; - "test-pcl-coreunit") - export BUILD_PORTABLE=1 - export TEST_PORTABLE_COREUNIT_SUITE=1 - ;; - "test-net40-fsharp") - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PORTABLE=1 - export TEST_NET40_FSHARP_SUITE=1 - ;; - "test-coreclr-fsharp") - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export BUILD_PROTO_WITH_CORECLR_LKG=1 - export BUILD_CORECLR=1 - export TEST_CORECLR_FSHARP_SUITE=1 - ;; - "publicsign") - export BUILD_PUBLICSIGN=1 - ;; - "init") - export BUILD_PROTO_WITH_CORECLR_LKG=1 - ;; - *) - errmsg=$(printf "Invalid argument: %s" "$arg") - failwith "$errmsg" - ;; - esac -done - -if [ $_buildexit -eq 1 ]; then - exit $_buildexitvalue -fi - -# Apply defaults, if necessary. -if [ $_autoselect -eq 1 ]; then - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 -fi - -if [ $_autoselect_tests -eq 1 ]; then - if [ $BUILD_NET40 -eq 1 ]; then - export TEST_NET40_COMPILERUNIT_SUITE=1 - export TEST_NET40_COREUNIT_SUITE=1 - export TEST_NET40_FSHARP_SUITE=1 - export TEST_NET40_FSHARPQA_SUITE=1 - fi - - if [ $BUILD_CORECLR -eq 1 ]; then - export BUILD_NET40=1 - export BUILD_NET40_FSHARP_CORE=1 - export TEST_CORECLR_FSHARP_SUITE=1 - export TEST_CORECLR_COREUNIT_SUITE=1 - fi - - if [ $BUILD_PORTABLE -eq 1 ]; then - export TEST_PORTABLE_COREUNIT_SUITE=1 - fi - - if [ $BUILD_VS -eq 1 ]; then - export TEST_VS_IDEUNIT_SUITE=1 - fi -fi - -# If the `PB_SKIPTESTS` variable is set to 'true' then no tests should be built or run, even if explicitly specified -if [ $PB_SKIPTESTS -eq "true" ]; then - export TEST_NET40_COMPILERUNIT_SUITE=0 - export TEST_NET40_COREUNIT_SUITE=0 - export TEST_NET40_FSHARP_SUITE=0 - export TEST_NET40_FSHARPQA_SUITE=0 - export TEST_CORECLR_COREUNIT_SUITE=0 - export TEST_CORECLR_FSHARP_SUITE=0 - export TEST_PORTABLE_COREUNIT_SUITE=0 - export TEST_VS_IDEUNIT_SUITE=0 -fi - -# -# Report config -# - -printf "Build/Tests configuration:\n" -printf "\n" -printf "BUILD_PROTO=%s\n" "$BUILD_PROTO" -printf "BUILD_PROTO_WITH_CORECLR_LKG=%s\n" "$BUILD_PROTO_WITH_CORECLR_LKG" -printf "BUILD_NET40=%s\n" "$BUILD_NET40" -printf "BUILD_NET40_FSHARP_CORE=%s\n" "$BUILD_NET40_FSHARP_CORE" -printf "BUILD_CORECLR=%s\n" "$BUILD_CORECLR" -printf "BUILD_PORTABLE=%s\n" "$BUILD_PORTABLE" -printf "BUILD_VS=%s\n" "$BUILD_VS" -printf "BUILD_SETUP=%s\n" "$BUILD_SETUP" -printf "BUILD_CONFIG=%s\n" "$BUILD_CONFIG" -printf "BUILD_PUBLICSIGN=%s\n" "$BUILD_PUBLICSIGN" -printf "\n" -printf "PB_SKIPTESTS=%s\n" "$PB_SKIPTESTS" -printf "PB_RESTORESOURCE=%s\n" "$PB_RESTORESOURCE" -printf "\n" -printf "TEST_NET40_COMPILERUNIT_SUITE=%s\n" "$TEST_NET40_COMPILERUNIT_SUITE" -printf "TEST_NET40_COREUNIT_SUITE=%s\n" "$TEST_NET40_COREUNIT_SUITE" -printf "TEST_NET40_FSHARP_SUITE=%s\n" "$TEST_NET40_FSHARP_SUITE" -printf "TEST_NET40_FSHARPQA_SUITE=%s\n" "$TEST_NET40_FSHARPQA_SUITE" -printf "TEST_CORECLR_COREUNIT_SUITE=%s\n" "$TEST_CORECLR_COREUNIT_SUITE" -printf "TEST_CORECLR_FSHARP_SUITE=%s\n" "$TEST_CORECLR_FSHARP_SUITE" -printf "TEST_PORTABLE_COREUNIT_SUITE=%s\n" "$TEST_PORTABLE_COREUNIT_SUITE" -printf "TEST_VS_IDEUNIT_SUITE=%s\n" "$TEST_VS_IDEUNIT_SUITE" -printf "INCLUDE_TEST_SPEC_NUNIT=%s\n" "$INCLUDE_TEST_SPEC_NUNIT" -printf "INCLUDE_TEST_TAGS=%s\n" "$INCLUDE_TEST_TAGS" -printf "\n" - -# TODO: Print out environment variables? -printf "Environment\n" -printf "\n" -printf "(TODO)\n" -printf "\n" -printf "\n" - -build_status "Done with arguments, starting preparation" - -_msbuildexe="msbuild" -msbuildflags="" - -# Perform any necessary setup and system configuration prior to running builds. -./before_install.sh -rc=$?; -if [ $rc -ne 0 ]; then - printf "before_install script failed.\n" - exit $rc -fi - -build_status "Done with prepare, starting package restore" - -# Use built-in Nuget executable on Mono, if available. -_nugetexe="mono .nuget/NuGet.exe" -if command -v nuget > /dev/null; then - _nugetexe="nuget" -fi -_nugetconfig=".nuget/NuGet.Config" - -# TODO: Confirm existence of 'nuget' (or $_nugetexe) before proceeding. - -# Restore packages (default to restoring packages if otherwise unspecified). -if [ "${RestorePackages:-true}" = 'true' ]; then - cd fcs - mono .paket/paket.exe restore - cd .. - exit_code=$? - if [ $exit_code -ne 0 ]; then - exit $exit_code - fi - - _nugetoptions="-PackagesDirectory packages -ConfigFile $_nugetconfig" - if [ "$PB_RESTORESOURCE" != "" ]; then - _nugetoptions="$_nugetoptions -FallbackSource $PB_RESTORESOURCE" - fi - - eval "$_nugetexe restore packages.config $_nugetoptions" - if [ $? -ne 0 ]; then - failwith "Nuget restore failed" - fi - - if [ "$BUILD_VS" = '1' ]; then - eval "$_nugetexe restore vsintegration/packages.config $_nugetoptions" - if [ $? -ne 0 ]; then - failwith "Nuget restore failed" - fi - fi - - if [ "$BUILD_SETUP" = '1' ]; then - eval "$_nugetexe restore setup/packages.config $_nugetoptions" - if [ $? -ne 0 ]; then - failwith "Nuget restore failed" - fi - fi -fi - -# If building for CoreCLR, restore the Tools directory. -if [ "$BUILD_PROTO_WITH_CORECLR_LKG" = '1' ]; then - # Restore the Tools directory - ./init-tools.sh - rc=$?; - if [ $rc -ne 0 ]; then - printf "init-tools script failed.\n" - exit $rc - fi -fi - -# TODO: Check for existence of fsi (either on the system, or from the FSharp.Compiler.Tools package that was restored). - -build_status "Done with package restore, starting dependency uptake check" - -if [ "$PB_PACKAGEVERSIONPROPSURL" != "" ]; then - dependencyUptakeDir="${_scriptdir}Tools/dependencyUptake" - mkdir -p "$dependencyUptakeDir" - - # download package version overrides - { printeval "curl '$PB_PACKAGEVERSIONPROPSURL' -o '$dependencyUptakeDir/PackageVersions.props'"; } || failwith "downloading package version properties failed" - - # prepare dependency uptake files - { printeval "$_msbuildexe $msbuildflags ${scriptdir}build/projects/PrepareDependencyUptake.proj /t:Build"; } || failwith "building dependency uptake files failed" - - # restore dependencies - { printeval "$_nugetexe restore '$dependencyUptakeDir/packages.config' -PackagesDirectory packages -ConfigFile '$dependencyUptakeDir/NuGet.config'"; } || failwith "restoring dependency uptake packages failed" -fi - -build_status "Done with package restore, starting proto" - -# Decide if Proto need building -if [ ! -f "Proto/net40/bin/fsc-proto.exe" ]; then - export BUILD_PROTO=1 -fi - -_dotnetexe=dotnet -_architecture=win7-x64 - -# Build Proto -if [ "$BUILD_PROTO" = '1' ]; then - rm -rfd Proto - - if [ "$BUILD_PROTO_WITH_CORECLR_LKG" = '1' ]; then - { pushd ./lkg/fsc && eval "$_dotnetexe restore" && popd; } || failwith "dotnet restore failed" - { pushd ./lkg/fsi && eval "$_dotnetexe restore" && popd; } || failwith "dotnet restore failed" - - { pushd ./lkg/fsc && eval "$_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture" && popd; } || failwith "dotnet publish failed" - { pushd ./lkg/fsi && eval "$_dotnetexe publish project.json --no-build -o ${_scriptdir}Tools/lkg -r $_architecture" && popd; } || failwith "dotnet publish failed" - - { printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj /p:Configuration=Proto /p:DisableLocalization=true"; } || failwith "compiler proto build failed" - -# { printeval "$_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo"; } || failwith "NGen of proto failed" - else - # Build proto-compiler and libs - { printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj /p:UseMonoPackaging=true /p:Configuration=Proto /p:DisableLocalization=true"; } || failwith "compiler proto build failed" - fi -fi - - -build_status "Done with proto, starting build" - -if [ "$BUILD_PHASE" = '1' ]; then - cmd="$_msbuildexe $msbuildflags build-everything.proj /p:UseMonoPackaging=true /p:Configuration=$BUILD_CONFIG $BUILD_DIAG /p:BUILD_PUBLICSIGN=$BUILD_PUBLICSIGN" - { printeval "$cmd"; } || failwith "'$cmd' failed" -fi - -build_status "Main part of build finished, completing parts of build needed for Mono setup" - -if [ "$BUILD_NET40" = '1' ]; then - { printeval "./autogen.sh --prefix=/usr"; } || failwith "./autogen.sh failed" - - { printeval "make"; } || failwith "make failed" -fi - -build_status "Done with build, starting update/prepare" - -if [ "$BUILD_NET40" = '1' ]; then - - { printeval "sudo make install"; } || failwith "sudo make install failed" - -# WINDOWS: -# src/update.sh $BUILD_CONFIG -# rc=$?; -# if [ $rc -ne 0 ]; then -# printf "src/update script failed.\n" -# exit $rc -# fi -fi - -NUNITPATH="packages/NUnit.Console.3.0.0/tools/" -printf "set NUNITPATH=%s\n" "$NUNITPATH" -if [ ! -d "$NUNITPATH" ]; then - failwith "Could not find $NUNITPATH" -fi - -{ printeval "cp -R $NUNITPATH ${_scriptdir}tests/fsharpqa/testenv/bin/nunit"; } || failwith "unable to copy nunit binaries to fsharpqa" -{ printeval "cp -R ${_scriptdir}tests/fsharpqa/testenv/src/nunit ${_scriptdir}tests/fsharpqa/testenv/bin/nunit"; } || failwith "unable to copy nunit binaries to fsharpqa" - -# TODO: Define location of ildasm/monodis and sn - -if [ "$TEST_NET40_COMPILERUNIT_SUITE" = '0' ] && [ "$TEST_PORTABLE_COREUNIT_SUITE" = '0' ] && [ "$TEST_CORECLR_COREUNIT_SUITE" = '0' ] && [ "$TEST_VS_IDEUNIT_SUITE" = '0' ] && [ "$TEST_NET40_FSHARP_SUITE" = '0' ] && [ "$TEST_NET40_FSHARPQA_SUITE" = '0' ]; then - # Successful build; not running tests so exit now. - exit 0 -fi - -if [ $no_test -eq 1 ]; then - # Successful build; not running tests so exit now. - exit 0 -fi - -build_status "Done with update, starting tests" - -if [ -n "$INCLUDE_TEST_SPEC_NUNIT" ]; then - export WHERE_ARG_NUNIT="--where $INCLUDE_TEST_SPEC_NUNIT" -fi - -if [ -n "$INCLUDE_TEST_TAGS" ]; then - export TTAGS_ARG_RUNALL="-ttags:$INCLUDE_TEST_TAGS" -fi - -printf "WHERE_ARG_NUNIT=%s\n" "$WHERE_ARG_NUNIT" - -export NUNITPATH="tests/fsharpqa/testenv/bin/nunit/" -export NUNIT3_CONSOLE="${NUNITPATH}nunit3-console.exe" -export link_exe="${_scriptdir}packages/VisualCppTools.14.0.24519-Pre/lib/native/bin/link.exe" -if [ ! -f "$link_exe" ]; then - failwith "failed to find '$link_exe' use nuget to restore the VisualCppTools package" -fi - -#if /I not '$single_threaded' == 'true' (set PARALLEL_ARG=-procs:$NUMBER_OF_PROCESSORS) else set PARALLEL_ARG=-procs:0 - -export FSCBINPATH="${_scriptdir}$BUILD_CONFIG/net40/bin" -export RESULTSDIR="${_scriptdir}tests/TestResults" -if [ ! -d "$RESULTSDIR" ]; then - mkdir "$RESULTSDIR" -fi - -printf "FSCBINPATH=%s\n" "$FSCBINPATH" -printf "RESULTSDIR=%s\n" "$RESULTSDIR" -printf "link_exe=%s\n" "$link_exe" -printf "NUNIT3_CONSOLE=%s\n" "$NUNIT3_CONSOLE" -printf "NUNITPATH=%s\n" "$NUNITPATH" - -# ---------------- net40-fsharp ----------------------- - -if [ "$TEST_NET40_FSHARP_SUITE" = '1' ]; then - OUTPUTARG="" - ERRORARG="" - OUTPUTFILE="" - ERRORFILE="" - XMLFILE="$RESULTSDIR/test-net40-fsharp-results.xml" - if [ "$CI" = '1' ]; then - OUTPUTFILE="$RESULTSDIR/test-net40-fsharp-output.log" - OUTPUTARG="--output:\"$OUTPUTFILE\"" - ERRORFILE="$RESULTSDIR/test-net40-fsharp-errors.log" - ERRORARG="--err:\"$ERRORFILE\"" - fi - - if ! printeval "mono $NUNIT3_CONSOLE --verbose \"$FSCBINPATH/FSharp.Tests.FSharpSuite.dll\" --framework:V4.0 --work:\"$FSCBINPATH\" $OUTPUTARG $ERRORARG --result:\"$XMLFILE;format=nunit3\" $WHERE_ARG_NUNIT"; then - if [ -f "$ERRORFILE" ]; then - echo ----------------------------------------------------------------- - cat "$ERRORFILE" - fi - echo ----------------------------------------------------------------- - echo Error: Running tests net40-fsharp failed, see log above -- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- net40-compilerunit ----------------------- - -if [ "$TEST_NET40_COMPILERUNIT_SUITE" = '1' ]; then - - OUTPUTARG="" - ERRORARG="" - OUTPUTFILE="" - ERRORFILE="$RESULTSDIR/test-net40-compilerunit-errors.log" - XMLFILE="$RESULTSDIR/test-net40-compilerunit-results.xml" - if [ "$CI" = '1' ]; then - OUTPUTFILE="$RESULTSDIR/test-net40-compilerunit-output.log" - ERRORARG="--err:\"$ERRORFILE\"" - OUTPUTARG="--output:\"$OUTPUTFILE\"" - fi - - if ! printeval "mono $NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/../../net40/bin/FSharp.Compiler.UnitTests.dll\" $WHERE_ARG_NUNIT"; then - if [ -f "$OUTPUTFILE" ]; then - echo ----------------------------------------------------------------- - cat "$OUTPUTFILE" - fi - if [ -f "$ERRORFILE" ]; then - echo ----------------------------------------------------------------- - cat "$ERRORFILE" - fi - echo ----------------------------------------------------------------- - echo Error: Running tests net40-compilerunit failed, see logs above -- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- net40-coreunit ----------------------- - -if [ "$TEST_NET40_COREUNIT_SUITE" = '1' ]; then - - OUTPUTARG="" - ERRORARG="" - OUTPUTFILE="" - ERRORFILE="" - XMLFILE="$RESULTSDIR/test-net40-coreunit-results.xml" - if [ "$CI" = '1' ]; then - ERRORFILE="$RESULTSDIR/test-net40-coreunit-errors.log" - OUTPUTFILE="$RESULTSDIR/test-net40-coreunit-output.log" - ERRORARG="--err:\"$ERRORFILE\"" - OUTPUTARG="--output:\"$OUTPUTFILE\"" - fi - - if ! printeval "mono $NUNIT3_CONSOLE --verbose --framework:V4.0 --result:\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG --work:\"$FSCBINPATH\" \"$FSCBINPATH/FSharp.Core.UnitTests.dll\" $WHERE_ARG_NUNIT"; then - if [ -f "$OUTPUTFILE" ]; then - echo ----------------------------------------------------------------- - cat "$OUTPUTFILE" - fi - if [ -f "$ERRORFILE" ]; then - echo ----------------------------------------------------------------- - cat "$ERRORFILE" - fi - echo ----------------------------------------------------------------- - echo Error: Running tests net40-coreunit failed, see logs above -- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- portable-coreunit ----------------------- - -if [ "$TEST_PORTABLE_COREUNIT_SUITE" = '1' ]; then - - OUTPUTARG="" - ERRORARG="" - OUTPUTFILE="" - ERRORFILE="" - XMLFILE="$RESULTSDIR/test-portable-coreunit-results.xml" - - if [ "$CI" = '1' ]; then - OUTPUTFILE="$RESULTSDIR/test-portable-coreunit-output.log" - ERRORFILE="$RESULTSDIR/test-portable-coreunit-errors.log" - ERRORARG="--err:\"$ERRORFILE\"" - OUTPUTARG="--output:\"$OUTPUTFILE\"" - fi - - if ! printeval "mono $NUNIT3_CONSOLE /framework:V4.0 /result=\"$XMLFILE;format=nunit3\" $OUTPUTARG $ERRORARG /work=\"$FSCBINPATH\" \"$FSCBINPATH/../../portable7/bin/FSharp.Core.UnitTests.dll\" \"$FSCBINPATH/../../portable47/bin/FSharp.Core.UnitTests.dll\" \"$FSCBINPATH/../../portable78/bin/FSharp.Core.UnitTests.dll\" \"$FSCBINPATH/../../portable259/bin/FSharp.Core.UnitTests.dll\" $WHERE_ARG_NUNIT"; then - if [ -f "$OUTPUTFILE" ]; then - echo ----------------------------------------------------------------- - cat "$OUTPUTFILE" - fi - if [ -f "$ERRORFILE" ]; then - echo ----------------------------------------------------------------- - cat "$ERRORFILE" - fi - echo ----------------------------------------------------------------- - echo Error: Running tests portable-coreunit failed, see logs above -- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- coreclr-coreunit ----------------------- - -if [ "$TEST_CORECLR_COREUNIT_SUITE" = '1' ]; then - - XMLFILE="$RESULTSDIR/test-coreclr-coreunit-results.xml" - OUTPUTFILE="$RESULTSDIR/test-coreclr-coreunit-output.log" - ERRORFILE="$RESULTSDIR/test-coreclr-coreunit-errors.log" - - if ! printeval "$_dotnetexe \"${_scriptdir}tests/testbin/$BUILD_CONFIG/coreclr/FSharp.Core.UnitTests/FSharp.Core.UnitTests.dll\" $WHERE_ARG_NUNIT"; then - echo ----------------------------------------------------------------- - echo Error: Running tests coreclr-coreunit failed, see logs above-- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- coreclr-fsharp ----------------------- - -if [ "$TEST_CORECLR_FSHARP_SUITE" = '1' ]; then - - export single_threaded=true - export permutations=FSC_CORECLR - - OUTPUTARG="" - ERRORARG="" - OUTPUTFILE="" - ERRORFILE="" - XMLFILE="$RESULTSDIR/test-coreclr-fsharp-results.xml" - if ! printeval "$_dotnetexe \"${_scriptdir}tests/testbin/$BUILD_CONFIG/coreclr/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.dll\" $WHERE_ARG_NUNIT"; then - echo ----------------------------------------------------------------- - echo Error: Running tests coreclr-fsharp failed, see logs above-- FAILED - echo ----------------------------------------------------------------- - exit 1 - fi -fi - -# ---------------- net40-fsharpqa ----------------------- - -OSARCH="${PROCESSOR_ARCHITECTURE:-x64}" - -# Set this to 1 in order to use an external compiler host process -# This only has an effect when running the FSHARPQA tests, but can -# greatly speed up execution since fsc.exe does not need to be spawned thousands of times -HOSTED_COMPILER=1 - -if [ "$TEST_NET40_FSHARPQA_SUITE" = '1' ]; then - - export FSC="$FSCBINPATH/fsc.exe" - export FSCOREDLLPATH="$FSCBINPATH/FSharp.Core.dll" - export PATH="$FSCBINPATH;$PATH" - - if ! command -v perl > /dev/null; then - failwith "perl is not in the PATH, it is required for the net40-fsharpqa test suite" - fi - - OUTPUTFILE=test-net40-fsharpqa-results.log - ERRORFILE=test-net40-fsharpqa-errors.log - FAILENV=test-net40-fsharpqa-errors - - { pushd "${_scriptdir}tests/fsharpqa/source" && \ - printeval "perl tests/fsharpqa/testenv/bin/runall.pl -resultsroot $RESULTSDIR -results $OUTPUTFILE -log $ERRORFILE -fail $FAILENV -cleanup:no $TTAGS_ARG_RUNALL $PARALLEL_ARG" && \ - popd; } || { - if [ -f "$RESULTSDIR/$OUTPUTFILE" ]; then - echo ----------------------------------------------------------------- - cat "$RESULTSDIR/$OUTPUTFILE" - fi - if [ -f "$RESULTSDIR/$ERRORFILE" ]; then - echo ----------------------------------------------------------------- - cat "$RESULTSDIR/$ERRORFILE" - fi - echo ----------------------------------------------------------------- - echo Error: Running tests net40-fsharpqa failed, see logs above -- FAILED - echo ----------------------------------------------------------------- - exit 1 - } -fi +make Configuration=release diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index a2dcc54b65a..a4cac39ae6f 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -50,7 +50,6 @@ "values": [ "net40\\bin\\VisualFSharpFull.vsix", "net40\\bin\\VisualFSharpTemplate.vsix", - "net40\\bin\\VisualFSharpOpenSource.vsix", "insertion\\Microsoft.FSharp.Dependencies.vsix", "insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix" ] @@ -66,7 +65,7 @@ "Microsoft.DiaSymReader.dll", "Microsoft.DiaSymReader.PortablePdb.dll", "Newtonsoft.Json.dll", - "System.ValueTuple.4.3.1.nupkg", + "System.ValueTuple.4.4.0.nupkg", "System.Collections.Immutable.dll", "System.Reflection.Metadata.dll", "System.ValueTuple.dll" diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props new file mode 100644 index 00000000000..c8d0dd7316b --- /dev/null +++ b/build/targets/AssemblyVersions.props @@ -0,0 +1,57 @@ + + + + + $([System.DateTime]::Now.ToString(yyyyMMdd.0)) + + + <_Build_Year>$(BUILD_BUILDNUMBER.Substring(0, 4)) + <_Build_Month>$(BUILD_BUILDNUMBER.Substring(4, 2)) + <_Build_Day>$(BUILD_BUILDNUMBER.Substring(6, 2)) + <_Build_Number>$(BUILD_BUILDNUMBER.Substring(9)) + $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) + + 4.4.3.0 + 10.1.1.0 + 10.1.4 + 15.6.0.0 + $(FSCoreVersion) + + + $(FSProductVersion) + + + $(VSAssemblyVersion) + + + $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) + $(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2, '0')) + $(BuildTimeStamp_Date)$(BuildTimeStamp_Number) + $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]).$(BUILD_BUILDNUMBER) + 42.42.42.42 + $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) + + + + + + diff --git a/build/targets/CommonPackages.targets b/build/targets/CommonPackages.targets new file mode 100644 index 00000000000..fad7b976127 --- /dev/null +++ b/build/targets/CommonPackages.targets @@ -0,0 +1,7 @@ + + + + + + + diff --git a/build/targets/ConvertPortablePdbs.targets b/build/targets/ConvertPortablePdbs.targets new file mode 100644 index 00000000000..0965566db0c --- /dev/null +++ b/build/targets/ConvertPortablePdbs.targets @@ -0,0 +1,20 @@ + + + + + + + + + $(FinalOutputPath)\ConvertedPdbs + $(NuGetPackageRoot)Microsoft.DiaSymReader.Pdb2Pdb\$(MicrosoftDiaSymReaderPdb2PdbPackageVersion)\tools\Pdb2Pdb.exe + "$(TargetPath)" /out "$(ConvertedPdbsDirectory)\$(TargetName).pdb" /verbose /srcsvrvar SRC_INDEX=public + + + + + + + diff --git a/build/targets/AssemblyAttributes.targets b/build/targets/GenerateAssemblyAttributes.targets similarity index 53% rename from build/targets/AssemblyAttributes.targets rename to build/targets/GenerateAssemblyAttributes.targets index b5836a9a81e..d7f7be76031 100644 --- a/build/targets/AssemblyAttributes.targets +++ b/build/targets/GenerateAssemblyAttributes.targets @@ -2,52 +2,21 @@ - - $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension) - - - - - false - - - - - - <_PublicKey>002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293 - - - <_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key) - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == ''">%(InternalsVisibleTo.Identity), PublicKey=$(_PublicKey) - - - - - - - - - - - + - $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyAttributes$(DefaultLanguageSourceExtension) + $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension) 2003;$(NoWarn) + + + <_UseWriteCodeFragmentHack Condition="'$(OS)' == 'Unix' and '$(Language)' == 'F#'">true + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCompanyAttribute"> <_Parameter1>Microsoft Corporation @@ -56,7 +25,7 @@ <_Parameter1>© Microsoft Corporation. All Rights Reserved. <_AssemblyVersionAttributes Include="System.Reflection.AssemblyDescriptionAttribute"> - <_Parameter1>$(AssemblyName).dll + <_Parameter1>$(AssemblyName) <_AssemblyVersionAttributes Include="System.Reflection.AssemblyFileVersionAttribute"> <_Parameter1>$(Build_FileVersion) @@ -68,7 +37,7 @@ <_Parameter1>Microsoft® F# <_AssemblyVersionAttributes Include="System.Reflection.AssemblyTitleAttribute"> - <_Parameter1>$(AssemblyName).dll + <_Parameter1>$(AssemblyName) <_AssemblyVersionAttributes Include="System.Reflection.AssemblyVersionAttribute"> <_Parameter1>$(MicroBuildAssemblyVersion) @@ -77,13 +46,34 @@ + OutputFile="$(GeneratedFSharpAssemblyVersionFile)" + Condition="'$(_UseWriteCodeFragmentHack)' != 'true'"> - + - + + + + <_LinesToWrite Include="// <auto-generated>" /> + <_LinesToWrite Include="namespace FSharp" /> + <_LinesToWrite Include="open System" /> + <_LinesToWrite Include="open System.Reflection" /> + <_LinesToWrite Include="[<assembly: %(_AssemblyVersionAttributes.Identity)("%(_AssemblyVersionAttributes._Parameter1)")>]" /> + <_LinesToWrite Include="do()" /> + + + + + + + + diff --git a/build/targets/GenerateInternalsVisibleTo.targets b/build/targets/GenerateInternalsVisibleTo.targets new file mode 100644 index 00000000000..ca4bb15e7ea --- /dev/null +++ b/build/targets/GenerateInternalsVisibleTo.targets @@ -0,0 +1,44 @@ + + + + $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension) + + + + + false + + + + + + <_PublicKey>002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293 + + + <_PublicKey>002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee + + + <_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key) + <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == ''">%(InternalsVisibleTo.Identity), PublicKey=$(_PublicKey) + + + + + + + + + + + + + diff --git a/build/targets/GitHash.props b/build/targets/GitHash.props index 817240dbcab..30f2d03b915 100644 --- a/build/targets/GitHash.props +++ b/build/targets/GitHash.props @@ -5,7 +5,7 @@ Copied from RepoToolset. Might be slightly modified to adjust for the current F# build system specifics if necessary. --> - + - $(MSBuildThisFileDirectory)..\..\ + $(MSBuildThisFileDirectory)..\..\ diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props new file mode 100644 index 00000000000..b9848069837 --- /dev/null +++ b/build/targets/PackageVersions.props @@ -0,0 +1,67 @@ + + + + + + $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\RoslynPackageVersion.txt').Trim()) + + + 1.3.1 + + + $(RoslynPackageVersion) + $(RoslynPackageVersion) + $(RoslynPackageVersion) + $(RoslynPackageVersion) + $(RoslynPackageVersion) + + + 8.0.1 + 14.0.25420 + 15.0.26201-alpha + 1.1.4322 + 15.0.26201 + 15.0.26201 + 15.0.26201 + 8.0.50727 + 15.0.26201 + 8.0.50727 + 14.3.25407 + 15.0.26201 + 15.0.26201 + 10.0.30319 + 11.0.50727 + 15.0.25123-Dev15Preview + 10.0.30319 + 11.0.61030 + 12.0.30110 + 7.10.6070 + 8.0.50727 + 10.0.30319 + 9.0.30729 + 15.1.192 + 12.0.4 + 7.0.4 + 8.0.4 + 11.0.4 + 7.0.4 + + + 1.0.30 + 1.1.0-roslyn-62714-01 + 8.0.0-alpha + 1.0.1 + 9.0.1 + 3.5.0 + 0.2.0-beta-000081 + + + + + + $(MSBuildThisFileDirectory)..\..\Tools\dependencyUptake\PackageVersions.props + + + + + diff --git a/configure.ac b/configure.ac deleted file mode 100644 index ec3df2198f6..00000000000 --- a/configure.ac +++ /dev/null @@ -1,76 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.61]) -AC_INIT([fsharp], [4.0], [https://github.com/fsharp/fsharp/issues]) - -# Checks for programs. -AC_PROG_MAKE_SET - -AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - -# pkg-config precedence: 1) our prefix 2) the system Mono location 3) the PATH -prefix_pkg_config="$prefix"/bin/pkg-config -osx_pkg_config=/Library/Frameworks/Mono.framework/Versions/Current/bin/pkg-config - -if test -e $prefix_pkg_config; then - PKG_CONFIG=$prefix_pkg_config -elif test -e $osx_pkg_config; then - PKG_CONFIG=$osx_pkg_config -elif test "x$PKG_CONFIG" = "xno"; then - AC_MSG_ERROR([You need to install pkg-config]) -fi - -AC_MSG_NOTICE("pkg-config: $PKG_CONFIG") -AC_MSG_NOTICE("PKG_CONFIG_LIBDIR: $PKG_CONFIG_LIBDIR") - -MONO_REQUIRED_VERSION=4.0 -MONO_RECOMMENDED_VERSION=4.2 -MONO_RECOMMENDED_REASON="as it is newer and already considered a stable version" - -if ! $PKG_CONFIG --atleast-version=$MONO_REQUIRED_VERSION mono; then - AC_MSG_ERROR("You need mono $MONO_REQUIRED_VERSION") -fi - -if ! $PKG_CONFIG --atleast-version=$MONO_RECOMMENDED_VERSION mono; then - AC_MSG_WARN([Mono $MONO_RECOMMENDED_VERSION or higher is recommended, $MONO_RECOMMENDED_REASON]) -fi - -AC_ARG_WITH([gacdir], - [ --with-gacdir=/path/to/gac Specify the gac directory (ex: /usr/lib/mono/gac)], - [], - [with_gacdir=no] - ) - -MONOPREFIX=$(cd `$PKG_CONFIG --variable=prefix mono` && pwd) -MONOBINDIR="$MONOPREFIX"/bin -MONOLIBDIR="$MONOPREFIX"/lib - -AC_PATH_PROG(MSBUILD, msbuild, no) -msbuild_from_pkg_config="$MONOBINDIR"/msbuild -if test -e $msbuild_from_pkg_config; then - MSBUILD=$msbuild_from_pkg_config -elif test "x$MSBUILD" == "xno"; then - AC_MSG_ERROR([Could not find msbuild]) -fi -AC_MSG_NOTICE(msbuild: $MSBUILD) - -AC_SUBST(MONOBINDIR) -AC_SUBST(MONOLIBDIR) - -AC_CONFIG_FILES([ -mono/launcher -mono/config.make -]) -AC_OUTPUT - -CONFIGURE_FILE=autogen.sh -if ! test -e $CONFIGURE_FILE; then - CONFIGURE_FILE=configure -fi -CONFIGURE_COMMAND="`dirname $0`/$CONFIGURE_FILE" - -if ! test "x$MONOPREFIX" = "x$prefix"; then - AC_WARN([Prefix to use is not the same as mono's: $prefix - Consider using: $CONFIGURE_COMMAND --prefix=$MONOPREFIX]) -fi diff --git a/fcs/.paket/paket.exe b/fcs/.paket/paket.exe index ef3ea32af2a..b98e000b232 100644 Binary files a/fcs/.paket/paket.exe and b/fcs/.paket/paket.exe differ 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 7c410604035..7e96d797f77 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 @@ -1,47 +1,24 @@ - - - + $(MSBuildProjectDirectory)\..\..\src + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\..\ - Library - FSharp.Compiler.Service.MSBuild.v12 - $(NoWarn);44;62;9 - {8157b50e-397d-4232-a4e0-1977afc7076d} - true - 0x06800000 - true - true - $(OtherFlags) --times - $(NoWarn);69;65;54;61;75 - true - ..\..\$(Configuration)\fcs\net45\ - - false - true - AnyCPU + net45 + ..\..\$(Configuration.ToLower())\fcs $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT - $(OtherFlags) /warnon:1182 - $(OtherFlags) --version:$(VersionPrefix).0 - - v4.5 - - - DEBUG; $(DefineConstants) - false - $(OtherFlags) --no-jit-optimize --jit-tracking - - - true + + Additional DLL for legacy compat for the F# compiler service. + Additional DLL for legacy compat for the F# compiler service. + false + Microsoft Corporation; F# community contributors + https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE + https://github.com/fsharp/FSharp.Compiler.Service + https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png + F#, compiler, msbuild @@ -49,44 +26,27 @@ - - - - - - + + - $(FSharpSourcesRoot)/../fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Framework.dll + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll false - $(FSharpSourcesRoot)/../fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Engine.dll + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Engine.dll false - $(FSharpSourcesRoot)/../fcs/dependencies/MSBuild.v12.0/Microsoft.Build.dll + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.dll false - $(FSharpSourcesRoot)/../fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Utilities.v12.0.dll + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Utilities.v12.0.dll false - $(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 + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.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 52d00fb4007..ab486b6cbcf 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj @@ -1,67 +1,34 @@ - - + $(MSBuildProjectDirectory)\..\..\src + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\..\ - 2.0 - 893c3cd9-5af8-4027-a667-21e62fc2c703 - FSharp.Compiler.Service.ProjectCracker - FSharp.Compiler.Service.ProjectCracker - FSharp.Compiler.Service.ProjectCracker - Library - ..\..\$(Configuration)\fcs\net45\ - $(OutputPath)$(AssemblyName).xml - false - - v4.5 - true - AnyCPU - 3 - $(OtherFlags) --version:$(VersionPrefix).0 + net45 + ..\..\$(Configuration.ToLower())\fcs - - true - full - false - false - DEBUG;TRACE - - - pdbonly - true - true - TRACE + + Legacy project file cracker for the F# compiler service. + Legacy project file cracker for the F# compiler service. + false + Microsoft Corporation; F# community contributors + https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE + https://github.com/fsharp/FSharp.Compiler.Service + https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png + F#, compiler, msbuild - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll - false - - ProjectCrackerOptions.fs + + + - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + - \ 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 91c908e30d2..871579de358 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj @@ -1,44 +1,18 @@ - - + $(MSBuildProjectDirectory)\..\..\src + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\..\ - 2.0 - b1bdd96d-47e1-4e65-8107-fbae23a06db4 Exe - ..\..\$(Configuration)\fcs\net45\ - $(OutputPath)$(AssemblyName).xml - FSharp.Compiler.Service.ProjectCrackerTool - FSharp.Compiler.Service.ProjectCrackerTool - FSharp.Compiler.Service.ProjectCrackerTool + net45 + $(DefineConstants);CROSS_PLATFORM_COMPILER + $(DefineConstants);ENABLE_MONO_SUPPORT $(OtherFlags) --staticlink:FSharp.Core - $(NoWarn);40;44;2011 true - false - - v4.5 - 3 - AnyCPU - true - $(OtherFlags) --version:$(VersionPrefix).0 - - - true - full - false - false - DEBUG;TRACE - - - pdbonly - true - true - TRACE + false + ..\..\$(Configuration.ToLower())\fcs @@ -46,85 +20,26 @@ - - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + + + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll + false + + + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Engine.dll + false + + + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.dll + false + + + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Utilities.v12.0.dll + false + + + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll false - - - - - - ..\packages\Microsoft.Build\lib\net45\Microsoft.Build.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Engine\lib\net45\Microsoft.Build.Engine.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Framework\lib\net45\Microsoft.Build.Framework.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Utilities.Core\lib\net45\Microsoft.Build.Utilities.Core.dll - True - True - - - - - - - - - True - - - - - - - - - ..\packages\System.Threading.Tasks.Dataflow\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll - True - True - - - - - \ No newline at end of file + diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/Program.fs b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/Program.fs index 7ce360c312f..8da6ceb2927 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/Program.fs +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/Program.fs @@ -6,7 +6,7 @@ open System.Runtime.Serialization.Json module Program = -#if !DOTNETCORE +#if !NETCOREAPP2_0 let addMSBuildv14BackupResolution () = let onResolveEvent = new ResolveEventHandler(fun sender evArgs -> let requestedAssembly = AssemblyName(evArgs.Name) @@ -40,7 +40,7 @@ module Program = let asText = Array.exists (fun (s: string) -> s = "--text") argv let argv = Array.filter (fun (s: string) -> s <> "--text") argv -#if !DOTNETCORE +#if !NETCOREAPP2_0 addMSBuildv14BackupResolution () #endif crackAndSendOutput asText argv diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/ProjectCrackerTool.fs b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/ProjectCrackerTool.fs index a20c7a33c0e..daa5c3c9e05 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/ProjectCrackerTool.fs +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/ProjectCrackerTool.fs @@ -11,7 +11,7 @@ module internal ProjectCrackerTool = open Microsoft.Build.Evaluation let runningOnMono = -#if DOTNETCORE +#if NETCOREAPP2_0 false #else try match System.Type.GetType("Mono.Runtime") with null -> false | _ -> true @@ -128,7 +128,7 @@ module internal ProjectCrackerTool = outFileOpt, directory, getItems, references, projectReferences, getprop project, project.FullPath -#if !DOTNETCORE +#if !NETCOREAPP2_0 let CrackProjectUsingOldBuildAPI (fsprojFile:string) properties logOpt = let engine = new Microsoft.Build.BuildEngine.Engine() Option.iter (fun l -> engine.RegisterLogger(l)) logOpt @@ -201,7 +201,7 @@ module internal ProjectCrackerTool = let outFileOpt, directory, getItems, references, projectReferences, getProp, fsprojFullPath = try -#if DOTNETCORE +#if NETCOREAPP2_0 CrackProjectUsingNewBuildAPI fsprojFileName properties logOpt with #else diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/paket.references b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/paket.references deleted file mode 100644 index 3ad1f9662c7..00000000000 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/paket.references +++ /dev/null @@ -1,4 +0,0 @@ -Microsoft.Build.Utilities.Core -Microsoft.Build.Engine -Microsoft.Build -System.Threading.Tasks.Dataflow \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj b/fcs/FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj deleted file mode 100644 index b9d44ad919f..00000000000 --- a/fcs/FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj +++ /dev/null @@ -1,62 +0,0 @@ - - - netcoreapp2.0 - $(DefineConstants);DOTNETCORE - $(DefineConstants);FX_ATLEAST_45 - $(DefineConstants);FX_ATLEAST_PORTABLE - $(DefineConstants);FX_NO_RUNTIMEENVIRONMENT - $(DefineConstants);FX_RESHAPED_REFLECTION - $(DefineConstants);NO_EXTENSIONTYPING - $(DefineConstants);TODO_REWORK_ASSEMBLY_LOAD - $(NoWarn);44; - true - true - true - false - - - - ReshapedReflection.fs - - - FsUnit.fs - - - Common.fs - - - EditorTests.fs - - - ExprTests.fs - - - TokenizerTests.fs - - - PerfTests.fs - - - - - Program.fs - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/App.config b/fcs/FSharp.Compiler.Service.Tests/App.config index 1e7989fe8cf..a895438e297 100644 --- a/fcs/FSharp.Compiler.Service.Tests/App.config +++ b/fcs/FSharp.Compiler.Service.Tests/App.config @@ -3,14 +3,6 @@ - - - - - - - - diff --git a/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj b/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj new file mode 100644 index 00000000000..49585864e4d --- /dev/null +++ b/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj @@ -0,0 +1,10 @@ + + + + net45;netstandard2.0 + false + + + + + \ No newline at end of file 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 4593e56815f..148b5f4dad6 100644 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -1,42 +1,25 @@ - - + $(MSBuildProjectDirectory)\..\..\src + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\..\ - 2.0 - EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F - Library - FSharp - FSharp.Compiler.Service.Tests - FSharp.Compiler.Service.Tests - LIBRARY - 58;75 - v4.6 - false - ..\..\$(Configuration)\fcs\net45\ - true - 3 - true + net46;netcoreapp2.0 + $(NoWarn);44; + true + true + false + true - - true - full - false - AnyCPU - true - - - pdbonly - true - AnyCPU - true + + $(DefineConstants);FX_NO_RUNTIMEENVIRONMENT + $(DefineConstants);NO_PROJECTCRACKER + + ReshapedReflection.fs + FsUnit.fs @@ -76,18 +59,23 @@ StructureTests.fs - - FSharp.Core.optdata - PreserveNewest - - - FSharp.Core.sigdata - PreserveNewest - + + TokenizerTests.fs + + + Program.fs + - + + + + + + + + @@ -101,98 +89,7 @@ + + - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - True - ..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - CSharp_Analysis - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Service - True - - - FSharp.Compiler.Service.ProjectCracker - {893c3cd9-5af8-4027-a667-21e62fc2c703} - True - - - - - - - - ..\packages\Microsoft.Build\lib\net45\Microsoft.Build.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Engine\lib\net45\Microsoft.Build.Engine.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Framework\lib\net45\Microsoft.Build.Framework.dll - True - True - - - - - - - - - ..\packages\Microsoft.Build.Utilities.Core\lib\net45\Microsoft.Build.Utilities.Core.dll - True - True - - - - - - - - - True - - - - - - - - - True - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.Tests/paket.references b/fcs/FSharp.Compiler.Service.Tests/paket.references deleted file mode 100644 index c64e284f16b..00000000000 --- a/fcs/FSharp.Compiler.Service.Tests/paket.references +++ /dev/null @@ -1,3 +0,0 @@ -Microsoft.Build.Utilities.Core -Microsoft.Build.Engine -Microsoft.Build \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.netstandard.sln b/fcs/FSharp.Compiler.Service.netstandard.sln deleted file mode 100644 index 5cb21d46635..00000000000 --- a/fcs/FSharp.Compiler.Service.netstandard.sln +++ /dev/null @@ -1,50 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service.netstandard", "FSharp.Compiler.Service.netstandard\FSharp.Compiler.Service.netstandard.fsproj", "{36B9F520-14B1-4431-AAF2-75433B87D851}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.Compiler.Service.Tests.netcore", "FSharp.Compiler.Service.Tests.netcore\FSharp.Compiler.Service.Tests.netcore.fsproj", "{1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|x64.ActiveCfg = Debug|x64 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|x64.Build.0 = Debug|x64 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|x86.ActiveCfg = Debug|x86 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Debug|x86.Build.0 = Debug|x86 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|Any CPU.Build.0 = Release|Any CPU - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|x64.ActiveCfg = Release|x64 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|x64.Build.0 = Release|x64 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|x86.ActiveCfg = Release|x86 - {36B9F520-14B1-4431-AAF2-75433B87D851}.Release|x86.Build.0 = Release|x86 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|x64.ActiveCfg = Debug|x64 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|x64.Build.0 = Debug|x64 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|x86.ActiveCfg = Debug|x86 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Debug|x86.Build.0 = Debug|x86 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|Any CPU.Build.0 = Release|Any CPU - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|x64.ActiveCfg = Release|x64 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|x64.Build.0 = Release|x64 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|x86.ActiveCfg = Release|x86 - {1004CE3D-0CCB-47F5-8DBF-657D1B9C19D7}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {DEDB1900-EFFF-4691-89B1-6DBEE6B77491} - EndGlobalSection -EndGlobal diff --git a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj b/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj deleted file mode 100644 index 5b035b3c9fc..00000000000 --- a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj +++ /dev/null @@ -1,668 +0,0 @@ - - - $(MSBuildProjectDirectory)\..\..\src - - - - netstandard1.6 - FSharp.Compiler.Service - $(DefineConstants);BUILDING_WITH_LKG - $(DefineConstants);COMPILER_SERVICE_AS_DLL - $(DefineConstants);COMPILER - $(DefineConstants);COMPILER_SERVICE - $(DefineConstants);COMPILER_SERVICE_ASSUMES_FSHARP_CORE_4_4_0_0 - $(DefineConstants);EXTENSIBLE_DUMPER - $(DefineConstants);NO_EXTENSIONTYPING - $(DefineConstants);FSHARP_CORE_4_5 - $(DefineConstants);FX_PORTABLE_OR_NETSTANDARD - $(DefineConstants);FX_ATLEAST_PORTABLE - $(DefineConstants);NETSTANDARD1_6 - $(DefineConstants);PREFERRED_UI_LANG - $(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE - $(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_CORHOST_SIGNER - $(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA - $(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE - $(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS - $(DefineConstants);FX_NO_HEAPTERMINATION - $(DefineConstants);FX_NO_LINKEDRESOURCES - $(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_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_WINFORMS - $(DefineConstants);FX_NO_WIN_REGISTRY - $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER - $(DefineConstants);FX_REDUCED_CONSOLE - $(DefineConstants);FX_REDUCED_EXCEPTIONS - $(DefineConstants);FX_RESHAPED_CONSOLE - $(DefineConstants);FX_RESHAPED_GLOBALIZATION - $(DefineConstants);FX_RESHAPED_REFEMIT - $(DefineConstants);FX_RESHAPED_REFLECTION - $(DefineConstants);FX_RESHAPED_REFLECTION_CORECLR - $(DefineConstants);FSI_TODO_NETCORE - $(DefineConstants);INCLUDE_METADATA_READER - $(DefineConstants);INCLUDE_METADATA_WRITER - $(DefineConstants);NO_DEBUG_LOG - $(DefineConstants);NO_INLINE_IL_PARSER - $(DefineConstants);NO_LOADER_OPTIMIZATION - $(DefineConstants);NO_LOGGING_GUI - $(DefineConstants);FX_RESHAPED_MSBUILD - $(DefineConstants);SIGNED - $(DefineConstants);TODO_REWORK_ASSEMBLY_LOAD - $(DefineConstants);TODO_REWORK_SERVER - $(NoWarn);44;69;65;54;61;75;62;9;2003; - true - true - true - - - - AssemblyInfo/AssemblyInfo.fs - - - FSComp.txt - - - FSIstrings.txt - - - FSStrings.resx - FSStrings.resources - - - --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 - - - --module Microsoft.FSharp.Compiler.Parser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - pars.fsy - - - Reshaped/reshapedreflection.fs - - - ErrorText/sformat.fsi - - - ErrorText/sformat.fs - - - ErrorText/sr.fsi - - - ErrorText/sr.fs - - - LexYaccRuntime/prim-lexing.fsi - - - LexYaccRuntime/prim-lexing.fs - - - LexYaccRuntime/prim-parsing.fsi - - - LexYaccRuntime/prim-parsing.fs - - - Utilities/ResizeArray.fsi - - - Utilities/ResizeArray.fs - - - Utilities/HashMultiMap.fsi - - - Utilities/HashMultiMap.fs - - - Utilities/EditDistance.fs - - - Utilities/TaggedCollections.fsi - - - Utilities/TaggedCollections.fs - - - Utilities/QueueList.fs - - - Utilities/ildiag.fsi - - - Utilities/ildiag.fs - - - Utilities/illib.fs - - - Utilities/filename.fsi - - - Utilities/filename.fs - - - Utilities/zmap.fsi - - - Utilities/zmap.fs - - - Utilities/zset.fsi - - - Utilities/zset.fs - - - Utilities/bytes.fsi - - - Utilities/bytes.fs - - - Utilities/lib.fs - - - Utilities/InternalCollections.fsi - - - Utilities/InternalCollections.fs - - - Utilities/rational.fsi - - - Utilities/rational.fs - - - ErrorLogging/range.fsi - - - ErrorLogging/range.fs - - - ErrorLogging/ErrorLogger.fs - - - ErrorLogging/ErrorResolutionHints.fs - - - ReferenceResolution/ReferenceResolver.fs - - - AbsIL/il.fsi - - - AbsIL/il.fs - - - AbsIL/ilx.fsi - - - AbsIL/ilx.fs - - - AbsIL/ilascii.fsi - - - AbsIL/ilascii.fs - - - AbsIL/ilprint.fsi - - - AbsIL/ilprint.fs - - - AbsIL/ilmorph.fsi - - - AbsIL/ilmorph.fs - - - AbsIL/ilsign.fs - - - AbsIL/ilsupp.fsi - - - AbsIL/ilsupp.fs - - - AbsIL/ilpars.fs - - - AbsIL/illex.fs - - - AbsIL/ilbinary.fsi - - - AbsIL/ilbinary.fs - - - AbsIL/ilread.fsi - - - AbsIL/ilread.fs - - - AbsIL/ilwritepdb.fsi - - - AbsIL/ilwritepdb.fs - - - AbsIL/ilwrite.fsi - - - AbsIL/ilwrite.fs - - - AbsIL/ilreflect.fs - - - CompilerLocation/CompilerLocationUtils.fs - - - PrettyNaming/PrettyNaming.fs - - - ILXErase/ilxsettings.fs - - - ILXErase/EraseClosures.fsi - - - ILXErase/EraseClosures.fs - - - ILXErase/EraseUnions.fsi - - - ILXErase/EraseUnions.fs - - - --unicode --lexlib Internal.Utilities.Text.Lexing - AbsIL/illex.fsl - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/lex.fsl - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/pplex.fsl - - - --module Microsoft.FSharp.Compiler.PPParser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ParserAndUntypedAST/pppars.fsy - - - ParserAndUntypedAST/UnicodeLexing.fsi - - - ParserAndUntypedAST/UnicodeLexing.fs - - - ParserAndUntypedAST/layout.fsi - - - ParserAndUntypedAST/layout.fs - - - ParserAndUntypedAST/ast.fs - - - ParserAndUntypedAST/pppars.fs - - - ParserAndUntypedAST/pars.fs - - - ParserAndUntypedAST/lexhelp.fsi - - - ParserAndUntypedAST/lexhelp.fs - - - ParserAndUntypedAST/pplex.fs - - - ParserAndUntypedAST/lex.fs - - - ParserAndUntypedAST/LexFilter.fs - - - TypedAST/tainted.fsi - - - TypedAST/tainted.fs - - - TypedAST/ExtensionTyping.fsi - - - TypedAST/ExtensionTyping.fs - - - TypedAST/QuotationPickler.fsi - - - TypedAST/QuotationPickler.fs - - - TypedAST/tast.fs - - - TypedAST/TcGlobals.fs - - - TypedAST/TastOps.fsi - - - TypedAST/TastOps.fs - - - TypedAST/TastPickle.fsi - - - TypedAST/TastPickle.fs - - - Logic/import.fsi - - - Logic/import.fs - - - Logic/infos.fs - - - Logic/AccessibilityLogic.fs - - - Logic/AttributeChecking.fs - - - Logic/InfoReader.fs - - - Logic/NicePrint.fs - - - Logic/AugmentWithHashCompare.fsi - - - Logic/AugmentWithHashCompare.fs - - - Logic/NameResolution.fsi - - - Logic/NameResolution.fs - - - Logic/TypeRelations.fs - - - Logic/SignatureConformance.fs - - - Logic/MethodOverrides.fs - - - Logic/MethodCalls.fs - - - Logic/PatternMatchCompilation.fsi - - - Logic/PatternMatchCompilation.fs - - - Logic/ConstraintSolver.fsi - - - Logic/ConstraintSolver.fs - - - Logic/CheckFormatStrings.fsi - - - Logic/CheckFormatStrings.fs - - - Logic/FindUnsolved.fs - - - Logic/QuotationTranslator.fsi - - - Logic/QuotationTranslator.fs - - - Logic/PostInferenceChecks.fsi - - - Logic/PostInferenceChecks.fs - - - Logic/TypeChecker.fsi - - - Logic/TypeChecker.fs - - - Optimize/Optimizer.fsi - - - Optimize/Optimizer.fs - - - Optimize/DetupleArgs.fsi - - - Optimize/DetupleArgs.fs - - - Optimize/InnerLambdasToTopLevelFuncs.fsi - - - Optimize/InnerLambdasToTopLevelFuncs.fs - - - Optimize/LowerCallsAndSeqs.fs - - - Optimize/autobox.fs - - - CodeGen/IlxGen.fsi - - - CodeGen/IlxGen.fs - - - Driver/CompileOps.fsi - - - Driver/CompileOps.fs - - - Driver/CompileOptions.fsi - - - Driver/CompileOptions.fs - - - Driver/fsc.fsi - - - Driver/fsc.fs - - - Symbols/SymbolHelpers.fsi - - - Symbols/SymbolHelpers.fs - - - Symbols/Symbols.fsi - - - Symbols/Symbols.fs - - - Symbols/Exprs.fsi - - - Symbols/Exprs.fs - - - Symbols/SymbolPatterns.fsi - - - Symbols/SymbolPatterns.fs - - - Service/IncrementalBuild.fsi - - - Service/IncrementalBuild.fs - - - Service/Reactor.fsi - - - Service/Reactor.fs - - - Service/ServiceConstants.fs - - - Service/ServiceLexing.fsi - - - Service/ServiceLexing.fs - - - Service/ServiceParseTreeWalk.fs - - - Service/ServiceNavigation.fsi - - - Service/ServiceNavigation.fs - - - Service/ServiceParamInfoLocations.fsi - - - Service/ServiceParamInfoLocations.fs - - - Service/ServiceUntypedParse.fsi - - - Service/ServiceUntypedParse.fs - - - Service/reshapedmsbuild.fs - - - Service/SimulatedMSBuildReferenceResolver.fs - - - Service/ServiceDeclarationLists.fsi - - - Service/ServiceDeclarationLists.fs - - - Service/ServiceAssemblyContent.fsi - - - Service/ServiceAssemblyContent.fs - - - Service/ServiceXmlDocParser.fsi - - - Service/ServiceXmlDocParser.fs - - - Service/ExternalSymbol.fsi - - - Service/ExternalSymbol.fs - - - Service/QuickParse.fsi - - - Service/QuickParse.fs - - - Service/service.fsi - - - Service/service.fs - - - Service/ServiceInterfaceStubGenerator.fsi - - - Service/ServiceInterfaceStubGenerator.fs - - - Service/ServiceStructure.fsi - - - Service/ServiceStructure.fs - - - Service/ServiceAnalysis.fsi - - - Service/ServiceAnalysis.fs - - - Service/fsi.fsi - - - Service/fsi.fs - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.sln b/fcs/FSharp.Compiler.Service.sln index 2fe403a3e36..192f8bd6242 100644 --- a/fcs/FSharp.Compiler.Service.sln +++ b/fcs/FSharp.Compiler.Service.sln @@ -51,7 +51,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "UntypedTree", "samples\Unty EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FscExe", "samples\FscExe\FscExe.fsproj", "{C94C257C-3C0A-4858-B5D8-D746498D1F08}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp_Analysis", "..\tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp_Analysis", "FSharp.Compiler.Service.Tests\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsiExe", "samples\FsiExe\FsiExe.fsproj", "{F9540CA8-1CE0-4546-A23A-A461E416E95B}" EndProject diff --git a/fcs/FSharp.Compiler.Service/AssemblyInfo.fs b/fcs/FSharp.Compiler.Service/AssemblyInfo.fs index 445698afde2..90521fefd5a 100644 --- a/fcs/FSharp.Compiler.Service/AssemblyInfo.fs +++ b/fcs/FSharp.Compiler.Service/AssemblyInfo.fs @@ -34,7 +34,7 @@ open System.Runtime.InteropServices [] [] [] -[] +[] #endif [] @@ -59,4 +59,4 @@ open System.Runtime.InteropServices [] #endif -do() +do() \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 5eee88d60bf..ce45abbc317 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -1,54 +1,48 @@ - - - - + $(MSBuildProjectDirectory)\..\..\src + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - Library - FSharp.Compiler.Service - $(NoWarn);44;62;9 - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - true - 0x06800000 - true - $(NoWarn);69;65;54;61;75 - true - ..\..\$(Configuration)\fcs\net45\ - $(OutputPath)$(AssemblyName).xml - - v4.5 - - $(DefineConstants);CROSS_PLATFORM_COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - $(DefineConstants);COMPILER + net45;netstandard2.0 $(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 - $(OtherFlags) --version:$(VersionPrefix).0 - false - true - + $(NoWarn);44;62;69;65;54;61;75;62;9;2003; + true + true + true - - true - full - false - AnyCPU + + The F# compiler as library. For editors, for tools, for scripting. For you. + The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. + false + Microsoft Corporation; F# community contributors + https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE + https://github.com/fsharp/FSharp.Compiler.Service + https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png + F#, fsharp, interactive, compiler, editor - - pdbonly - true - AnyCPU + + $(DefineConstants);FX_NO_PDB_READER + $(DefineConstants);FX_NO_PDB_WRITER + $(DefineConstants);FX_NO_SYMBOLSTORE + $(DefineConstants);FX_NO_LINKEDRESOURCES + $(DefineConstants);FX_NO_APP_DOMAINS + $(DefineConstants);FX_NO_RUNTIMEENVIRONMENT + $(DefineConstants);FX_NO_WIN_REGISTRY + $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION + $(DefineConstants);FX_RESHAPED_REFEMIT - + AssemblyInfo/AssemblyInfo.fs @@ -57,8 +51,9 @@ FSIstrings.txt - + FSStrings.resx + FSStrings.resources --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser --open Microsoft.FSharp.Compiler.AbstractIL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing @@ -68,214 +63,225 @@ --module Microsoft.FSharp.Compiler.Parser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing pars.fsy - + Reshaped/reshapedreflection.fs - + ErrorText/sformat.fsi - + ErrorText/sformat.fs - + ErrorText/sr.fsi - + ErrorText/sr.fs - + LexYaccRuntime/prim-lexing.fsi - + LexYaccRuntime/prim-lexing.fs - + LexYaccRuntime/prim-parsing.fsi - + LexYaccRuntime/prim-parsing.fs - - Utilities\ResizeArray.fsi + + Utilities/ResizeArray.fsi - - Utilities\ResizeArray.fs + + Utilities/ResizeArray.fs - + Utilities/HashMultiMap.fsi - + Utilities/HashMultiMap.fs - - Utilities\EditDistance.fs + + Utilities/EditDistance.fs - + Utilities/TaggedCollections.fsi - + Utilities/TaggedCollections.fs - + Utilities/QueueList.fs - + Utilities/ildiag.fsi - + Utilities/ildiag.fs - + Utilities/illib.fs - + Utilities/filename.fsi - + Utilities/filename.fs - + Utilities/zmap.fsi - + Utilities/zmap.fs - + Utilities/zset.fsi - + Utilities/zset.fs - + Utilities/bytes.fsi - + Utilities/bytes.fs - + Utilities/lib.fs - + Utilities/InternalCollections.fsi - + Utilities/InternalCollections.fs - + Utilities/rational.fsi - + Utilities/rational.fs - + ErrorLogging/range.fsi - + ErrorLogging/range.fs - + ErrorLogging/ErrorLogger.fs - + ErrorLogging/ErrorResolutionHints.fs - + ReferenceResolution/ReferenceResolver.fs --unicode --lexlib Internal.Utilities.Text.Lexing AbsIL/illex.fsl - + AbsIL/il.fsi - + AbsIL/il.fs - + AbsIL/ilx.fsi - + AbsIL/ilx.fs - + AbsIL/ilascii.fsi - + AbsIL/ilascii.fs - + AbsIL/ilprint.fsi - + AbsIL/ilprint.fs - + AbsIL/ilmorph.fsi - + AbsIL/ilmorph.fs - + + + + AbsIL/ilsign.fs + + + + AbsIL/ilsupp.fsi - + AbsIL/ilsupp.fs - + AbsIL/ilpars.fs - + AbsIL/illex.fs - + AbsIL/ilbinary.fsi - + AbsIL/ilbinary.fs - + AbsIL/ilread.fsi - + AbsIL/ilread.fs - + AbsIL/ilwritepdb.fsi - + AbsIL/ilwritepdb.fs - + AbsIL/ilwrite.fsi - + AbsIL/ilwrite.fs - + AbsIL/ilreflect.fs - + CompilerLocation/CompilerLocationUtils.fs - + PrettyNaming/PrettyNaming.fs - + ILXErase/ilxsettings.fs - + ILXErase/EraseClosures.fsi - + ILXErase/EraseClosures.fs - + ILXErase/EraseUnions.fsi - + ILXErase/EraseUnions.fs + + --unicode --lexlib Internal.Utilities.Text.Lexing + AbsIL/illex.fsl + --unicode --lexlib Internal.Utilities.Text.Lexing ParserAndUntypedAST/lex.fsl @@ -288,208 +294,208 @@ --module Microsoft.FSharp.Compiler.PPParser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing ParserAndUntypedAST/pppars.fsy - + ParserAndUntypedAST/UnicodeLexing.fsi - + ParserAndUntypedAST/UnicodeLexing.fs - + ParserAndUntypedAST/layout.fsi - + ParserAndUntypedAST/layout.fs - + ParserAndUntypedAST/ast.fs - + ParserAndUntypedAST/pppars.fs - + ParserAndUntypedAST/pars.fs - + ParserAndUntypedAST/lexhelp.fsi - + ParserAndUntypedAST/lexhelp.fs - + ParserAndUntypedAST/pplex.fs - + ParserAndUntypedAST/lex.fs - + ParserAndUntypedAST/LexFilter.fs - + TypedAST/tainted.fsi - + TypedAST/tainted.fs - + TypedAST/ExtensionTyping.fsi - + TypedAST/ExtensionTyping.fs - + TypedAST/QuotationPickler.fsi - + TypedAST/QuotationPickler.fs - + TypedAST/tast.fs - + TypedAST/TcGlobals.fs - + TypedAST/TastOps.fsi - + TypedAST/TastOps.fs - + TypedAST/TastPickle.fsi - + TypedAST/TastPickle.fs - + Logic/import.fsi - + Logic/import.fs - + Logic/infos.fs - + Logic/AccessibilityLogic.fs - + Logic/AttributeChecking.fs - + Logic/InfoReader.fs - + Logic/NicePrint.fs - + Logic/AugmentWithHashCompare.fsi - + Logic/AugmentWithHashCompare.fs - + Logic/NameResolution.fsi - + Logic/NameResolution.fs - + Logic/TypeRelations.fs - + Logic/SignatureConformance.fs - + Logic/MethodOverrides.fs - + Logic/MethodCalls.fs - + Logic/PatternMatchCompilation.fsi - + Logic/PatternMatchCompilation.fs - + Logic/ConstraintSolver.fsi - + Logic/ConstraintSolver.fs - + Logic/CheckFormatStrings.fsi - + Logic/CheckFormatStrings.fs - + Logic/FindUnsolved.fs - + Logic/QuotationTranslator.fsi - + Logic/QuotationTranslator.fs - + Logic/PostInferenceChecks.fsi - + Logic/PostInferenceChecks.fs - + Logic/TypeChecker.fsi - + Logic/TypeChecker.fs - + Optimize/Optimizer.fsi - + Optimize/Optimizer.fs - + Optimize/DetupleArgs.fsi - + Optimize/DetupleArgs.fs - + Optimize/InnerLambdasToTopLevelFuncs.fsi - + Optimize/InnerLambdasToTopLevelFuncs.fs - + Optimize/LowerCallsAndSeqs.fs - - Optimize\autobox.fs + + Optimize/autobox.fs - + CodeGen/IlxGen.fsi - + CodeGen/IlxGen.fs - + Driver/CompileOps.fsi - + Driver/CompileOps.fs - + Driver/CompileOptions.fsi - + Driver/CompileOptions.fs - + Driver/fsc.fsi - + Driver/fsc.fs @@ -624,38 +630,31 @@ Service/fsi.fs - - - - - + + + + + + + + + + + + + + + + + - - $(FSharpSourcesRoot)\..\packages\Microsoft.DiaSymReader.PortablePdb.1.2.0\lib\portable-net45+win8\Microsoft.DiaSymReader.PortablePdb.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.DiaSymReader.1.1.0\lib\portable-net45+win8\Microsoft.DiaSymReader.dll - - - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll - false + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - - + + + \ No newline at end of file diff --git a/fcs/README.md b/fcs/README.md index ffe9546e802..d297185ee65 100644 --- a/fcs/README.md +++ b/fcs/README.md @@ -60,9 +60,9 @@ which does things like: Yu can push the packages if you have permissions, either automatically using ``build Release`` or manually set APIKEY=... - .nuget\nuget.exe push Release\FSharp.Compiler.Service.19.0.1.nupkg %APIKEY% -Source https://nuget.org - .nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.19.0.1.nupkg %APIKEY% -Source https://nuget.org - .nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.19.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.21.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.MSBuild.v12.21.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.ProjectCracker.21.0.1.nupkg %APIKEY% -Source https://nuget.org ### Use of Paket and FAKE diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index 8a98636494b..59a8745a7e3 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -1,3 +1,8 @@ +#### 21.0.1 + * Use new .NET SDK project files + * FSharp.Compiler.Service nuget now uses net45 and netstandard2.0 + * FSharp.Compiler.Service netstandard2.0 now supports type providers + #### 19.0.1 * Rename ``LogicalEnclosingEntity`` to ``ApparentEnclosingEntity`` for consistency int he F# codebase terminology. * Rename ``EnclosingEntity`` to ``DeclaringEntity``. In the case of extension properties, ``EnclosingEntity`` was incorrectly returning the logical enclosing entity (i.e. the type the property appears to extend), and in this case ``ApparentEnclosingEntity`` should be used instead. diff --git a/fcs/build.cmd b/fcs/build.cmd index c18c0a1f227..731fc76abb7 100644 --- a/fcs/build.cmd +++ b/fcs/build.cmd @@ -1,7 +1,7 @@ @echo off setlocal -cd fcs +pushd %~dp0% if errorlevel 1 ( endlocal diff --git a/fcs/build.fsx b/fcs/build.fsx index 1e39de8bbb9..03b57797b02 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -13,12 +13,18 @@ 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") +let isMono = true +#else +let isMono = false #endif -let dotnetExePath = DotNetCli.InstallDotNetSDK "2.0.2" +// -------------------------------------------------------------------------------------- +// Utilities +// -------------------------------------------------------------------------------------- + +let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.4" let runDotnet workingDir args = let result = @@ -29,11 +35,8 @@ let runDotnet workingDir args = if result <> 0 then failwithf "dotnet %s failed" args -// -------------------------------------------------------------------------------------- -// Utilities -// -------------------------------------------------------------------------------------- - let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x + let runCmdIn workDir (exe:string) = Printf.ksprintf (fun (args:string) -> #if MONO let exe = exe.Replace("\\","/") @@ -51,33 +54,16 @@ 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") - +let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../release/fcs") // Read release notes & version info from RELEASE_NOTES.md let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") let isAppVeyorBuild = buildServer = BuildServer.AppVeyor +let isJenkinsBuild = buildServer = BuildServer.Jenkins let isVersionTag tag = Version.TryParse tag |> fst let hasRepoVersionTag = isAppVeyorBuild && AppVeyorEnvironment.RepoTag && isVersionTag AppVeyorEnvironment.RepoTagName let assemblyVersion = if hasRepoVersionTag then AppVeyorEnvironment.RepoTagName else release.NugetVersion -let nugetVersion = release.NugetVersion -open SemVerHelper -let nugetDebugVersion = - let semVer = SemVerHelper.parse nugetVersion - let debugPatch, debugPreRelease = - match semVer.PreRelease with - | None -> semVer.Patch + 1, { Origin = "alpha001"; Name = "alpha"; Number = Some 1; Parts = [AlphaNumeric "alpha001"] } - | Some pre -> - let num = match pre.Number with Some i -> i + 1 | None -> 1 - let name = pre.Name - let newOrigin = sprintf "%s%03d" name num - semVer.Patch, { Origin = newOrigin; Name = name; Number = Some num; Parts = [AlphaNumeric newOrigin] } - let debugVer = - { semVer with - Patch = debugPatch - PreRelease = Some debugPreRelease } - debugVer.ToString() -let buildDate = DateTime.UtcNow + let buildVersion = if hasRepoVersionTag then assemblyVersion else if isAppVeyorBuild then sprintf "%s-b%s" assemblyVersion AppVeyorEnvironment.BuildNumber @@ -88,92 +74,37 @@ Target "Clean" (fun _ -> ) Target "Restore" (fun _ -> - for p in (!! "./../**/packages.config") do - 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/NuGet.Config")) TimeSpan.MaxValue - if result <> 0 then failwithf "nuget restore %s failed" p - - runDotnet __SOURCE_DIRECTORY__ "restore tools.fsproj" + // We assume a paket restore has already been run + runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.sln -v n" + for p in [ "../packages.config" ] do + 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 + |> assertExitCodeZero ) Target "BuildVersion" (fun _ -> Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" buildVersion) |> ignore ) -// -------------------------------------------------------------------------------------- -// Clean build results & restore NuGet packages - - -Target "Build.NetFx" (fun _ -> - !! "FSharp.Compiler.Service.sln" - |> MSBuild "" "Build" ["Configuration","Release" ] - |> Log (".NETFxBuild-Output: ") -) - - -// -------------------------------------------------------------------------------------- -// Run the unit tests using test runner - -Target "Test.NetFx" (fun _ -> - let testDir = __SOURCE_DIRECTORY__ + "/../tests/fcs" - CleanDir testDir - - let outDir = releaseDir + "/fcs" - - !! (outDir + "/**/*.*") - |> CopyFiles testDir - - let toolPath = __SOURCE_DIRECTORY__ + "/../packages/NUnit.Console.3.0.0/tools" - !! (toolPath + "/*.*") - |> CopyFiles testDir - - !! (testDir + "/**/FSharp.Compiler.Service.Tests.dll") - |> Fake.Testing.NUnit3.NUnit3 (fun p -> - { p with - ToolPath = testDir + "/nunit3-console.exe" - ShadowCopy = false - WorkingDir = FullName testDir - TimeOut = TimeSpan.FromMinutes 20. }) -) - -// -------------------------------------------------------------------------------------- -// Build a NuGet package -Target "NuGet.NetFx" (fun _ -> - runCmdIn __SOURCE_DIRECTORY__ "../.nuget/NuGet.exe" @"pack nuget/FSharp.Compiler.Service.nuspec -OutputDirectory %s" releaseDir - runCmdIn __SOURCE_DIRECTORY__ "../.nuget/NuGet.exe" @"pack nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec -OutputDirectory %s" releaseDir - runCmdIn __SOURCE_DIRECTORY__ "../.nuget/NuGet.exe" @"pack nuget/FSharp.Compiler.Service.ProjectCracker.nuspec -OutputDirectory %s" releaseDir +Target "Build" (fun _ -> + runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.sln -v n -c Release" ) +Target "Test" (fun _ -> + // This project file is used for the netcoreapp2.0 tests to work out reference sets + runDotnet __SOURCE_DIRECTORY__ "restore ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n" + runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n" - -// -------------------------------------------------------------------------------------- -// .NET Core and .NET Core SDK - - -Target "Build.NetStd" (fun _ -> - runDotnet __SOURCE_DIRECTORY__ (sprintf "pack %s -v n -c Release" "FSharp.Compiler.Service.netstandard.sln") -) - - -Target "Test.NetStd" (fun _ -> - runDotnet __SOURCE_DIRECTORY__ (sprintf "run -p FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj -c Release -- --result:TestResults.NetStd.xml;format=nunit3") + // Now run the tests + runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release" ) - -//use dotnet-mergenupkg to merge the .NETstandard nuget package into the default one -Target "Nuget.AddNetStd" (fun _ -> - let nupkg = sprintf "%s/FSharp.Compiler.Service.%s.nupkg" releaseDir release.AssemblyVersion - let netcoreNupkg = sprintf "FSharp.Compiler.Service.netstandard/bin/Release/FSharp.Compiler.Service.%s.nupkg" release.AssemblyVersion - runDotnet __SOURCE_DIRECTORY__ (sprintf "mergenupkg --source %s --other %s --framework netstandard1.6" nupkg netcoreNupkg) +Target "NuGet" (fun _ -> + runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.sln -v n -c Release" ) - -// -------------------------------------------------------------------------------------- -// Generate the documentation - Target "GenerateDocsEn" (fun _ -> executeFSIWithArgs "docsrc/tools" "generate.fsx" [] [] |> ignore ) @@ -182,9 +113,6 @@ Target "GenerateDocsJa" (fun _ -> executeFSIWithArgs "docsrc/tools" "generate.ja.fsx" [] [] |> ignore ) -// -------------------------------------------------------------------------------------- -// Release Scripts - Target "PublishNuGet" (fun _ -> Paket.Push (fun p -> let apikey = @@ -199,47 +127,28 @@ Target "PublishNuGet" (fun _ -> // -------------------------------------------------------------------------------------- // Run all targets by default. Invoke 'build ' to override +Target "Start" DoNothing Target "Release" DoNothing -Target "NuGet" DoNothing -Target "Build" DoNothing Target "GenerateDocs" DoNothing Target "TestAndNuGet" DoNothing -"Clean" - =?> ("BuildVersion", isAppVeyorBuild) - ==> "Restore" - ==> "Build.NetStd" - -"Clean" +"Start" =?> ("BuildVersion", isAppVeyorBuild) ==> "Restore" - ==> "Build.NetFx" - -"Build.NetFx" - ==> "Test.NetFx" - -"Build.NetStd" - ==> "Test.NetStd" - -"Build.NetFx" - ==> "Build.NetStd" ==> "Build" -"Build.NetStd" - ==> "Nuget.AddNetStd" +"Build" + ==> "Test" -"Build.NetFx" - ==> "NuGet.NetFx" - ==> "Nuget.AddNetStd" +"Build" ==> "NuGet" -"Test.NetFx" +"Test" ==> "TestAndNuGet" "NuGet" ==> "TestAndNuGet" - "Build" ==> "NuGet" ==> "PublishNuGet" diff --git a/fcs/cibuild.sh b/fcs/cibuild.sh new file mode 100755 index 00000000000..ddc49d8ff34 --- /dev/null +++ b/fcs/cibuild.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# note: expects to run from top directory +./mono/latest-mono-stable.sh +./fcs/build.sh NuGet diff --git a/fcs/docsrc/content/fsharp-readme.md b/fcs/docsrc/content/fsharp-readme.md deleted file mode 100644 index 5cf3c67e36d..00000000000 --- a/fcs/docsrc/content/fsharp-readme.md +++ /dev/null @@ -1,218 +0,0 @@ -F# Compiler README -============================================================================================= - -> **NOTE:** This readme file is the original `README.md` document from the F# compiler -source code ([github.com/fsharp/fsharp](https://github.com/fsharp/fsharp)). This project is a fork of the F# compiler -source, with several minor changes that expose certain services. The readme is included -here for reference. - -This is the F# compiler, core library and core tools (open source edition). -The `master` branch is for the latest version of F# (currently F# 3.0). -To bootstrap the compiler, binaries built from an earlier version of this project are used. - -## Requirements - -Requires mono 2.9 or higher. Prefer Mono 3.0. - -On OSX, requires automake 2.69. To install from [homebrew](http://mxcl.github.com/homebrew): - - [lang=text] - brew install automake - - -## Building - -### On Linux and other Unix systems: -The usual: - - [lang=text] - ./autogen.sh - make - sudo make install - -By default that makes optimized binaries. To make debug, use `make CONFIG=debug` - - -### On MacOS (OSX) - -Use a prefix to your version of Mono: - - [lang=text] - ./autogen.sh --prefix=/Library/Frameworks/Mono.framework/Versions/Current/ - make - sudo make install - -By default that makes optimized binaries. To make debug, use `make CONFIG=debug` - -### On Windows, using msbuild (e.g.. if .NET is installed) -If you have only VS2012 installed, and not VS2010, you'll need to install the F# 2.0 Runtime (http://www.microsoft.com/en-us/download/details.aspx?id=13450) - - [lang=text] - cd src - msbuild fsharp-proto-build.proj - ngen install ..\lib\proto\4.0\fsc-proto.exe (optional) - msbuild fsharp-library-build.proj /p:Configuration=Release - msbuild fsharp-compiler-build.proj /p:Configuration=Release - -You can also build the FSharp.Core for .NET 2.0, Mono 2.1, MonoTouch, Silverlight 5.0, Windows Phone 7.1, Portable Profile47 (net45+sl5+win8), Portable Profile88 (net4+sl4+wp71+win8) and XNA 4.0 for Xbox 360 profiles: - - [lang=text] - msbuild fsharp-library-build.proj /p:TargetFramework=net20 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=mono21 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=monotouch /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=portable-net45+sl5+win8 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=portable-net4+sl4+wp71+win8 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=sl5 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=wp7 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=net40-xna40-xbox360 /p:Configuration=Release - -You can also build the FSharp.Core and FSharp.Compiler.Silverlight.dll for Silverlight 5.0: - - [lang=text] - msbuild fsharp-library-build.proj /p:TargetFramework=sl5-compiler /p:Configuration=Release - msbuild fsharp-compiler-build.proj /p:TargetFramework=sl5-compiler /p:Configuration=Release - -Change to ` /p:Configuration=Debug` for debug binaries. - -### On Windows, using xbuild (e.g. if no .NET is installed and only Mono 3.0 is installed): - - [lang=text] - cd src - xbuild fsharp-proto-build.proj - xbuild fsharp-library-build.proj - xbuild fsharp-compiler-build.proj - -Building using xbuild does not yet lay down a Mono-ready distribution (see src/fsharp/targets.make), so should only -be used for private development rather than preparing distributions. - - -## Strong Names - -The FSharp.Core.dll produced is only delay-signed (Mono does not require strong names). -If a strong-name signed FSharp.Core.dll is needed then use the one in - - [lang=text] - lib\bootstrap\signed\3.0\v4.0\FSharp.Core.dll - -## What you get - -Once built the main compiler binaries go in - - [lang=text] - lib/release/4.0 - -There are versions of FSharp.Core for .NET 2.0, MonoAndroid, MonoTouch (Mono profile 2.1) in - - [lang=text] - lib/release/2.0 - lib/release/2.1 - lib/release/2.1monotouch - -On `make install` the binaries etc. go in the prefix, e.g. - - [lang=text] - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/2.0/FSharp.Core.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/2.1/FSharp.Core.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0/fsc.exe - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0/FSharp.Compiler.dll - ... - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/fsc.exe - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/FSharp.Compiler.dll - ... - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/.../FSharp.Compiler.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/.../FSharp.Compiler.dll - ... - -plus some files for xbuild support - - [lang=text] - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/Microsoft\ F#/v4.0/* - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/Microsoft\ SDKs/F#/3.0/Framework/* - -(these names are the canonical names for Microsoft.FSharp.Targets used by project files coming from Visual Studio) - -plus scripts - - /usr/bin/fsharpc (F# compiler) - /usr/bin/fsharpi (F# Interactive) - -## Development notes - -###Continuous Integration Build - -We have a CI build set up with the JetBrains/Teamcity server as part of the F# community projects there: - -http://teamcity.codebetter.com/project.html?projectId=project61&tab=projectOverview - -@forki controls access. Right now this builds both a Mono 'make' install and a Windows 'cd src; msbuild fsharp-build.proj' build. No binaries are saved from the build, it is just for sanity checking. - - -###Editing the Compiler with Visual Studio or MonoDevelop - -Open `all-vs2012.sln`, and edit in modes Debug or Release. The compiler takes a good while to compile and that -can be a bit invasive to the work flow, so it's normally better to do the actual compilation from -the command line, see above. - -The F# support in MonoDevelop uses an in-process background compiler. On the Mac this causes pausing garbage -collections to kick in which makes editing the compiler in MonoDevelop awkward. - -### Building F# Core Unit Tests for .NET 4.x (optional) - -This uses the proto compiler to build the unit tests that check some parts of `FSharp.Core.dll` and `FSharp.Compiler.dll`. There is also another set of tests under `tests\fsharp`. - - [lang=text] - msbuild fsharp-library-unittests-build.proj /p:TargetFramework=net40 - -*Note: You must have NUnit installed to build the unit tests.* - - - -### Validation and Use - -Here are some simple tests to validate what you have built by checking `fsi.exe` (F# Interactive) starts up: - - - [lang=text] - lib\debug\4.0\fsi.exe - 1 + 1;; - \#q;; - lib\debug\4.0\fsi.exe /help - lib\debug\4.0\fsc.exe /help - echo printfn "hello world" > hello.fs - lib\debug\4.0\fsc.exe hello.fs - hello.exe - - -### Running Compiler tests (on Windows) - -There are language tests under `tests\fsharp\core`. The test apparatus is primitive and unfortunately uses batch files. You can run these on Windows using: - - [lang=text] - cd ..\tests\fsharp\core - ..\..\build-and-run-all-installed-ilx-configs.bat results.log - - -The results file will contain one entry for each test directory, plus any reported errors. - - - [lang=text] - tests\fsharp\core - tests\fsharp\core\queriesCustomQueryOps - tests\fsharp\core\queriesLeafExpressionConvert - tests\fsharp\core\queriesNullableOperators - tests\fsharp\core\queriesOverIEnumerable - ... - -Some tests for LINQ queries require SQL Server be installed. A failing test will look like this: - - [lang=text] - ERRORLEVEL=1: in tests\fsharp\core\csfromfs\build.bat - -You can then go to the relevant directory and run `build.bat` and `run.bat`. - - -## History - -F# compiler sources dropped by Microsoft are available from [fsharppowerpack.codeplex.com](http://fsharppowerpack.codeplex.com). - -Uses bootstrapping libraries, tools and F# compiler. The `lib/bootstrap/X.0` directories contain mono-built libraries, compiler and tools that can be used to bootstrap a build. You can also supply your own via the `--with-bootstrap` option. \ No newline at end of file diff --git a/fcs/docsrc/content/ja/compiler.fsx b/fcs/docsrc/content/ja/compiler.fsx index d21e63b8ef0..393f837cb5f 100644 --- a/fcs/docsrc/content/ja/compiler.fsx +++ b/fcs/docsrc/content/ja/compiler.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラの組み込み ==================== diff --git a/fcs/docsrc/content/ja/editor.fsx b/fcs/docsrc/content/ja/editor.fsx index 014be2e86c5..7bd61da5189 100644 --- a/fcs/docsrc/content/ja/editor.fsx +++ b/fcs/docsrc/content/ja/editor.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス: エディタサービス ==================================== @@ -14,7 +14,7 @@ 今回も `FSharpChecker` オブジェクトを作成するところから始めます。 > **注意:** 以下で使用しているAPIは試験的なもので、最新バージョンのnugetパッケージの - 公開に伴って変更されることがあります。 +公開に伴って変更されることがあります。 サンプルソースコードの型チェック -------------------------------- @@ -44,14 +44,14 @@ let checker = FSharpChecker.Create() *) // サンプルの入力となる複数行文字列 let input = - """ - open System - - let foo() = - let msg = String.Concat("Hello"," ","world") - if true then - printfn "%s" msg. - """ +""" +open System + +let foo() = +let msg = String.Concat("Hello"," ","world") +if true then +printfn "%s" msg. +""" // 入力値の分割とファイル名の定義 let inputLines = input.Split('\n') let file = "/home/user/Test.fsx" @@ -73,8 +73,8 @@ let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(projOp *) // パースを実行 let parseFileResults = - checker.ParseFile(file, input, parsingOptions) - |> Async.RunSynchronously +checker.ParseFile(file, input, parsingOptions) +|> Async.RunSynchronously (** `TypeCheckResults` に備えられた興味深い機能の紹介に入る前に、 サンプル入力に対して型チェッカーを実行する必要があります。 @@ -84,25 +84,25 @@ F#コードにエラーがあった場合も何らかの型チェックの結果 // 型チェックを実行 let checkFileAnswer = - checker.CheckFileInProject(parseFileResults, file, 0, input, projOptions) - |> Async.RunSynchronously +checker.CheckFileInProject(parseFileResults, file, 0, input, projOptions) +|> Async.RunSynchronously (** あるいは `ParseAndCheckFileInProject` を使用すれば1つの操作で両方のチェックを行うことができます: *) let parseResults2, checkFileAnswer2 = - checker.ParseAndCheckFileInProject(file, 0, input, projOptions) - |> Async.RunSynchronously +checker.ParseAndCheckFileInProject(file, 0, input, projOptions) +|> Async.RunSynchronously (** この返り値は `CheckFileAnswer` 型で、この型に機能的に興味深いものが揃えられています... *) let checkFileResults = - match checkFileAnswer with - | FSharpCheckFileAnswer.Succeeded(res) -> res - | res -> failwithf "パースが完了していません... (%A)" res +match checkFileAnswer with +| FSharpCheckFileAnswer.Succeeded(res) -> res +| res -> failwithf "パースが完了していません... (%A)" res (** @@ -147,7 +147,7 @@ printfn "%A" tip (** > **注意:** `GetToolTipTextAlternate` は古い関数 `GetToolTipText` に代わるものです。 - `GetToolTipText` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 +`GetToolTipText` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 この関数には位置とトークンの種類の他にも、 (ソースコードの変更時に役立つように)特定行の現在の内容と、 @@ -178,19 +178,19 @@ printfn "%A" tip *) // 特定の位置における宣言(自動補完)を取得する let decls = - checkFileResults.GetDeclarationListInfo - (Some parseFileResults, 7, 23, inputLines.[6], [], "msg", fun _ -> false) - |> Async.RunSynchronously +checkFileResults.GetDeclarationListInfo +(Some parseFileResults, 7, 23, inputLines.[6], [], "msg", fun _ -> false) +|> Async.RunSynchronously // 利用可能な項目を表示 for item in decls.Items do - printfn " - %s" item.Name +printfn " - %s" item.Name (** > **注意:** `GetDeclarationListInfo` は古い関数 `GetDeclarations` に代わるものです。 - `GetDeclarations` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 - また、将来的には現在の `GetDeclarations` が削除され、 `GetDeclarationListInfo` が - `GetDeclarations` になる予定です。 +`GetDeclarations` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 +また、将来的には現在の `GetDeclarations` が削除され、 `GetDeclarationListInfo` が +`GetDeclarations` になる予定です。 コードを実行してみると、 `Substring` や `ToUpper` 、 `ToLower` といった 文字列に対するいつものメソッドのリストが取得できていることでしょう。 @@ -214,13 +214,13 @@ for item in decls.Items do *) //String.Concatメソッドのオーバーロードを取得する let methods = - checkFileResults.GetMethodsAlternate(5, 27, inputLines.[4], Some ["String"; "Concat"]) |> Async.RunSynchronously +checkFileResults.GetMethodsAlternate(5, 27, inputLines.[4], Some ["String"; "Concat"]) |> Async.RunSynchronously // 連結された引数リストを表示 for mi in methods.Methods do - [ for p in mi.Parameters -> p.Display ] - |> String.concat ", " - |> printfn "%s(%s)" methods.MethodName +[ for p in mi.Parameters -> p.Display ] +|> String.concat ", " +|> printfn "%s(%s)" methods.MethodName (** ここでは `Display` プロパティを使用することで各引数に対する アノテーションを取得しています。 @@ -247,9 +247,9 @@ F#コンパイラは型チェックを(自動的に)バックグラウンドで ファイルに対する型チェックを諦めるか、どちらか選択することになります。 > [fsharpbinding](https://github.com/fsharp/fsharpbinding) プロジェクトには - 1つのF#エージェント経由ですべてのリクエストをバックグラウンドワークとして - 処理するような、より複雑な具体例も含まれています。 - エディタの機能を実装する方法としてはこちらのほうが適切です。 +1つのF#エージェント経由ですべてのリクエストをバックグラウンドワークとして +処理するような、より複雑な具体例も含まれています。 +エディタの機能を実装する方法としてはこちらのほうが適切です。 *) diff --git a/fcs/docsrc/content/ja/filesystem.fsx b/fcs/docsrc/content/ja/filesystem.fsx index 2c18c95fa9a..1646b49ccff 100644 --- a/fcs/docsrc/content/ja/filesystem.fsx +++ b/fcs/docsrc/content/ja/filesystem.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス: ファイルシステム仮想化 ========================================== diff --git a/fcs/docsrc/content/ja/fsharp-readme.md b/fcs/docsrc/content/ja/fsharp-readme.md deleted file mode 100644 index f7b5238400d..00000000000 --- a/fcs/docsrc/content/ja/fsharp-readme.md +++ /dev/null @@ -1,249 +0,0 @@ -F# コンパイラのREADME -============================================================================================= - -> **注意:** このreadmeファイルはF# コンパイラソースコード -([github.com/fsharp/fsharp](https://github.com/fsharp/fsharp)) -に付属していたオリジナルのファイルのコピーです。 -F# Compiler Servicesプロジェクトは元々F# Compilerプロジェクトから派生したもので、 -いくつかのサービスを公開するために若干の変更が加えられています。 -ここに含まれるreadmeファイルは参考程度にとどめてください。 - -このプロジェクトには(オープンソース版の)F# コンパイラ、コアライブラリ、コアツールが含まれます。 -いずれもMITライセンスが適用されます。 -`master` ブランチは最新バージョンのF#(現時点ではF# 3.0)に対応します。 -なおコンパイラをブートストラップするために、 -このプロジェクトの以前のバージョンでビルドされたバイナリが使用されます。 - -## 必須要件 - -Mono 2.9以上のバージョンが必要です。Mono 3.0が推奨されます。 - -OS Xの場合、automake 2.69が必要です。 -[homebrew](http://brew.sh/) 経由でインストールする場合は -以下のようにします: - - [lang=text] - brew install automake - -## ビルド - -### Linuxおよびその他のUnixシステムの場合 - -通常の手順は以下の通りです: - - [lang=text] - ./autogen.sh - make - sudo make install - -デフォルトでは最適化されたバイナリが生成されます。 -デバッグ版をビルドする場合は `make CONFIG=debug` とします。 - -### MacOS (OSX)の場合 - -Monoのバージョンを指定するprefixを設定します: - - [lang=text] - ./autogen.sh --prefix=/Library/Frameworks/Mono.framework/Versions/Current/ - make - sudo make install - -デフォルトでは最適化されたバイナリが生成されます。 -デバッグ版をビルドする場合は `make CONFIG=debug` とします。 - -### Windows上でmsbuildを使用する(つまり.NETがインストールされている)場合 - -VS2010がインストールされておらず、VS2012しかインストールされていない場合には -[F# 2.0 ランタイム](http://www.microsoft.com/en-us/download/details.aspx?id=13450) -のインストールが必要です: - - [lang=text] - cd src - msbuild fsharp-proto-build.proj - ngen install ..\lib\proto\4.0\fsc-proto.exe (optional) - msbuild fsharp-library-build.proj /p:Configuration=Release - msbuild fsharp-compiler-build.proj /p:Configuration=Release - -また、.NET 2.0やMono 2.1、MonoTouch、Silverlight 5.0、 -Windows Phone 7.1、ポータブルプロファイル47(.NET4.5+Silverlight5+Windows8)、 -ポータブルプロファイル88(.NET4+Silverlight4+WindowsPhone7.1+Windows8)、 -Xbox 360用XNA 4.0のプロファイルに対応するFSharp.Coreをビルドすることもできます: - - [lang=text] - msbuild fsharp-library-build.proj /p:TargetFramework=net20 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=mono21 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=monotouch /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=portable-net45+sl5+win8 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=portable-net4+sl4+wp71+win8 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=sl5 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=wp7 /p:Configuration=Release - msbuild fsharp-library-build.proj /p:TargetFramework=net40-xna40-xbox360 /p:Configuration=Release - -Silverlight 5.0用にFSharp.CoreとFSharp.Compiler.Silverlight.dll -をビルドすることもできます: - - [lang=text] - msbuild fsharp-library-build.proj /p:TargetFramework=sl5-compiler /p:Configuration=Release - msbuild fsharp-compiler-build.proj /p:TargetFramework=sl5-compiler /p:Configuration=Release - -デバッグ版バイナリを出力する場合は ` /p:Configuration=Debug` に変更します。 - -### Windows上でxbuildを使用する(つまり.NETがインストールされておらず、Mono 3.0だけがインストールされている)場合 - - [lang=text] - cd src - xbuild fsharp-proto-build.proj - xbuild fsharp-library-build.proj - xbuild fsharp-compiler-build.proj - -xbuildを使用したビルドはMono準拠の公開用バイナリ生成にはまだ対応していないため -(src/fsharp/targets.make を参照)、個人的な使用にとどめ、 -公開用のビルドには使用してはいけません。 - -## 厳密名 - -生成されたFSharp.Core.dllには遅延署名だけが行われます -(Monoでは厳密名が必須ではありません)。 -厳密名で署名されたFSharp.Core.dllが必要であれば以下を使用してください: - - [lang=text] - lib\bootstrap\signed\3.0\v4.0\FSharp.Core.dll - -## 生成されるファイル - -ビルドが完了すると、メインのコンパイラバイナリは以下の場所に生成されます: - - [lang=text] - lib/release/4.0 - -.NET 2.0やMonoAndroid、MonoTouch(Monoプロファイル2.1)は以下の場所に生成されます: - - [lang=text] - lib/release/2.0 - lib/release/2.1 - lib/release/2.1monotouch - -`make install` を実行した場合のプレフィックスは以下のようになります: - - [lang=text] - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/2.0/FSharp.Core.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/2.1/FSharp.Core.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0/fsc.exe - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0/FSharp.Compiler.dll - ... - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/fsc.exe - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/FSharp.Compiler.dll - ... - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/.../FSharp.Compiler.dll - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/gac/.../FSharp.Compiler.dll - ... - -またxbuildをサポートする場合は以下のプレフィックスになります: - - [lang=text] - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/Microsoft\ F#/v4.0/* - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/Microsoft\ SDKs/F#/3.0/Framework/* - -(これらの名前はVisual Studio由来のプロジェクトファイルで使用されている -Microsoft.FSharp.Targetsファイル内における正式名です) - -また、以下のスクリプトが配置されます: - - [lang=text] - /usr/bin/fsharpc (F# コンパイラ) - /usr/bin/fsharpi (F# Interactive) - -## 開発者用メモ - -### 継続的インテグレーションビルド - -このプロジェクトはJetBrains/Teamcityサーバー上において、 -F#コミュニティプロジェクトの一部として継続的インテグレーション -(CI:continuous integration)ビルドが行われています: - -[http://teamcity.codebetter.com/project.html?projectId=project61&tab=projectOverview](http://teamcity.codebetter.com/project.html?projectId=project61&tab=projectOverview) - -主な管理者は @forki です。 -今のところMono用に'make' installと、 -Windows用に 'cd src; msbuild fsharp-build.proj' のビルドが行われています。 -ビルドされたバイナリは保存されておらず、 -単にサニティチェックだけが対象になっています。 - -### Visual StudioまたはMonoDevelop上でコンパイラを編集する - -`all-vs2012.sln` を開いてモードをDebugまたはReleaseに設定します。 -コンパイラはコンパイル中でも気を利かせてワークフローに若干介入することがあるため、 -実際にコンパイルを実行するには上記にあるようなコマンドライン経由で -コンパイルするとよいでしょう。 - -MonoDevelopでサポートされているF#ではプロセス内バックグラウンドコンパイラが -使用されます。 -Mac上ではこれが原因でガベージコレクションを止めることがあり、 -MonoDevelop上でのコンパイラの編集がしづらくなる場合があります。 - -### .NET 4.x用にF# Coreの単体テストをビルドする(省略可) - -このプロジェクトでは、 `FSharp.Core.dll` や `FSharp.Compiler.dll` の一部を -チェックする単体テストをビルドするためにprotoコンパイラを使用しています。 -また、 `tests\fsharp` 以下にもいくつかのテストがあります。 - - [lang=text] - msbuild fsharp-library-unittests-build.proj /p:TargetFramework=net40 - -*注意: 単体テストをビルドする場合、NUnitをインストールしておく必要があります。* - -### 検証および使用方法 - -ビルドされたバイナリを簡単に検証するには、以下のようにして `fsi.exe` -(F# Interactive) を起動してみるとよいでしょう: - - [lang=text] - lib\debug\4.0\fsi.exe - 1 + 1;; - \#q;; - lib\debug\4.0\fsi.exe /help - lib\debug\4.0\fsc.exe /help - echo printfn "hello world" > hello.fs - lib\debug\4.0\fsc.exe hello.fs - hello.exe - - -### (Windows上で)コンパイラのテストを実行する - -`tests\fsharp\core` 以下には言語機能のテストがあります。 -テスト機構は素朴なもので、残念なことにバッチファイルを使用しています。 -これらのテストをWindows上で実行するには以下のようにします: - - [lang=text] - cd ..\tests\fsharp\core - ..\..\build-and-run-all-installed-ilx-configs.bat results.log - -それぞれのテストディレクトリには1つのテスト結果ファイルが生成され、 -発生したエラーも記録されます。 - - [lang=text] - tests\fsharp\core - tests\fsharp\core\queriesCustomQueryOps - tests\fsharp\core\queriesLeafExpressionConvert - tests\fsharp\core\queriesNullableOperators - tests\fsharp\core\queriesOverIEnumerable - ... - -LINQクエリに対するいくつかのテストではSQL Serverのインストールが必要です。 -テストが失敗すると、たとえば以下のように出力されます: - - [lang=text] - ERRORLEVEL=1: in tests\fsharp\core\csfromfs\build.bat - -この場合、関連するディレクトリに移動した後、 -`build.bat` および `run.bat` を実行します。 - -## 歴史 - -Microsoftから公開されたF#コンパイラのソースは -[fsharppowerpack.codeplex.com](http://fsharppowerpack.codeplex.com) にあります。 - -ブートストラップ用ライブラリ、ツール、F#コンパイラが利用できます。 -`lib/bootstrap/X.0` ディレクトリにはMonoビルド用ライブラリやコンパイラ、 -ビルドをブートストラップするために使用するツールなどが含まれています。 -ブートストラップを独自に指定する場合は `--with-bootstrap` オプションを使用します。 diff --git a/fcs/docsrc/content/ja/interactive.fsx b/fcs/docsrc/content/ja/interactive.fsx index 3344b41958b..63240cd98fd 100644 --- a/fcs/docsrc/content/ja/interactive.fsx +++ b/fcs/docsrc/content/ja/interactive.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** インタラクティブサービス: F# Interactiveの組み込み ================================================== diff --git a/fcs/docsrc/content/ja/project.fsx b/fcs/docsrc/content/ja/project.fsx index 78cf6eff3e0..3e2895b9f38 100644 --- a/fcs/docsrc/content/ja/project.fsx +++ b/fcs/docsrc/content/ja/project.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス: プロジェクトの分析 ====================================== diff --git a/fcs/docsrc/content/ja/symbols.fsx b/fcs/docsrc/content/ja/symbols.fsx index c962a2b8f62..2e3f53bdba4 100644 --- a/fcs/docsrc/content/ja/symbols.fsx +++ b/fcs/docsrc/content/ja/symbols.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス: シンボルの処理 ================================== diff --git a/fcs/docsrc/content/ja/tokenizer.fsx b/fcs/docsrc/content/ja/tokenizer.fsx index abcbb222c48..589061e0b0a 100644 --- a/fcs/docsrc/content/ja/tokenizer.fsx +++ b/fcs/docsrc/content/ja/tokenizer.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス:F#トークナイザを使用する ============================================ diff --git a/fcs/docsrc/content/ja/untypedtree.fsx b/fcs/docsrc/content/ja/untypedtree.fsx index 6a95c86a8d8..38f6e0b0e9c 100644 --- a/fcs/docsrc/content/ja/untypedtree.fsx +++ b/fcs/docsrc/content/ja/untypedtree.fsx @@ -1,5 +1,5 @@ (*** hide ***) -#I "../../../bin/v4.5/" +#I "../../../../debug/bin/net45/" (** コンパイラサービス:型無し構文木の処理 ====================================== diff --git a/fcs/docsrc/tools/generate.fsx b/fcs/docsrc/tools/generate.fsx index 59bd10187af..000f25f6a47 100644 --- a/fcs/docsrc/tools/generate.fsx +++ b/fcs/docsrc/tools/generate.fsx @@ -32,7 +32,7 @@ open FSharp.MetadataFormat let root = "." // Paths with template/source/output locations -let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45" +let bin = __SOURCE_DIRECTORY__ @@ "../../../release/fcs/net45" let content = __SOURCE_DIRECTORY__ @@ "../content" let output = __SOURCE_DIRECTORY__ @@ "../../../docs" let files = __SOURCE_DIRECTORY__ @@ "../files" diff --git a/fcs/docsrc/tools/generate.ja.fsx b/fcs/docsrc/tools/generate.ja.fsx index 8044db885d3..feaeb592d35 100644 --- a/fcs/docsrc/tools/generate.ja.fsx +++ b/fcs/docsrc/tools/generate.ja.fsx @@ -41,7 +41,7 @@ open FSharp.MetadataFormat let root = "." // Paths with template/source/output locations -let bin = __SOURCE_DIRECTORY__ @@ "../../../Release/fcs/net45" +let bin = __SOURCE_DIRECTORY__ @@ "../../../release/fcs/net45" let content = __SOURCE_DIRECTORY__ @@ "../content/ja" let outputJa = __SOURCE_DIRECTORY__ @@ "../../../docs/ja" let files = __SOURCE_DIRECTORY__ @@ "../files" diff --git a/fcs/fcs.props b/fcs/fcs.props index 3c813b2b341..c3e2198b38f 100644 --- a/fcs/fcs.props +++ b/fcs/fcs.props @@ -3,14 +3,10 @@ - 19.0.1 + 21.0.1 $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools fsi.exe - - 1.3.1 - {HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - \ No newline at end of file diff --git a/fcs/netfx.props b/fcs/netfx.props new file mode 100644 index 00000000000..064f29b1809 --- /dev/null +++ b/fcs/netfx.props @@ -0,0 +1,28 @@ + + + + + + + true + + + /Library/Frameworks/Mono.framework/Versions/Current/lib/mono + /usr/lib/mono + /usr/local/lib/mono + + + $(BaseFrameworkPathOverrideForMono)/4.5-api + $(BaseFrameworkPathOverrideForMono)/4.5.1-api + $(BaseFrameworkPathOverrideForMono)/4.5.2-api + $(BaseFrameworkPathOverrideForMono)/4.6-api + $(BaseFrameworkPathOverrideForMono)/4.6.1-api + $(BaseFrameworkPathOverrideForMono)/4.6.2-api + $(BaseFrameworkPathOverrideForMono)/4.7-api + $(BaseFrameworkPathOverrideForMono)/4.7.1-api + true + + + $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths) + + \ No newline at end of file diff --git a/fcs/nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec b/fcs/nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec deleted file mode 100644 index 6c20765492a..00000000000 --- a/fcs/nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - FSharp.Compiler.Service.MSBuild.v12 - Adds legacy MSBuild 12.0 support to the F# compiler services package for resolving references such as #r "System, Version=4.1.0.0,..." - en-US - false - 19.0.1 - Microsoft Corporation and F# community contributors - https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE - https://github.com/fsharp/FSharp.Compiler.Service - https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png - F#, fsharp, interactive, compiler, editor - F# compiler services for creating IDE tools, language extensions and for F# embedding. - - - - - - - - - - diff --git a/fcs/nuget/FSharp.Compiler.Service.ProjectCracker.nuspec b/fcs/nuget/FSharp.Compiler.Service.ProjectCracker.nuspec deleted file mode 100644 index 9b2f6ea823a..00000000000 --- a/fcs/nuget/FSharp.Compiler.Service.ProjectCracker.nuspec +++ /dev/null @@ -1,29 +0,0 @@ - - - - FSharp.Compiler.Service.ProjectCracker - The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. - en-US - false - 19.0.1 - Microsoft Corporation and F# community contributors - https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE - https://github.com/fsharp/FSharp.Compiler.Service - https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png - F#, fsharp, interactive, compiler, editor - F# compiler services for creating IDE tools, language extensions and for F# embedding. - - - - - - - - - - - - - - - diff --git a/fcs/nuget/FSharp.Compiler.Service.nuspec b/fcs/nuget/FSharp.Compiler.Service.nuspec deleted file mode 100644 index 37229cf4a39..00000000000 --- a/fcs/nuget/FSharp.Compiler.Service.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - FSharp.Compiler.Service - The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. - en-US - false - 19.0.1 - Microsoft Corporation and F# community contributors - https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE - https://github.com/fsharp/FSharp.Compiler.Service - https://raw.github.com/fsharp/FSharp.Compiler.Service/master/misc/logo.png - F#, fsharp, interactive, compiler, editor - F# compiler services for creating IDE tools, language extensions and for F# embedding. - - - - - - - - - - - - diff --git a/fcs/paket.dependencies b/fcs/paket.dependencies index 39535eedd9d..ccaead9f031 100644 --- a/fcs/paket.dependencies +++ b/fcs/paket.dependencies @@ -4,9 +4,3 @@ source https://www.nuget.org/api/v2/ nuget FAKE nuget FSharp.Formatting - -nuget Microsoft.Build.Utilities.Core 14.3.0 -nuget Microsoft.Build.Framework 14.3.0 -nuget Microsoft.Build.Engine 14.3.0 -nuget Microsoft.Build 14.3.0 -nuget System.Threading.Tasks.Dataflow 4.5.24.0 \ No newline at end of file diff --git a/fcs/paket.lock b/fcs/paket.lock index 947bfc412b7..1ead25b452a 100644 --- a/fcs/paket.lock +++ b/fcs/paket.lock @@ -1,24 +1,10 @@ RESTRICTION: || (== net45) (== net46) NUGET remote: https://www.nuget.org/api/v2 - FAKE (4.63.2) + FAKE (4.64.6) FSharp.Compiler.Service (2.0.0.6) FSharp.Formatting (2.14.4) FSharp.Compiler.Service (2.0.0.6) FSharpVSPowerTools.Core (>= 2.3 < 2.4) FSharpVSPowerTools.Core (2.3) FSharp.Compiler.Service (>= 2.0.0.3) - Microsoft.Build (14.3) - Microsoft.Build.Framework (14.3) - Microsoft.Build.Engine (14.3) - Microsoft.Build.Framework (14.3) - Microsoft.Build.Framework (14.3) - System.Collections (>= 4.0.11) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - System.Runtime (>= 4.1) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - System.Runtime.InteropServices (>= 4.1) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - Microsoft.Build.Utilities.Core (14.3) - Microsoft.Build.Framework (14.3) - System.Collections (4.3) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - System.Runtime (4.3) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - System.Runtime.InteropServices (4.3) - restriction: || (&& (== net45) (>= netstandard1.3)) (== net46) - System.Threading.Tasks.Dataflow (4.5.24) diff --git a/fcs/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index ffdf63d5c63..470cec8c1ef 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -1,64 +1,18 @@ - - - + + + - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - 2.0 - a40507d6-fa48-43d3-b18a-ae3daace4020 + net46;netcoreapp2.0 Exe - EditorService - EditorService - v4.5 - EditorService - - true + false - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - AnyCPU - bin\Debug\EditorService.xml - true - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - AnyCPU - bin\Release\EditorService.xml - true - - - - - $(SolutionDir)\..\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/samples/EditorService/paket.references b/fcs/samples/EditorService/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/samples/FscExe/FscExe.fsproj b/fcs/samples/FscExe/FscExe.fsproj index 946034ec67c..ae716f00027 100644 --- a/fcs/samples/FscExe/FscExe.fsproj +++ b/fcs/samples/FscExe/FscExe.fsproj @@ -1,76 +1,19 @@ - - - - + + + - $(MSBuildProjectDirectory)\..\..\..\src - - - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - x86 - {C94C257C-3C0A-4858-B5D8-D746498D1F08} + net46 Exe - $(NoWarn);62;44 - FscExe - FscExe - COMPILER;$(DefineConstants) - FX_RESIDENT_COMPILER;$(DefineConstants) - true - $(OtherFlags) --warnon:1182 - true - 4.4.0.0 - v4.5 - - - - true - full - false - false - bin\Debug\ - TRACE;DEBUG;$(DefineConstants) - 3 - AnyCPU - bin\Debug\FsiExe.xml - true - - - - - pdbonly - true - true - bin\Release\ - TRACE;$(DefineConstants) - 3 - AnyCPU - bin\Release\FsiExe.xml - true + false + $(DefineConstants);RESIDENT_COMPILER - - Driver/FscMain.fs - + - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - + + - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - - - - \ No newline at end of file + diff --git a/fcs/samples/FscExe/FscMain.fs b/fcs/samples/FscExe/FscMain.fs index 6a639ea678d..af8f290df78 100644 --- a/fcs/samples/FscExe/FscMain.fs +++ b/fcs/samples/FscExe/FscMain.fs @@ -14,11 +14,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.Range -#if FX_RESHAPED_REFLECTION -open Microsoft.FSharp.Core.ReflectionAdapters -#endif - -#if FX_RESIDENT_COMPILER +#if RESIDENT_COMPILER type TypeInThisAssembly() = member x.Dummy = 1 let progress = ref false @@ -58,19 +54,15 @@ module FSharpResidentCompiler = // Use different base channel names on mono and CLR as a CLR remoting process can't talk // to a mono server static let baseChannelName = -#if ENABLE_MONO_SUPPORT if runningOnMono then "FSCChannelMono" else -#endif "FSCChannel" static let channelName = baseChannelName + "_" + domainName + "_" + userName static let serverName = -#if ENABLE_MONO_SUPPORT if runningOnMono then "FSCServerMono" else -#endif "FSCSever" static let mutable serverExists = true @@ -131,7 +123,6 @@ module FSharpResidentCompiler = // On Unix, the file permissions of the implicit socket need to be set correctly to make this // private to the user. -#if ENABLE_MONO_SUPPORT if runningOnMono then try let monoPosix = System.Reflection.Assembly.Load(new System.Reflection.AssemblyName("Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756")) @@ -152,7 +143,6 @@ module FSharpResidentCompiler = #endif () // Fail silently -#endif server.Run() static member private ConnectToServer() = @@ -177,7 +167,6 @@ module FSharpResidentCompiler = with _ -> if !progress then printfn "client: error while creating client, starting client instead" let procInfo = -#if ENABLE_MONO_SUPPORT if runningOnMono then let shellName, useShellExecute = match System.Environment.GetEnvironmentVariable("FSC_MONO") with @@ -194,7 +183,6 @@ module FSharpResidentCompiler = CreateNoWindow = true, UseShellExecute = useShellExecute) else -#endif ProcessStartInfo(FileName=fscServerExe, Arguments = "/server", CreateNoWindow = true, @@ -274,6 +262,7 @@ module Driver = System.Console.WriteLine("Press any key to continue...") System.Console.ReadKey() |> ignore +#if RESIDENT_COMPILER if runningOnMono && hasArgument "resident" argv then let argv = stripArgument "resident" argv @@ -293,14 +282,13 @@ module Driver = elif runningOnMono && hasArgument "server" argv then FSharpResidentCompiler.FSharpCompilationServer.RunServer() 0 - +#endif else let errors, exitCode = FSharpChecker.Create().Compile (argv) |> Async.RunSynchronously for error in errors do eprintfn "%s" (error.ToString()) exitCode -#if FX_NO_DEFAULT_DEPENDENCY_TYPE -#else +#if !FX_NO_DEFAULT_DEPENDENCY_TYPE [] #endif do () diff --git a/fcs/samples/FscExe/paket.references b/fcs/samples/FscExe/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/samples/FsiExe/FsiExe.fsproj b/fcs/samples/FsiExe/FsiExe.fsproj index ef52e8ee777..6ee84579726 100644 --- a/fcs/samples/FsiExe/FsiExe.fsproj +++ b/fcs/samples/FsiExe/FsiExe.fsproj @@ -1,63 +1,11 @@ - - - + + + - $(MSBuildProjectDirectory)\..\..\..\src - - - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - 2.0 - {f9540ca8-1ce0-4546-a23a-a461e416e95b} + net46 Exe - FsiExe - FsiExe - v4.5 - FsiExe - 40 - - true - - - true - full - false - false - bin\Debug\ - TRACE;DEBUG - 3 - AnyCPU - bin\Debug\FsiExe.xml - true - - + false - - pdbonly - true - true - bin\Release\ - TRACE - 3 - AnyCPU - bin\Release\FsiExe.xml - true - - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - - - - - - - @@ -65,11 +13,9 @@ - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + + + - - \ No newline at end of file + diff --git a/fcs/samples/FsiExe/paket.references b/fcs/samples/FsiExe/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/samples/InteractiveService/InteractiveService.fsproj b/fcs/samples/InteractiveService/InteractiveService.fsproj index 4efd2a56b12..6d767f44f42 100644 --- a/fcs/samples/InteractiveService/InteractiveService.fsproj +++ b/fcs/samples/InteractiveService/InteractiveService.fsproj @@ -1,68 +1,17 @@ - - - + + + - $(MSBuildProjectDirectory)\..\..\..\src - - - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - 2.0 - 067e95e5-e3dc-4ca7-813a-4d1e277d2d52 + net46 Exe - InteractiveService - InteractiveService - v4.5 - InteractiveService - 4.4.0.0 - - true - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - AnyCPU - bin\Debug\InteractiveService.xml - true + false - - pdbonly - true - true - bin\Release\ - TRACE - 3 - AnyCPU - bin\Release\InteractiveService.xml - true - - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - - - - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + - - \ No newline at end of file + diff --git a/fcs/samples/InteractiveService/paket.references b/fcs/samples/InteractiveService/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/samples/Tokenizer/Tokenizer.fsproj b/fcs/samples/Tokenizer/Tokenizer.fsproj index a58aaf190f4..6d767f44f42 100644 --- a/fcs/samples/Tokenizer/Tokenizer.fsproj +++ b/fcs/samples/Tokenizer/Tokenizer.fsproj @@ -1,71 +1,17 @@ - - - + + + - $(MSBuildProjectDirectory)\..\..\..\src - - - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\ - 2.0 - 92793069-816f-4f69-84ac-0966f8275e65 + net46 Exe - Tokenizer - Tokenizer - v4.5 - Tokenizer - 4.4.0.0 - - true - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - AnyCPU - bin\Debug\Tokenizer.xml - true - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - AnyCPU - bin\Release\Tokenizer.xml - true + false - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - - - - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + - - 11 - - - \ No newline at end of file + diff --git a/fcs/samples/Tokenizer/paket.references b/fcs/samples/Tokenizer/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/samples/UntypedTree/UntypedTree.fsproj b/fcs/samples/UntypedTree/UntypedTree.fsproj index e8818931cdd..6d767f44f42 100644 --- a/fcs/samples/UntypedTree/UntypedTree.fsproj +++ b/fcs/samples/UntypedTree/UntypedTree.fsproj @@ -1,71 +1,17 @@ - - - + + + - $(MSBuildProjectDirectory)\..\..\..\src - - - Debug - AnyCPU - 2.0 - c816728d-bbea-472d-9f6c-e8913957a673 + net46 Exe - UntypedTree - UntypedTree - v4.5 - UntypedTree - 4.4.0.0 - - true - $(MSBuildProjectDirectory)\..\..\ - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - AnyCPU - bin\Debug\UntypedTree.xml - true - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - AnyCPU - bin\Release\UntypedTree.xml - true + false - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools\FSharp.Core.dll - true - - - - - - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + - - 11 - - - \ No newline at end of file + diff --git a/fcs/samples/UntypedTree/UntypedTree.sln b/fcs/samples/UntypedTree/UntypedTree.sln deleted file mode 100644 index a7b50130754..00000000000 --- a/fcs/samples/UntypedTree/UntypedTree.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "UntypedTree", "UntypedTree.fsproj", "{C816728D-BBEA-472D-9F6C-E8913957A673}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/fcs/samples/UntypedTree/paket.references b/fcs/samples/UntypedTree/paket.references deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/fcs/tools.fsproj b/fcs/tools.fsproj deleted file mode 100644 index 45aa251d767..00000000000 --- a/fcs/tools.fsproj +++ /dev/null @@ -1,10 +0,0 @@ - - - Exe - net45 - - - - - - \ No newline at end of file diff --git a/mono/appveyor.ps1 b/mono/appveyor.ps1 index b26a52d32f9..30445b98db0 100644 --- a/mono/appveyor.ps1 +++ b/mono/appveyor.ps1 @@ -1,6 +1,6 @@ # the version under development, update after a release -$version = '4.1.28' +$version = '4.1.31' function isVersionTag($tag){ $v = New-Object Version diff --git a/mono/build-mono.sh b/mono/build-mono.sh index 28ba3622aa9..12e49fae468 100755 --- a/mono/build-mono.sh +++ b/mono/build-mono.sh @@ -1,24 +1,8 @@ #!/bin/sh -# Perform any necessary setup prior to running builds -# (e.g., restoring NuGet packages). -echo "prepare-mono.sh..." - -./mono/prepare-mono.sh - -rc=$?; -if [ $rc -ne 0 ]; then - echo "mono/prepare-mono script failed." - exit $rc -fi -echo "done mono/prepare-mono.sh, building..." - -chmod +x mono/travis-autogen.sh - -# Generate the makefiles # Bootstrap the compiler # Install the compiler -./mono/travis-autogen.sh && \ +./mono/prepare-mono.sh && \ make && \ sudo make install diff --git a/mono/cibuild.sh b/mono/cibuild.sh new file mode 100755 index 00000000000..e91b33e7839 --- /dev/null +++ b/mono/cibuild.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# note: expects to run from top directory +./mono/latest-mono-stable.sh +make Configuration=$@ +#sudo make install Configuration=$@ +#./mono/test-mono.sh \ No newline at end of file diff --git a/mono/config.make.in b/mono/config.make similarity index 91% rename from mono/config.make.in rename to mono/config.make index 3106ab99fd4..f7002c1119f 100644 --- a/mono/config.make.in +++ b/mono/config.make @@ -2,18 +2,26 @@ DEFAULT: all .PHONY: install-sdk-lib -prefix := @prefix@ -topdir := @abs_top_srcdir@/ -builddir := @abs_top_builddir@/ -libdir := ${prefix}/lib/ -bindir := ${prefix}/bin/ -monobindir := @MONOBINDIR@ -monolibdir := @MONOLIBDIR@ - -monodir := ${libdir}mono +monocmd = $(shell which mono) +monocmddir = $(dir $(monocmd)) +prefix = $(shell (cd $(monocmddir)/..; pwd)) +thisdir = $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) +topdir = $(thisdir)../ +builddir = $(topdir) +libdir = $(prefix)/lib/ +bindir = $(prefix)/bin/ +monobindir = $(bindir) +monolibdir = $(libdir) +monodir = $(monolibdir)mono + +debugvars: + @echo prefix=$(prefix) + @echo topdir=$(topdir) + @echo monodir=$(monodir) + @echo monolibdir=$(monolibdir) + @echo monobindir=$(monobindir) TargetDotnetProfile = net40 -CONFIG = release Configuration = Release DISTVERSION = 201011 @@ -95,7 +103,7 @@ INSTALL = $(SHELL) $(topdir)/mono/install-sh INSTALL_BIN = $(INSTALL) -c -m 755 INSTALL_LIB = $(INSTALL_BIN) -MSBUILD = @MSBUILD@ +MSBUILD = msbuild EXTRA_DIST = configure NO_DIST = .gitignore lib/debug lib/proto lib/release @@ -127,7 +135,7 @@ install-sdk-lib: @mkdir -p $(DESTDIR)$(monodir)/fsharp @if test "x$(DELAY_SIGN)" = "x1"; then \ echo "Signing $(outdir)$(ASSEMBLY) with Mono key"; \ - $(monobindir)/sn -q -R $(outdir)$(ASSEMBLY) $(topdir)mono/mono.snk; \ + $(monobindir)sn -q -R $(outdir)$(ASSEMBLY) $(topdir)mono/mono.snk; \ fi @if test x-$(NAME) = x-FSharp.Compiler.Private; then \ echo "Installing extra dependency System.Collections.Immutable.dll to $(DESTDIR)$(monodir)/fsharp/"; \ @@ -203,6 +211,12 @@ install-sdk-lib: $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ + \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ fi @if test x-$(outsuffix) = x-net40; then \ if test -e $(outdir)$(NAME).dll; then \ diff --git a/mono/latest-mono-stable.sh b/mono/latest-mono-stable.sh new file mode 100755 index 00000000000..045b80f8377 --- /dev/null +++ b/mono/latest-mono-stable.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# suitable for Ubuntu 16.04 - get latest Mono stable +mono --version +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list +sudo apt-get update +ps -A | grep apt +#sudo rm /var/lib/dpkg/lock +#sudo dpkg --configure -a +sudo apt-get -my install mono-devel +mono --version diff --git a/mono/launcher b/mono/launcher new file mode 100644 index 00000000000..e61b7bba19d --- /dev/null +++ b/mono/launcher @@ -0,0 +1,19 @@ +#!/bin/sh +EXEC="exec " + +if test x"$1" = x--debug; then + DEBUG=--debug + shift +fi + +if test x"$1" = x--gdb; then + shift + EXEC="gdb --eval-command=run --args " +fi + +if test x"$1" = x--valgrind; then + shift + EXEC="valgrind $VALGRIND_OPTIONS" +fi + +$EXEC @MONOBINDIR@/mono $DEBUG $MONO_OPTIONS @DIR@/@TOOL@ --exename:$(basename "$0") "$@" diff --git a/mono/launcher.in b/mono/launcher.in deleted file mode 100644 index 047101512e6..00000000000 --- a/mono/launcher.in +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -EXEC="exec " - -if test x"$1" = x--debug; then - DEBUG=--debug - shift -fi - -if test x"$1" = x--gdb; then - shift - EXEC="gdb --eval-command=run --args " -fi - -if test x"$1" = x--valgrind; then - shift - EXEC="valgrind $VALGRIND_OPTIONS" -fi - -# Beware this line must match the regular expression " (\/.*)\/fsi\.exe" when @TOOL@ is fsi.exe. -# That's because the FSharp MonoDevelop addin looks inside the text of this script to determine the installation -# location of the default FSharp install in order to find the FSharp compiler binaries (see -# fsharpbinding/MonoDevelop.FSharpBinding/Services/CompilerLocationUtils.fs). That's a pretty unfortunate -# way of finding those binaries. And really should be changed. -$EXEC @MONOBINDIR@/mono $DEBUG $MONO_OPTIONS @DIR@/@TOOL@ --exename:$(basename "$0") "$@" diff --git a/mono/prepare-mono.sh b/mono/prepare-mono.sh index 77f3e18b99d..229a7eb8492 100755 --- a/mono/prepare-mono.sh +++ b/mono/prepare-mono.sh @@ -26,41 +26,6 @@ if [ $OS = 'Linux' ]; then sudo apt-get -y install mono-devel msbuild fi -# Check if SSL certificates have been imported into Mono's certificate store. -# If certs haven't been installed, some/all of the Nuget packages will fail to restore. -#if [ $('certmgr -list -c Trust | grep -c -F "X.509"') -le 1 ]; then -# echo "No SSL certificates installed so unable to restore NuGet packages." >&2; -# echo "Run 'mozroots --sync --import' to install certificates to Mono's certificate store." >&2; -# exit 1 -#fi - -# Restore NuGet packages (needed for compiler bootstrap and tests). -mono .nuget/NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget/NuGet.Config - -(if test x-$BUILD_CORECLR = x-1; then \ - sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'; \ - sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893; \ - sudo apt-get update; \ - sudo apt-get -y install dotnet-dev-1.0.0-preview2-003131; \ - (cd tests/fsharp; mono ../../.nuget/NuGet.exe restore project.json -PackagesDirectory ../../packages -ConfigFile ../../.nuget/NuGet.Config); \ - ./init-tools.sh; \ - echo "------ start log"; \ - cat ./init-tools.log; echo "------ end log"; \ -fi) - -(if test x-$BUILD_PROTO_WITH_CORECLR_LKG = x-1; then \ - (cd lkg/fsc && dotnet restore --packages ../packages && dotnet publish project.json -o ../Tools/lkg -r ubuntu.14.04-x64); \ - (cd lkg/fsi && dotnet restore --packages ../packages && dotnet publish project.json -o ../Tools/lkg -r ubuntu.14.04-x64); \ -fi) - -#TODO: work out how to avoid the need for this -echo "chmod u+x packages/FSharp.Compiler.Tools.4.1.27/tools/fsi.exe" -echo "chmod u+x packages/FsLexYacc.7.0.6/build/fslex.exe" -echo "chmod u+x packages/FsLexYacc.7.0.6/build/fsyacc.exe" -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 - # The FSharp.Compiler.Tools package doesn't work correctly unless a proper install of F# has been done on the machine. # OSX can skip this because the OSX Mono installer includes F#. if [ $OS != 'OSX' ]; then diff --git a/mono/test-mono.sh b/mono/test-mono.sh index 6fcb92cbe3a..bbcc8b8705e 100755 --- a/mono/test-mono.sh +++ b/mono/test-mono.sh @@ -2,6 +2,7 @@ # Run some a variation of the tests/fsharp suite # Run the FSharp.Core.UnitTests suite +# note: expects to run from top directory (cd tests/projects; ./build.sh) && (cd tests/fsharp/core; ./run-opt.sh) # This currently takes too long in travis diff --git a/mono/travis-autogen.sh b/mono/travis-autogen.sh deleted file mode 100755 index 9c356b0862f..00000000000 --- a/mono/travis-autogen.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -echo "TRAVIS_OS_NAME=$TRAVIS_OS_NAME" -if [ "$TRAVIS_OS_NAME" = "osx" ]; - then - # Parse 'Mono JIT compiler version 5.0.1.1' to '5.0.1' - monoVer=$(mono --version | head -n 1 | cut -d' ' -f 5 | cut -d'.' -f 1-3) - prefix="/Library/Frameworks/Mono.framework/Versions/$monoVer"; - else - prefix="/usr"; -fi - -echo "./autogen.sh --prefix=$prefix" -./autogen.sh --prefix=$prefix \ No newline at end of file diff --git a/netci.groovy b/netci.groovy index cc7956a9834..33522433650 100644 --- a/netci.groovy +++ b/netci.groovy @@ -4,7 +4,7 @@ import jobs.generation.JobReport; def project = GithubProject def branch = GithubBranchName -def osList = ['Windows_NT', 'Ubuntu14.04'] //, 'OSX'], 'CentOS7.1' +def osList = ['Windows_NT', 'Ubuntu16.04'] //, 'OSX'], 'CentOS7.1' def static getBuildJobName(def configuration, def os) { return configuration.toLowerCase() + '_' + os.toLowerCase() @@ -14,83 +14,84 @@ def static getBuildJobName(def configuration, def os) { osList.each { os -> def configurations = []; if (os == 'Windows_NT') { - configurations = ['Debug', 'Release_ci_part1', 'Release_ci_part2', 'Release_ci_part3', 'Release_net40_no_vs', 'Release_fcs' ]; + configurations = ['Debug_default', 'Release_ci_part1', 'Release_ci_part2', 'Release_ci_part3', 'Release_ci_part4', 'Release_net40_no_vs', 'Release_fcs' ]; } else { // Linux - configurations = ['Release', 'Release_fcs' ]; + // TODO: It should be possible to enable these configurations immediately subsequent to the PR containing this line + //configurations = ['Debug_default', 'Release_net40_test', 'Release_fcs' ]; + configurations = [ 'Release_default', 'Release_fcs' ]; } configurations.each { configuration -> - def lowerConfiguration = configuration.toLowerCase() - - // Calculate job name def jobName = getBuildJobName(configuration, os) - - def buildPath = ''; - if (os == 'Windows_NT') { - buildPath = ".\\" - } - else { - buildPath = "./" - } def buildCommand = ''; - def buildFlavor= ''; + def buildOutput= ''; + def buildArgs= ''; if (configuration == "Release_fcs" && branch != "dev15.5") { // Build and test FCS NuGet package - buildPath = "./fcs/" - buildFlavor = "" + buildOutput = "release" if (os == 'Windows_NT') { - build_args = "TestAndNuget" + buildCommand = ".\\fcs\\build.cmd TestAndNuget" } else { - build_args = "Build" + buildCommand = "./fcs/cibuild.sh Build" } } - else if (configuration == "Debug") { - buildFlavor = "debug" - build_args = "" - } - else { - buildFlavor = "release" - if (configuration == "Release_ci_part1") { - build_args = "ci_part1" - } - else if (configuration == "Release_ci_part2") { - build_args = "ci_part2" + else if (configuration == "Debug_default") { + buildOutput = "debug" + if (os == 'Windows_NT') { + buildCommand = "build.cmd debug" } - else if (configuration == "Release_ci_part3") { - build_args = "ci_part3" + else { + buildCommand = "./mono/cibuild.sh debug" } - else if (configuration == "Release_net40_no_vs") { - build_args = "net40" + } + else if (configuration == "Release_default") { + buildOutput = "release" + if (os == 'Windows_NT') { + buildCommand = "build.cmd release" } else { - build_args = "none" + buildCommand = "./mono/cibuild.sh release" } } - - if (os == 'Windows_NT') { - buildCommand = "${buildPath}build.cmd ${buildFlavor} ${build_args}" + else if (configuration == "Release_net40_test") { + buildOutput = "release" + buildCommand = "build.cmd release net40 test" } - else { - buildCommand = "${buildPath}build.sh ${buildFlavor} ${build_args}" + else if (configuration == "Release_ci_part1") { + buildOutput = "release" + buildCommand = "build.cmd release ci_part1" + } + else if (configuration == "Release_ci_part2") { + buildOutput = "release" + buildCommand = "build.cmd release ci_part2" + } + else if (configuration == "Release_ci_part3") { + buildOutput = "release" + buildCommand = "build.cmd release ci_part3" + } + else if (configuration == "Release_ci_part4") { + buildOutput = "release" + buildCommand = "build.cmd release ci_part4" + } + else if (configuration == "Release_net40_no_vs") { + buildOutput = "release" + buildCommand = "build.cmd release net40" } + def newJobName = Utilities.getFullJobName(project, jobName, isPullRequest) def newJob = job(newJobName) { steps { if (os == 'Windows_NT') { - batchFile(""" -echo *** Build Visual F# Tools *** - -${buildPath}build.cmd ${buildFlavor} ${build_args}""") + batchFile(buildCommand) } else { - // Shell shell(buildCommand) } } @@ -98,20 +99,18 @@ ${buildPath}build.cmd ${buildFlavor} ${build_args}""") // TODO: set to false after tests are fully enabled def skipIfNoTestFiles = true + def skipIfNoBuildOutput = false - def affinity = configuration == 'Release_net40_no_vs' ? 'latest-or-auto' : (os == 'Windows_NT' ? 'latest-or-auto-dev15-0' : 'latest-or-auto') + // outer-latest = "sudo is enabled by default" + // latest-or-auto = "sudo is not enabled" + // + // https://github.com/Microsoft/visualfsharp/pull/4372#issuecomment-367850885 + def affinity = (configuration == 'Release_net40_no_vs' ? 'latest-or-auto' : (os == 'Windows_NT' ? 'latest-dev15-5' : 'outer-latest')) Utilities.setMachineAffinity(newJob, os, affinity) Utilities.standardJobSetup(newJob, project, isPullRequest, "*/${branch}") - if (build_args != "none") { - Utilities.addArchival(newJob, "tests/TestResults/*.*", "", skipIfNoTestFiles, false) - if (configuration == "Release_fcs") { - Utilities.addArchival(newJob, "Release/**") - } - else { - Utilities.addArchival(newJob, "${buildFlavor}/**") - } - } + Utilities.addArchival(newJob, "tests/TestResults/*.*", "", skipIfNoTestFiles, false) + Utilities.addArchival(newJob, "${buildOutput}/**", "", skipIfNoBuildOutput, false) if (isPullRequest) { Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build") } diff --git a/packages.config b/packages.config index 12479d822d4..dc6205ef46c 100644 --- a/packages.config +++ b/packages.config @@ -19,18 +19,22 @@ - + + + + + - + - + @@ -69,6 +73,6 @@ - + diff --git a/scripts/dotnet-install.sh b/scripts/dotnet-install.sh old mode 100644 new mode 100755 diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index 9c4e65e6ca9..b05b7d9d0d7 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -17,6 +17,7 @@ + @@ -126,6 +127,10 @@ + + + + @@ -140,6 +145,7 @@ + @@ -187,7 +193,7 @@ - + diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 713620cd557..7d9325d6d81 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -10,8 +10,11 @@ $(SetupRootFolder)\..\packages + + - 10.1 + + $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]) $([System.DateTime]::Now.ToString(yyyyMMdd.0)) diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr index 9dd32500602..346d1be98e7 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr @@ -7,6 +7,7 @@ folder "InstallDir:MSBuild\Microsoft\VisualStudio\v15.0\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.NetSdk.Overrides.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" diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr index 77153f3fded..a8c5becc80e 100644 --- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr @@ -10,9 +10,11 @@ folder "InstallDir:Common7\IDE\PublicAssemblies\$(LocaleParentCulture)" 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 diff --git a/setup/fsharp-setup-build.proj b/setup/fsharp-setup-build.proj index dc917a64244..94d23f51a9c 100644 --- a/setup/fsharp-setup-build.proj +++ b/setup/fsharp-setup-build.proj @@ -16,9 +16,6 @@ ..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj - - ..\vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj - ..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj @@ -42,7 +39,7 @@ + Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);DisableOutputPathCopying=true;$(CustomProps)" /> diff --git a/setup/packages.config b/setup/packages.config index 036cb400855..af635aca175 100644 --- a/setup/packages.config +++ b/setup/packages.config @@ -12,6 +12,6 @@ - + diff --git a/setup/publish-assets.ps1 b/setup/publish-assets.ps1 index d0082433535..4232cef6e49 100644 --- a/setup/publish-assets.ps1 +++ b/setup/publish-assets.ps1 @@ -30,9 +30,12 @@ try { "master" { $requestUrl = "https://dotnet.myget.org/F/fsharp/vsix/upload" } - "dev15.6" { + "dev15.7" { $requestUrl = "https://dotnet.myget.org/F/fsharp-preview/vsix/upload" } + "dev15.8" { + $requestUrl = "https://dotnet.myget.org/F/fsharp-dev15-8-preview/vsix/upload" + } default { Write-Host "Branch [$branchName] is not supported for publishing." exit 0 # non-fatal diff --git a/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets b/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets new file mode 100644 index 00000000000..76fb5cd8119 --- /dev/null +++ b/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets @@ -0,0 +1,5 @@ + + + + + diff --git a/src/FSharp.Profiles.props b/src/FSharp.Profiles.props new file mode 100644 index 00000000000..8e03b11fdcf --- /dev/null +++ b/src/FSharp.Profiles.props @@ -0,0 +1,59 @@ + + + + + + $(DefineConstants);CROSS_PLATFORM_COMPILER + $(DefineConstants);ENABLE_MONO_SUPPORT + $(DefineConstants);BE_SECURITY_TRANSPARENT + $(DefineConstants);FX_LCIDFROMCODEPAGE + + + + $(DefineConstants);FX_PORTABLE_OR_NETSTANDARD + $(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_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 + $(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_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);FX_RESHAPED_MSBUILD + $(DefineConstants);FSI_TODO_NETCORE + $(OtherFlags) --simpleresolution + + + diff --git a/src/FSharpSource.Profiles.targets b/src/FSharpSource.Profiles.targets index d56c1d703fd..9069ebdb955 100644 --- a/src/FSharpSource.Profiles.targets +++ b/src/FSharpSource.Profiles.targets @@ -3,7 +3,7 @@ - $(DefineConstants);PREFERRED_UI_LANG + $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);BE_SECURITY_TRANSPARENT $(DefineConstants);FX_LCIDFROMCODEPAGE @@ -13,9 +13,7 @@ - $(DefineConstants);FX_PORTABLE_OR_NETSTANDARD $(DefineConstants);NETSTANDARD1_6 - $(DefineConstants);PREFERRED_UI_LANG $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_ARRAY_LONG_LENGTH $(DefineConstants);FX_NO_BEGINEND_READWRITE @@ -23,13 +21,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 @@ -46,17 +42,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);FX_RESHAPED_MSBUILD - $(DefineConstants);FSI_TODO_NETCORE $(OtherFlags) --simpleresolution netstandard1.6 diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 6fb4d68ae72..7b9434be24d 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -58,23 +58,35 @@ Given $(BUILD_BUILDNUMBER) = '20161225.1' Given $(MicroBuildAssemblyVersion) = '15.4.1.0' - Then $(BuildTimeStamp_Day) = 161225 + Then $(BuildTimeStamp_Date) = 161225 Then $(BuildTimeStamp_Number) = 01 Then $(BuildTimeStamp) = 16122501 Then $(MicroBuildAssemblyVersion_WithoutRevision) = 15.4.1 Then $(VsixPackageVersion) = 15.4.1.16122501 + Then $(NuGetPackageVersionSuffix) = 161225-01 --> - $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) + $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) $(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2, '0')) - $(BuildTimeStamp_Day)$(BuildTimeStamp_Number) + $(BuildTimeStamp_Date)$(BuildTimeStamp_Number) $(MicroBuildAssemblyVersion.Substring(0, $(MicroBuildAssemblyVersion.LastIndexOf('.')))) $(MicroBuildAssemblyVersion_WithoutRevision).$(BuildTimeStamp) + $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) - 2.6.0-vs-for-mac-62329-05 - 15.0 + + true + net40 + + + net40 + FSharp + true + true + true + + 15.0.26201 1.3.1 Microsoft.VSSDK.BuildTools.15.1.192 @@ -85,6 +97,10 @@ 1.1.0 1.2.0 + + obj\$(Configuration)\$(TargetDotnetProfile)\ + obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ + 4.1.19 4.1 @@ -102,58 +118,31 @@ $(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\net45 $(FSharpSourcesRoot)\..\packages\NUnit.ConsoleRunner\$(NUnitVersion)\tools\ + true + $(MSBuildThisFileDirectory)..\Tools\dependencyUptake\PackageVersions.props + true true - 0.2.0-beta-000076 + 0.2.0-beta-000081 - - fs - - - - $(FSCoreVersion) - - - $(FSProductVersion) - - - $(VSAssemblyVersion) - - - - - true - net40 - - - net40 - FSharp - true - true - true - - false - - - obj\$(Configuration)\$(TargetDotnetProfile)\ - obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - - - + + false + true true $(FSharpSourcesRoot)\fsharp\msft.pubkey true true - + + true false true @@ -173,6 +162,7 @@ full + portable false prompt @@ -185,6 +175,7 @@ pdbonly + portable true false @@ -196,6 +187,7 @@ full + portable true DEBUG;NO_STRONG_NAMES;$(DefineConstants) @@ -239,6 +231,11 @@ $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools + + + + 14.0.0.0 + diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index 93e556026d1..2b06fc0f03a 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -6,81 +6,50 @@ $(MSBuildThisFileDirectory)..\ - - - - false - true - - - - - - - - - true - false - fs - - - - - - - true - true - fs - - - - - - - - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - true - true - fs - - - - - - - - NO_STRONG_NAMES;$(DefineConstants) - fs - - - + + fs + - - $(OtherFlags) --version:"$(MicroBuildAssemblyVersion)" + + + + true + false + false + NO_STRONG_NAMES;$(DefineConstants) - - $(IntermediateOutputPath)source_link.json + + + $(FSharpSourcesRoot)\fsharp\test.snk + false + STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants) - - NO_STRONG_NAMES;$(DefineConstants) + + + $(FSCoreVersion) + $(OtherFlags) --version:"$(MicroBuildAssemblyVersion)" + + + + $(IntermediateOutputPath)source_link.json + MSBUILD_AT_LEAST_14;$(DefineConstants) + - false $(FSharpSourcesRoot)\..\packages - 2.6.2 - 2.6.2.0 + 3.0.0-alpha3 + 3.0.0.0 $(FSharpSourcesRoot)\..\packages\FsCheck.$(FsCheckVersion)\lib\ @@ -124,7 +93,8 @@ fsharp30\$(TargetDotnetProfile) fsharp31\$(TargetDotnetProfile) fsharp40\$(TargetDotnetProfile) - obj\$(TargetFrameworkOutputDirectory)\ + $(TargetDotnetProfile) + obj\$(Configuration)\$(TargetFrameworkOutputDirectory)\ @@ -154,8 +124,8 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFrameworkOutputDirectory)\bin $(FSharpSourcesRoot)\..\Proto\$(ProtoFlavour)\bin - fsc-proto.exe - ..\Proto\$(ProtoFlavour)\bin\Microsoft.Portable.FSharp-proto.targets + fsc.exe + ..\Proto\$(ProtoFlavour)\bin\Microsoft.Portable.FSharp.targets @@ -163,8 +133,8 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFrameworkOutputDirectory)\bin $(FSharpSourcesRoot)\..\Proto\$(ProtoFlavour)\bin - fsc-proto.exe - ..\Proto\$(ProtoFlavour)\bin\Microsoft.FSharp-proto.targets + fsc.exe + ..\Proto\$(ProtoFlavour)\bin\Microsoft.FSharp.Targets @@ -200,8 +170,8 @@ $(FSharpSourcesRoot)\..\.nuget\ -ConfigFile "$(NuGetConfigFile)" - "$(NuGetToolPath)NuGet.exe install -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)NuGet.Config" - "$(NuGetToolPath)NuGet.exe" restore -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)NuGet.Config" + "$(NuGetToolPath)NuGet.exe install -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)..\NuGet.Config" + "$(NuGetToolPath)NuGet.exe" restore -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)..\NuGet.Config" @@ -242,12 +212,12 @@ - + - + @@ -326,13 +296,13 @@ - + + diff --git a/src/absil/il.fs b/src/absil/il.fs index 9335440f70c..2b172b3a126 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -16,6 +16,7 @@ open System.Collections open System.Collections.Generic open System.Collections.Concurrent open System.Runtime.CompilerServices +open System.Reflection let logging = false @@ -1090,7 +1091,6 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly - | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family @@ -1130,6 +1130,7 @@ type ILNativeType = | LPSTR | LPWSTR | LPTSTR + | LPUTF8STR | ByValStr | TBSTR | LPSTRUCT @@ -1358,31 +1359,38 @@ type ILGenericParameterDef = type ILGenericParameterDefs = ILGenericParameterDef list +let memberAccessOfFlags flags = + let f = (flags &&& 0x00000007) + if f = 0x00000001 then ILMemberAccess.Private + elif f = 0x00000006 then ILMemberAccess.Public + elif f = 0x00000004 then ILMemberAccess.Family + elif f = 0x00000002 then ILMemberAccess.FamilyAndAssembly + elif f = 0x00000005 then ILMemberAccess.FamilyOrAssembly + elif f = 0x00000003 then ILMemberAccess.Assembly + else failwith "impossible: the flags parameter value is come from enums MethodAttributes and FieldAttributes must have access flag" + +let convertMemberAccess (ilMemberAccess:ILMemberAccess) = + match ilMemberAccess with + | ILMemberAccess.Public -> MethodAttributes.Public + | ILMemberAccess.Private -> MethodAttributes.Private + | ILMemberAccess.Assembly -> MethodAttributes.Assembly + | ILMemberAccess.FamilyAndAssembly -> MethodAttributes.FamANDAssem + | ILMemberAccess.FamilyOrAssembly -> MethodAttributes.FamORAssem + | ILMemberAccess.Family -> MethodAttributes.Family + +let inline conditionalAdd condition flagToAdd source = if condition then source ||| flagToAdd else source &&& ~~~flagToAdd + [] type ILMethodDef = { Name: string; - mdKind: MethodKind; + Attributes: MethodAttributes; + ImplAttributes: MethodImplAttributes; CallingConv: ILCallingConv; Parameters: ILParameters; Return: ILReturn; - Access: ILMemberAccess; - mdBody: ILLazyMethodBody; - mdCodeKind: MethodCodeKind; - IsInternalCall: bool; - IsManaged: bool; - IsForwardRef: bool; + mdBody: ILLazyMethodBody; SecurityDecls: ILPermissions; - HasSecurity: bool; IsEntryPoint:bool; - IsReqSecObj: bool; - IsHideBySig: bool; - IsSpecialName: bool; - IsUnmanagedExport: bool; - IsSynchronized: bool; - IsPreserveSig: bool; - IsMustRun: bool; - IsNoInline: bool; - IsAggressiveInline : bool GenericParams: ILGenericParameterDefs; CustomAttrs: ILAttributes; } member x.ParameterTypes = typesOfILParams x.Parameters @@ -1400,19 +1408,52 @@ type ILMethodDef = member x.MaxStack = x.MethodBody.MaxStack member x.IsZeroInit = x.MethodBody.IsZeroInit - member x.IsClassInitializer = match x.mdKind with | MethodKind.Cctor -> true | _ -> false - member x.IsConstructor = match x.mdKind with | MethodKind.Ctor -> true | _ -> false - member x.IsStatic = match x.mdKind with | MethodKind.Static -> true | _ -> false - member x.IsNonVirtualInstance = match x.mdKind with | MethodKind.NonVirtual -> true | _ -> false - member x.IsVirtual = match x.mdKind with | MethodKind.Virtual _ -> true | _ -> false - - member x.IsFinal = match x.mdKind with | MethodKind.Virtual v -> v.IsFinal | _ -> invalidOp "not virtual" - member x.IsNewSlot = match x.mdKind with | MethodKind.Virtual v -> v.IsNewSlot | _ -> invalidOp "not virtual" - member x.IsCheckAccessOnOverride= match x.mdKind with | MethodKind.Virtual v -> v.IsCheckAccessOnOverride | _ -> invalidOp "not virtual" - member x.IsAbstract = match x.mdKind with | MethodKind.Virtual v -> v.IsAbstract | _ -> invalidOp "not virtual" - member md.CallingSignature = mkILCallSig (md.CallingConv,md.ParameterTypes,md.Return.Type) + member x.IsClassInitializer = x.Name = ".cctor" + member x.IsConstructor = x.Name = ".ctor" + + member x.Access = memberAccessOfFlags (int x.Attributes) + member x.IsStatic = x.Attributes &&& MethodAttributes.Static <> enum 0 + member x.IsNonVirtualInstance = not x.IsStatic && not x.IsVirtual + member x.IsVirtual = x.Attributes &&& MethodAttributes.Virtual <> enum 0 + member x.IsFinal = x.Attributes &&& MethodAttributes.Final <> enum 0 + member x.IsNewSlot = x.Attributes &&& MethodAttributes.NewSlot <> enum 0 + member x.IsCheckAccessOnOverride= x.Attributes &&& MethodAttributes.CheckAccessOnOverride <> enum 0 + member x.IsAbstract = x.Attributes &&& MethodAttributes.Abstract <> enum 0 + member x.IsHideBySig = x.Attributes &&& MethodAttributes.HideBySig <> enum 0 + member x.IsSpecialName = x.Attributes &&& MethodAttributes.SpecialName <> enum 0 + member x.IsUnmanagedExport = x.Attributes &&& MethodAttributes.UnmanagedExport <> enum 0 + member x.IsReqSecObj = x.Attributes &&& MethodAttributes.RequireSecObject <> enum 0 + member x.HasSecurity = x.Attributes &&& MethodAttributes.HasSecurity <> enum 0 + + member x.IsManaged = x.ImplAttributes &&& MethodImplAttributes.Managed <> enum 0 + member x.IsForwardRef = x.ImplAttributes &&& MethodImplAttributes.ForwardRef <> enum 0 + member x.IsInternalCall = x.ImplAttributes &&& MethodImplAttributes.InternalCall <> enum 0 + member x.IsPreserveSig = x.ImplAttributes &&& MethodImplAttributes.PreserveSig <> enum 0 + member x.IsSynchronized = x.ImplAttributes &&& MethodImplAttributes.Synchronized <> enum 0 + member x.IsNoInline = x.ImplAttributes &&& MethodImplAttributes.NoInlining <> enum 0 + member x.IsAggressiveInline= x.ImplAttributes &&& MethodImplAttributes.AggressiveInlining <> enum 0 + member x.IsMustRun = x.ImplAttributes &&& MethodImplAttributes.NoOptimization <> enum 0 + + member x.WithSpecialName = { x with Attributes = x.Attributes ||| MethodAttributes.SpecialName } + member x.WithHideBySig() = + { x with + Attributes = + if x.IsVirtual then x.Attributes &&& ~~~MethodAttributes.CheckAccessOnOverride ||| MethodAttributes.HideBySig + else failwith "WithHideBySig" } + member x.WithHideBySig(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.HideBySig} + member x.WithFinal(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.Final} + member x.WithAbstract(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.Abstract} + member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~MethodAttributes.MemberAccessMask ||| convertMemberAccess access } + member x.WithNewSlot = { x with Attributes = x.Attributes ||| MethodAttributes.NewSlot } + member x.WithSecurity(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.HasSecurity} + member x.WithPInvoke(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.PinvokeImpl} + member x.WithPreserveSig(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.PreserveSig} + member x.WithSynchronized(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Synchronized} + member x.WithNoInlining(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.NoInlining} + member x.WithAggressiveInlining(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.AggressiveInlining} + member x.WithRuntime(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Runtime} /// Index table by name and arity. type MethodDefMap = Map @@ -1446,15 +1487,17 @@ type ILMethodDefs(f : (unit -> ILMethodDef[])) = [] type ILEventDef = - { Type: ILType option; + { Type: ILType option; Name: string; - IsRTSpecialName: bool; - IsSpecialName: bool; + Attributes: EventAttributes AddMethod: ILMethodRef; RemoveMethod: ILMethodRef; FireMethod: ILMethodRef option; OtherMethods: ILMethodRef list; CustomAttrs: ILAttributes; } + member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_>(0) + member x.IsRTSpecialName = (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_>(0) + override x.ToString() = "event " + x.Name (* Index table by name. *) [] @@ -1466,8 +1509,7 @@ type ILEventDefs = [] type ILPropertyDef = { Name: string; - IsRTSpecialName: bool; - IsSpecialName: bool; + Attributes: PropertyAttributes; SetMethod: ILMethodRef option; GetMethod: ILMethodRef option; CallingConv: ILThisConvention; @@ -1475,6 +1517,9 @@ type ILPropertyDef = Init: ILFieldInit option; Args: ILTypes; CustomAttrs: ILAttributes; } + member x.IsSpecialName = (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_>(0) + member x.IsRTSpecialName = (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_>(0) + override x.ToString() = "property " + x.Name // Index table by name. [] @@ -1483,21 +1528,38 @@ type ILPropertyDefs = member x.AsList = let (Properties t) = x in t.Entries() member x.LookupByName s = let (Properties t) = x in t.[s] +let convertFieldAccess (ilMemberAccess:ILMemberAccess) = + match ilMemberAccess with + | ILMemberAccess.Assembly -> FieldAttributes.Assembly + | ILMemberAccess.FamilyAndAssembly -> FieldAttributes.FamANDAssem + | ILMemberAccess.FamilyOrAssembly -> FieldAttributes.FamORAssem + | ILMemberAccess.Family -> FieldAttributes.Family + | ILMemberAccess.Private -> FieldAttributes.Private + | ILMemberAccess.Public -> FieldAttributes.Public + [] type ILFieldDef = { Name: string; Type: ILType; - IsStatic: bool; - Access: ILMemberAccess; + Attributes: FieldAttributes; Data: byte[] option; LiteralValue: ILFieldInit option; Offset: int32 option; - IsSpecialName: bool; - Marshal: ILNativeType option; - NotSerialized: bool; - IsLiteral: bool ; - IsInitOnly: bool; + Marshal: ILNativeType option; CustomAttrs: ILAttributes; } + member x.IsStatic = x.Attributes &&& FieldAttributes.Static <> enum 0 + member x.IsSpecialName = x.Attributes &&& FieldAttributes.SpecialName <> enum 0 + member x.IsLiteral = x.Attributes &&& FieldAttributes.Literal <> enum 0 + member x.NotSerialized = x.Attributes &&& FieldAttributes.NotSerialized <> enum 0 + member x.IsInitOnly = x.Attributes &&& FieldAttributes.InitOnly <> enum 0 + member x.Access = memberAccessOfFlags (int x.Attributes) + member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~FieldAttributes.FieldAccessMask ||| convertFieldAccess access } + member x.WithInitOnly(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.InitOnly } + member x.WithStatic(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Static } + member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName) } + member x.WithNotSerialized(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized } + member x.WithLiteralDefaultValue(literal) = { x with LiteralValue = literal; Attributes = x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault) } + member x.WithFieldMarshal(marshal) = { x with Marshal = marshal; Attributes = x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal } // Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation. @@ -1543,6 +1605,23 @@ type ILTypeDefAccess = | Private | Nested of ILMemberAccess +let typeAccessOfFlags flags = + let f = (flags &&& 0x00000007) + if f = 0x00000001 then ILTypeDefAccess.Public + elif f = 0x00000002 then ILTypeDefAccess.Nested ILMemberAccess.Public + elif f = 0x00000003 then ILTypeDefAccess.Nested ILMemberAccess.Private + elif f = 0x00000004 then ILTypeDefAccess.Nested ILMemberAccess.Family + elif f = 0x00000006 then ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly + elif f = 0x00000007 then ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly + elif f = 0x00000005 then ILTypeDefAccess.Nested ILMemberAccess.Assembly + else ILTypeDefAccess.Private + +let typeEncodingOfFlags flags = + let f = (flags &&& 0x00030000) + if f = 0x00020000 then ILDefaultPInvokeEncoding.Auto + elif f = 0x00010000 then ILDefaultPInvokeEncoding.Unicode + else ILDefaultPInvokeEncoding.Ansi + [] type ILTypeDefKind = | Class @@ -1551,42 +1630,110 @@ type ILTypeDefKind = | Enum | Delegate +let typeKindOfFlags nm _mdefs _fdefs (super:ILType option) flags = + if (flags &&& 0x00000020) <> 0x0 then ILTypeDefKind.Interface + else + let isEnum, isDelegate, isMulticastDelegate, isValueType = + match super with + | None -> false , false, false, false + | Some ty -> + ty.TypeSpec.Name = "System.Enum", + ty.TypeSpec.Name = "System.Delegate", + ty.TypeSpec.Name = "System.MulticastDelegate", + ty.TypeSpec.Name = "System.ValueType" && nm <> "System.Enum" + let selfIsMulticastDelegate = nm = "System.MulticastDelegate" + if isEnum then ILTypeDefKind.Enum + elif (isDelegate && not selfIsMulticastDelegate) || isMulticastDelegate then ILTypeDefKind.Delegate + elif isValueType then ILTypeDefKind.ValueType + else ILTypeDefKind.Class + +let convertTypeAccessFlags access = + match access with + | ILTypeDefAccess.Public -> TypeAttributes.Public + | ILTypeDefAccess.Private -> TypeAttributes.NotPublic + | ILTypeDefAccess.Nested ILMemberAccess.Public -> TypeAttributes.NestedPublic + | ILTypeDefAccess.Nested ILMemberAccess.Private -> TypeAttributes.NestedPrivate + | ILTypeDefAccess.Nested ILMemberAccess.Family -> TypeAttributes.NestedFamily + | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem + | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem + | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + +let convertTypeKind kind = + match kind with + | ILTypeDefKind.Class -> TypeAttributes.Class + | ILTypeDefKind.ValueType -> TypeAttributes.Class + | ILTypeDefKind.Interface -> TypeAttributes.Abstract ||| TypeAttributes.Interface + | ILTypeDefKind.Enum -> TypeAttributes.Class + | ILTypeDefKind.Delegate -> TypeAttributes.Class + +let convertLayout layout = + match layout with + | ILTypeDefLayout.Auto -> TypeAttributes.AutoLayout + | ILTypeDefLayout.Sequential _ -> TypeAttributes.SequentialLayout + | ILTypeDefLayout.Explicit _ -> TypeAttributes.ExplicitLayout + +let convertEncoding encoding = + match encoding with + | ILDefaultPInvokeEncoding.Auto -> TypeAttributes.AutoClass + | ILDefaultPInvokeEncoding.Ansi -> TypeAttributes.AnsiClass + | ILDefaultPInvokeEncoding.Unicode -> TypeAttributes.UnicodeClass + +let convertToNestedTypeAccess (ilMemberAccess:ILMemberAccess) = + match ilMemberAccess with + | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem + | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem + | ILMemberAccess.Family -> TypeAttributes.NestedFamily + | ILMemberAccess.Private -> TypeAttributes.NestedPrivate + | ILMemberAccess.Public -> TypeAttributes.NestedPublic + +let convertInitSemantics (init:ILTypeInit) = + match init with + | ILTypeInit.BeforeField -> TypeAttributes.BeforeFieldInit + | ILTypeInit.OnAny -> enum 0 [] type ILTypeDef = - { tdKind: ILTypeDefKind; - Name: string; + { Name: string; + Attributes: TypeAttributes; GenericParams: ILGenericParameterDefs; (* class is generic *) - Access: ILTypeDefAccess; - IsAbstract: bool; - IsSealed: bool; - IsSerializable: bool; - IsComInterop: bool; (* Class or interface generated for COM interop *) Layout: ILTypeDefLayout; - IsSpecialName: bool; - Encoding: ILDefaultPInvokeEncoding; NestedTypes: ILTypeDefs; Implements: ILTypes; Extends: ILType option; Methods: ILMethodDefs; SecurityDecls: ILPermissions; - HasSecurity: bool; Fields: ILFieldDefs; MethodImpls: ILMethodImplDefs; - InitSemantics: ILTypeInit; Events: ILEventDefs; Properties: ILPropertyDefs; CustomAttrs: ILAttributes; } - member x.IsClass = (match x.tdKind with ILTypeDefKind.Class -> true | _ -> false) - member x.IsInterface = (match x.tdKind with ILTypeDefKind.Interface -> true | _ -> false) - member x.IsEnum = (match x.tdKind with ILTypeDefKind.Enum -> true | _ -> false) - member x.IsDelegate = (match x.tdKind with ILTypeDefKind.Delegate -> true | _ -> false) - - member tdef.IsStructOrEnum = - match tdef.tdKind with - | ILTypeDefKind.ValueType | ILTypeDefKind.Enum -> true - | _ -> false - + member x.IsClass = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Class + member x.IsStruct = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.ValueType + member x.IsInterface = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Interface + member x.IsEnum = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Enum + member x.IsDelegate = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Delegate + member x.Access = typeAccessOfFlags (int x.Attributes) + member x.IsAbstract = x.Attributes &&& TypeAttributes.Abstract <> enum 0 + member x.IsSealed = x.Attributes &&& TypeAttributes.Sealed <> enum 0 + member x.IsSerializable = x.Attributes &&& TypeAttributes.Serializable <> enum 0 + member x.IsComInterop = x.Attributes &&& TypeAttributes.Import <> enum 0 (* Class or interface generated for COM interop *) + member x.IsSpecialName = x.Attributes &&& TypeAttributes.SpecialName <> enum 0 + member x.HasSecurity = x.Attributes &&& TypeAttributes.HasSecurity <> enum 0 + member x.Encoding = typeEncodingOfFlags (int x.Attributes) + member x.IsStructOrEnum = x.IsStruct || x.IsEnum + member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertTypeAccessFlags access } + member x.WithNestedAccess(access) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertToNestedTypeAccess access } + member x.WithSealed(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Sealed } + member x.WithSerializable(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Serializable } + member x.WithAbstract(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Abstract } + member x.WithImport(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Import } + member x.WithHasSecurity(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.HasSecurity } + member x.WithLayout(layout) = { x with Attributes = x.Attributes ||| convertLayout layout; Layout = layout } + member x.WithKind(kind) = { x with Attributes = x.Attributes ||| convertTypeKind kind; Extends = match kind with ILTypeDefKind.Interface -> None | _ -> x.Extends } + member x.WithEncoding(encoding) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.StringFormatMask ||| convertEncoding encoding } + member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.SpecialName} + member x.WithInitSemantics(init) = { x with Attributes = x.Attributes ||| convertInitSemantics init } and [] ILTypeDefs(f : unit -> (string list * string * ILAttributes * Lazy)[]) = @@ -1629,10 +1776,11 @@ and [] ILExportedTypeOrForwarder = { ScopeRef: ILScopeRef; Name: string; - IsForwarder: bool; - Access: ILTypeDefAccess; + Attributes: TypeAttributes Nested: ILNestedExportedTypes; CustomAttrs: ILAttributes } + member x.Access = typeAccessOfFlags (int x.Attributes) + member x.IsForwarder = x.Attributes &&& enum(0x00200000) <> enum 0 and ILExportedTypesAndForwarders = | ILExportedTypesAndForwarders of Lazy> @@ -2304,29 +2452,15 @@ let mkILVoidReturn = mkILReturn ILType.Void let mkILCtor (access,args,impl) = { Name=".ctor"; - mdKind=MethodKind.Ctor; + Attributes=convertMemberAccess access ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName; + ImplAttributes=MethodImplAttributes.Managed CallingConv=ILCallingConv.Instance; Parameters = args Return= mkILVoidReturn; - Access=access; mdBody= mkMethBodyAux impl; - mdCodeKind=MethodCodeKind.IL; - IsInternalCall=false; - IsManaged=true; - IsForwardRef=false; SecurityDecls=emptyILSecurityDecls; - HasSecurity=false; IsEntryPoint=false; GenericParams=mkILEmptyGenericParams; - IsReqSecObj=false; - IsHideBySig=false; - IsSpecialName=true; - IsUnmanagedExport=false; - IsSynchronized=false; - IsNoInline=false; - IsAggressiveInline=false - IsMustRun=false; - IsPreserveSig=false; CustomAttrs = emptyILCustomAttrs; } // -------------------------------------------------------------------- @@ -2358,59 +2492,31 @@ let mkILNonGenericEmptyCtor tag superTy = let mkILStaticMethod (genparams,nm,access,args,ret,impl) = { GenericParams=genparams; Name=nm; + Attributes=convertMemberAccess access ||| MethodAttributes.Static; + ImplAttributes=MethodImplAttributes.Managed CallingConv = ILCallingConv.Static; - mdKind=MethodKind.Static; Parameters = args Return= ret; - Access=access; - HasSecurity=false; SecurityDecls=emptyILSecurityDecls; IsEntryPoint=false; CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; - mdCodeKind=MethodCodeKind.IL; - IsInternalCall=false; - IsManaged=true; - IsForwardRef=false; - IsReqSecObj=false; - IsHideBySig=false; - IsSpecialName=false; - IsUnmanagedExport=false; - IsSynchronized=false; - IsNoInline=false; - IsAggressiveInline=false; - IsMustRun=false; - IsPreserveSig=false; } + mdBody= mkMethBodyAux impl; } let mkILNonGenericStaticMethod (nm,access,args,ret,impl) = mkILStaticMethod (mkILEmptyGenericParams,nm,access,args,ret,impl) let mkILClassCtor impl = { Name=".cctor"; + Attributes=MethodAttributes.Private ||| MethodAttributes.Static ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName; + ImplAttributes=MethodImplAttributes.Managed CallingConv=ILCallingConv.Static; GenericParams=mkILEmptyGenericParams; - mdKind=MethodKind.Cctor; Parameters = [] Return=mkILVoidReturn; - Access=ILMemberAccess.Private; IsEntryPoint=false; - HasSecurity=false; SecurityDecls=emptyILSecurityDecls; CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; - mdCodeKind=MethodCodeKind.IL; - IsInternalCall=false; - IsManaged=true; - IsForwardRef=false; - IsReqSecObj=false; - IsHideBySig=false; - IsSpecialName=true; - IsUnmanagedExport=false; - IsSynchronized=false; - IsNoInline=false; - IsAggressiveInline=false - IsMustRun=false; - IsPreserveSig=false; } + mdBody= mkMethBodyAux impl; } // -------------------------------------------------------------------- // Make a virtual method, where the overriding is simply the default @@ -2422,66 +2528,35 @@ let mk_ospec (typ:ILType,callconv,nm,genparams,formal_args,formal_ret) = let mkILGenericVirtualMethod (nm,access,genparams,actual_args,actual_ret,impl) = { Name=nm; + Attributes= + convertMemberAccess access ||| + MethodAttributes.CheckAccessOnOverride ||| + (match impl with MethodBody.Abstract -> MethodAttributes.Abstract ||| MethodAttributes.Virtual | _ -> MethodAttributes.Virtual); + ImplAttributes=MethodImplAttributes.Managed GenericParams=genparams; CallingConv=ILCallingConv.Instance; - mdKind= - MethodKind.Virtual - { IsFinal=false; - // REVIEW: We'll need to start setting this eventually - IsNewSlot = false; - IsCheckAccessOnOverride=true; - IsAbstract=(match impl with MethodBody.Abstract -> true | _ -> false) ; }; Parameters=actual_args; Return=actual_ret; - Access=access; IsEntryPoint=false; - HasSecurity=false; SecurityDecls=emptyILSecurityDecls; CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; - mdCodeKind=MethodCodeKind.IL; - IsInternalCall=false; - IsManaged=true; - IsForwardRef=false; - IsReqSecObj=false; - IsHideBySig=false; - IsSpecialName=false; - IsUnmanagedExport=false; - IsSynchronized=false; - IsNoInline=false; - IsAggressiveInline=false - IsMustRun=false; - IsPreserveSig=false; } + mdBody= mkMethBodyAux impl; } let mkILNonGenericVirtualMethod (nm,access,args,ret,impl) = mkILGenericVirtualMethod (nm,access,mkILEmptyGenericParams,args,ret,impl) let mkILGenericNonVirtualMethod (nm,access,genparams, actual_args,actual_ret, impl) = { Name=nm; + Attributes=convertMemberAccess access ||| MethodAttributes.HideBySig; // see Bug343136: missing HideBySig attribute makes it problematic for C# to consume F# method overloads. + ImplAttributes=MethodImplAttributes.Managed GenericParams=genparams; CallingConv=ILCallingConv.Instance; - mdKind=MethodKind.NonVirtual; Parameters=actual_args; Return=actual_ret; - Access=access; IsEntryPoint=false; - HasSecurity=false; SecurityDecls=emptyILSecurityDecls; CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; - mdCodeKind=MethodCodeKind.IL; - IsInternalCall=false; - IsManaged=true; - IsForwardRef=false; - IsReqSecObj=false; - IsHideBySig=true; // see Bug343136: missing HideBySig attribute makes it problematic for C# to consume F# method overloads. - IsSpecialName=false; - IsUnmanagedExport=false; - IsSynchronized=false; - IsNoInline=false; - IsAggressiveInline=false - IsMustRun=false; - IsPreserveSig=false; } + mdBody= mkMethBodyAux impl; } let mkILNonGenericInstanceMethod (nm,access,args,ret,impl) = mkILGenericNonVirtualMethod (nm,access,mkILEmptyGenericParams,args,ret,impl) @@ -2558,19 +2633,18 @@ let prependInstrsToClassCtor instrs tag cd = cdef_cctorCode2CodeOrCreate tag (prependInstrsToMethod instrs) cd -let mkILField (isStatic,nm,ty,init,at,access,isLiteral) = +let mkILField (isStatic,nm,ty,(init:ILFieldInit option),(at: byte [] option),access,isLiteral) = { Name=nm; Type=ty; - IsStatic = isStatic; + Attributes=convertFieldAccess access ||| + (if isStatic then FieldAttributes.Static else enum 0) ||| + (if isLiteral then FieldAttributes.Literal else enum 0) ||| + (if init.IsSome then FieldAttributes.HasDefault else enum 0) ||| + (if at.IsSome then FieldAttributes.HasFieldRVA else enum 0) LiteralValue = init; Data=at; Offset=None; - IsSpecialName = false; Marshal=None; - NotSerialized=false; - IsInitOnly = false; - IsLiteral = isLiteral; - Access = access; CustomAttrs=emptyILCustomAttrs } let mkILInstanceField (nm,ty,init,access) = mkILField (false,nm,ty,init,None,access,false) @@ -2610,6 +2684,13 @@ let mkILExportedTypesLazy (l:Lazy<_>) = ILExportedTypesAndForwarders (lazy (Li let addNestedExportedTypeToTable (y: ILNestedExportedType) tab = Map.add y.Name y tab +let mkTypeForwarder scopeRef name nested customAttrs access = + { ScopeRef=scopeRef; + Name=name; + Attributes=enum(0x00200000) ||| convertTypeAccessFlags access; + Nested=nested; + CustomAttrs=customAttrs; } + let mkILNestedExportedTypes l = ILNestedExportedTypes (notlazy (List.foldBack addNestedExportedTypeToTable l Map.empty)) @@ -2669,19 +2750,11 @@ let mkILStorageCtor(tag,preblock,typ,flds,access) = mkILStorageCtorWithParamName let mkILGenericClass (nm, access, genparams, extends, impl, methods, fields, nestedTypes, props, events, attrs, init) = - { tdKind=ILTypeDefKind.Class; - Name=nm; + { Name=nm; + Attributes=convertTypeAccessFlags access ||| TypeAttributes.AutoLayout ||| TypeAttributes.Class ||| (match init with | ILTypeInit.BeforeField -> TypeAttributes.BeforeFieldInit | _ -> enum 0) ||| TypeAttributes.AnsiClass; GenericParams= genparams; - Access = access; - Implements = impl - IsAbstract = false; - IsSealed = false; - IsSerializable = false; - IsComInterop=false; - IsSpecialName=false; + Implements = impl; Layout=ILTypeDefLayout.Auto; - Encoding=ILDefaultPInvokeEncoding.Ansi; - InitSemantics=init; Extends = Some extends; Methods= methods; Fields= fields; @@ -2690,25 +2763,16 @@ let mkILGenericClass (nm, access, genparams, extends, impl, methods, fields, nes MethodImpls=emptyILMethodImpls; Properties=props; Events=events; - SecurityDecls=emptyILSecurityDecls; - HasSecurity=false; + SecurityDecls=emptyILSecurityDecls; } let mkRawDataValueTypeDef (iltyp_ValueType: ILType) (nm,size,pack) = - { tdKind=ILTypeDefKind.ValueType; - Name = nm; + { Name = nm; GenericParams= []; - Access = ILTypeDefAccess.Private; + Attributes = TypeAttributes.NotPublic ||| TypeAttributes.Sealed ||| TypeAttributes.ExplicitLayout ||| TypeAttributes.BeforeFieldInit ||| TypeAttributes.AnsiClass; Implements = [] - IsAbstract = false; - IsSealed = true; Extends = Some iltyp_ValueType; - IsComInterop=false; - IsSerializable = false; - IsSpecialName=false; Layout=ILTypeDefLayout.Explicit { Size=Some size; Pack=Some pack }; - Encoding=ILDefaultPInvokeEncoding.Ansi; - InitSemantics=ILTypeInit.BeforeField; Methods= emptyILMethods; Fields= emptyILFields; NestedTypes=emptyILTypeDefs; @@ -2716,8 +2780,7 @@ let mkRawDataValueTypeDef (iltyp_ValueType: ILType) (nm,size,pack) = MethodImpls=emptyILMethodImpls; Properties=emptyILProperties; Events=emptyILEvents; - SecurityDecls=emptyILSecurityDecls; - HasSecurity=false; } + SecurityDecls=emptyILSecurityDecls; } let mkILSimpleClass (ilg: ILGlobals) (nm, access, methods, fields, nestedTypes, props, events, attrs, init) = @@ -2793,19 +2856,13 @@ let buildILCode (_methName:string) lab2pc instrs tryspecs localspecs : ILCode = // Detecting Delegates // -------------------------------------------------------------------- -let mkILDelegateMethods (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IAsyncResult) (parms,rtv:ILReturn) = +let mkILDelegateMethods (access) (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IAsyncResult) (parms,rtv:ILReturn) = let rty = rtv.Type let one nm args ret = - let mdef = mkILNonGenericVirtualMethod (nm,ILMemberAccess.Public,args,mkILReturn ret,MethodBody.Abstract) - {mdef with - mdKind= - match mdef.mdKind with - | MethodKind.Virtual vinfo -> MethodKind.Virtual {vinfo with IsAbstract=false; } - | k -> k - mdCodeKind=MethodCodeKind.Runtime; - IsHideBySig=true; } - let ctor = mkILCtor(ILMemberAccess.Public, [ mkILParamNamed("object",ilg.typ_Object); mkILParamNamed("method",ilg.typ_IntPtr) ], MethodBody.Abstract) - let ctor = { ctor with mdCodeKind=MethodCodeKind.Runtime; IsHideBySig=true } + let mdef = mkILNonGenericVirtualMethod (nm,access,args,mkILReturn ret,MethodBody.Abstract) + mdef.WithAbstract(false).WithHideBySig(true).WithRuntime(true) + let ctor = mkILCtor(access, [ mkILParamNamed("object",ilg.typ_Object); mkILParamNamed("method",ilg.typ_IntPtr) ], MethodBody.Abstract) + let ctor = ctor.WithRuntime(true).WithHideBySig(true) [ ctor; one "Invoke" parms rty; one "BeginInvoke" (parms @ [mkILParamNamed("callback",iltyp_AsyncCallback); mkILParamNamed("objects",ilg.typ_Object) ] ) iltyp_IAsyncResult; @@ -2823,7 +2880,7 @@ type ILEnumInfo = let getTyOfILEnumInfo info = info.enumType let computeILEnumInfo (mdName,mdFields: ILFieldDefs) = - match (List.partition (fun fd -> fd.IsStatic) mdFields.AsList) with + match (List.partition (fun (fd:ILFieldDef) -> fd.IsStatic) mdFields.AsList) with | staticFields,[vfd] -> { enumType = vfd.Type; enumValues = staticFields |> List.map (fun fd -> (fd.Name, match fd.LiteralValue with Some i -> i | None -> failwith ("info_of_enum_tdef: badly formed enum "+mdName+": static field does not have an default value"))) } @@ -3614,7 +3671,7 @@ and refs_of_tdef s (td : ILTypeDef) = refs_of_fields s td.Fields.AsList; refs_of_method_impls s td.MethodImpls.AsList; refs_of_events s td.Events; - refs_of_tdef_kind s td.tdKind; + refs_of_tdef_kind s td; refs_of_custom_attrs s td.CustomAttrs; refs_of_properties s td.Properties diff --git a/src/absil/il.fsi b/src/absil/il.fsi index b6f374217f2..d067c3c0ee8 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -6,6 +6,7 @@ module public Microsoft.FSharp.Compiler.AbstractIL.IL open Internal.Utilities open System.Collections.Generic +open System.Reflection [] type PrimaryAssembly = @@ -756,6 +757,7 @@ type ILNativeType = | LPSTR | LPWSTR | LPTSTR + | LPUTF8STR | ByValStr | TBSTR | LPSTRUCT @@ -812,7 +814,6 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly - | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family @@ -1028,32 +1029,14 @@ type ILLazyMethodBody = [] type ILMethodDef = { Name: string; - mdKind: MethodKind; + Attributes: MethodAttributes; + ImplAttributes: MethodImplAttributes; CallingConv: ILCallingConv; Parameters: ILParameters; Return: ILReturn; - Access: ILMemberAccess; mdBody: ILLazyMethodBody; - mdCodeKind: MethodCodeKind; - IsInternalCall: bool; - IsManaged: bool; - IsForwardRef: bool; SecurityDecls: ILPermissions; - /// Some methods are marked "HasSecurity" even if there are no permissions attached, e.g. if they use SuppressUnmanagedCodeSecurityAttribute - HasSecurity: bool; IsEntryPoint:bool; - IsReqSecObj: bool; - IsHideBySig: bool; - IsSpecialName: bool; - /// The method is exported to unmanaged code using COM interop. - IsUnmanagedExport: bool; - IsSynchronized: bool; - IsPreserveSig: bool; - /// .NET 2.0 feature: SafeHandle finalizer must be run. - IsMustRun: bool; - IsNoInline: bool; - IsAggressiveInline: bool; - GenericParams: ILGenericParameterDefs; CustomAttrs: ILAttributes; } @@ -1083,10 +1066,42 @@ type ILMethodDef = member IsFinal: bool member IsNewSlot: bool - member IsCheckAccessOnOverride : bool + member IsCheckAccessOnOverride: bool member IsAbstract: bool - member MethodBody : ILMethodBody + member MethodBody: ILMethodBody member CallingSignature: ILCallingSignature + member Access: ILMemberAccess + member IsHideBySig: bool + member IsSpecialName: bool + /// The method is exported to unmanaged code using COM interop. + member IsUnmanagedExport: bool + member IsReqSecObj: bool + /// Some methods are marked "HasSecurity" even if there are no permissions attached, e.g. if they use SuppressUnmanagedCodeSecurityAttribute + member HasSecurity: bool + member IsManaged: bool + member IsForwardRef: bool + member IsInternalCall: bool + member IsPreserveSig: bool + member IsSynchronized: bool + member IsNoInline: bool + member IsAggressiveInline: bool + /// .NET 2.0 feature: SafeHandle finalizer must be run. + member IsMustRun: bool + + member WithSpecialName: ILMethodDef + member WithHideBySig: unit -> ILMethodDef + member WithHideBySig: bool -> ILMethodDef + member WithFinal: bool -> ILMethodDef + member WithAbstract: bool -> ILMethodDef + member WithAccess: ILMemberAccess -> ILMethodDef + member WithNewSlot: ILMethodDef + member WithSecurity: bool -> ILMethodDef + member WithPInvoke: bool -> ILMethodDef + member WithPreserveSig: bool -> ILMethodDef + member WithSynchronized: bool -> ILMethodDef + member WithNoInlining: bool -> ILMethodDef + member WithAggressiveInlining: bool -> ILMethodDef + member WithRuntime: bool -> ILMethodDef /// Tables of methods. Logically equivalent to a list of methods but /// the table is kept in a form optimized for looking up methods by @@ -1105,18 +1120,26 @@ type ILMethodDefs = type ILFieldDef = { Name: string; Type: ILType; - IsStatic: bool; - Access: ILMemberAccess; + Attributes: FieldAttributes; Data: byte[] option; LiteralValue: ILFieldInit option; /// The explicit offset in bytes when explicit layout is used. Offset: int32 option; - IsSpecialName: bool; Marshal: ILNativeType option; - NotSerialized: bool; - IsLiteral: bool ; - IsInitOnly: bool; CustomAttrs: ILAttributes; } + member IsStatic: bool + member IsSpecialName: bool + member IsLiteral: bool + member NotSerialized: bool + member IsInitOnly: bool + member Access: ILMemberAccess + member WithAccess: ILMemberAccess -> ILFieldDef + member WithInitOnly: bool -> ILFieldDef + member WithStatic: bool -> ILFieldDef + member WithSpecialName: bool -> ILFieldDef + member WithNotSerialized: bool -> ILFieldDef + member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef + member WithFieldMarshal: ILNativeType option -> ILFieldDef /// Tables of fields. Logically equivalent to a list of fields but /// the table is kept in a form optimized for looking up fields by @@ -1129,15 +1152,16 @@ type ILFieldDefs = /// Event definitions. [] type ILEventDef = - { Type: ILType option; + { Type: ILType option; Name: string; - IsRTSpecialName: bool; - IsSpecialName: bool; + Attributes: EventAttributes AddMethod: ILMethodRef; RemoveMethod: ILMethodRef; FireMethod: ILMethodRef option; OtherMethods: ILMethodRef list; CustomAttrs: ILAttributes; } + member IsSpecialName : bool + member IsRTSpecialName : bool /// Table of those events in a type definition. [] @@ -1149,8 +1173,7 @@ type ILEventDefs = [] type ILPropertyDef = { Name: string; - IsRTSpecialName: bool; - IsSpecialName: bool; + Attributes: PropertyAttributes; SetMethod: ILMethodRef option; GetMethod: ILMethodRef option; CallingConv: ILThisConvention; @@ -1158,6 +1181,8 @@ type ILPropertyDef = Init: ILFieldInit option; Args: ILTypes; CustomAttrs: ILAttributes; } + member IsSpecialName : bool + member IsRTSpecialName : bool /// Table of those properties in a type definition. [] @@ -1263,37 +1288,49 @@ type ILTypeDefs = /// have a very specific form. and [] ILTypeDef = - { tdKind: ILTypeDefKind; - Name: string; + { Name: string; + Attributes: TypeAttributes; GenericParams: ILGenericParameterDefs; - Access: ILTypeDefAccess; - IsAbstract: bool; - IsSealed: bool; - IsSerializable: bool; - /// Class or interface generated for COM interop. - IsComInterop: bool; Layout: ILTypeDefLayout; - IsSpecialName: bool; - Encoding: ILDefaultPInvokeEncoding; NestedTypes: ILTypeDefs; Implements: ILTypes; Extends: ILType option; Methods: ILMethodDefs; SecurityDecls: ILPermissions; - /// Some classes are marked "HasSecurity" even if there are no permissions attached, - /// e.g. if they use SuppressUnmanagedCodeSecurityAttribute - HasSecurity: bool; Fields: ILFieldDefs; MethodImpls: ILMethodImplDefs; - InitSemantics: ILTypeInit; Events: ILEventDefs; Properties: ILPropertyDefs; CustomAttrs: ILAttributes; } member IsClass: bool; + member IsStruct: bool; member IsInterface: bool; member IsEnum: bool; member IsDelegate: bool; member IsStructOrEnum : bool + member Access: ILTypeDefAccess + member IsAbstract: bool + member IsSealed: bool + member IsSerializable: bool + /// Class or interface generated for COM interop. + member IsComInterop: bool + member IsSpecialName: bool + /// Some classes are marked "HasSecurity" even if there are no permissions attached, + /// e.g. if they use SuppressUnmanagedCodeSecurityAttribute + member HasSecurity: bool + member Encoding: ILDefaultPInvokeEncoding; + member WithAccess: ILTypeDefAccess -> ILTypeDef + member WithNestedAccess: ILMemberAccess -> ILTypeDef + member WithSealed: bool -> ILTypeDef + member WithSerializable: bool -> ILTypeDef + member WithAbstract: bool -> ILTypeDef + member WithImport: bool -> ILTypeDef + member WithHasSecurity: bool -> ILTypeDef + member WithLayout: ILTypeDefLayout -> ILTypeDef + member WithKind: ILTypeDefKind -> ILTypeDef + member WithEncoding: ILDefaultPInvokeEncoding -> ILTypeDef + member WithSpecialName: bool -> ILTypeDef + member WithInitSemantics: ILTypeInit -> ILTypeDef [] [] @@ -1339,10 +1376,11 @@ type ILExportedTypeOrForwarder = { ScopeRef: ILScopeRef; /// [Namespace.]Name Name: string; - IsForwarder: bool; - Access: ILTypeDefAccess; + Attributes: TypeAttributes Nested: ILNestedExportedTypes; - CustomAttrs: ILAttributes } + CustomAttrs: ILAttributes } + member Access: ILTypeDefAccess + member IsForwarder: bool [] [] @@ -1685,10 +1723,10 @@ val mkILClassCtor: MethodBody -> ILMethodDef val mkILNonGenericEmptyCtor: ILSourceMarker option -> ILType -> ILMethodDef val mkILStaticMethod: ILGenericParameterDefs * string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef val mkILNonGenericStaticMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef -val mkILGenericVirtualMethod: string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef -val mkILGenericNonVirtualMethod: string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef +val mkILGenericVirtualMethod: string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef +val mkILGenericNonVirtualMethod: string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef val mkILNonGenericVirtualMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef -val mkILNonGenericInstanceMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef +val mkILNonGenericInstanceMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef /// Make field definitions. @@ -1727,7 +1765,7 @@ val mkILStorageCtor: ILSourceMarker option * ILInstr list * ILType * (string * I val mkILSimpleStorageCtor: ILSourceMarker option * ILTypeSpec option * ILType * ILParameter list * (string * ILType) list * ILMemberAccess -> ILMethodDef val mkILSimpleStorageCtorWithParamNames: ILSourceMarker option * ILTypeSpec option * ILType * ILParameter list * (string * string * ILType) list * ILMemberAccess -> ILMethodDef -val mkILDelegateMethods: ILGlobals -> ILType * ILType -> ILParameter list * ILReturn -> ILMethodDef list +val mkILDelegateMethods: ILMemberAccess -> ILGlobals -> ILType * ILType -> ILParameter list * ILReturn -> ILMethodDef list /// Given a delegate type definition which lies in a particular scope, /// make a reference to its constructor. @@ -1785,6 +1823,7 @@ val emptyILTypeDefs: ILTypeDefs val mkILTypeDefsComputed: (unit -> (string list * string * ILAttributes * Lazy) array) -> ILTypeDefs val addILTypeDef: ILTypeDef -> ILTypeDefs -> ILTypeDefs +val mkTypeForwarder: ILScopeRef -> string -> ILNestedExportedTypes -> ILAttributes -> ILTypeDefAccess -> ILExportedTypeOrForwarder val mkILNestedExportedTypes: ILNestedExportedType list -> ILNestedExportedTypes val mkILNestedExportedTypesLazy: Lazy -> ILNestedExportedTypes diff --git a/src/absil/ilbinary.fs b/src/absil/ilbinary.fs index 78467beeef3..46dfef12be6 100644 --- a/src/absil/ilbinary.fs +++ b/src/absil/ilbinary.fs @@ -838,6 +838,7 @@ let nt_ARRAY = 0x2Auy let nt_LPSTRUCT = 0x2Buy let nt_CUSTOMMARSHALER = 0x2Cuy let nt_ERROR = 0x2Duy +let nt_LPUTF8STR = 0x30uy let nt_MAX = 0x50uy // From c:/clrenv.i386/Crt/Inc/i386/hs.h @@ -894,6 +895,7 @@ let ILNativeTypeMap = nt_LPSTR , ILNativeType.LPSTR nt_LPWSTR , ILNativeType.LPWSTR nt_LPTSTR, ILNativeType.LPTSTR + nt_LPUTF8STR, ILNativeType.LPUTF8STR nt_IUNKNOWN , (* COM interop *) ILNativeType.IUnknown nt_IDISPATCH , (* COM interop *) ILNativeType.IDispatch nt_BYVALSTR , ILNativeType.ByValStr diff --git a/src/absil/illib.fs b/src/absil/illib.fs index a19497e8c56..2e97b0ab88c 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -37,14 +37,14 @@ let inline isSingleton l = let inline isNonNull x = not (isNull x) let inline nonNull msg x = if isNull x then failwith ("null: " ^ msg) else x -let (===) x y = LanguagePrimitives.PhysicalEquality x y +let inline (===) x y = LanguagePrimitives.PhysicalEquality x y //--------------------------------------------------------------------- // Library: ReportTime //--------------------------------------------------------------------- let reportTime = - let tFirst = ref None - let tPrev = ref None + let tFirst = ref None + let tPrev = ref None fun showTimes descr -> if showTimes then let t = System.Diagnostics.Process.GetCurrentProcess().UserProcessorTime.TotalSeconds @@ -237,36 +237,12 @@ module Option = let mapFold f s opt = match opt with | None -> None,s - | Some x -> let x',s' = f s x in Some x',s' - - let otherwise opt dflt = - match opt with - | None -> dflt - | Some x -> x - - let fold f z x = - match x with - | None -> z - | Some x -> f z x - - let attempt (f: unit -> 'T) = try Some (f()) with _ -> None - - - let orElseWith f opt = - match opt with - | None -> f() - | x -> x - - let orElse v opt = - match opt with - | None -> v - | x -> x - - let defaultValue v opt = - match opt with - | None -> v - | Some x -> x + | Some x -> + let x',s' = f s x + Some x',s' + let attempt (f: unit -> 'T) = try Some (f()) with _ -> None + module List = //let item n xs = List.nth xs n @@ -442,9 +418,6 @@ module List = | x::xs -> if i=n then f x::xs else x::mn (i+1) xs mn 0 xs - - let rec until p l = match l with [] -> [] | h::t -> if p h then [] else h :: until p t - let count pred xs = List.fold (fun n x -> if pred x then n+1 else n) 0 xs // WARNING: not tail-recursive @@ -521,23 +494,9 @@ module String = if s.Length = 0 then s else lowercase s.[0..0] + s.[ 1.. s.Length - 1 ] + let dropPrefix (s:string) (t:string) = s.[t.Length..s.Length - 1] - let tryDropPrefix (s:string) (t:string) = - if s.StartsWith t then - Some s.[t.Length..s.Length - 1] - else - None - - let tryDropSuffix (s:string) (t:string) = - if s.EndsWith t then - Some s.[0..s.Length - t.Length - 1] - else - None - - let hasPrefix s t = Option.isSome (tryDropPrefix s t) - let dropPrefix s t = match (tryDropPrefix s t) with Some(res) -> res | None -> failwith "dropPrefix" - - let dropSuffix s t = match (tryDropSuffix s t) with Some(res) -> res | None -> failwith "dropSuffix" + let dropSuffix (s:string) (t:string) = s.[0..s.Length - t.Length - 1] open System open System.IO diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index 0e1727effe1..abad68c9772 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -13,6 +13,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.IL open System.Text open System.IO +open System.Reflection #if DEBUG let pretty () = true @@ -212,11 +213,10 @@ and goutput_typ_with_shortened_class_syntax env os = function | typ2 -> goutput_typ env os typ2 and goutput_gactuals env os inst = - if inst.Length = 0 then () - else - output_string os "<"; + if not (List.isEmpty inst) then + output_string os "<" output_seq ", " (goutput_gactual env) os inst - output_string os ">"; + output_string os ">" and goutput_gactual env os ty = goutput_typ env os ty @@ -396,7 +396,6 @@ let output_member_access os access = (match access with | ILMemberAccess.Public -> "public" | ILMemberAccess.Private -> "private" - | ILMemberAccess.CompilerControlled -> "privatescope" | ILMemberAccess.Family -> "family" | ILMemberAccess.FamilyAndAssembly -> "famandassem" | ILMemberAccess.FamilyOrAssembly -> "famorassem" @@ -770,10 +769,9 @@ let goutput_ilmbody env os (il: ILMethodBody) = let goutput_mbody is_entrypoint env os md = - match md.mdCodeKind with - | MethodCodeKind.Native -> output_string os "native " - | MethodCodeKind.IL -> output_string os "cil " - | MethodCodeKind.Runtime -> output_string os "runtime " + if md.ImplAttributes &&& MethodImplAttributes.Native <> enum 0 then output_string os "native " + elif md.ImplAttributes &&& MethodImplAttributes.IL <> enum 0 then output_string os "cil " + else output_string os "runtime " output_string os (if md.IsInternalCall then "internalcall " else " "); output_string os (if md.IsManaged then "managed " else " "); @@ -788,19 +786,18 @@ let goutput_mbody is_entrypoint env os md = output_string os "\n"; output_string os "}\n" -let goutput_mdef env os md = +let goutput_mdef env os (md:ILMethodDef) = let attrs = - match md.mdKind with - | MethodKind.Virtual vinfo -> + if md.IsVirtual then "virtual "^ - (if vinfo.IsFinal then "final " else "")^ - (if vinfo.IsNewSlot then "newslot " else "")^ - (if vinfo.IsCheckAccessOnOverride then " strict " else "")^ - (if vinfo.IsAbstract then " abstract " else "")^ + (if md.IsFinal then "final " else "")^ + (if md.IsNewSlot then "newslot " else "")^ + (if md.IsCheckAccessOnOverride then " strict " else "")^ + (if md.IsAbstract then " abstract " else "")^ " " - | MethodKind.NonVirtual -> "" - | MethodKind.Ctor -> "rtspecialname" - | MethodKind.Static -> + elif md.IsNonVirtualInstance then "" + elif md.IsConstructor then "rtspecialname" + elif md.IsStatic then "static "^ (match md.mdBody.Contents with MethodBody.PInvoke (attr) -> @@ -824,7 +821,8 @@ let goutput_mdef env os md = ")" | _ -> "") - | MethodKind.Cctor -> "specialname rtspecialname static" + elif md.IsClassInitializer then "specialname rtspecialname static" + else "" let is_entrypoint = md.IsEntryPoint let menv = ppenv_enter_method (List.length md.GenericParams) env output_string os " .method "; @@ -865,14 +863,14 @@ let goutput_superclass env os = function | Some typ -> output_string os "extends "; (goutput_typ_with_shortened_class_syntax env) os typ let goutput_superinterfaces env os imp = - if imp = [] then () else - output_string os "implements "; - output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp + if not (List.isEmpty imp) then + output_string os "implements " + output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp let goutput_implements env os (imp:ILTypes) = - if imp.Length = 0 then () else - output_string os "implements "; - output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp + if not (List.isEmpty imp) then + output_string os "implements " + output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp let the = function Some x -> x | None -> failwith "the" @@ -904,10 +902,9 @@ let rec goutput_tdef (enc) env contents os cd = goutput_pdefs env os cd.Properties; else output_string os "\n"; - match cd.tdKind with - | ILTypeDefKind.Class | ILTypeDefKind.Enum | ILTypeDefKind.Delegate | ILTypeDefKind.ValueType -> output_string os ".class " - | ILTypeDefKind.Interface -> output_string os ".class interface " - output_init_semantics os cd.InitSemantics; + if cd.IsInterface then output_string os ".class interface " + else output_string os ".class " + output_init_semantics os cd.Attributes; output_string os " "; output_type_access os cd.Access; output_string os " "; @@ -937,9 +934,7 @@ let rec goutput_tdef (enc) env contents os cd = output_string os "\n}"; and output_init_semantics os f = - match f with - ILTypeInit.BeforeField -> output_string os "beforefieldinit"; - | ILTypeInit.OnAny -> () + if f &&& TypeAttributes.BeforeFieldInit <> enum 0 then output_string os "beforefieldinit" and goutput_lambdas env os lambdas = match lambdas with diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index b4a88f58e7d..e89164a42a0 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -27,6 +27,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.NativeInterop +open System.Reflection type ILReaderOptions = { pdbPath: string option @@ -1622,16 +1623,6 @@ and seekReadClassLayout ctxt idx = | None -> { Size = None; Pack = None } | Some (pack, size) -> { Size = Some size; Pack = Some pack } -and memberAccessOfFlags flags = - let f = (flags &&& 0x00000007) - if f = 0x00000001 then ILMemberAccess.Private - elif f = 0x00000006 then ILMemberAccess.Public - elif f = 0x00000004 then ILMemberAccess.Family - elif f = 0x00000002 then ILMemberAccess.FamilyAndAssembly - elif f = 0x00000005 then ILMemberAccess.FamilyOrAssembly - elif f = 0x00000003 then ILMemberAccess.Assembly - else ILMemberAccess.CompilerControlled - and typeAccessOfFlags flags = let f = (flags &&& 0x00000007) if f = 0x00000001 then ILTypeDefAccess.Public @@ -1649,25 +1640,6 @@ and typeLayoutOfFlags ctxt flags tidx = elif f = 0x00000010 then ILTypeDefLayout.Explicit (seekReadClassLayout ctxt tidx) else ILTypeDefLayout.Auto -and typeKindOfFlags nm _mdefs _fdefs (super:ILType option) flags = - if (flags &&& 0x00000020) <> 0x0 then ILTypeDefKind.Interface - else - let isEnum = (match super with None -> false | Some ty -> ty.TypeSpec.Name = "System.Enum") - let isDelegate = (match super with None -> false | Some ty -> ty.TypeSpec.Name = "System.Delegate") - let isMulticastDelegate = (match super with None -> false | Some ty -> ty.TypeSpec.Name = "System.MulticastDelegate") - let selfIsMulticastDelegate = nm = "System.MulticastDelegate" - let isValueType = (match super with None -> false | Some ty -> ty.TypeSpec.Name = "System.ValueType" && nm <> "System.Enum") - if isEnum then ILTypeDefKind.Enum - elif (isDelegate && not selfIsMulticastDelegate) || isMulticastDelegate then ILTypeDefKind.Delegate - elif isValueType then ILTypeDefKind.ValueType - else ILTypeDefKind.Class - -and typeEncodingOfFlags flags = - let f = (flags &&& 0x00030000) - if f = 0x00020000 then ILDefaultPInvokeEncoding.Auto - elif f = 0x00010000 then ILDefaultPInvokeEncoding.Unicode - else ILDefaultPInvokeEncoding.Ansi - and isTopTypeDef flags = (typeAccessOfFlags flags = ILTypeDefAccess.Private) || typeAccessOfFlags flags = ILTypeDefAccess.Public @@ -1725,36 +1697,23 @@ and seekReadTypeDef ctxt toponly (idx:int) = let hasLayout = (match layout with ILTypeDefLayout.Explicit _ -> true | _ -> false) let mdefs = seekReadMethods ctxt numtypars methodsIdx endMethodsIdx let fdefs = seekReadFields ctxt (numtypars, hasLayout) fieldsIdx endFieldsIdx - let kind = typeKindOfFlags nm mdefs fdefs super flags let nested = seekReadNestedTypeDefs ctxt idx let impls = seekReadInterfaceImpls ctxt numtypars idx let sdecls = seekReadSecurityDecls ctxt (TaggedIndex(hds_TypeDef, idx)) let mimpls = seekReadMethodImpls ctxt numtypars idx let props = seekReadProperties ctxt numtypars idx let events = seekReadEvents ctxt numtypars idx - { tdKind= kind - Name=nm + { Name=nm GenericParams=typars - Access= typeAccessOfFlags flags - IsAbstract= (flags &&& 0x00000080) <> 0x0 - IsSealed= (flags &&& 0x00000100) <> 0x0 - IsSerializable= (flags &&& 0x00002000) <> 0x0 - IsComInterop= (flags &&& 0x00001000) <> 0x0 + Attributes= enum(flags) Layout = layout - IsSpecialName= (flags &&& 0x00000400) <> 0x0 - Encoding=typeEncodingOfFlags flags NestedTypes= nested Implements = impls Extends = super Methods = mdefs SecurityDecls = sdecls - HasSecurity=(flags &&& 0x00040000) <> 0x0 Fields=fdefs MethodImpls=mimpls - InitSemantics= - if kind = ILTypeDefKind.Interface then ILTypeInit.OnAny - elif (flags &&& 0x00100000) <> 0x0 then ILTypeInit.BeforeField - else ILTypeInit.OnAny Events= events Properties=props CustomAttrs=cas } @@ -1857,7 +1816,7 @@ and seekReadTypeDefOrRef ctxt numtypars boxity (ginst:ILTypes) (TaggedIndex(tag, | tag when tag = tdor_TypeDef -> seekReadTypeDefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeRef -> seekReadTypeRefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeSpec -> - if ginst.Length > 0 then dprintn ("type spec used as type constructor for a generic instantiation: ignoring instantiation") + if not (List.isEmpty ginst) then dprintn ("type spec used as type constructor for a generic instantiation: ignoring instantiation") readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt idx) | _ -> failwith "seekReadTypeDefOrRef ctxt" @@ -1935,12 +1894,7 @@ and seekReadField ctxt (numtypars, hasLayout) (idx:int) = let fd = { Name = nm Type= readBlobHeapAsFieldSig ctxt numtypars typeIdx - Access = memberAccessOfFlags flags - IsStatic = isStatic - IsInitOnly = (flags &&& 0x0020) <> 0 - IsLiteral = (flags &&& 0x0040) <> 0 - NotSerialized = (flags &&& 0x0080) <> 0 - IsSpecialName = (flags &&& 0x0200) <> 0 || (flags &&& 0x0400) <> 0 (* REVIEW: RTSpecialName *) + Attributes = enum(flags) LiteralValue = if (flags &&& 0x8000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_FieldDef, idx))) Marshal = if (flags &&& 0x1000) = 0 then None else @@ -2281,30 +2235,13 @@ and seekReadFieldDefAsFieldSpecUncached ctxtH idx = and seekReadMethod ctxt numtypars (idx:int) = let (codeRVA, implflags, flags, nameIdx, typeIdx, paramIdx) = seekReadMethodRow ctxt idx let nm = readStringHeap ctxt nameIdx - let isStatic = (flags &&& 0x0010) <> 0x0 - let final = (flags &&& 0x0020) <> 0x0 - let virt = (flags &&& 0x0040) <> 0x0 - let strict = (flags &&& 0x0200) <> 0x0 - let hidebysig = (flags &&& 0x0080) <> 0x0 - let newslot = (flags &&& 0x0100) <> 0x0 let abstr = (flags &&& 0x0400) <> 0x0 - let specialname = (flags &&& 0x0800) <> 0x0 let pinvoke = (flags &&& 0x2000) <> 0x0 - let export = (flags &&& 0x0008) <> 0x0 - let _rtspecialname = (flags &&& 0x1000) <> 0x0 - let reqsecobj = (flags &&& 0x8000) <> 0x0 - let hassec = (flags &&& 0x4000) <> 0x0 let codetype = implflags &&& 0x0003 let unmanaged = (implflags &&& 0x0004) <> 0x0 - let forwardref = (implflags &&& 0x0010) <> 0x0 - let preservesig = (implflags &&& 0x0080) <> 0x0 let internalcall = (implflags &&& 0x1000) <> 0x0 - let synchronized = (implflags &&& 0x0020) <> 0x0 let noinline = (implflags &&& 0x0008) <> 0x0 let aggressiveinline = (implflags &&& 0x0100) <> 0x0 - let mustrun = (implflags &&& 0x0040) <> 0x0 - let cctor = (nm = ".cctor") - let ctor = (nm = ".ctor") let _generic, _genarity, cc, retty, argtys, varargs = readBlobHeapAsMethodSig ctxt numtypars typeIdx if varargs <> None then dprintf "ignoring sentinel and varargs in ILMethodDef signature" @@ -2318,34 +2255,10 @@ and seekReadMethod ctxt numtypars (idx:int) = let ret, ilParams = seekReadParams ctxt (retty, argtys) paramIdx endParamIdx { Name=nm - mdKind = - (if cctor then MethodKind.Cctor - elif ctor then MethodKind.Ctor - elif isStatic then MethodKind.Static - elif virt then - MethodKind.Virtual - { IsFinal=final - IsNewSlot=newslot - IsCheckAccessOnOverride=strict - IsAbstract=abstr } - else MethodKind.NonVirtual) - Access = memberAccessOfFlags flags + Attributes = enum(flags) + ImplAttributes= enum(implflags) SecurityDecls=seekReadSecurityDecls ctxt (TaggedIndex(hds_MethodDef, idx)) - HasSecurity=hassec IsEntryPoint= (fst ctxt.entryPointToken = TableNames.Method && snd ctxt.entryPointToken = idx) - IsReqSecObj=reqsecobj - IsHideBySig=hidebysig - IsSpecialName=specialname - IsUnmanagedExport=export - IsSynchronized=synchronized - IsNoInline=noinline - IsAggressiveInline=aggressiveinline - IsMustRun=mustrun - IsPreserveSig=preservesig - IsManaged = not unmanaged - IsInternalCall = internalcall - IsForwardRef = forwardref - mdCodeKind = (if (codetype = 0x00) then MethodCodeKind.IL elif (codetype = 0x01) then MethodCodeKind.Native elif (codetype = 0x03) then MethodCodeKind.Runtime else MethodCodeKind.Native) GenericParams=seekReadGenericParams ctxt numtypars (tomd_MethodDef, idx) CustomAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)) Parameters= ilParams @@ -2445,10 +2358,9 @@ and seekReadMethodSemantics ctxt id = and seekReadEvent ctxt numtypars idx = let (flags, nameIdx, typIdx) = seekReadEventRow ctxt idx - { Name = readStringHeap ctxt nameIdx - Type = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject typIdx - IsSpecialName = (flags &&& 0x0200) <> 0x0 - IsRTSpecialName = (flags &&& 0x0400) <> 0x0 + { Type = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject typIdx + Name = readStringHeap ctxt nameIdx + Attributes = enum(flags) AddMethod= seekReadMethodSemantics ctxt (0x0008, TaggedIndex(hs_Event, idx)) RemoveMethod=seekReadMethodSemantics ctxt (0x0010, TaggedIndex(hs_Event, idx)) FireMethod=seekReadoptional_MethodSemantics ctxt (0x0020, TaggedIndex(hs_Event, idx)) @@ -2488,8 +2400,7 @@ and seekReadProperty ctxt numtypars idx = | None -> cc { Name=readStringHeap ctxt nameIdx CallingConv = cc2 - IsRTSpecialName=(flags &&& 0x0400) <> 0x0 - IsSpecialName= (flags &&& 0x0200) <> 0x0 + Attributes = enum(flags) SetMethod=setter GetMethod=getter Type=retty @@ -3245,8 +3156,7 @@ and seekReadTopExportedTypes ctxt () = yield { ScopeRef = seekReadImplAsScopeRef ctxt implIdx Name = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) - IsForwarder = ((flags &&& 0x00200000) <> 0) - Access = typeAccessOfFlags flags + Attributes = enum(flags) Nested = seekReadNestedExportedTypes ctxt exported nested i CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ExportedType, i)) } ]) diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 774b7a24366..8f040838c60 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1465,60 +1465,13 @@ let emitParameter cenv emEnv (defineParameter : int * ParameterAttributes * stri let parB = defineParameter(i, attrs, name) emitCustomAttrs cenv emEnv (wrapCustomAttr parB.SetCustomAttribute) param.CustomAttrs -//---------------------------------------------------------------------------- -// convMethodAttributes -//---------------------------------------------------------------------------- - -let convMethodAttributes (mdef: ILMethodDef) = - let attrKind = - match mdef.mdKind with - | MethodKind.Static -> MethodAttributes.Static - | MethodKind.Cctor -> MethodAttributes.Static - | MethodKind.Ctor -> enum 0 - | MethodKind.NonVirtual -> enum 0 - | MethodKind.Virtual vinfo -> MethodAttributes.Virtual ||| - flagsIf vinfo.IsNewSlot MethodAttributes.NewSlot ||| - flagsIf vinfo.IsFinal MethodAttributes.Final ||| - flagsIf vinfo.IsCheckAccessOnOverride MethodAttributes.CheckAccessOnOverride ||| - flagsIf vinfo.IsAbstract MethodAttributes.Abstract - - let attrAccess = - match mdef.Access with - | ILMemberAccess.Assembly -> MethodAttributes.Assembly - | ILMemberAccess.CompilerControlled -> failwith "Method access compiler controled." - | ILMemberAccess.FamilyAndAssembly -> MethodAttributes.FamANDAssem - | ILMemberAccess.FamilyOrAssembly -> MethodAttributes.FamORAssem - | ILMemberAccess.Family -> MethodAttributes.Family - | ILMemberAccess.Private -> MethodAttributes.Private - | ILMemberAccess.Public -> MethodAttributes.Public - - let attrOthers = flagsIf mdef.HasSecurity MethodAttributes.HasSecurity ||| - flagsIf mdef.IsSpecialName MethodAttributes.SpecialName ||| - flagsIf mdef.IsHideBySig MethodAttributes.HideBySig ||| - flagsIf mdef.IsReqSecObj MethodAttributes.RequireSecObject - - attrKind ||| attrAccess ||| attrOthers - -let convMethodImplFlags mdef = - (match mdef.mdCodeKind with - | MethodCodeKind.Native -> MethodImplAttributes.Native - | MethodCodeKind.Runtime -> MethodImplAttributes.Runtime - | MethodCodeKind.IL -> MethodImplAttributes.IL) - ||| flagsIf mdef.IsInternalCall MethodImplAttributes.InternalCall - ||| (if mdef.IsManaged then MethodImplAttributes.Managed else MethodImplAttributes.Unmanaged) - ||| flagsIf mdef.IsForwardRef MethodImplAttributes.ForwardRef - ||| flagsIf mdef.IsPreserveSig MethodImplAttributes.PreserveSig - ||| flagsIf mdef.IsSynchronized MethodImplAttributes.Synchronized - ||| flagsIf (match mdef.mdBody.Contents with MethodBody.IL b -> b.NoInlining | _ -> false) MethodImplAttributes.NoInlining - ||| flagsIf (match mdef.mdBody.Contents with MethodBody.IL b -> b.AggressiveInlining | _ -> false) MethodImplAttributes.AggressiveInlining - //---------------------------------------------------------------------------- // buildMethodPass2 //---------------------------------------------------------------------------- let rec buildMethodPass2 cenv tref (typB:TypeBuilder) emEnv (mdef : ILMethodDef) = - let attrs = convMethodAttributes mdef - let implflags = convMethodImplFlags mdef + let attrs = mdef.Attributes + let implflags = mdef.ImplAttributes let cconv = convCallConv mdef.CallingConv let mref = mkRefToILMethod (tref, mdef) let emEnv = if mdef.IsEntryPoint && isNil mdef.ParameterTypes then @@ -1646,20 +1599,8 @@ let buildFieldPass2 cenv tref (typB:TypeBuilder) emEnv (fdef : ILFieldDef) = (*{ -Data: bytes option; -Marshal: NativeType option; *) - let attrsAccess = match fdef.Access with - | ILMemberAccess.Assembly -> FieldAttributes.Assembly - | ILMemberAccess.CompilerControlled -> failwith "Field access compiler controled." - | ILMemberAccess.FamilyAndAssembly -> FieldAttributes.FamANDAssem - | ILMemberAccess.FamilyOrAssembly -> FieldAttributes.FamORAssem - | ILMemberAccess.Family -> FieldAttributes.Family - | ILMemberAccess.Private -> FieldAttributes.Private - | ILMemberAccess.Public -> FieldAttributes.Public - let attrsOther = flagsIf fdef.IsStatic FieldAttributes.Static ||| - flagsIf fdef.IsSpecialName FieldAttributes.SpecialName ||| - flagsIf fdef.IsLiteral FieldAttributes.Literal ||| - flagsIf fdef.IsInitOnly FieldAttributes.InitOnly ||| - flagsIf fdef.NotSerialized FieldAttributes.NotSerialized - let attrs = attrsAccess ||| attrsOther + + let attrs = fdef.Attributes let fieldT = convType cenv emEnv fdef.Type let fieldB = match fdef.Data with @@ -1767,7 +1708,6 @@ let typeAttrbutesOfTypeAccess x = | ILTypeDefAccess.Nested macc -> match macc with | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly - | ILMemberAccess.CompilerControlled -> failwith "Nested compiler controled." | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILMemberAccess.Family -> TypeAttributes.NestedFamily @@ -1796,9 +1736,9 @@ let typeAttributesOfTypeLayout cenv emEnv x = (p.Size |> Option.toList |> List.map (fun x -> ("Size", cenv.ilg.typ_Int32, false, ILAttribElem.Int32 x)))))) | _ -> None match x with - | ILTypeDefLayout.Auto -> TypeAttributes.AutoLayout, None - | ILTypeDefLayout.Explicit p -> TypeAttributes.ExplicitLayout, (attr 0x02 p) - | ILTypeDefLayout.Sequential p -> TypeAttributes.SequentialLayout, (attr 0x00 p) + | ILTypeDefLayout.Auto -> None + | ILTypeDefLayout.Explicit p -> (attr 0x02 p) + | ILTypeDefLayout.Sequential p -> (attr 0x00 p) //---------------------------------------------------------------------------- @@ -1810,17 +1750,9 @@ let rec buildTypeDefPass1 cenv emEnv (modB:ModuleBuilder) rootTypeBuilder nestin // -SecurityDecls: Permissions; // -InitSemantics: ILTypeInit; // TypeAttributes - let attrsKind = typeAttrbutesOfTypeDefKind tdef.tdKind - let attrsAccess = typeAttrbutesOfTypeAccess tdef.Access - let attrsLayout, cattrsLayout = typeAttributesOfTypeLayout cenv emEnv tdef.Layout - let attrsEnc = typeAttributesOfTypeEncoding tdef.Encoding - let attrsOther = flagsIf tdef.IsAbstract TypeAttributes.Abstract ||| - flagsIf tdef.IsSealed TypeAttributes.Sealed ||| - flagsIf tdef.IsSerializable TypeAttributes.Serializable ||| - flagsIf tdef.IsSpecialName TypeAttributes.SpecialName ||| - flagsIf tdef.HasSecurity TypeAttributes.HasSecurity + let cattrsLayout = typeAttributesOfTypeLayout cenv emEnv tdef.Layout - let attrsType = attrsKind ||| attrsAccess ||| attrsLayout ||| attrsEnc ||| attrsOther + let attrsType = tdef.Attributes // TypeBuilder from TypeAttributes. let typB : TypeBuilder = rootTypeBuilder (tdef.Name, attrsType) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 8ea9dec6a7a..e1af01dd561 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1069,8 +1069,7 @@ and GetFieldInitFlags i = // -------------------------------------------------------------------- let GetMemberAccessFlags access = - match access with - | ILMemberAccess.CompilerControlled -> 0x00000000 + match access with | ILMemberAccess.Public -> 0x00000006 | ILMemberAccess.Private -> 0x00000001 | ILMemberAccess.Family -> 0x00000004 @@ -1088,44 +1087,13 @@ let GetTypeAccessFlags access = | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> 0x00000006 | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> 0x00000007 | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> 0x00000005 - | ILTypeDefAccess.Nested ILMemberAccess.CompilerControlled -> failwith "bad type acccess" let rec GetTypeDefAsRow cenv env _enc (td:ILTypeDef) = let nselem, nelem = GetTypeNameAsElemPair cenv td.Name let flags = if (isTypeNameForGlobalFunctions td.Name) then 0x00000000 else - - GetTypeAccessFlags td.Access ||| - begin - match td.Layout with - | ILTypeDefLayout.Auto -> 0x00000000 - | ILTypeDefLayout.Sequential _ -> 0x00000008 - | ILTypeDefLayout.Explicit _ -> 0x00000010 - end ||| - begin - match td.tdKind with - | ILTypeDefKind.Interface -> 0x00000020 - | _ -> 0x00000000 - end ||| - (if td.IsAbstract then 0x00000080l else 0x00000000) ||| - (if td.IsSealed then 0x00000100l else 0x00000000) ||| - (if td.IsComInterop then 0x00001000l else 0x00000000) ||| - (if td.IsSerializable then 0x00002000l else 0x00000000) ||| - begin - match td.Encoding with - | ILDefaultPInvokeEncoding.Ansi -> 0x00000000 - | ILDefaultPInvokeEncoding.Auto -> 0x00020000 - | ILDefaultPInvokeEncoding.Unicode -> 0x00010000 - end ||| - begin - match td.InitSemantics with - | ILTypeInit.BeforeField when not (match td.tdKind with ILTypeDefKind.Interface -> true | _ -> false) -> 0x00100000 - | _ -> 0x00000000 - end ||| - (if td.IsSpecialName then 0x00000400 else 0x00000000) ||| - // @REVIEW (if rtspecialname_of_tdef td then 0x00000800 else 0x00000000) ||| - (if td.HasSecurity || not td.SecurityDecls.AsList.IsEmpty then 0x00040000 else 0x00000000) + int td.Attributes let tdorTag, tdorRow = GetTypeOptionAsTypeDefOrRef cenv env td.Extends UnsharedRow @@ -1339,10 +1307,10 @@ and GetMethodDefOrRefAsUncodedToken (tag, idx) = getUncodedToken tab idx and GetMethodSpecInfoAsUncodedToken cenv env ((_, _, _, _, _, _, minst:ILGenericArgs) as minfo) = - if minst.Length > 0 then - getUncodedToken TableNames.MethodSpec (GetMethodSpecInfoAsMethodSpecIdx cenv env minfo) - else - GetMethodDefOrRefAsUncodedToken (GetMethodRefInfoAsMethodRefOrDef false cenv env (GetMethodRefInfoOfMethodSpecInfo minfo)) + if List.isEmpty minst then + GetMethodDefOrRefAsUncodedToken (GetMethodRefInfoAsMethodRefOrDef false cenv env (GetMethodRefInfoOfMethodSpecInfo minfo)) + else + getUncodedToken TableNames.MethodSpec (GetMethodSpecInfoAsMethodSpecIdx cenv env minfo) and GetMethodSpecAsUncodedToken cenv env mspec = GetMethodSpecInfoAsUncodedToken cenv env (InfoOfMethodSpec mspec) @@ -2349,17 +2317,7 @@ let GenILMethodBody mname cenv env (il: ILMethodBody) = // -------------------------------------------------------------------- let rec GetFieldDefAsFieldDefRow cenv env (fd: ILFieldDef) = - let flags = - GetMemberAccessFlags fd.Access ||| - (if fd.IsStatic then 0x0010 else 0x0) ||| - (if fd.IsInitOnly then 0x0020 else 0x0) ||| - (if fd.IsLiteral then 0x0040 else 0x0) ||| - (if fd.NotSerialized then 0x0080 else 0x0) ||| - (if fd.IsSpecialName then 0x0200 else 0x0) ||| - (if fd.IsSpecialName then 0x0400 else 0x0) ||| // REVIEW: RTSpecialName - (if (fd.LiteralValue <> None) then 0x8000 else 0x0) ||| - (if (fd.Marshal <> None) then 0x1000 else 0x0) ||| - (if (fd.Data <> None) then 0x0100 else 0x0) + let flags = int fd.Attributes UnsharedRow [| UShort (uint16 flags) StringE (GetStringHeapIdx cenv fd.Name) @@ -2517,7 +2475,7 @@ let GenReturnPass3 cenv (returnv: ILReturn) = let GetMethodDefSigAsBytes cenv env (mdef: ILMethodDef) = emitBytesViaBuffer (fun bb -> bb.EmitByte (callconvToByte mdef.GenericParams.Length mdef.CallingConv) - if mdef.GenericParams.Length > 0 then bb.EmitZ32 mdef.GenericParams.Length + if not (List.isEmpty mdef.GenericParams) then bb.EmitZ32 mdef.GenericParams.Length bb.EmitZ32 mdef.Parameters.Length EmitType cenv env bb mdef.Return.Type mdef.ParameterTypes |> List.iter (EmitType cenv env bb)) @@ -2526,40 +2484,9 @@ let GenMethodDefSigAsBlobIdx cenv env mdef = GetBytesAsBlobIdx cenv (GetMethodDefSigAsBytes cenv env mdef) let GenMethodDefAsRow cenv env midx (md: ILMethodDef) = - let flags = - GetMemberAccessFlags md.Access ||| - (if (match md.mdKind with - | MethodKind.Static | MethodKind.Cctor -> true - | _ -> false) then 0x0010 else 0x0) ||| - (if (match md.mdKind with MethodKind.Virtual vinfo -> vinfo.IsFinal | _ -> false) then 0x0020 else 0x0) ||| - (if (match md.mdKind with MethodKind.Virtual _ -> true | _ -> false) then 0x0040 else 0x0) ||| - (if md.IsHideBySig then 0x0080 else 0x0) ||| - (if (match md.mdKind with MethodKind.Virtual vinfo -> vinfo.IsCheckAccessOnOverride | _ -> false) then 0x0200 else 0x0) ||| - (if (match md.mdKind with MethodKind.Virtual vinfo -> vinfo.IsNewSlot | _ -> false) then 0x0100 else 0x0) ||| - (if (match md.mdKind with MethodKind.Virtual vinfo -> vinfo.IsAbstract | _ -> false) then 0x0400 else 0x0) ||| - (if md.IsSpecialName then 0x0800 else 0x0) ||| - (if (match md.mdBody.Contents with MethodBody.PInvoke _ -> true | _ -> false) then 0x2000 else 0x0) ||| - (if md.IsUnmanagedExport then 0x0008 else 0x0) ||| - (if - (match md.mdKind with - | MethodKind.Ctor | MethodKind.Cctor -> true - | _ -> false) then 0x1000 else 0x0) ||| // RTSpecialName - (if md.IsReqSecObj then 0x8000 else 0x0) ||| - (if md.HasSecurity || not md.SecurityDecls.AsList.IsEmpty then 0x4000 else 0x0) + let flags = md.Attributes - let implflags = - (match md.mdCodeKind with - | MethodCodeKind.Native -> 0x0001 - | MethodCodeKind.Runtime -> 0x0003 - | MethodCodeKind.IL -> 0x0000) ||| - (if md.IsInternalCall then 0x1000 else 0x0000) ||| - (if md.IsManaged then 0x0000 else 0x0004) ||| - (if md.IsForwardRef then 0x0010 else 0x0000) ||| - (if md.IsPreserveSig then 0x0080 else 0x0000) ||| - (if md.IsSynchronized then 0x0020 else 0x0000) ||| - (if md.IsMustRun then 0x0040 else 0x0000) ||| - (if (md.IsNoInline || (match md.mdBody.Contents with MethodBody.IL il -> il.NoInlining | _ -> false)) then 0x0008 else 0x0000) ||| - (if (md.IsAggressiveInline || (match md.mdBody.Contents with MethodBody.IL il -> il.AggressiveInlining | _ -> false)) then 0x0100 else 0x0000) + let implflags = md.ImplAttributes if md.IsEntryPoint then if cenv.entrypoint <> None then failwith "duplicate entrypoint" @@ -2698,10 +2625,7 @@ and GetPropertySigAsBytes cenv env prop = prop.Args |> List.iter (EmitType cenv env bb)) and GetPropertyAsPropertyRow cenv env (prop:ILPropertyDef) = - let flags = - (if prop.IsSpecialName then 0x0200 else 0x0) ||| - (if prop.IsRTSpecialName then 0x0400 else 0x0) ||| - (if prop.Init <> None then 0x1000 else 0x0) + let flags = prop.Attributes UnsharedRow [| UShort (uint16 flags) StringE (GetStringHeapIdx cenv prop.Name) @@ -2733,9 +2657,7 @@ let rec GenEventMethodSemanticsPass3 cenv eidx kind mref = /// ILEventDef --> Event Row + MethodSemantics entries and GenEventAsEventRow cenv env (md: ILEventDef) = - let flags = - (if md.IsSpecialName then 0x0200 else 0x0) ||| - (if md.IsRTSpecialName then 0x0400 else 0x0) + let flags = md.Attributes let tdorTag, tdorRow = GetTypeOptionAsTypeDefOrRef cenv env md.Type UnsharedRow [| UShort (uint16 flags) @@ -2861,8 +2783,7 @@ and GenNestedExportedTypesPass3 cenv nidx (nce: ILNestedExportedTypes) = and GenExportedTypePass3 cenv (ce: ILExportedTypeOrForwarder) = let nselem, nelem = GetTypeNameAsElemPair cenv ce.Name - let flags = GetTypeAccessFlags ce.Access - let flags = if ce.IsForwarder then 0x00200000 ||| flags else flags + let flags = int32 ce.Attributes let impl = GetScopeRefAsImplementationElem cenv ce.ScopeRef let cidx = AddUnsharedRow cenv TableNames.ExportedType diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index f8baa3aea4c..760ac9e428a 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -423,22 +423,15 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou list.ToArray() |> Array.sortWith scopeSorter collectScopes scope |> Seq.iter(fun s -> - if s.Children.Length = 0 then - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - 0, s.EndOffset - s.StartOffset ) |>ignore - else - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - s.StartOffset, s.EndOffset - s.StartOffset) |>ignore - - for localVariable in s.Locals do - lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) - ) + metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), + Unchecked.defaultof, + nextHandle lastLocalVariableHandle, + Unchecked.defaultof, + s.StartOffset, s.EndOffset - s.StartOffset ) |>ignore + + for localVariable in s.Locals do + lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) + ) match minfo.RootScope with | None -> () diff --git a/src/buildfromsource/FSharp.Build/AssemblyInfo.fs b/src/buildfromsource/FSharp.Build/AssemblyInfo.fs index a7a7514f325..a4e379030c7 100644 --- a/src/buildfromsource/FSharp.Build/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Build/AssemblyInfo.fs @@ -8,7 +8,7 @@ open System.Reflection [] [] [] -[] -[] +[] +[] [] do() diff --git a/src/buildfromsource/FSharp.Build/FSBuild.fs b/src/buildfromsource/FSharp.Build/FSBuild.fs index f4e36cd07a1..5b94476c3d3 100644 --- a/src/buildfromsource/FSharp.Build/FSBuild.fs +++ b/src/buildfromsource/FSharp.Build/FSBuild.fs @@ -16,14 +16,14 @@ type internal SR private() = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t diff --git a/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj b/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj index 4fe08c815b5..05d080ccfa7 100644 --- a/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj +++ b/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj @@ -17,7 +17,6 @@ FSBuild.resx - @@ -47,6 +46,11 @@ {BuildSuffix} + + Microsoft.FSharp.Overrides.NetSdk.targets + {BuildSuffix} + + diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs index 927c3df7027..0b84de0ded6 100644 --- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] +[] +[] [] do() diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs index bc255ecfc74..e5391e9bda9 100644 --- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs +++ b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs @@ -16,14 +16,14 @@ type internal SR private() = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 7cea584c57f..bdfcb71eee2 100644 --- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -8,7 +8,6 @@ FSharp.Compiler.Interactive.Settings $(NoWarn);45;55;62;75;1182;1204 true - true $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 @@ -18,7 +17,6 @@ FSInteractiveSettings.resx - diff --git a/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs b/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs index 83e8163f373..48330e2d1a3 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] +[] +[] [] do() diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index 63c331ab68d..cfcb45aa717 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -16,14 +16,14 @@ type internal SR private() = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t @@ -595,3714 +595,3723 @@ type internal SR private() = /// The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '%s' and '%s'. Consider using type annotations to resolve the ambiguity /// (Originally from ..\FSComp.txt:163) static member typrelCannotResolveImplicitGenericInstantiation(a0 : System.String, a1 : System.String) = (331, GetStringFunc("typrelCannotResolveImplicitGenericInstantiation",",,,%s,,,%s,,,") a0 a1) - /// Could not resolve the ambiguity inherent in the use of the operator '%s' at or near this program point. Consider using type annotations to resolve the ambiguity. - /// (Originally from ..\FSComp.txt:164) - static member typrelCannotResolveAmbiguityInOverloadedOperator(a0 : System.String) = (332, GetStringFunc("typrelCannotResolveAmbiguityInOverloadedOperator",",,,%s,,,") a0) /// Could not resolve the ambiguity inherent in the use of a 'printf'-style format string - /// (Originally from ..\FSComp.txt:165) + /// (Originally from ..\FSComp.txt:164) static member typrelCannotResolveAmbiguityInPrintf() = (333, GetStringFunc("typrelCannotResolveAmbiguityInPrintf",",,,") ) /// Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position - /// (Originally from ..\FSComp.txt:166) + /// (Originally from ..\FSComp.txt:165) static member typrelCannotResolveAmbiguityInEnum() = (334, GetStringFunc("typrelCannotResolveAmbiguityInEnum",",,,") ) /// Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position - /// (Originally from ..\FSComp.txt:167) + /// (Originally from ..\FSComp.txt:166) static member typrelCannotResolveAmbiguityInDelegate() = (335, GetStringFunc("typrelCannotResolveAmbiguityInDelegate",",,,") ) /// Invalid value - /// (Originally from ..\FSComp.txt:168) + /// (Originally from ..\FSComp.txt:167) static member typrelInvalidValue() = (337, GetStringFunc("typrelInvalidValue",",,,") ) /// The signature and implementation are not compatible because the respective type parameter counts differ - /// (Originally from ..\FSComp.txt:169) + /// (Originally from ..\FSComp.txt:168) static member typrelSigImplNotCompatibleParamCountsDiffer() = (338, GetStringFunc("typrelSigImplNotCompatibleParamCountsDiffer",",,,") ) /// The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation - /// (Originally from ..\FSComp.txt:170) + /// (Originally from ..\FSComp.txt:169) static member typrelSigImplNotCompatibleCompileTimeRequirementsDiffer() = (339, GetStringFunc("typrelSigImplNotCompatibleCompileTimeRequirementsDiffer",",,,") ) /// The signature and implementation are not compatible because the declaration of the type parameter '%s' requires a constraint of the form %s - /// (Originally from ..\FSComp.txt:171) + /// (Originally from ..\FSComp.txt:170) static member typrelSigImplNotCompatibleConstraintsDiffer(a0 : System.String, a1 : System.String) = (340, GetStringFunc("typrelSigImplNotCompatibleConstraintsDiffer",",,,%s,,,%s,,,") a0 a1) /// The signature and implementation are not compatible because the type parameter '%s' has a constraint of the form %s but the implementation does not. Either remove this constraint from the signature or add it to the implementation. - /// (Originally from ..\FSComp.txt:172) + /// (Originally from ..\FSComp.txt:171) static member typrelSigImplNotCompatibleConstraintsDifferRemove(a0 : System.String, a1 : System.String) = (341, GetStringFunc("typrelSigImplNotCompatibleConstraintsDifferRemove",",,,%s,,,%s,,,") a0 a1) /// The type '%s' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' - /// (Originally from ..\FSComp.txt:173) + /// (Originally from ..\FSComp.txt:172) static member typrelTypeImplementsIComparableShouldOverrideObjectEquals(a0 : System.String) = (342, GetStringFunc("typrelTypeImplementsIComparableShouldOverrideObjectEquals",",,,%s,,,") a0) /// The type '%s' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly - /// (Originally from ..\FSComp.txt:174) + /// (Originally from ..\FSComp.txt:173) static member typrelTypeImplementsIComparableDefaultObjectEqualsProvided(a0 : System.String) = (343, GetStringFunc("typrelTypeImplementsIComparableDefaultObjectEqualsProvided",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type - /// (Originally from ..\FSComp.txt:175) + /// (Originally from ..\FSComp.txt:174) static member typrelExplicitImplementationOfGetHashCodeOrEquals(a0 : System.String) = (344, GetStringFunc("typrelExplicitImplementationOfGetHashCodeOrEquals",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' - /// (Originally from ..\FSComp.txt:176) + /// (Originally from ..\FSComp.txt:175) static member typrelExplicitImplementationOfGetHashCode(a0 : System.String) = (345, GetStringFunc("typrelExplicitImplementationOfGetHashCode",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' - /// (Originally from ..\FSComp.txt:177) + /// (Originally from ..\FSComp.txt:176) static member typrelExplicitImplementationOfEquals(a0 : System.String) = (346, GetStringFunc("typrelExplicitImplementationOfEquals",",,,%s,,,") a0) /// The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ..\FSComp.txt:178) + /// (Originally from ..\FSComp.txt:177) static member ExceptionDefsNotCompatibleHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleHiddenBySignature",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ..\FSComp.txt:179) + /// (Originally from ..\FSComp.txt:178) static member ExceptionDefsNotCompatibleDotNetRepresentationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleDotNetRepresentationsDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:180) + /// (Originally from ..\FSComp.txt:179) static member ExceptionDefsNotCompatibleAbbreviationHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleAbbreviationHiddenBySignature",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:181) + /// (Originally from ..\FSComp.txt:180) static member ExceptionDefsNotCompatibleSignaturesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleSignaturesDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:182) + /// (Originally from ..\FSComp.txt:181) static member ExceptionDefsNotCompatibleExceptionDeclarationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleExceptionDeclarationsDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the field '%s' was required by the signature but was not specified by the implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:183) + /// (Originally from ..\FSComp.txt:182) static member ExceptionDefsNotCompatibleFieldInSigButNotImpl(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInSigButNotImpl",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The exception definitions are not compatible because the field '%s' was present in the implementation but not in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:184) + /// (Originally from ..\FSComp.txt:183) static member ExceptionDefsNotCompatibleFieldInImplButNotSig(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInImplButNotSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:185) + /// (Originally from ..\FSComp.txt:184) static member ExceptionDefsNotCompatibleFieldOrderDiffers(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldOrderDiffers",",,,%s,,,%s,,,") a0 a1) /// The namespace or module attributes differ between signature and implementation - /// (Originally from ..\FSComp.txt:186) + /// (Originally from ..\FSComp.txt:185) static member typrelModuleNamespaceAttributesDifferInSigAndImpl() = (355, GetStringFunc("typrelModuleNamespaceAttributesDifferInSigAndImpl",",,,") ) /// This method is over-constrained in its type parameters - /// (Originally from ..\FSComp.txt:187) + /// (Originally from ..\FSComp.txt:186) static member typrelMethodIsOverconstrained() = (356, GetStringFunc("typrelMethodIsOverconstrained",",,,") ) /// No implementations of '%s' had the correct number of arguments and type parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:188) + /// (Originally from ..\FSComp.txt:187) static member typrelOverloadNotFound(a0 : System.String, a1 : System.String) = (357, GetStringFunc("typrelOverloadNotFound",",,,%s,,,%s,,,") a0 a1) /// The override for '%s' was ambiguous - /// (Originally from ..\FSComp.txt:189) + /// (Originally from ..\FSComp.txt:188) static member typrelOverrideWasAmbiguous(a0 : System.String) = (358, GetStringFunc("typrelOverrideWasAmbiguous",",,,%s,,,") a0) /// More than one override implements '%s' - /// (Originally from ..\FSComp.txt:190) + /// (Originally from ..\FSComp.txt:189) static member typrelMoreThenOneOverride(a0 : System.String) = (359, GetStringFunc("typrelMoreThenOneOverride",",,,%s,,,") a0) /// The method '%s' is sealed and cannot be overridden - /// (Originally from ..\FSComp.txt:191) + /// (Originally from ..\FSComp.txt:190) static member typrelMethodIsSealed(a0 : System.String) = (360, GetStringFunc("typrelMethodIsSealed",",,,%s,,,") a0) /// The override '%s' implements more than one abstract slot, e.g. '%s' and '%s' - /// (Originally from ..\FSComp.txt:192) + /// (Originally from ..\FSComp.txt:191) static member typrelOverrideImplementsMoreThenOneSlot(a0 : System.String, a1 : System.String, a2 : System.String) = (361, GetStringFunc("typrelOverrideImplementsMoreThenOneSlot",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Duplicate or redundant interface - /// (Originally from ..\FSComp.txt:193) + /// (Originally from ..\FSComp.txt:192) static member typrelDuplicateInterface() = (362, GetStringFunc("typrelDuplicateInterface",",,,") ) /// The interface '%s' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. - /// (Originally from ..\FSComp.txt:194) + /// (Originally from ..\FSComp.txt:193) static member typrelNeedExplicitImplementation(a0 : System.String) = (363, GetStringFunc("typrelNeedExplicitImplementation",",,,%s,,,") a0) /// A named argument has been assigned more than one value - /// (Originally from ..\FSComp.txt:195) + /// (Originally from ..\FSComp.txt:194) static member typrelNamedArgumentHasBeenAssignedMoreThenOnce() = (364, GetStringFunc("typrelNamedArgumentHasBeenAssignedMoreThenOnce",",,,") ) /// No implementation was given for '%s' - /// (Originally from ..\FSComp.txt:196) + /// (Originally from ..\FSComp.txt:195) static member typrelNoImplementationGiven(a0 : System.String) = (365, GetStringFunc("typrelNoImplementationGiven",",,,%s,,,") a0) /// No implementation was given for '%s'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - /// (Originally from ..\FSComp.txt:197) + /// (Originally from ..\FSComp.txt:196) static member typrelNoImplementationGivenWithSuggestion(a0 : System.String) = (366, GetStringFunc("typrelNoImplementationGivenWithSuggestion",",,,%s,,,") a0) /// The member '%s' does not have the correct number of arguments. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:198) + /// (Originally from ..\FSComp.txt:197) static member typrelMemberDoesNotHaveCorrectNumberOfArguments(a0 : System.String, a1 : System.String) = (367, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfArguments",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not have the correct number of method type parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:199) + /// (Originally from ..\FSComp.txt:198) static member typrelMemberDoesNotHaveCorrectNumberOfTypeParameters(a0 : System.String, a1 : System.String) = (368, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfTypeParameters",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not have the correct kinds of generic parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:200) + /// (Originally from ..\FSComp.txt:199) static member typrelMemberDoesNotHaveCorrectKindsOfGenericParameters(a0 : System.String, a1 : System.String) = (369, GetStringFunc("typrelMemberDoesNotHaveCorrectKindsOfGenericParameters",",,,%s,,,%s,,,") a0 a1) /// The member '%s' cannot be used to implement '%s'. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:201) + /// (Originally from ..\FSComp.txt:200) static member typrelMemberCannotImplement(a0 : System.String, a1 : System.String, a2 : System.String) = (370, GetStringFunc("typrelMemberCannotImplement",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Error while parsing embedded IL - /// (Originally from ..\FSComp.txt:202) + /// (Originally from ..\FSComp.txt:201) static member astParseEmbeddedILError() = (371, GetStringFunc("astParseEmbeddedILError",",,,") ) /// Error while parsing embedded IL type - /// (Originally from ..\FSComp.txt:203) + /// (Originally from ..\FSComp.txt:202) static member astParseEmbeddedILTypeError() = (372, GetStringFunc("astParseEmbeddedILTypeError",",,,") ) /// This indexer notation has been removed from the F# language - /// (Originally from ..\FSComp.txt:204) + /// (Originally from ..\FSComp.txt:203) static member astDeprecatedIndexerNotation() = (GetStringFunc("astDeprecatedIndexerNotation",",,,") ) /// Invalid expression on left of assignment - /// (Originally from ..\FSComp.txt:205) + /// (Originally from ..\FSComp.txt:204) static member astInvalidExprLeftHandOfAssignment() = (374, GetStringFunc("astInvalidExprLeftHandOfAssignment",",,,") ) /// The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. - /// (Originally from ..\FSComp.txt:206) + /// (Originally from ..\FSComp.txt:205) static member augNoRefEqualsOnStruct() = (376, GetStringFunc("augNoRefEqualsOnStruct",",,,") ) /// This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' - /// (Originally from ..\FSComp.txt:207) + /// (Originally from ..\FSComp.txt:206) static member augInvalidAttrs() = (377, GetStringFunc("augInvalidAttrs",",,,") ) /// The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute - /// (Originally from ..\FSComp.txt:208) + /// (Originally from ..\FSComp.txt:207) static member augNoEqualityNeedsNoComparison() = (378, GetStringFunc("augNoEqualityNeedsNoComparison",",,,") ) /// The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute - /// (Originally from ..\FSComp.txt:209) + /// (Originally from ..\FSComp.txt:208) static member augStructCompNeedsStructEquality() = (379, GetStringFunc("augStructCompNeedsStructEquality",",,,") ) /// The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:210) + /// (Originally from ..\FSComp.txt:209) static member augStructEqNeedsNoCompOrStructComp() = (380, GetStringFunc("augStructEqNeedsNoCompOrStructComp",",,,") ) /// A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:211) + /// (Originally from ..\FSComp.txt:210) static member augTypeCantHaveRefEqAndStructAttrs() = (381, GetStringFunc("augTypeCantHaveRefEqAndStructAttrs",",,,") ) /// Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:212) + /// (Originally from ..\FSComp.txt:211) static member augOnlyCertainTypesCanHaveAttrs() = (382, GetStringFunc("augOnlyCertainTypesCanHaveAttrs",",,,") ) /// A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ..\FSComp.txt:213) + /// (Originally from ..\FSComp.txt:212) static member augRefEqCantHaveObjEquals() = (383, GetStringFunc("augRefEqCantHaveObjEquals",",,,") ) /// A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ..\FSComp.txt:214) + /// (Originally from ..\FSComp.txt:213) static member augCustomEqNeedsObjEquals() = (384, GetStringFunc("augCustomEqNeedsObjEquals",",,,") ) /// A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' - /// (Originally from ..\FSComp.txt:215) + /// (Originally from ..\FSComp.txt:214) static member augCustomCompareNeedsIComp() = (385, GetStringFunc("augCustomCompareNeedsIComp",",,,") ) /// A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ..\FSComp.txt:216) + /// (Originally from ..\FSComp.txt:215) static member augNoEqNeedsNoObjEquals() = (386, GetStringFunc("augNoEqNeedsNoObjEquals",",,,") ) /// A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ..\FSComp.txt:217) + /// (Originally from ..\FSComp.txt:216) static member augNoCompCantImpIComp() = (386, GetStringFunc("augNoCompCantImpIComp",",,,") ) /// The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes - /// (Originally from ..\FSComp.txt:218) + /// (Originally from ..\FSComp.txt:217) static member augCustomEqNeedsNoCompOrCustomComp() = (387, GetStringFunc("augCustomEqNeedsNoCompOrCustomComp",",,,") ) /// Positional specifiers are not permitted in format strings - /// (Originally from ..\FSComp.txt:219) + /// (Originally from ..\FSComp.txt:218) static member forPositionalSpecifiersNotPermitted() = (GetStringFunc("forPositionalSpecifiersNotPermitted",",,,") ) /// Missing format specifier - /// (Originally from ..\FSComp.txt:220) + /// (Originally from ..\FSComp.txt:219) static member forMissingFormatSpecifier() = (GetStringFunc("forMissingFormatSpecifier",",,,") ) /// '%s' flag set twice - /// (Originally from ..\FSComp.txt:221) + /// (Originally from ..\FSComp.txt:220) static member forFlagSetTwice(a0 : System.String) = (GetStringFunc("forFlagSetTwice",",,,%s,,,") a0) /// Prefix flag (' ' or '+') set twice - /// (Originally from ..\FSComp.txt:222) + /// (Originally from ..\FSComp.txt:221) static member forPrefixFlagSpacePlusSetTwice() = (GetStringFunc("forPrefixFlagSpacePlusSetTwice",",,,") ) /// The # formatting modifier is invalid in F# - /// (Originally from ..\FSComp.txt:223) + /// (Originally from ..\FSComp.txt:222) static member forHashSpecifierIsInvalid() = (GetStringFunc("forHashSpecifierIsInvalid",",,,") ) /// Bad precision in format specifier - /// (Originally from ..\FSComp.txt:224) + /// (Originally from ..\FSComp.txt:223) static member forBadPrecision() = (GetStringFunc("forBadPrecision",",,,") ) /// Bad width in format specifier - /// (Originally from ..\FSComp.txt:225) + /// (Originally from ..\FSComp.txt:224) static member forBadWidth() = (GetStringFunc("forBadWidth",",,,") ) /// '%s' format does not support '0' flag - /// (Originally from ..\FSComp.txt:226) + /// (Originally from ..\FSComp.txt:225) static member forDoesNotSupportZeroFlag(a0 : System.String) = (GetStringFunc("forDoesNotSupportZeroFlag",",,,%s,,,") a0) /// Precision missing after the '.' - /// (Originally from ..\FSComp.txt:227) + /// (Originally from ..\FSComp.txt:226) static member forPrecisionMissingAfterDot() = (GetStringFunc("forPrecisionMissingAfterDot",",,,") ) /// '%s' format does not support precision - /// (Originally from ..\FSComp.txt:228) + /// (Originally from ..\FSComp.txt:227) static member forFormatDoesntSupportPrecision(a0 : System.String) = (GetStringFunc("forFormatDoesntSupportPrecision",",,,%s,,,") a0) /// Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:229) + /// (Originally from ..\FSComp.txt:228) static member forBadFormatSpecifier() = (GetStringFunc("forBadFormatSpecifier",",,,") ) /// The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:230) + /// (Originally from ..\FSComp.txt:229) static member forLIsUnnecessary() = (GetStringFunc("forLIsUnnecessary",",,,") ) /// The 'h' or 'H' in this format specifier is unnecessary. You can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:231) + /// (Originally from ..\FSComp.txt:230) static member forHIsUnnecessary() = (GetStringFunc("forHIsUnnecessary",",,,") ) /// '%s' does not support prefix '%s' flag - /// (Originally from ..\FSComp.txt:232) + /// (Originally from ..\FSComp.txt:231) static member forDoesNotSupportPrefixFlag(a0 : System.String, a1 : System.String) = (GetStringFunc("forDoesNotSupportPrefixFlag",",,,%s,,,%s,,,") a0 a1) /// Bad format specifier: '%s' - /// (Originally from ..\FSComp.txt:233) + /// (Originally from ..\FSComp.txt:232) static member forBadFormatSpecifierGeneral(a0 : System.String) = (GetStringFunc("forBadFormatSpecifierGeneral",",,,%s,,,") a0) /// System.Environment.Exit did not exit - /// (Originally from ..\FSComp.txt:234) + /// (Originally from ..\FSComp.txt:233) static member elSysEnvExitDidntExit() = (GetStringFunc("elSysEnvExitDidntExit",",,,") ) /// The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined - /// (Originally from ..\FSComp.txt:235) + /// (Originally from ..\FSComp.txt:234) static member elDeprecatedOperator() = (GetStringFunc("elDeprecatedOperator",",,,") ) /// A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. - /// (Originally from ..\FSComp.txt:236) + /// (Originally from ..\FSComp.txt:235) static member chkProtectedOrBaseCalled() = (405, GetStringFunc("chkProtectedOrBaseCalled",",,,") ) /// The byref-typed variable '%s' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. - /// (Originally from ..\FSComp.txt:237) + /// (Originally from ..\FSComp.txt:236) static member chkByrefUsedInInvalidWay(a0 : System.String) = (406, GetStringFunc("chkByrefUsedInInvalidWay",",,,%s,,,") a0) /// The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. - /// (Originally from ..\FSComp.txt:238) + /// (Originally from ..\FSComp.txt:237) static member chkBaseUsedInInvalidWay() = (408, GetStringFunc("chkBaseUsedInInvalidWay",",,,") ) /// The variable '%s' is used in an invalid way - /// (Originally from ..\FSComp.txt:239) + /// (Originally from ..\FSComp.txt:238) static member chkVariableUsedInInvalidWay(a0 : System.String) = (GetStringFunc("chkVariableUsedInInvalidWay",",,,%s,,,") a0) /// The type '%s' is less accessible than the value, member or type '%s' it is used in. - /// (Originally from ..\FSComp.txt:240) + /// (Originally from ..\FSComp.txt:239) static member chkTypeLessAccessibleThanType(a0 : System.String, a1 : System.String) = (410, GetStringFunc("chkTypeLessAccessibleThanType",",,,%s,,,%s,,,") a0 a1) /// 'System.Void' can only be used as 'typeof' in F# - /// (Originally from ..\FSComp.txt:241) + /// (Originally from ..\FSComp.txt:240) static member chkSystemVoidOnlyInTypeof() = (411, GetStringFunc("chkSystemVoidOnlyInTypeof",",,,") ) /// A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - /// (Originally from ..\FSComp.txt:242) + /// (Originally from ..\FSComp.txt:241) static member chkErrorUseOfByref() = (412, GetStringFunc("chkErrorUseOfByref",",,,") ) /// Calls to 'reraise' may only occur directly in a handler of a try-with - /// (Originally from ..\FSComp.txt:243) + /// (Originally from ..\FSComp.txt:242) static member chkErrorContainsCallToRethrow() = (413, GetStringFunc("chkErrorContainsCallToRethrow",",,,") ) /// Expression-splicing operators may only be used within quotations - /// (Originally from ..\FSComp.txt:244) + /// (Originally from ..\FSComp.txt:243) static member chkSplicingOnlyInQuotations() = (414, GetStringFunc("chkSplicingOnlyInQuotations",",,,") ) /// First-class uses of the expression-splicing operator are not permitted - /// (Originally from ..\FSComp.txt:245) + /// (Originally from ..\FSComp.txt:244) static member chkNoFirstClassSplicing() = (415, GetStringFunc("chkNoFirstClassSplicing",",,,") ) /// First-class uses of the address-of operators are not permitted - /// (Originally from ..\FSComp.txt:246) + /// (Originally from ..\FSComp.txt:245) static member chkNoFirstClassAddressOf() = (416, GetStringFunc("chkNoFirstClassAddressOf",",,,") ) /// First-class uses of the 'reraise' function is not permitted - /// (Originally from ..\FSComp.txt:247) + /// (Originally from ..\FSComp.txt:246) static member chkNoFirstClassRethrow() = (417, GetStringFunc("chkNoFirstClassRethrow",",,,") ) /// The byref typed value '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:248) + /// (Originally from ..\FSComp.txt:247) static member chkNoByrefAtThisPoint(a0 : System.String) = (418, GetStringFunc("chkNoByrefAtThisPoint",",,,%s,,,") a0) /// 'base' values may only be used to make direct calls to the base implementations of overridden members - /// (Originally from ..\FSComp.txt:249) + /// (Originally from ..\FSComp.txt:248) static member chkLimitationsOfBaseKeyword() = (419, GetStringFunc("chkLimitationsOfBaseKeyword",",,,") ) /// Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - /// (Originally from ..\FSComp.txt:250) + /// (Originally from ..\FSComp.txt:249) static member chkObjCtorsCantUseExceptionHandling() = (420, GetStringFunc("chkObjCtorsCantUseExceptionHandling",",,,") ) /// The address of the variable '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:251) + /// (Originally from ..\FSComp.txt:250) static member chkNoAddressOfAtThisPoint(a0 : System.String) = (421, GetStringFunc("chkNoAddressOfAtThisPoint",",,,%s,,,") a0) /// The address of the static field '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:252) + /// (Originally from ..\FSComp.txt:251) static member chkNoAddressStaticFieldAtThisPoint(a0 : System.String) = (422, GetStringFunc("chkNoAddressStaticFieldAtThisPoint",",,,%s,,,") a0) /// The address of the field '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:253) + /// (Originally from ..\FSComp.txt:252) static member chkNoAddressFieldAtThisPoint(a0 : System.String) = (423, GetStringFunc("chkNoAddressFieldAtThisPoint",",,,%s,,,") a0) /// The address of an array element cannot be used at this point - /// (Originally from ..\FSComp.txt:254) + /// (Originally from ..\FSComp.txt:253) static member chkNoAddressOfArrayElementAtThisPoint() = (424, GetStringFunc("chkNoAddressOfArrayElementAtThisPoint",",,,") ) /// The type of a first-class function cannot contain byrefs - /// (Originally from ..\FSComp.txt:255) + /// (Originally from ..\FSComp.txt:254) static member chkFirstClassFuncNoByref() = (425, GetStringFunc("chkFirstClassFuncNoByref",",,,") ) /// A method return type would contain byrefs which is not permitted - /// (Originally from ..\FSComp.txt:256) + /// (Originally from ..\FSComp.txt:255) static member chkReturnTypeNoByref() = (426, GetStringFunc("chkReturnTypeNoByref",",,,") ) /// Invalid custom attribute value (not a constant or literal) - /// (Originally from ..\FSComp.txt:257) + /// (Originally from ..\FSComp.txt:256) static member chkInvalidCustAttrVal() = (428, GetStringFunc("chkInvalidCustAttrVal",",,,") ) /// The attribute type '%s' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. - /// (Originally from ..\FSComp.txt:258) + /// (Originally from ..\FSComp.txt:257) static member chkAttrHasAllowMultiFalse(a0 : System.String) = (429, GetStringFunc("chkAttrHasAllowMultiFalse",",,,%s,,,") a0) /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to its definition at or near '%s'. This is an invalid forward reference. - /// (Originally from ..\FSComp.txt:259) + /// (Originally from ..\FSComp.txt:258) static member chkMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (430, GetStringFunc("chkMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// A byref typed value would be stored here. Top-level let-bound byref values are not permitted. - /// (Originally from ..\FSComp.txt:260) + /// (Originally from ..\FSComp.txt:259) static member chkNoByrefAsTopValue() = (431, GetStringFunc("chkNoByrefAsTopValue",",,,") ) /// [] terms cannot contain uses of the prefix splice operator '%%' - /// (Originally from ..\FSComp.txt:261) + /// (Originally from ..\FSComp.txt:260) static member chkReflectedDefCantSplice() = (432, GetStringFunc("chkReflectedDefCantSplice",",,,") ) /// A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. - /// (Originally from ..\FSComp.txt:262) + /// (Originally from ..\FSComp.txt:261) static member chkEntryPointUsage() = (433, GetStringFunc("chkEntryPointUsage",",,,") ) /// compiled form of the union case - /// (Originally from ..\FSComp.txt:263) + /// (Originally from ..\FSComp.txt:262) static member chkUnionCaseCompiledForm() = (GetStringFunc("chkUnionCaseCompiledForm",",,,") ) /// default augmentation of the union case - /// (Originally from ..\FSComp.txt:264) + /// (Originally from ..\FSComp.txt:263) static member chkUnionCaseDefaultAugmentation() = (GetStringFunc("chkUnionCaseDefaultAugmentation",",,,") ) /// The property '%s' has the same name as a method in type '%s'. - /// (Originally from ..\FSComp.txt:265) + /// (Originally from ..\FSComp.txt:264) static member chkPropertySameNameMethod(a0 : System.String, a1 : System.String) = (434, GetStringFunc("chkPropertySameNameMethod",",,,%s,,,%s,,,") a0 a1) /// The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well. - /// (Originally from ..\FSComp.txt:266) + /// (Originally from ..\FSComp.txt:265) static member chkGetterSetterDoNotMatchAbstract(a0 : System.String, a1 : System.String) = (435, GetStringFunc("chkGetterSetterDoNotMatchAbstract",",,,%s,,,%s,,,") a0 a1) /// The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. - /// (Originally from ..\FSComp.txt:267) + /// (Originally from ..\FSComp.txt:266) static member chkPropertySameNameIndexer(a0 : System.String, a1 : System.String) = (436, GetStringFunc("chkPropertySameNameIndexer",",,,%s,,,%s,,,") a0 a1) /// A type would store a byref typed value. This is not permitted by Common IL. - /// (Originally from ..\FSComp.txt:268) + /// (Originally from ..\FSComp.txt:267) static member chkCantStoreByrefValue() = (437, GetStringFunc("chkCantStoreByrefValue",",,,") ) /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s'. - /// (Originally from ..\FSComp.txt:270) + /// (Originally from ..\FSComp.txt:269) static member chkDuplicateMethod(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethod",",,,%s,,,%s,,,") a0 a1) /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:271) + /// (Originally from ..\FSComp.txt:270) static member chkDuplicateMethodWithSuffix(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethodWithSuffix",",,,%s,,,%s,,,") a0 a1) /// The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. - /// (Originally from ..\FSComp.txt:272) + /// (Originally from ..\FSComp.txt:271) static member chkDuplicateMethodCurried(a0 : System.String, a1 : System.String) = (439, GetStringFunc("chkDuplicateMethodCurried",",,,%s,,,%s,,,") a0 a1) /// Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments - /// (Originally from ..\FSComp.txt:273) + /// (Originally from ..\FSComp.txt:272) static member chkCurriedMethodsCantHaveOutParams() = (440, GetStringFunc("chkCurriedMethodsCantHaveOutParams",",,,") ) /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s'. - /// (Originally from ..\FSComp.txt:274) + /// (Originally from ..\FSComp.txt:273) static member chkDuplicateProperty(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicateProperty",",,,%s,,,%s,,,") a0 a1) /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:275) + /// (Originally from ..\FSComp.txt:274) static member chkDuplicatePropertyWithSuffix(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicatePropertyWithSuffix",",,,%s,,,%s,,,") a0 a1) /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type. - /// (Originally from ..\FSComp.txt:276) + /// (Originally from ..\FSComp.txt:275) static member chkDuplicateMethodInheritedType(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedType",",,,%s,,,") a0) /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:277) + /// (Originally from ..\FSComp.txt:276) static member chkDuplicateMethodInheritedTypeWithSuffix(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedTypeWithSuffix",",,,%s,,,") a0) /// This type implements the same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#. - /// (Originally from ..\FSComp.txt:278) + /// (Originally from ..\FSComp.txt:277) static member chkMultipleGenericInterfaceInstantiations(a0 : System.String, a1 : System.String) = (443, GetStringFunc("chkMultipleGenericInterfaceInstantiations",",,,%s,,,%s,,,") a0 a1) /// The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check - /// (Originally from ..\FSComp.txt:279) + /// (Originally from ..\FSComp.txt:278) static member chkValueWithDefaultValueMustHaveDefaultValue() = (444, GetStringFunc("chkValueWithDefaultValueMustHaveDefaultValue",",,,") ) /// The type abbreviation contains byrefs. This is not permitted by F#. - /// (Originally from ..\FSComp.txt:280) + /// (Originally from ..\FSComp.txt:279) static member chkNoByrefInTypeAbbrev() = (445, GetStringFunc("chkNoByrefInTypeAbbrev",",,,") ) /// The variable '%s' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. - /// (Originally from ..\FSComp.txt:281) + /// (Originally from ..\FSComp.txt:280) static member crefBoundVarUsedInSplice(a0 : System.String) = (446, GetStringFunc("crefBoundVarUsedInSplice",",,,%s,,,") a0) /// Quotations cannot contain uses of generic expressions - /// (Originally from ..\FSComp.txt:282) + /// (Originally from ..\FSComp.txt:281) static member crefQuotationsCantContainGenericExprs() = (447, GetStringFunc("crefQuotationsCantContainGenericExprs",",,,") ) /// Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. - /// (Originally from ..\FSComp.txt:283) + /// (Originally from ..\FSComp.txt:282) static member crefQuotationsCantContainGenericFunctions() = (448, GetStringFunc("crefQuotationsCantContainGenericFunctions",",,,") ) /// Quotations cannot contain object expressions - /// (Originally from ..\FSComp.txt:284) + /// (Originally from ..\FSComp.txt:283) static member crefQuotationsCantContainObjExprs() = (449, GetStringFunc("crefQuotationsCantContainObjExprs",",,,") ) /// Quotations cannot contain expressions that take the address of a field - /// (Originally from ..\FSComp.txt:285) + /// (Originally from ..\FSComp.txt:284) static member crefQuotationsCantContainAddressOf() = (450, GetStringFunc("crefQuotationsCantContainAddressOf",",,,") ) /// Quotations cannot contain expressions that fetch static fields - /// (Originally from ..\FSComp.txt:286) + /// (Originally from ..\FSComp.txt:285) static member crefQuotationsCantContainStaticFieldRef() = (451, GetStringFunc("crefQuotationsCantContainStaticFieldRef",",,,") ) /// Quotations cannot contain inline assembly code or pattern matching on arrays - /// (Originally from ..\FSComp.txt:287) + /// (Originally from ..\FSComp.txt:286) static member crefQuotationsCantContainInlineIL() = (452, GetStringFunc("crefQuotationsCantContainInlineIL",",,,") ) /// Quotations cannot contain descending for loops - /// (Originally from ..\FSComp.txt:288) + /// (Originally from ..\FSComp.txt:287) static member crefQuotationsCantContainDescendingForLoops() = (453, GetStringFunc("crefQuotationsCantContainDescendingForLoops",",,,") ) /// Quotations cannot contain expressions that fetch union case indexes - /// (Originally from ..\FSComp.txt:289) + /// (Originally from ..\FSComp.txt:288) static member crefQuotationsCantFetchUnionIndexes() = (454, GetStringFunc("crefQuotationsCantFetchUnionIndexes",",,,") ) /// Quotations cannot contain expressions that set union case fields - /// (Originally from ..\FSComp.txt:290) + /// (Originally from ..\FSComp.txt:289) static member crefQuotationsCantSetUnionFields() = (455, GetStringFunc("crefQuotationsCantSetUnionFields",",,,") ) /// Quotations cannot contain expressions that set fields in exception values - /// (Originally from ..\FSComp.txt:291) + /// (Originally from ..\FSComp.txt:290) static member crefQuotationsCantSetExceptionFields() = (456, GetStringFunc("crefQuotationsCantSetExceptionFields",",,,") ) /// Quotations cannot contain expressions that require byref pointers - /// (Originally from ..\FSComp.txt:292) + /// (Originally from ..\FSComp.txt:291) static member crefQuotationsCantRequireByref() = (457, GetStringFunc("crefQuotationsCantRequireByref",",,,") ) /// Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call - /// (Originally from ..\FSComp.txt:293) + /// (Originally from ..\FSComp.txt:292) static member crefQuotationsCantCallTraitMembers() = (458, GetStringFunc("crefQuotationsCantCallTraitMembers",",,,") ) /// Quotations cannot contain this kind of constant - /// (Originally from ..\FSComp.txt:294) + /// (Originally from ..\FSComp.txt:293) static member crefQuotationsCantContainThisConstant() = (459, GetStringFunc("crefQuotationsCantContainThisConstant",",,,") ) /// Quotations cannot contain this kind of pattern match - /// (Originally from ..\FSComp.txt:295) + /// (Originally from ..\FSComp.txt:294) static member crefQuotationsCantContainThisPatternMatch() = (460, GetStringFunc("crefQuotationsCantContainThisPatternMatch",",,,") ) /// Quotations cannot contain array pattern matching - /// (Originally from ..\FSComp.txt:296) + /// (Originally from ..\FSComp.txt:295) static member crefQuotationsCantContainArrayPatternMatching() = (461, GetStringFunc("crefQuotationsCantContainArrayPatternMatching",",,,") ) /// Quotations cannot contain this kind of type - /// (Originally from ..\FSComp.txt:297) + /// (Originally from ..\FSComp.txt:296) static member crefQuotationsCantContainThisType() = (462, GetStringFunc("crefQuotationsCantContainThisType",",,,") ) /// The declared type parameter '%s' cannot be used here since the type parameter cannot be resolved at compile time - /// (Originally from ..\FSComp.txt:298) + /// (Originally from ..\FSComp.txt:297) static member csTypeCannotBeResolvedAtCompileTime(a0 : System.String) = (GetStringFunc("csTypeCannotBeResolvedAtCompileTime",",,,%s,,,") a0) /// This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'. - /// (Originally from ..\FSComp.txt:299) + /// (Originally from ..\FSComp.txt:298) static member csCodeLessGeneric() = (464, GetStringFunc("csCodeLessGeneric",",,,") ) /// Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. - /// (Originally from ..\FSComp.txt:300) + /// (Originally from ..\FSComp.txt:299) static member csTypeInferenceMaxDepth() = (465, GetStringFunc("csTypeInferenceMaxDepth",",,,") ) /// Expected arguments to an instance member - /// (Originally from ..\FSComp.txt:301) + /// (Originally from ..\FSComp.txt:300) static member csExpectedArguments() = (GetStringFunc("csExpectedArguments",",,,") ) /// This indexer expects %d arguments but is here given %d - /// (Originally from ..\FSComp.txt:302) + /// (Originally from ..\FSComp.txt:301) static member csIndexArgumentMismatch(a0 : System.Int32, a1 : System.Int32) = (GetStringFunc("csIndexArgumentMismatch",",,,%d,,,%d,,,") a0 a1) /// Expecting a type supporting the operator '%s' but given a function type. You may be missing an argument to a function. - /// (Originally from ..\FSComp.txt:303) + /// (Originally from ..\FSComp.txt:302) static member csExpectTypeWithOperatorButGivenFunction(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenFunction",",,,%s,,,") a0) /// Expecting a type supporting the operator '%s' but given a tuple type - /// (Originally from ..\FSComp.txt:304) + /// (Originally from ..\FSComp.txt:303) static member csExpectTypeWithOperatorButGivenTuple(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenTuple",",,,%s,,,") a0) /// None of the types '%s' support the operator '%s' - /// (Originally from ..\FSComp.txt:305) + /// (Originally from ..\FSComp.txt:304) static member csTypesDoNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperator",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support the operator '%s' - /// (Originally from ..\FSComp.txt:306) + /// (Originally from ..\FSComp.txt:305) static member csTypeDoesNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperator",",,,%s,,,%s,,,") a0 a1) /// None of the types '%s' support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:307) + /// (Originally from ..\FSComp.txt:306) static member csTypesDoNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:308) + /// (Originally from ..\FSComp.txt:307) static member csTypeDoesNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support a conversion to the type '%s' - /// (Originally from ..\FSComp.txt:309) + /// (Originally from ..\FSComp.txt:308) static member csTypeDoesNotSupportConversion(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportConversion",",,,%s,,,%s,,,") a0 a1) /// The type '%s' has a method '%s' (full name '%s'), but the method is static - /// (Originally from ..\FSComp.txt:310) + /// (Originally from ..\FSComp.txt:309) static member csMethodFoundButIsStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type '%s' has a method '%s' (full name '%s'), but the method is not static - /// (Originally from ..\FSComp.txt:311) + /// (Originally from ..\FSComp.txt:310) static member csMethodFoundButIsNotStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsNotStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The constraints 'struct' and 'not struct' are inconsistent - /// (Originally from ..\FSComp.txt:312) + /// (Originally from ..\FSComp.txt:311) static member csStructConstraintInconsistent() = (472, GetStringFunc("csStructConstraintInconsistent",",,,") ) /// The type '%s' does not have 'null' as a proper value - /// (Originally from ..\FSComp.txt:313) + /// (Originally from ..\FSComp.txt:312) static member csTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csTypeDoesNotHaveNull",",,,%s,,,") a0) /// The type '%s' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. - /// (Originally from ..\FSComp.txt:314) + /// (Originally from ..\FSComp.txt:313) static member csNullableTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csNullableTypeDoesNotHaveNull",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint because it has the 'NoComparison' attribute - /// (Originally from ..\FSComp.txt:315) + /// (Originally from ..\FSComp.txt:314) static member csTypeDoesNotSupportComparison1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison1",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface - /// (Originally from ..\FSComp.txt:316) + /// (Originally from ..\FSComp.txt:315) static member csTypeDoesNotSupportComparison2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison2",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison - /// (Originally from ..\FSComp.txt:317) + /// (Originally from ..\FSComp.txt:316) static member csTypeDoesNotSupportComparison3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison3",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it has the 'NoEquality' attribute - /// (Originally from ..\FSComp.txt:318) + /// (Originally from ..\FSComp.txt:317) static member csTypeDoesNotSupportEquality1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality1",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it is a function type - /// (Originally from ..\FSComp.txt:319) + /// (Originally from ..\FSComp.txt:318) static member csTypeDoesNotSupportEquality2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality2",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality - /// (Originally from ..\FSComp.txt:320) + /// (Originally from ..\FSComp.txt:319) static member csTypeDoesNotSupportEquality3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality3",",,,%s,,,") a0) /// The type '%s' is not a CLI enum type - /// (Originally from ..\FSComp.txt:321) + /// (Originally from ..\FSComp.txt:320) static member csTypeIsNotEnumType(a0 : System.String) = (GetStringFunc("csTypeIsNotEnumType",",,,%s,,,") a0) /// The type '%s' has a non-standard delegate type - /// (Originally from ..\FSComp.txt:322) + /// (Originally from ..\FSComp.txt:321) static member csTypeHasNonStandardDelegateType(a0 : System.String) = (GetStringFunc("csTypeHasNonStandardDelegateType",",,,%s,,,") a0) /// The type '%s' is not a CLI delegate type - /// (Originally from ..\FSComp.txt:323) + /// (Originally from ..\FSComp.txt:322) static member csTypeIsNotDelegateType(a0 : System.String) = (GetStringFunc("csTypeIsNotDelegateType",",,,%s,,,") a0) /// This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. - /// (Originally from ..\FSComp.txt:324) + /// (Originally from ..\FSComp.txt:323) static member csTypeParameterCannotBeNullable() = (GetStringFunc("csTypeParameterCannotBeNullable",",,,") ) /// A generic construct requires that the type '%s' is a CLI or F# struct type - /// (Originally from ..\FSComp.txt:325) + /// (Originally from ..\FSComp.txt:324) static member csGenericConstructRequiresStructType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresStructType",",,,%s,,,") a0) /// A generic construct requires that the type '%s' is an unmanaged type - /// (Originally from ..\FSComp.txt:326) + /// (Originally from ..\FSComp.txt:325) static member csGenericConstructRequiresUnmanagedType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresUnmanagedType",",,,%s,,,") a0) /// The type '%s' is not compatible with any of the types %s, arising from the use of a printf-style format string - /// (Originally from ..\FSComp.txt:327) + /// (Originally from ..\FSComp.txt:326) static member csTypeNotCompatibleBecauseOfPrintf(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeNotCompatibleBecauseOfPrintf",",,,%s,,,%s,,,") a0 a1) /// A generic construct requires that the type '%s' have reference semantics, but it does not, i.e. it is a struct - /// (Originally from ..\FSComp.txt:328) + /// (Originally from ..\FSComp.txt:327) static member csGenericConstructRequiresReferenceSemantics(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresReferenceSemantics",",,,%s,,,") a0) /// A generic construct requires that the type '%s' be non-abstract - /// (Originally from ..\FSComp.txt:329) + /// (Originally from ..\FSComp.txt:328) static member csGenericConstructRequiresNonAbstract(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresNonAbstract",",,,%s,,,") a0) /// A generic construct requires that the type '%s' have a public default constructor - /// (Originally from ..\FSComp.txt:330) + /// (Originally from ..\FSComp.txt:329) static member csGenericConstructRequiresPublicDefaultConstructor(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresPublicDefaultConstructor",",,,%s,,,") a0) /// Type instantiation length mismatch - /// (Originally from ..\FSComp.txt:331) + /// (Originally from ..\FSComp.txt:330) static member csTypeInstantiationLengthMismatch() = (483, GetStringFunc("csTypeInstantiationLengthMismatch",",,,") ) /// Optional arguments not permitted here - /// (Originally from ..\FSComp.txt:332) + /// (Originally from ..\FSComp.txt:331) static member csOptionalArgumentNotPermittedHere() = (484, GetStringFunc("csOptionalArgumentNotPermittedHere",",,,") ) /// %s is not a static member - /// (Originally from ..\FSComp.txt:333) + /// (Originally from ..\FSComp.txt:332) static member csMemberIsNotStatic(a0 : System.String) = (485, GetStringFunc("csMemberIsNotStatic",",,,%s,,,") a0) /// %s is not an instance member - /// (Originally from ..\FSComp.txt:334) + /// (Originally from ..\FSComp.txt:333) static member csMemberIsNotInstance(a0 : System.String) = (486, GetStringFunc("csMemberIsNotInstance",",,,%s,,,") a0) /// Argument length mismatch - /// (Originally from ..\FSComp.txt:335) + /// (Originally from ..\FSComp.txt:334) static member csArgumentLengthMismatch() = (487, GetStringFunc("csArgumentLengthMismatch",",,,") ) /// The argument types don't match - /// (Originally from ..\FSComp.txt:336) + /// (Originally from ..\FSComp.txt:335) static member csArgumentTypesDoNotMatch() = (488, GetStringFunc("csArgumentTypesDoNotMatch",",,,") ) /// This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument - /// (Originally from ..\FSComp.txt:337) + /// (Originally from ..\FSComp.txt:336) static member csMethodExpectsParams() = (489, GetStringFunc("csMethodExpectsParams",",,,") ) /// The member or object constructor '%s' is not %s - /// (Originally from ..\FSComp.txt:338) + /// (Originally from ..\FSComp.txt:337) static member csMemberIsNotAccessible(a0 : System.String, a1 : System.String) = (490, GetStringFunc("csMemberIsNotAccessible",",,,%s,,,%s,,,") a0 a1) /// The member or object constructor '%s' is not %s. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. - /// (Originally from ..\FSComp.txt:339) + /// (Originally from ..\FSComp.txt:338) static member csMemberIsNotAccessible2(a0 : System.String, a1 : System.String) = (491, GetStringFunc("csMemberIsNotAccessible2",",,,%s,,,%s,,,") a0 a1) /// %s is not a static method - /// (Originally from ..\FSComp.txt:340) + /// (Originally from ..\FSComp.txt:339) static member csMethodIsNotAStaticMethod(a0 : System.String) = (492, GetStringFunc("csMethodIsNotAStaticMethod",",,,%s,,,") a0) /// %s is not an instance method - /// (Originally from ..\FSComp.txt:341) + /// (Originally from ..\FSComp.txt:340) static member csMethodIsNotAnInstanceMethod(a0 : System.String) = (493, GetStringFunc("csMethodIsNotAnInstanceMethod",",,,%s,,,") a0) /// The member or object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ..\FSComp.txt:342) + /// (Originally from ..\FSComp.txt:341) static member csMemberHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMemberHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ..\FSComp.txt:343) + /// (Originally from ..\FSComp.txt:342) static member csCtorHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csCtorHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The required signature is %s - /// (Originally from ..\FSComp.txt:344) + /// (Originally from ..\FSComp.txt:343) static member csRequiredSignatureIs(a0 : System.String) = (495, GetStringFunc("csRequiredSignatureIs",",,,%s,,,") a0) /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:345) + /// (Originally from ..\FSComp.txt:344) static member csMemberSignatureMismatch(a0 : System.String, a1 : System.Int32, a2 : System.String) = (496, GetStringFunc("csMemberSignatureMismatch",",,,%s,,,%d,,,%s,,,") a0 a1 a2) /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:346) + /// (Originally from ..\FSComp.txt:345) static member csMemberSignatureMismatch2(a0 : System.String, a1 : System.Int32, a2 : System.String) = (497, GetStringFunc("csMemberSignatureMismatch2",",,,%s,,,%d,,,%s,,,") a0 a1 a2) /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ..\FSComp.txt:347) + /// (Originally from ..\FSComp.txt:346) static member csMemberSignatureMismatch3(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (498, GetStringFunc("csMemberSignatureMismatch3",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ..\FSComp.txt:348) + /// (Originally from ..\FSComp.txt:347) static member csMemberSignatureMismatch4(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (499, GetStringFunc("csMemberSignatureMismatch4",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' requires %d argument(s) but is here given %d unnamed and %d named argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:349) + /// (Originally from ..\FSComp.txt:348) static member csMemberSignatureMismatchArityNamed(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.Int32, a4 : System.String) = (500, GetStringFunc("csMemberSignatureMismatchArityNamed",",,,%s,,,%d,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3 a4) /// The member or object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:350) + /// (Originally from ..\FSComp.txt:349) static member csMemberSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csMemberSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:351) + /// (Originally from ..\FSComp.txt:350) static member csCtorSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). - /// (Originally from ..\FSComp.txt:352) + /// (Originally from ..\FSComp.txt:351) static member csCtorSignatureMismatchArityProp(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArityProp",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' takes %d type argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:353) + /// (Originally from ..\FSComp.txt:352) static member csMemberSignatureMismatchArityType(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (502, GetStringFunc("csMemberSignatureMismatchArityType",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// A member or object constructor '%s' taking %d arguments is not accessible from this code location. All accessible versions of method '%s' take %d arguments. - /// (Originally from ..\FSComp.txt:354) + /// (Originally from ..\FSComp.txt:353) static member csMemberNotAccessible(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.Int32) = (503, GetStringFunc("csMemberNotAccessible",",,,%s,,,%d,,,%s,,,%d,,,") a0 a1 a2 a3) /// Incorrect generic instantiation. No %s member named '%s' takes %d generic arguments. - /// (Originally from ..\FSComp.txt:355) + /// (Originally from ..\FSComp.txt:354) static member csIncorrectGenericInstantiation(a0 : System.String, a1 : System.String, a2 : System.Int32) = (504, GetStringFunc("csIncorrectGenericInstantiation",",,,%s,,,%s,,,%d,,,") a0 a1 a2) /// The member or object constructor '%s' does not take %d argument(s). An overload was found taking %d arguments. - /// (Originally from ..\FSComp.txt:356) + /// (Originally from ..\FSComp.txt:355) static member csMemberOverloadArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (505, GetStringFunc("csMemberOverloadArityMismatch",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// No %s member or object constructor named '%s' takes %d arguments - /// (Originally from ..\FSComp.txt:357) + /// (Originally from ..\FSComp.txt:356) static member csNoMemberTakesTheseArguments(a0 : System.String, a1 : System.String, a2 : System.Int32) = (506, GetStringFunc("csNoMemberTakesTheseArguments",",,,%s,,,%s,,,%d,,,") a0 a1 a2) /// No %s member or object constructor named '%s' takes %d arguments. Note the call to this member also provides %d named arguments. - /// (Originally from ..\FSComp.txt:358) + /// (Originally from ..\FSComp.txt:357) static member csNoMemberTakesTheseArguments2(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.Int32) = (507, GetStringFunc("csNoMemberTakesTheseArguments2",",,,%s,,,%s,,,%d,,,%d,,,") a0 a1 a2 a3) /// No %s member or object constructor named '%s' takes %d arguments. The named argument '%s' doesn't correspond to any argument or settable return property for any overload. - /// (Originally from ..\FSComp.txt:359) + /// (Originally from ..\FSComp.txt:358) static member csNoMemberTakesTheseArguments3(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (508, GetStringFunc("csNoMemberTakesTheseArguments3",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) /// Method or object constructor '%s' not found - /// (Originally from ..\FSComp.txt:360) + /// (Originally from ..\FSComp.txt:359) static member csMethodNotFound(a0 : System.String) = (509, GetStringFunc("csMethodNotFound",",,,%s,,,") a0) /// No overloads match for method '%s'. - /// (Originally from ..\FSComp.txt:361) + /// (Originally from ..\FSComp.txt:360) static member csNoOverloadsFound(a0 : System.String) = (GetStringFunc("csNoOverloadsFound",",,,%s,,,") a0) /// A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed. - /// (Originally from ..\FSComp.txt:362) + /// (Originally from ..\FSComp.txt:361) static member csMethodIsOverloaded(a0 : System.String) = (GetStringFunc("csMethodIsOverloaded",",,,%s,,,") a0) /// Candidates: %s - /// (Originally from ..\FSComp.txt:363) + /// (Originally from ..\FSComp.txt:362) static member csCandidates(a0 : System.String) = (GetStringFunc("csCandidates",",,,%s,,,") a0) /// The available overloads are shown below. - /// (Originally from ..\FSComp.txt:364) + /// (Originally from ..\FSComp.txt:363) static member csSeeAvailableOverloads() = (GetStringFunc("csSeeAvailableOverloads",",,,") ) /// Accessibility modifiers are not permitted on 'do' bindings, but '%s' was given. - /// (Originally from ..\FSComp.txt:365) + /// (Originally from ..\FSComp.txt:364) static member parsDoCannotHaveVisibilityDeclarations(a0 : System.String) = (512, GetStringFunc("parsDoCannotHaveVisibilityDeclarations",",,,%s,,,") a0) /// End of file in #if section begun at or after here - /// (Originally from ..\FSComp.txt:366) + /// (Originally from ..\FSComp.txt:365) static member parsEofInHashIf() = (513, GetStringFunc("parsEofInHashIf",",,,") ) /// End of file in string begun at or before here - /// (Originally from ..\FSComp.txt:367) + /// (Originally from ..\FSComp.txt:366) static member parsEofInString() = (514, GetStringFunc("parsEofInString",",,,") ) /// End of file in verbatim string begun at or before here - /// (Originally from ..\FSComp.txt:368) + /// (Originally from ..\FSComp.txt:367) static member parsEofInVerbatimString() = (515, GetStringFunc("parsEofInVerbatimString",",,,") ) /// End of file in comment begun at or before here - /// (Originally from ..\FSComp.txt:369) + /// (Originally from ..\FSComp.txt:368) static member parsEofInComment() = (516, GetStringFunc("parsEofInComment",",,,") ) /// End of file in string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:370) + /// (Originally from ..\FSComp.txt:369) static member parsEofInStringInComment() = (517, GetStringFunc("parsEofInStringInComment",",,,") ) /// End of file in verbatim string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:371) + /// (Originally from ..\FSComp.txt:370) static member parsEofInVerbatimStringInComment() = (518, GetStringFunc("parsEofInVerbatimStringInComment",",,,") ) /// End of file in IF-OCAML section begun at or before here - /// (Originally from ..\FSComp.txt:372) + /// (Originally from ..\FSComp.txt:371) static member parsEofInIfOcaml() = (519, GetStringFunc("parsEofInIfOcaml",",,,") ) /// End of file in directive begun at or before here - /// (Originally from ..\FSComp.txt:373) + /// (Originally from ..\FSComp.txt:372) static member parsEofInDirective() = (520, GetStringFunc("parsEofInDirective",",,,") ) /// No #endif found for #if or #else - /// (Originally from ..\FSComp.txt:374) + /// (Originally from ..\FSComp.txt:373) static member parsNoHashEndIfFound() = (521, GetStringFunc("parsNoHashEndIfFound",",,,") ) /// Attributes have been ignored in this construct - /// (Originally from ..\FSComp.txt:375) + /// (Originally from ..\FSComp.txt:374) static member parsAttributesIgnored() = (522, GetStringFunc("parsAttributesIgnored",",,,") ) /// 'use' bindings are not permitted in primary constructors - /// (Originally from ..\FSComp.txt:376) + /// (Originally from ..\FSComp.txt:375) static member parsUseBindingsIllegalInImplicitClassConstructors() = (523, GetStringFunc("parsUseBindingsIllegalInImplicitClassConstructors",",,,") ) /// 'use' bindings are not permitted in modules and are treated as 'let' bindings - /// (Originally from ..\FSComp.txt:377) + /// (Originally from ..\FSComp.txt:376) static member parsUseBindingsIllegalInModules() = (524, GetStringFunc("parsUseBindingsIllegalInModules",",,,") ) /// An integer for loop must use a simple identifier - /// (Originally from ..\FSComp.txt:378) + /// (Originally from ..\FSComp.txt:377) static member parsIntegerForLoopRequiresSimpleIdentifier() = (525, GetStringFunc("parsIntegerForLoopRequiresSimpleIdentifier",",,,") ) /// At most one 'with' augmentation is permitted - /// (Originally from ..\FSComp.txt:379) + /// (Originally from ..\FSComp.txt:378) static member parsOnlyOneWithAugmentationAllowed() = (526, GetStringFunc("parsOnlyOneWithAugmentationAllowed",",,,") ) /// A semicolon is not expected at this point - /// (Originally from ..\FSComp.txt:380) + /// (Originally from ..\FSComp.txt:379) static member parsUnexpectedSemicolon() = (527, GetStringFunc("parsUnexpectedSemicolon",",,,") ) /// Unexpected end of input - /// (Originally from ..\FSComp.txt:381) + /// (Originally from ..\FSComp.txt:380) static member parsUnexpectedEndOfFile() = (528, GetStringFunc("parsUnexpectedEndOfFile",",,,") ) /// Accessibility modifiers are not permitted here, but '%s' was given. - /// (Originally from ..\FSComp.txt:382) + /// (Originally from ..\FSComp.txt:381) static member parsUnexpectedVisibilityDeclaration(a0 : System.String) = (529, GetStringFunc("parsUnexpectedVisibilityDeclaration",",,,%s,,,") a0) /// Only '#' compiler directives may occur prior to the first 'namespace' declaration - /// (Originally from ..\FSComp.txt:383) + /// (Originally from ..\FSComp.txt:382) static member parsOnlyHashDirectivesAllowed() = (530, GetStringFunc("parsOnlyHashDirectivesAllowed",",,,") ) /// Accessibility modifiers should come immediately prior to the identifier naming a construct - /// (Originally from ..\FSComp.txt:384) + /// (Originally from ..\FSComp.txt:383) static member parsVisibilityDeclarationsShouldComePriorToIdentifier() = (531, GetStringFunc("parsVisibilityDeclarationsShouldComePriorToIdentifier",",,,") ) /// Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' - /// (Originally from ..\FSComp.txt:385) + /// (Originally from ..\FSComp.txt:384) static member parsNamespaceOrModuleNotBoth() = (532, GetStringFunc("parsNamespaceOrModuleNotBoth",",,,") ) /// A module abbreviation must be a simple name, not a path - /// (Originally from ..\FSComp.txt:386) + /// (Originally from ..\FSComp.txt:385) static member parsModuleAbbreviationMustBeSimpleName() = (534, GetStringFunc("parsModuleAbbreviationMustBeSimpleName",",,,") ) /// Ignoring attributes on module abbreviation - /// (Originally from ..\FSComp.txt:387) + /// (Originally from ..\FSComp.txt:386) static member parsIgnoreAttributesOnModuleAbbreviation() = (535, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviation",",,,") ) /// The '%s' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ..\FSComp.txt:388) + /// (Originally from ..\FSComp.txt:387) static member parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (536, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) /// The '%s' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ..\FSComp.txt:389) + /// (Originally from ..\FSComp.txt:388) static member parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (537, GetStringFunc("parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) /// Unclosed block - /// (Originally from ..\FSComp.txt:390) + /// (Originally from ..\FSComp.txt:389) static member parsUnClosedBlockInHashLight() = (538, GetStringFunc("parsUnClosedBlockInHashLight",",,,") ) /// Unmatched 'begin' or 'struct' - /// (Originally from ..\FSComp.txt:391) + /// (Originally from ..\FSComp.txt:390) static member parsUnmatchedBeginOrStruct() = (539, GetStringFunc("parsUnmatchedBeginOrStruct",",,,") ) /// A module name must be a simple name, not a path - /// (Originally from ..\FSComp.txt:392) + /// (Originally from ..\FSComp.txt:391) static member parsModuleDefnMustBeSimpleName() = (541, GetStringFunc("parsModuleDefnMustBeSimpleName",",,,") ) /// Unexpected empty type moduleDefn list - /// (Originally from ..\FSComp.txt:393) + /// (Originally from ..\FSComp.txt:392) static member parsUnexpectedEmptyModuleDefn() = (542, GetStringFunc("parsUnexpectedEmptyModuleDefn",",,,") ) /// Attributes should be placed before 'val' - /// (Originally from ..\FSComp.txt:394) + /// (Originally from ..\FSComp.txt:393) static member parsAttributesMustComeBeforeVal() = (GetStringFunc("parsAttributesMustComeBeforeVal",",,,") ) /// Attributes are not permitted on interface implementations - /// (Originally from ..\FSComp.txt:395) + /// (Originally from ..\FSComp.txt:394) static member parsAttributesAreNotPermittedOnInterfaceImplementations() = (543, GetStringFunc("parsAttributesAreNotPermittedOnInterfaceImplementations",",,,") ) /// Syntax error - /// (Originally from ..\FSComp.txt:396) + /// (Originally from ..\FSComp.txt:395) static member parsSyntaxError() = (544, GetStringFunc("parsSyntaxError",",,,") ) /// Augmentations are not permitted on delegate type moduleDefns - /// (Originally from ..\FSComp.txt:397) + /// (Originally from ..\FSComp.txt:396) static member parsAugmentationsIllegalOnDelegateType() = (545, GetStringFunc("parsAugmentationsIllegalOnDelegateType",",,,") ) /// Unmatched 'class', 'interface' or 'struct' - /// (Originally from ..\FSComp.txt:398) + /// (Originally from ..\FSComp.txt:397) static member parsUnmatchedClassInterfaceOrStruct() = (546, GetStringFunc("parsUnmatchedClassInterfaceOrStruct",",,,") ) /// A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. - /// (Originally from ..\FSComp.txt:399) + /// (Originally from ..\FSComp.txt:398) static member parsEmptyTypeDefinition() = (547, GetStringFunc("parsEmptyTypeDefinition",",,,") ) /// Unmatched 'with' or badly formatted 'with' block - /// (Originally from ..\FSComp.txt:400) + /// (Originally from ..\FSComp.txt:399) static member parsUnmatchedWith() = (550, GetStringFunc("parsUnmatchedWith",",,,") ) /// 'get', 'set' or 'get,set' required - /// (Originally from ..\FSComp.txt:401) + /// (Originally from ..\FSComp.txt:400) static member parsGetOrSetRequired() = (551, GetStringFunc("parsGetOrSetRequired",",,,") ) /// Only class types may take value arguments - /// (Originally from ..\FSComp.txt:402) + /// (Originally from ..\FSComp.txt:401) static member parsOnlyClassCanTakeValueArguments() = (552, GetStringFunc("parsOnlyClassCanTakeValueArguments",",,,") ) /// Unmatched 'begin' - /// (Originally from ..\FSComp.txt:403) + /// (Originally from ..\FSComp.txt:402) static member parsUnmatchedBegin() = (553, GetStringFunc("parsUnmatchedBegin",",,,") ) /// Invalid declaration syntax - /// (Originally from ..\FSComp.txt:404) + /// (Originally from ..\FSComp.txt:403) static member parsInvalidDeclarationSyntax() = (554, GetStringFunc("parsInvalidDeclarationSyntax",",,,") ) /// 'get' and/or 'set' required - /// (Originally from ..\FSComp.txt:405) + /// (Originally from ..\FSComp.txt:404) static member parsGetAndOrSetRequired() = (555, GetStringFunc("parsGetAndOrSetRequired",",,,") ) /// Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' - /// (Originally from ..\FSComp.txt:406) + /// (Originally from ..\FSComp.txt:405) static member parsTypeAnnotationsOnGetSet() = (556, GetStringFunc("parsTypeAnnotationsOnGetSet",",,,") ) /// A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' - /// (Originally from ..\FSComp.txt:407) + /// (Originally from ..\FSComp.txt:406) static member parsGetterMustHaveAtLeastOneArgument() = (557, GetStringFunc("parsGetterMustHaveAtLeastOneArgument",",,,") ) /// Multiple accessibilities given for property getter or setter - /// (Originally from ..\FSComp.txt:408) + /// (Originally from ..\FSComp.txt:407) static member parsMultipleAccessibilitiesForGetSet() = (558, GetStringFunc("parsMultipleAccessibilitiesForGetSet",",,,") ) /// Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' - /// (Originally from ..\FSComp.txt:409) + /// (Originally from ..\FSComp.txt:408) static member parsSetSyntax() = (559, GetStringFunc("parsSetSyntax",",,,") ) /// Interfaces always have the same visibility as the enclosing type - /// (Originally from ..\FSComp.txt:410) + /// (Originally from ..\FSComp.txt:409) static member parsInterfacesHaveSameVisibilityAsEnclosingType() = (560, GetStringFunc("parsInterfacesHaveSameVisibilityAsEnclosingType",",,,") ) /// Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. - /// (Originally from ..\FSComp.txt:411) + /// (Originally from ..\FSComp.txt:410) static member parsAccessibilityModsIllegalForAbstract() = (561, GetStringFunc("parsAccessibilityModsIllegalForAbstract",",,,") ) /// Attributes are not permitted on 'inherit' declarations - /// (Originally from ..\FSComp.txt:412) + /// (Originally from ..\FSComp.txt:411) static member parsAttributesIllegalOnInherit() = (562, GetStringFunc("parsAttributesIllegalOnInherit",",,,") ) /// Accessibility modifiers are not permitted on an 'inherits' declaration - /// (Originally from ..\FSComp.txt:413) + /// (Originally from ..\FSComp.txt:412) static member parsVisibilityIllegalOnInherit() = (563, GetStringFunc("parsVisibilityIllegalOnInherit",",,,") ) /// 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. - /// (Originally from ..\FSComp.txt:414) + /// (Originally from ..\FSComp.txt:413) static member parsInheritDeclarationsCannotHaveAsBindings() = (564, GetStringFunc("parsInheritDeclarationsCannotHaveAsBindings",",,,") ) /// Attributes are not allowed here - /// (Originally from ..\FSComp.txt:415) + /// (Originally from ..\FSComp.txt:414) static member parsAttributesIllegalHere() = (565, GetStringFunc("parsAttributesIllegalHere",",,,") ) /// Accessibility modifiers are not permitted in this position for type abbreviations - /// (Originally from ..\FSComp.txt:416) + /// (Originally from ..\FSComp.txt:415) static member parsTypeAbbreviationsCannotHaveVisibilityDeclarations() = (566, GetStringFunc("parsTypeAbbreviationsCannotHaveVisibilityDeclarations",",,,") ) /// Accessibility modifiers are not permitted in this position for enum types - /// (Originally from ..\FSComp.txt:417) + /// (Originally from ..\FSComp.txt:416) static member parsEnumTypesCannotHaveVisibilityDeclarations() = (567, GetStringFunc("parsEnumTypesCannotHaveVisibilityDeclarations",",,,") ) /// All enum fields must be given values - /// (Originally from ..\FSComp.txt:418) + /// (Originally from ..\FSComp.txt:417) static member parsAllEnumFieldsRequireValues() = (568, GetStringFunc("parsAllEnumFieldsRequireValues",",,,") ) /// Accessibility modifiers are not permitted on inline assembly code types - /// (Originally from ..\FSComp.txt:419) + /// (Originally from ..\FSComp.txt:418) static member parsInlineAssemblyCannotHaveVisibilityDeclarations() = (569, GetStringFunc("parsInlineAssemblyCannotHaveVisibilityDeclarations",",,,") ) /// Unexpected identifier: '%s' - /// (Originally from ..\FSComp.txt:420) + /// (Originally from ..\FSComp.txt:419) static member parsUnexpectedIdentifier(a0 : System.String) = (571, GetStringFunc("parsUnexpectedIdentifier",",,,%s,,,") a0) /// Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. - /// (Originally from ..\FSComp.txt:421) + /// (Originally from ..\FSComp.txt:420) static member parsUnionCasesCannotHaveVisibilityDeclarations() = (572, GetStringFunc("parsUnionCasesCannotHaveVisibilityDeclarations",",,,") ) /// Accessibility modifiers are not permitted on enumeration fields - /// (Originally from ..\FSComp.txt:422) + /// (Originally from ..\FSComp.txt:421) static member parsEnumFieldsCannotHaveVisibilityDeclarations() = (573, GetStringFunc("parsEnumFieldsCannotHaveVisibilityDeclarations",",,,") ) /// Consider using a separate record type instead - /// (Originally from ..\FSComp.txt:423) + /// (Originally from ..\FSComp.txt:422) static member parsConsiderUsingSeparateRecordType() = (GetStringFunc("parsConsiderUsingSeparateRecordType",",,,") ) /// Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. - /// (Originally from ..\FSComp.txt:424) + /// (Originally from ..\FSComp.txt:423) static member parsRecordFieldsCannotHaveVisibilityDeclarations() = (575, GetStringFunc("parsRecordFieldsCannotHaveVisibilityDeclarations",",,,") ) /// The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings - /// (Originally from ..\FSComp.txt:425) + /// (Originally from ..\FSComp.txt:424) static member parsLetAndForNonRecBindings() = (576, GetStringFunc("parsLetAndForNonRecBindings",",,,") ) /// Unmatched '(' - /// (Originally from ..\FSComp.txt:426) + /// (Originally from ..\FSComp.txt:425) static member parsUnmatchedParen() = (583, GetStringFunc("parsUnmatchedParen",",,,") ) /// Successive patterns should be separated by spaces or tupled - /// (Originally from ..\FSComp.txt:427) + /// (Originally from ..\FSComp.txt:426) static member parsSuccessivePatternsShouldBeSpacedOrTupled() = (584, GetStringFunc("parsSuccessivePatternsShouldBeSpacedOrTupled",",,,") ) /// No matching 'in' found for this 'let' - /// (Originally from ..\FSComp.txt:428) + /// (Originally from ..\FSComp.txt:427) static member parsNoMatchingInForLet() = (586, GetStringFunc("parsNoMatchingInForLet",",,,") ) /// Error in the return expression for this 'let'. Possible incorrect indentation. - /// (Originally from ..\FSComp.txt:429) + /// (Originally from ..\FSComp.txt:428) static member parsErrorInReturnForLetIncorrectIndentation() = (587, GetStringFunc("parsErrorInReturnForLetIncorrectIndentation",",,,") ) /// The block following this '%s' is unfinished. Every code block is an expression and must have a result. '%s' cannot be the final code element in a block. Consider giving this block an explicit result. - /// (Originally from ..\FSComp.txt:430) + /// (Originally from ..\FSComp.txt:429) static member parsExpectedExpressionAfterLet(a0 : System.String, a1 : System.String) = (588, GetStringFunc("parsExpectedExpressionAfterLet",",,,%s,,,%s,,,") a0 a1) /// Incomplete conditional. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:431) + /// (Originally from ..\FSComp.txt:430) static member parsIncompleteIf() = (589, GetStringFunc("parsIncompleteIf",",,,") ) /// 'assert' may not be used as a first class value. Use 'assert ' instead. - /// (Originally from ..\FSComp.txt:432) + /// (Originally from ..\FSComp.txt:431) static member parsAssertIsNotFirstClassValue() = (590, GetStringFunc("parsAssertIsNotFirstClassValue",",,,") ) /// Identifier expected - /// (Originally from ..\FSComp.txt:433) + /// (Originally from ..\FSComp.txt:432) static member parsIdentifierExpected() = (594, GetStringFunc("parsIdentifierExpected",",,,") ) /// 'in' or '=' expected - /// (Originally from ..\FSComp.txt:434) + /// (Originally from ..\FSComp.txt:433) static member parsInOrEqualExpected() = (595, GetStringFunc("parsInOrEqualExpected",",,,") ) /// The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. - /// (Originally from ..\FSComp.txt:435) + /// (Originally from ..\FSComp.txt:434) static member parsArrowUseIsLimited() = (596, GetStringFunc("parsArrowUseIsLimited",",,,") ) /// Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized - /// (Originally from ..\FSComp.txt:436) + /// (Originally from ..\FSComp.txt:435) static member parsSuccessiveArgsShouldBeSpacedOrTupled() = (597, GetStringFunc("parsSuccessiveArgsShouldBeSpacedOrTupled",",,,") ) /// Unmatched '[' - /// (Originally from ..\FSComp.txt:437) + /// (Originally from ..\FSComp.txt:436) static member parsUnmatchedBracket() = (598, GetStringFunc("parsUnmatchedBracket",",,,") ) /// Missing qualification after '.' - /// (Originally from ..\FSComp.txt:438) + /// (Originally from ..\FSComp.txt:437) static member parsMissingQualificationAfterDot() = (599, GetStringFunc("parsMissingQualificationAfterDot",",,,") ) /// In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array - /// (Originally from ..\FSComp.txt:439) + /// (Originally from ..\FSComp.txt:438) static member parsParenFormIsForML() = (GetStringFunc("parsParenFormIsForML",",,,") ) /// Mismatched quotation, beginning with '%s' - /// (Originally from ..\FSComp.txt:440) + /// (Originally from ..\FSComp.txt:439) static member parsMismatchedQuote(a0 : System.String) = (601, GetStringFunc("parsMismatchedQuote",",,,%s,,,") a0) /// Unmatched '%s' - /// (Originally from ..\FSComp.txt:441) + /// (Originally from ..\FSComp.txt:440) static member parsUnmatched(a0 : System.String) = (602, GetStringFunc("parsUnmatched",",,,%s,,,") a0) /// Unmatched '[|' - /// (Originally from ..\FSComp.txt:442) + /// (Originally from ..\FSComp.txt:441) static member parsUnmatchedBracketBar() = (603, GetStringFunc("parsUnmatchedBracketBar",",,,") ) /// Unmatched '{' - /// (Originally from ..\FSComp.txt:443) + /// (Originally from ..\FSComp.txt:442) static member parsUnmatchedBrace() = (604, GetStringFunc("parsUnmatchedBrace",",,,") ) /// Field bindings must have the form 'id = expr;' - /// (Originally from ..\FSComp.txt:444) + /// (Originally from ..\FSComp.txt:443) static member parsFieldBinding() = (609, GetStringFunc("parsFieldBinding",",,,") ) /// This member is not permitted in an object implementation - /// (Originally from ..\FSComp.txt:445) + /// (Originally from ..\FSComp.txt:444) static member parsMemberIllegalInObjectImplementation() = (610, GetStringFunc("parsMemberIllegalInObjectImplementation",",,,") ) /// Missing function body - /// (Originally from ..\FSComp.txt:446) + /// (Originally from ..\FSComp.txt:445) static member parsMissingFunctionBody() = (611, GetStringFunc("parsMissingFunctionBody",",,,") ) /// Syntax error in labelled type argument - /// (Originally from ..\FSComp.txt:447) + /// (Originally from ..\FSComp.txt:446) static member parsSyntaxErrorInLabeledType() = (613, GetStringFunc("parsSyntaxErrorInLabeledType",",,,") ) /// Unexpected infix operator in type expression - /// (Originally from ..\FSComp.txt:448) + /// (Originally from ..\FSComp.txt:447) 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:449) + /// (Originally from ..\FSComp.txt:448) static member parsMultiArgumentGenericTypeFormDeprecated() = (GetStringFunc("parsMultiArgumentGenericTypeFormDeprecated",",,,") ) /// Invalid literal in type - /// (Originally from ..\FSComp.txt:450) + /// (Originally from ..\FSComp.txt:449) static member parsInvalidLiteralInType() = (618, GetStringFunc("parsInvalidLiteralInType",",,,") ) /// Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. - /// (Originally from ..\FSComp.txt:451) + /// (Originally from ..\FSComp.txt:450) static member parsUnexpectedOperatorForUnitOfMeasure() = (619, GetStringFunc("parsUnexpectedOperatorForUnitOfMeasure",",,,") ) /// Unexpected integer literal in unit-of-measure expression - /// (Originally from ..\FSComp.txt:452) + /// (Originally from ..\FSComp.txt:451) static member parsUnexpectedIntegerLiteralForUnitOfMeasure() = (620, GetStringFunc("parsUnexpectedIntegerLiteralForUnitOfMeasure",",,,") ) /// Syntax error: unexpected type parameter specification - /// (Originally from ..\FSComp.txt:453) + /// (Originally from ..\FSComp.txt:452) static member parsUnexpectedTypeParameter() = (621, GetStringFunc("parsUnexpectedTypeParameter",",,,") ) /// Mismatched quotation operator name, beginning with '%s' - /// (Originally from ..\FSComp.txt:454) + /// (Originally from ..\FSComp.txt:453) 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:455) + /// (Originally from ..\FSComp.txt:454) static member parsActivePatternCaseMustBeginWithUpperCase() = (623, GetStringFunc("parsActivePatternCaseMustBeginWithUpperCase",",,,") ) /// The '|' character is not permitted in active pattern case identifiers - /// (Originally from ..\FSComp.txt:456) + /// (Originally from ..\FSComp.txt:455) static member parsActivePatternCaseContainsPipe() = (624, GetStringFunc("parsActivePatternCaseContainsPipe",",,,") ) /// Denominator must not be 0 in unit-of-measure exponent - /// (Originally from ..\FSComp.txt:457) + /// (Originally from ..\FSComp.txt:456) static member parsIllegalDenominatorForMeasureExponent() = (625, GetStringFunc("parsIllegalDenominatorForMeasureExponent",",,,") ) /// No '=' symbol should follow a 'namespace' declaration - /// (Originally from ..\FSComp.txt:458) + /// (Originally from ..\FSComp.txt:457) 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:459) + /// (Originally from ..\FSComp.txt:458) 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:460) + /// (Originally from ..\FSComp.txt:459) static member parsSyntaxModuleSigEndDeprecated() = (GetStringFunc("parsSyntaxModuleSigEndDeprecated",",,,") ) /// A static field was used where an instance field is expected - /// (Originally from ..\FSComp.txt:461) + /// (Originally from ..\FSComp.txt:460) static member tcStaticFieldUsedWhenInstanceFieldExpected() = (627, GetStringFunc("tcStaticFieldUsedWhenInstanceFieldExpected",",,,") ) /// Method '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:462) + /// (Originally from ..\FSComp.txt:461) static member tcMethodNotAccessible(a0 : System.String) = (629, GetStringFunc("tcMethodNotAccessible",",,,%s,,,") a0) /// Implicit product of measures following / - /// (Originally from ..\FSComp.txt:464) + /// (Originally from ..\FSComp.txt:463) static member tcImplicitMeasureFollowingSlash() = (632, GetStringFunc("tcImplicitMeasureFollowingSlash",",,,") ) /// Unexpected SynMeasure.Anon - /// (Originally from ..\FSComp.txt:465) + /// (Originally from ..\FSComp.txt:464) static member tcUnexpectedMeasureAnon() = (633, GetStringFunc("tcUnexpectedMeasureAnon",",,,") ) /// Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. - /// (Originally from ..\FSComp.txt:466) + /// (Originally from ..\FSComp.txt:465) static member tcNonZeroConstantCannotHaveGenericUnit() = (634, GetStringFunc("tcNonZeroConstantCannotHaveGenericUnit",",,,") ) /// In sequence expressions, results are generated using 'yield' - /// (Originally from ..\FSComp.txt:467) + /// (Originally from ..\FSComp.txt:466) static member tcSeqResultsUseYield() = (635, GetStringFunc("tcSeqResultsUseYield",",,,") ) /// Unexpected big rational constant - /// (Originally from ..\FSComp.txt:468) + /// (Originally from ..\FSComp.txt:467) static member tcUnexpectedBigRationalConstant() = (GetStringFunc("tcUnexpectedBigRationalConstant",",,,") ) /// Units-of-measure supported only on float, float32, decimal and signed integer types - /// (Originally from ..\FSComp.txt:469) + /// (Originally from ..\FSComp.txt:468) static member tcInvalidTypeForUnitsOfMeasure() = (636, GetStringFunc("tcInvalidTypeForUnitsOfMeasure",",,,") ) /// Unexpected Const_uint16array - /// (Originally from ..\FSComp.txt:470) + /// (Originally from ..\FSComp.txt:469) static member tcUnexpectedConstUint16Array() = (GetStringFunc("tcUnexpectedConstUint16Array",",,,") ) /// Unexpected Const_bytearray - /// (Originally from ..\FSComp.txt:471) + /// (Originally from ..\FSComp.txt:470) static member tcUnexpectedConstByteArray() = (GetStringFunc("tcUnexpectedConstByteArray",",,,") ) /// A parameter with attributes must also be given a name, e.g. '[] Name : Type' - /// (Originally from ..\FSComp.txt:472) + /// (Originally from ..\FSComp.txt:471) static member tcParameterRequiresName() = (640, GetStringFunc("tcParameterRequiresName",",,,") ) /// Return values cannot have names - /// (Originally from ..\FSComp.txt:473) + /// (Originally from ..\FSComp.txt:472) static member tcReturnValuesCannotHaveNames() = (641, GetStringFunc("tcReturnValuesCannotHaveNames",",,,") ) /// MemberKind.PropertyGetSet only expected in parse trees - /// (Originally from ..\FSComp.txt:474) + /// (Originally from ..\FSComp.txt:473) static member tcMemberKindPropertyGetSetNotExpected() = (GetStringFunc("tcMemberKindPropertyGetSetNotExpected",",,,") ) /// Namespaces cannot contain values. Consider using a module to hold your value declarations. - /// (Originally from ..\FSComp.txt:475) + /// (Originally from ..\FSComp.txt:474) 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:476) + /// (Originally from ..\FSComp.txt:475) static member tcNamespaceCannotContainExtensionMembers() = (644, GetStringFunc("tcNamespaceCannotContainExtensionMembers",",,,") ) /// Multiple visibility attributes have been specified for this identifier - /// (Originally from ..\FSComp.txt:477) + /// (Originally from ..\FSComp.txt:476) 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:478) + /// (Originally from ..\FSComp.txt:477) 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:479) + /// (Originally from ..\FSComp.txt:478) 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:480) + /// (Originally from ..\FSComp.txt:479) 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:481) + /// (Originally from ..\FSComp.txt:480) 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:482) + /// (Originally from ..\FSComp.txt:481) 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:483) + /// (Originally from ..\FSComp.txt:482) 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:484) + /// (Originally from ..\FSComp.txt:483) 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:485) + /// (Originally from ..\FSComp.txt:484) 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:486) + /// (Originally from ..\FSComp.txt:485) static member tcInvalidIndexOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidIndexOperatorDefinition",",,,%s,,,") a0) /// Expected module or namespace parent %s - /// (Originally from ..\FSComp.txt:487) + /// (Originally from ..\FSComp.txt:486) 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:488) + /// (Originally from ..\FSComp.txt:487) 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:489) + /// (Originally from ..\FSComp.txt:488) 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:490) + /// (Originally from ..\FSComp.txt:489) static member tcImplementsIStructuralComparableExplicitly(a0 : System.String) = (649, GetStringFunc("tcImplementsIStructuralComparableExplicitly",",,,%s,,,") a0) /// This record contains fields from inconsistent types - /// (Originally from ..\FSComp.txt:491) + /// (Originally from ..\FSComp.txt:490) static member tcRecordFieldInconsistentTypes() = (656, GetStringFunc("tcRecordFieldInconsistentTypes",",,,") ) /// DLLImport stubs cannot be inlined - /// (Originally from ..\FSComp.txt:492) + /// (Originally from ..\FSComp.txt:491) static member tcDllImportStubsCannotBeInlined() = (657, GetStringFunc("tcDllImportStubsCannotBeInlined",",,,") ) /// Structs may only bind a 'this' parameter at member declarations - /// (Originally from ..\FSComp.txt:493) + /// (Originally from ..\FSComp.txt:492) static member tcStructsCanOnlyBindThisAtMemberDeclaration() = (658, GetStringFunc("tcStructsCanOnlyBindThisAtMemberDeclaration",",,,") ) /// Unexpected expression at recursive inference point - /// (Originally from ..\FSComp.txt:494) + /// (Originally from ..\FSComp.txt:493) 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:495) + /// (Originally from ..\FSComp.txt:494) 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:496) + /// (Originally from ..\FSComp.txt:495) 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:497) + /// (Originally from ..\FSComp.txt:496) 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:498) + /// (Originally from ..\FSComp.txt:497) 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:499) + /// (Originally from ..\FSComp.txt:498) static member tcTypeParametersInferredAreNotStable() = (664, GetStringFunc("tcTypeParametersInferredAreNotStable",",,,") ) /// Explicit type parameters may only be used on module or member bindings - /// (Originally from ..\FSComp.txt:500) + /// (Originally from ..\FSComp.txt:499) 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:501) + /// (Originally from ..\FSComp.txt:500) 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:502) + /// (Originally from ..\FSComp.txt:501) static member tcFieldsDoNotDetermineUniqueRecordType() = (667, GetStringFunc("tcFieldsDoNotDetermineUniqueRecordType",",,,") ) /// The field '%s' appears twice in this record expression or pattern - /// (Originally from ..\FSComp.txt:503) + /// (Originally from ..\FSComp.txt:502) static member tcFieldAppearsTwiceInRecord(a0 : System.String) = (668, GetStringFunc("tcFieldAppearsTwiceInRecord",",,,%s,,,") a0) /// Unknown union case - /// (Originally from ..\FSComp.txt:504) + /// (Originally from ..\FSComp.txt:503) 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:505) + /// (Originally from ..\FSComp.txt:504) 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:506) + /// (Originally from ..\FSComp.txt:505) static member tcPropertyRequiresExplicitTypeParameters() = (671, GetStringFunc("tcPropertyRequiresExplicitTypeParameters",",,,") ) /// A constructor cannot have explicit type parameters. Consider using a static construction method instead. - /// (Originally from ..\FSComp.txt:507) + /// (Originally from ..\FSComp.txt:506) 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:508) + /// (Originally from ..\FSComp.txt:507) static member tcInstanceMemberRequiresTarget() = (673, GetStringFunc("tcInstanceMemberRequiresTarget",",,,") ) /// Unexpected source-level property specification in syntax tree - /// (Originally from ..\FSComp.txt:509) + /// (Originally from ..\FSComp.txt:508) static member tcUnexpectedPropertyInSyntaxTree() = (674, GetStringFunc("tcUnexpectedPropertyInSyntaxTree",",,,") ) /// A static initializer requires an argument - /// (Originally from ..\FSComp.txt:510) + /// (Originally from ..\FSComp.txt:509) static member tcStaticInitializerRequiresArgument() = (675, GetStringFunc("tcStaticInitializerRequiresArgument",",,,") ) /// An object constructor requires an argument - /// (Originally from ..\FSComp.txt:511) + /// (Originally from ..\FSComp.txt:510) 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:512) + /// (Originally from ..\FSComp.txt:511) static member tcStaticMemberShouldNotHaveThis() = (677, GetStringFunc("tcStaticMemberShouldNotHaveThis",",,,") ) /// An explicit static initializer should use the syntax 'static new(args) = expr' - /// (Originally from ..\FSComp.txt:513) + /// (Originally from ..\FSComp.txt:512) static member tcExplicitStaticInitializerSyntax() = (678, GetStringFunc("tcExplicitStaticInitializerSyntax",",,,") ) /// An explicit object constructor should use the syntax 'new(args) = expr' - /// (Originally from ..\FSComp.txt:514) + /// (Originally from ..\FSComp.txt:513) static member tcExplicitObjectConstructorSyntax() = (679, GetStringFunc("tcExplicitObjectConstructorSyntax",",,,") ) /// Unexpected source-level property specification - /// (Originally from ..\FSComp.txt:515) + /// (Originally from ..\FSComp.txt:514) 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:516) + /// (Originally from ..\FSComp.txt:515) static member tcObjectExpressionFormDeprecated() = (GetStringFunc("tcObjectExpressionFormDeprecated",",,,") ) /// Invalid declaration - /// (Originally from ..\FSComp.txt:517) + /// (Originally from ..\FSComp.txt:516) static member tcInvalidDeclaration() = (682, GetStringFunc("tcInvalidDeclaration",",,,") ) /// Attributes are not allowed within patterns - /// (Originally from ..\FSComp.txt:518) + /// (Originally from ..\FSComp.txt:517) static member tcAttributesInvalidInPatterns() = (683, GetStringFunc("tcAttributesInvalidInPatterns",",,,") ) /// The generic function '%s' must be given explicit type argument(s) - /// (Originally from ..\FSComp.txt:519) + /// (Originally from ..\FSComp.txt:518) 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:520) + /// (Originally from ..\FSComp.txt:519) 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:521) + /// (Originally from ..\FSComp.txt:520) 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:522) + /// (Originally from ..\FSComp.txt:521) static member tcDefaultStructConstructorCall() = (688, GetStringFunc("tcDefaultStructConstructorCall",",,,") ) /// Couldn't find Dispose on IDisposable, or it was overloaded - /// (Originally from ..\FSComp.txt:523) + /// (Originally from ..\FSComp.txt:522) static member tcCouldNotFindIDisposable() = (GetStringFunc("tcCouldNotFindIDisposable",",,,") ) /// This value is not a literal and cannot be used in a pattern - /// (Originally from ..\FSComp.txt:524) + /// (Originally from ..\FSComp.txt:523) static member tcNonLiteralCannotBeUsedInPattern() = (689, GetStringFunc("tcNonLiteralCannotBeUsedInPattern",",,,") ) /// This field is readonly - /// (Originally from ..\FSComp.txt:525) + /// (Originally from ..\FSComp.txt:524) static member tcFieldIsReadonly() = (690, GetStringFunc("tcFieldIsReadonly",",,,") ) /// Named arguments must appear after all other arguments - /// (Originally from ..\FSComp.txt:526) + /// (Originally from ..\FSComp.txt:525) 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:527) + /// (Originally from ..\FSComp.txt:526) 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:528) + /// (Originally from ..\FSComp.txt:527) 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:529) + /// (Originally from ..\FSComp.txt:528) 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:530) + /// (Originally from ..\FSComp.txt:529) static member tcInvalidObjectConstructionExpression() = (696, GetStringFunc("tcInvalidObjectConstructionExpression",",,,") ) /// Invalid constraint - /// (Originally from ..\FSComp.txt:531) + /// (Originally from ..\FSComp.txt:530) 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:532) + /// (Originally from ..\FSComp.txt:531) static member tcInvalidConstraintTypeSealed() = (698, GetStringFunc("tcInvalidConstraintTypeSealed",",,,") ) /// An 'enum' constraint must be of the form 'enum' - /// (Originally from ..\FSComp.txt:533) + /// (Originally from ..\FSComp.txt:532) static member tcInvalidEnumConstraint() = (699, GetStringFunc("tcInvalidEnumConstraint",",,,") ) /// 'new' constraints must take one argument of type 'unit' and return the constructed type - /// (Originally from ..\FSComp.txt:534) + /// (Originally from ..\FSComp.txt:533) 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:535) + /// (Originally from ..\FSComp.txt:534) 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:536) + /// (Originally from ..\FSComp.txt:535) static member tcExpectedUnitOfMeasureMarkWithAttribute() = (702, GetStringFunc("tcExpectedUnitOfMeasureMarkWithAttribute",",,,") ) /// Expected type parameter, not unit-of-measure parameter - /// (Originally from ..\FSComp.txt:537) + /// (Originally from ..\FSComp.txt:536) static member tcExpectedTypeParameter() = (703, GetStringFunc("tcExpectedTypeParameter",",,,") ) /// Expected type, not unit-of-measure - /// (Originally from ..\FSComp.txt:538) + /// (Originally from ..\FSComp.txt:537) static member tcExpectedTypeNotUnitOfMeasure() = (704, GetStringFunc("tcExpectedTypeNotUnitOfMeasure",",,,") ) /// Expected unit-of-measure, not type - /// (Originally from ..\FSComp.txt:539) + /// (Originally from ..\FSComp.txt:538) 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:540) + /// (Originally from ..\FSComp.txt:539) static member tcInvalidUnitsOfMeasurePrefix() = (706, GetStringFunc("tcInvalidUnitsOfMeasurePrefix",",,,") ) /// Unit-of-measure cannot be used in type constructor application - /// (Originally from ..\FSComp.txt:541) + /// (Originally from ..\FSComp.txt:540) 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:542) + /// (Originally from ..\FSComp.txt:541) static member tcRequireBuilderMethod(a0 : System.String) = (708, GetStringFunc("tcRequireBuilderMethod",",,,%s,,,") a0) /// This type has no nested types - /// (Originally from ..\FSComp.txt:543) + /// (Originally from ..\FSComp.txt:542) static member tcTypeHasNoNestedTypes() = (709, GetStringFunc("tcTypeHasNoNestedTypes",",,,") ) /// Unexpected %s in type expression - /// (Originally from ..\FSComp.txt:544) + /// (Originally from ..\FSComp.txt:543) static member tcUnexpectedSymbolInTypeExpression(a0 : System.String) = (711, GetStringFunc("tcUnexpectedSymbolInTypeExpression",",,,%s,,,") a0) /// Type parameter cannot be used as type constructor - /// (Originally from ..\FSComp.txt:545) + /// (Originally from ..\FSComp.txt:544) static member tcTypeParameterInvalidAsTypeConstructor() = (712, GetStringFunc("tcTypeParameterInvalidAsTypeConstructor",",,,") ) /// Illegal syntax in type expression - /// (Originally from ..\FSComp.txt:546) + /// (Originally from ..\FSComp.txt:545) static member tcIllegalSyntaxInTypeExpression() = (713, GetStringFunc("tcIllegalSyntaxInTypeExpression",",,,") ) /// Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression - /// (Originally from ..\FSComp.txt:547) + /// (Originally from ..\FSComp.txt:546) static member tcAnonymousUnitsOfMeasureCannotBeNested() = (714, GetStringFunc("tcAnonymousUnitsOfMeasureCannotBeNested",",,,") ) /// Anonymous type variables are not permitted in this declaration - /// (Originally from ..\FSComp.txt:548) + /// (Originally from ..\FSComp.txt:547) static member tcAnonymousTypeInvalidInDeclaration() = (715, GetStringFunc("tcAnonymousTypeInvalidInDeclaration",",,,") ) /// Unexpected / in type - /// (Originally from ..\FSComp.txt:549) + /// (Originally from ..\FSComp.txt:548) static member tcUnexpectedSlashInType() = (716, GetStringFunc("tcUnexpectedSlashInType",",,,") ) /// Unexpected type arguments - /// (Originally from ..\FSComp.txt:550) + /// (Originally from ..\FSComp.txt:549) static member tcUnexpectedTypeArguments() = (717, GetStringFunc("tcUnexpectedTypeArguments",",,,") ) /// Optional arguments are only permitted on type members - /// (Originally from ..\FSComp.txt:551) + /// (Originally from ..\FSComp.txt:550) static member tcOptionalArgsOnlyOnMembers() = (718, GetStringFunc("tcOptionalArgsOnlyOnMembers",",,,") ) /// Name '%s' not bound in pattern context - /// (Originally from ..\FSComp.txt:552) + /// (Originally from ..\FSComp.txt:551) 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:553) + /// (Originally from ..\FSComp.txt:552) static member tcInvalidNonPrimitiveLiteralInPatternMatch() = (720, GetStringFunc("tcInvalidNonPrimitiveLiteralInPatternMatch",",,,") ) /// Type arguments cannot be specified here - /// (Originally from ..\FSComp.txt:554) + /// (Originally from ..\FSComp.txt:553) static member tcInvalidTypeArgumentUsage() = (721, GetStringFunc("tcInvalidTypeArgumentUsage",",,,") ) /// Only active patterns returning exactly one result may accept arguments - /// (Originally from ..\FSComp.txt:555) + /// (Originally from ..\FSComp.txt:554) static member tcRequireActivePatternWithOneResult() = (722, GetStringFunc("tcRequireActivePatternWithOneResult",",,,") ) /// Invalid argument to parameterized pattern label - /// (Originally from ..\FSComp.txt:556) + /// (Originally from ..\FSComp.txt:555) static member tcInvalidArgForParameterizedPattern() = (723, GetStringFunc("tcInvalidArgForParameterizedPattern",",,,") ) /// Internal error. Invalid index into active pattern array - /// (Originally from ..\FSComp.txt:557) + /// (Originally from ..\FSComp.txt:556) static member tcInvalidIndexIntoActivePatternArray() = (724, GetStringFunc("tcInvalidIndexIntoActivePatternArray",",,,") ) /// This union case does not take arguments - /// (Originally from ..\FSComp.txt:558) + /// (Originally from ..\FSComp.txt:557) static member tcUnionCaseDoesNotTakeArguments() = (725, GetStringFunc("tcUnionCaseDoesNotTakeArguments",",,,") ) /// This union case takes one argument - /// (Originally from ..\FSComp.txt:559) + /// (Originally from ..\FSComp.txt:558) static member tcUnionCaseRequiresOneArgument() = (726, GetStringFunc("tcUnionCaseRequiresOneArgument",",,,") ) /// This union case expects %d arguments in tupled form - /// (Originally from ..\FSComp.txt:560) + /// (Originally from ..\FSComp.txt:559) static member tcUnionCaseExpectsTupledArguments(a0 : System.Int32) = (727, GetStringFunc("tcUnionCaseExpectsTupledArguments",",,,%d,,,") a0) /// Field '%s' is not static - /// (Originally from ..\FSComp.txt:561) + /// (Originally from ..\FSComp.txt:560) 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:562) + /// (Originally from ..\FSComp.txt:561) static member tcFieldNotLiteralCannotBeUsedInPattern() = (729, GetStringFunc("tcFieldNotLiteralCannotBeUsedInPattern",",,,") ) /// This is not a variable, constant, active recognizer or literal - /// (Originally from ..\FSComp.txt:563) + /// (Originally from ..\FSComp.txt:562) static member tcRequireVarConstRecogOrLiteral() = (730, GetStringFunc("tcRequireVarConstRecogOrLiteral",",,,") ) /// This is not a valid pattern - /// (Originally from ..\FSComp.txt:564) + /// (Originally from ..\FSComp.txt:563) 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:565) + /// (Originally from ..\FSComp.txt:564) static member tcUseWhenPatternGuard() = (GetStringFunc("tcUseWhenPatternGuard",",,,") ) /// Illegal pattern - /// (Originally from ..\FSComp.txt:566) + /// (Originally from ..\FSComp.txt:565) static member tcIllegalPattern() = (733, GetStringFunc("tcIllegalPattern",",,,") ) /// Syntax error - unexpected '?' symbol - /// (Originally from ..\FSComp.txt:567) + /// (Originally from ..\FSComp.txt:566) static member tcSyntaxErrorUnexpectedQMark() = (734, GetStringFunc("tcSyntaxErrorUnexpectedQMark",",,,") ) /// Expected %d expressions, got %d - /// (Originally from ..\FSComp.txt:568) + /// (Originally from ..\FSComp.txt:567) static member tcExpressionCountMisMatch(a0 : System.Int32, a1 : System.Int32) = (735, GetStringFunc("tcExpressionCountMisMatch",",,,%d,,,%d,,,") a0 a1) /// TcExprUndelayed: delayed - /// (Originally from ..\FSComp.txt:569) + /// (Originally from ..\FSComp.txt:568) static member tcExprUndelayed() = (736, GetStringFunc("tcExprUndelayed",",,,") ) /// This expression form may only be used in sequence and computation expressions - /// (Originally from ..\FSComp.txt:570) + /// (Originally from ..\FSComp.txt:569) 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:571) + /// (Originally from ..\FSComp.txt:570) static member tcInvalidObjectExpressionSyntaxForm() = (738, GetStringFunc("tcInvalidObjectExpressionSyntaxForm",",,,") ) /// Invalid object, sequence or record expression - /// (Originally from ..\FSComp.txt:572) + /// (Originally from ..\FSComp.txt:571) static member tcInvalidObjectSequenceOrRecordExpression() = (739, GetStringFunc("tcInvalidObjectSequenceOrRecordExpression",",,,") ) /// Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' - /// (Originally from ..\FSComp.txt:573) + /// (Originally from ..\FSComp.txt:572) 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:574) + /// (Originally from ..\FSComp.txt:573) static member tcExpressionWithIfRequiresParenthesis() = (GetStringFunc("tcExpressionWithIfRequiresParenthesis",",,,") ) /// Unable to parse format string '%s' - /// (Originally from ..\FSComp.txt:575) + /// (Originally from ..\FSComp.txt:574) 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:576) + /// (Originally from ..\FSComp.txt:575) 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:577) + /// (Originally from ..\FSComp.txt:576) static member tcExpressionFormRequiresObjectConstructor() = (743, GetStringFunc("tcExpressionFormRequiresObjectConstructor",",,,") ) /// Named arguments cannot be given to member trait calls - /// (Originally from ..\FSComp.txt:578) + /// (Originally from ..\FSComp.txt:577) static member tcNamedArgumentsCannotBeUsedInMemberTraits() = (744, GetStringFunc("tcNamedArgumentsCannotBeUsedInMemberTraits",",,,") ) /// This is not a valid name for an enumeration case - /// (Originally from ..\FSComp.txt:579) + /// (Originally from ..\FSComp.txt:578) static member tcNotValidEnumCaseName() = (745, GetStringFunc("tcNotValidEnumCaseName",",,,") ) /// This field is not mutable - /// (Originally from ..\FSComp.txt:580) + /// (Originally from ..\FSComp.txt:579) 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:581) + /// (Originally from ..\FSComp.txt:580) 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:582) + /// (Originally from ..\FSComp.txt:581) static member tcConstructRequiresComputationExpressions() = (748, GetStringFunc("tcConstructRequiresComputationExpressions",",,,") ) /// This construct may only be used within sequence or computation expressions - /// (Originally from ..\FSComp.txt:583) + /// (Originally from ..\FSComp.txt:582) static member tcConstructRequiresSequenceOrComputations() = (749, GetStringFunc("tcConstructRequiresSequenceOrComputations",",,,") ) /// This construct may only be used within computation expressions - /// (Originally from ..\FSComp.txt:584) + /// (Originally from ..\FSComp.txt:583) static member tcConstructRequiresComputationExpression() = (750, GetStringFunc("tcConstructRequiresComputationExpression",",,,") ) /// Invalid indexer expression - /// (Originally from ..\FSComp.txt:585) + /// (Originally from ..\FSComp.txt:584) 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:586) + /// (Originally from ..\FSComp.txt:585) static member tcObjectOfIndeterminateTypeUsedRequireTypeConstraint() = (752, GetStringFunc("tcObjectOfIndeterminateTypeUsedRequireTypeConstraint",",,,") ) /// Cannot inherit from a variable type - /// (Originally from ..\FSComp.txt:587) + /// (Originally from ..\FSComp.txt:586) static member tcCannotInheritFromVariableType() = (753, GetStringFunc("tcCannotInheritFromVariableType",",,,") ) /// Calls to object constructors on type parameters cannot be given arguments - /// (Originally from ..\FSComp.txt:588) + /// (Originally from ..\FSComp.txt:587) static member tcObjectConstructorsOnTypeParametersCannotTakeArguments() = (754, GetStringFunc("tcObjectConstructorsOnTypeParametersCannotTakeArguments",",,,") ) /// The 'CompiledName' attribute cannot be used with this language element - /// (Originally from ..\FSComp.txt:589) + /// (Originally from ..\FSComp.txt:588) static member tcCompiledNameAttributeMisused() = (755, GetStringFunc("tcCompiledNameAttributeMisused",",,,") ) /// '%s' may only be used with named types - /// (Originally from ..\FSComp.txt:590) + /// (Originally from ..\FSComp.txt:589) 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:591) + /// (Originally from ..\FSComp.txt:590) 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:592) + /// (Originally from ..\FSComp.txt:591) 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:593) + /// (Originally from ..\FSComp.txt:592) 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:594) + /// (Originally from ..\FSComp.txt:593) static member tcIDisposableTypeShouldUseNew() = (760, GetStringFunc("tcIDisposableTypeShouldUseNew",",,,") ) /// '%s' may only be used to construct object types - /// (Originally from ..\FSComp.txt:595) + /// (Originally from ..\FSComp.txt:594) 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:596) + /// (Originally from ..\FSComp.txt:595) 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:597) + /// (Originally from ..\FSComp.txt:596) 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:598) + /// (Originally from ..\FSComp.txt:597) 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:599) + /// (Originally from ..\FSComp.txt:598) static member tcExtraneousFieldsGivenValues() = (765, GetStringFunc("tcExtraneousFieldsGivenValues",",,,") ) /// Only overrides of abstract and virtual members may be specified in object expressions - /// (Originally from ..\FSComp.txt:600) + /// (Originally from ..\FSComp.txt:599) 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:601) + /// (Originally from ..\FSComp.txt:600) 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:602) + /// (Originally from ..\FSComp.txt:601) 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:603) + /// (Originally from ..\FSComp.txt:602) 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:604) + /// (Originally from ..\FSComp.txt:603) 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:605) + /// (Originally from ..\FSComp.txt:604) 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:606) + /// (Originally from ..\FSComp.txt:605) static member tcPredefinedTypeCannotBeUsedAsSuperType() = (771, GetStringFunc("tcPredefinedTypeCannotBeUsedAsSuperType",",,,") ) /// 'new' must be used with a named type - /// (Originally from ..\FSComp.txt:607) + /// (Originally from ..\FSComp.txt:606) static member tcNewMustBeUsedWithNamedType() = (772, GetStringFunc("tcNewMustBeUsedWithNamedType",",,,") ) /// Cannot create an extension of a sealed type - /// (Originally from ..\FSComp.txt:608) + /// (Originally from ..\FSComp.txt:607) static member tcCannotCreateExtensionOfSealedType() = (773, GetStringFunc("tcCannotCreateExtensionOfSealedType",",,,") ) /// No arguments may be given when constructing a record value - /// (Originally from ..\FSComp.txt:609) + /// (Originally from ..\FSComp.txt:608) static member tcNoArgumentsForRecordValue() = (774, GetStringFunc("tcNoArgumentsForRecordValue",",,,") ) /// Interface implementations cannot be given on construction expressions - /// (Originally from ..\FSComp.txt:610) + /// (Originally from ..\FSComp.txt:609) static member tcNoInterfaceImplementationForConstructionExpression() = (775, GetStringFunc("tcNoInterfaceImplementationForConstructionExpression",",,,") ) /// Object construction expressions may only be used to implement constructors in class types - /// (Originally from ..\FSComp.txt:611) + /// (Originally from ..\FSComp.txt:610) static member tcObjectConstructionCanOnlyBeUsedInClassTypes() = (776, GetStringFunc("tcObjectConstructionCanOnlyBeUsedInClassTypes",",,,") ) /// Only simple bindings of the form 'id = expr' can be used in construction expressions - /// (Originally from ..\FSComp.txt:612) + /// (Originally from ..\FSComp.txt:611) 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:613) + /// (Originally from ..\FSComp.txt:612) static member tcObjectsMustBeInitializedWithObjectExpression() = (778, GetStringFunc("tcObjectsMustBeInitializedWithObjectExpression",",,,") ) /// Expected an interface type - /// (Originally from ..\FSComp.txt:614) + /// (Originally from ..\FSComp.txt:613) static member tcExpectedInterfaceType() = (779, GetStringFunc("tcExpectedInterfaceType",",,,") ) /// Constructor expressions for interfaces do not take arguments - /// (Originally from ..\FSComp.txt:615) + /// (Originally from ..\FSComp.txt:614) static member tcConstructorForInterfacesDoNotTakeArguments() = (780, GetStringFunc("tcConstructorForInterfacesDoNotTakeArguments",",,,") ) /// This object constructor requires arguments - /// (Originally from ..\FSComp.txt:616) + /// (Originally from ..\FSComp.txt:615) static member tcConstructorRequiresArguments() = (781, GetStringFunc("tcConstructorRequiresArguments",",,,") ) /// 'new' may only be used with object constructors - /// (Originally from ..\FSComp.txt:617) + /// (Originally from ..\FSComp.txt:616) static member tcNewRequiresObjectConstructor() = (782, GetStringFunc("tcNewRequiresObjectConstructor",",,,") ) /// At least one override did not correctly implement its corresponding abstract member - /// (Originally from ..\FSComp.txt:618) + /// (Originally from ..\FSComp.txt:617) 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:619) + /// (Originally from ..\FSComp.txt:618) static member tcNumericLiteralRequiresModule(a0 : System.String) = (784, GetStringFunc("tcNumericLiteralRequiresModule",",,,%s,,,") a0) /// Invalid record construction - /// (Originally from ..\FSComp.txt:620) + /// (Originally from ..\FSComp.txt:619) 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:621) + /// (Originally from ..\FSComp.txt:620) static member tcExpressionFormRequiresRecordTypes() = (786, GetStringFunc("tcExpressionFormRequiresRecordTypes",",,,") ) /// The inherited type is not an object model type - /// (Originally from ..\FSComp.txt:622) + /// (Originally from ..\FSComp.txt:621) 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:623) + /// (Originally from ..\FSComp.txt:622) 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:624) + /// (Originally from ..\FSComp.txt:623) 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:625) + /// (Originally from ..\FSComp.txt:624) static member tcTypeIsNotARecordTypeNeedConstructor() = (790, GetStringFunc("tcTypeIsNotARecordTypeNeedConstructor",",,,") ) /// This type is not a record type - /// (Originally from ..\FSComp.txt:626) + /// (Originally from ..\FSComp.txt:625) 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:627) + /// (Originally from ..\FSComp.txt:626) 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:628) + /// (Originally from ..\FSComp.txt:627) static member tcConstructIsAmbiguousInSequenceExpression() = (793, GetStringFunc("tcConstructIsAmbiguousInSequenceExpression",",,,") ) /// 'do!' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:629) + /// (Originally from ..\FSComp.txt:628) 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:630) + /// (Originally from ..\FSComp.txt:629) static member tcUseForInSequenceExpression() = (795, GetStringFunc("tcUseForInSequenceExpression",",,,") ) /// 'try'/'with' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:631) + /// (Originally from ..\FSComp.txt:630) static member tcTryIllegalInSequenceExpression() = (796, GetStringFunc("tcTryIllegalInSequenceExpression",",,,") ) /// In sequence expressions, multiple results are generated using 'yield!' - /// (Originally from ..\FSComp.txt:632) + /// (Originally from ..\FSComp.txt:631) static member tcUseYieldBangForMultipleResults() = (797, GetStringFunc("tcUseYieldBangForMultipleResults",",,,") ) /// Invalid assignment - /// (Originally from ..\FSComp.txt:633) + /// (Originally from ..\FSComp.txt:632) static member tcInvalidAssignment() = (799, GetStringFunc("tcInvalidAssignment",",,,") ) /// Invalid use of a type name - /// (Originally from ..\FSComp.txt:634) + /// (Originally from ..\FSComp.txt:633) static member tcInvalidUseOfTypeName() = (800, GetStringFunc("tcInvalidUseOfTypeName",",,,") ) /// This type has no accessible object constructors - /// (Originally from ..\FSComp.txt:635) + /// (Originally from ..\FSComp.txt:634) static member tcTypeHasNoAccessibleConstructor() = (801, GetStringFunc("tcTypeHasNoAccessibleConstructor",",,,") ) /// Invalid use of an interface type - /// (Originally from ..\FSComp.txt:638) + /// (Originally from ..\FSComp.txt:637) 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:639) + /// (Originally from ..\FSComp.txt:638) static member tcInvalidUseOfDelegate() = (805, GetStringFunc("tcInvalidUseOfDelegate",",,,") ) /// Property '%s' is not static - /// (Originally from ..\FSComp.txt:640) + /// (Originally from ..\FSComp.txt:639) static member tcPropertyIsNotStatic(a0 : System.String) = (806, GetStringFunc("tcPropertyIsNotStatic",",,,%s,,,") a0) /// Property '%s' is not readable - /// (Originally from ..\FSComp.txt:641) + /// (Originally from ..\FSComp.txt:640) static member tcPropertyIsNotReadable(a0 : System.String) = (807, GetStringFunc("tcPropertyIsNotReadable",",,,%s,,,") a0) /// This lookup cannot be used here - /// (Originally from ..\FSComp.txt:642) + /// (Originally from ..\FSComp.txt:641) static member tcLookupMayNotBeUsedHere() = (808, GetStringFunc("tcLookupMayNotBeUsedHere",",,,") ) /// Property '%s' is static - /// (Originally from ..\FSComp.txt:643) + /// (Originally from ..\FSComp.txt:642) static member tcPropertyIsStatic(a0 : System.String) = (809, GetStringFunc("tcPropertyIsStatic",",,,%s,,,") a0) /// Property '%s' cannot be set - /// (Originally from ..\FSComp.txt:644) + /// (Originally from ..\FSComp.txt:643) 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:645) + /// (Originally from ..\FSComp.txt:644) static member tcConstructorsCannotBeFirstClassValues() = (811, GetStringFunc("tcConstructorsCannotBeFirstClassValues",",,,") ) /// The syntax 'expr.id' may only be used with record labels, properties and fields - /// (Originally from ..\FSComp.txt:646) + /// (Originally from ..\FSComp.txt:645) static member tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields() = (812, GetStringFunc("tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields",",,,") ) /// Event '%s' is static - /// (Originally from ..\FSComp.txt:647) + /// (Originally from ..\FSComp.txt:646) static member tcEventIsStatic(a0 : System.String) = (813, GetStringFunc("tcEventIsStatic",",,,%s,,,") a0) /// Event '%s' is not static - /// (Originally from ..\FSComp.txt:648) + /// (Originally from ..\FSComp.txt:647) 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:649) + /// (Originally from ..\FSComp.txt:648) 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:650) + /// (Originally from ..\FSComp.txt:649) 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:651) + /// (Originally from ..\FSComp.txt:650) static member tcUnnamedArgumentsDoNotFormPrefix() = (GetStringFunc("tcUnnamedArgumentsDoNotFormPrefix",",,,") ) /// Static optimization conditionals are only for use within the F# library - /// (Originally from ..\FSComp.txt:652) + /// (Originally from ..\FSComp.txt:651) static member tcStaticOptimizationConditionalsOnlyForFSharpLibrary() = (817, GetStringFunc("tcStaticOptimizationConditionalsOnlyForFSharpLibrary",",,,") ) /// The corresponding formal argument is not optional - /// (Originally from ..\FSComp.txt:653) + /// (Originally from ..\FSComp.txt:652) static member tcFormalArgumentIsNotOptional() = (818, GetStringFunc("tcFormalArgumentIsNotOptional",",,,") ) /// Invalid optional assignment to a property or field - /// (Originally from ..\FSComp.txt:654) + /// (Originally from ..\FSComp.txt:653) static member tcInvalidOptionalAssignmentToPropertyOrField() = (819, GetStringFunc("tcInvalidOptionalAssignmentToPropertyOrField",",,,") ) /// A delegate constructor must be passed a single function value - /// (Originally from ..\FSComp.txt:655) + /// (Originally from ..\FSComp.txt:654) static member tcDelegateConstructorMustBePassed() = (820, GetStringFunc("tcDelegateConstructorMustBePassed",",,,") ) /// A binding cannot be marked both 'use' and 'rec' - /// (Originally from ..\FSComp.txt:656) + /// (Originally from ..\FSComp.txt:655) static member tcBindingCannotBeUseAndRec() = (821, GetStringFunc("tcBindingCannotBeUseAndRec",",,,") ) /// The 'VolatileField' attribute may only be used on 'let' bindings in classes - /// (Originally from ..\FSComp.txt:657) + /// (Originally from ..\FSComp.txt:656) static member tcVolatileOnlyOnClassLetBindings() = (823, GetStringFunc("tcVolatileOnlyOnClassLetBindings",",,,") ) /// Attributes are not permitted on 'let' bindings in expressions - /// (Originally from ..\FSComp.txt:658) + /// (Originally from ..\FSComp.txt:657) static member tcAttributesAreNotPermittedOnLetBindings() = (824, GetStringFunc("tcAttributesAreNotPermittedOnLetBindings",",,,") ) /// The 'DefaultValue' attribute may only be used on 'val' declarations - /// (Originally from ..\FSComp.txt:659) + /// (Originally from ..\FSComp.txt:658) static member tcDefaultValueAttributeRequiresVal() = (825, GetStringFunc("tcDefaultValueAttributeRequiresVal",",,,") ) /// The 'ConditionalAttribute' attribute may only be used on members - /// (Originally from ..\FSComp.txt:660) + /// (Originally from ..\FSComp.txt:659) static member tcConditionalAttributeRequiresMembers() = (826, GetStringFunc("tcConditionalAttributeRequiresMembers",",,,") ) /// This is not a valid name for an active pattern - /// (Originally from ..\FSComp.txt:661) + /// (Originally from ..\FSComp.txt:660) static member tcInvalidActivePatternName() = (827, GetStringFunc("tcInvalidActivePatternName",",,,") ) /// The 'EntryPointAttribute' attribute may only be used on function definitions in modules - /// (Originally from ..\FSComp.txt:662) + /// (Originally from ..\FSComp.txt:661) static member tcEntryPointAttributeRequiresFunctionInModule() = (828, GetStringFunc("tcEntryPointAttributeRequiresFunctionInModule",",,,") ) /// Mutable values cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:663) + /// (Originally from ..\FSComp.txt:662) static member tcMutableValuesCannotBeInline() = (829, GetStringFunc("tcMutableValuesCannotBeInline",",,,") ) /// Mutable values cannot have generic parameters - /// (Originally from ..\FSComp.txt:664) + /// (Originally from ..\FSComp.txt:663) static member tcMutableValuesMayNotHaveGenericParameters() = (830, GetStringFunc("tcMutableValuesMayNotHaveGenericParameters",",,,") ) /// Mutable function values should be written 'let mutable f = (fun args -> ...)' - /// (Originally from ..\FSComp.txt:665) + /// (Originally from ..\FSComp.txt:664) static member tcMutableValuesSyntax() = (831, GetStringFunc("tcMutableValuesSyntax",",,,") ) /// Only functions may be marked 'inline' - /// (Originally from ..\FSComp.txt:666) + /// (Originally from ..\FSComp.txt:665) static member tcOnlyFunctionsCanBeInline() = (832, GetStringFunc("tcOnlyFunctionsCanBeInline",",,,") ) /// A literal value cannot be given the [] or [] attributes - /// (Originally from ..\FSComp.txt:667) + /// (Originally from ..\FSComp.txt:666) static member tcIllegalAttributesForLiteral() = (833, GetStringFunc("tcIllegalAttributesForLiteral",",,,") ) /// A literal value cannot be marked 'mutable' - /// (Originally from ..\FSComp.txt:668) + /// (Originally from ..\FSComp.txt:667) static member tcLiteralCannotBeMutable() = (834, GetStringFunc("tcLiteralCannotBeMutable",",,,") ) /// A literal value cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:669) + /// (Originally from ..\FSComp.txt:668) static member tcLiteralCannotBeInline() = (835, GetStringFunc("tcLiteralCannotBeInline",",,,") ) /// Literal values cannot have generic parameters - /// (Originally from ..\FSComp.txt:670) + /// (Originally from ..\FSComp.txt:669) static member tcLiteralCannotHaveGenericParameters() = (836, GetStringFunc("tcLiteralCannotHaveGenericParameters",",,,") ) /// This is not a valid constant expression - /// (Originally from ..\FSComp.txt:671) + /// (Originally from ..\FSComp.txt:670) static member tcInvalidConstantExpression() = (837, GetStringFunc("tcInvalidConstantExpression",",,,") ) /// This type is not accessible from this code location - /// (Originally from ..\FSComp.txt:672) + /// (Originally from ..\FSComp.txt:671) static member tcTypeIsInaccessible() = (838, GetStringFunc("tcTypeIsInaccessible",",,,") ) /// Unexpected condition in imported assembly: failed to decode AttributeUsage attribute - /// (Originally from ..\FSComp.txt:673) + /// (Originally from ..\FSComp.txt:672) 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:674) + /// (Originally from ..\FSComp.txt:673) 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:675) + /// (Originally from ..\FSComp.txt:674) static member tcAttributeIsNotValidForLanguageElementUseDo() = (841, GetStringFunc("tcAttributeIsNotValidForLanguageElementUseDo",",,,") ) /// This attribute is not valid for use on this language element - /// (Originally from ..\FSComp.txt:676) + /// (Originally from ..\FSComp.txt:675) static member tcAttributeIsNotValidForLanguageElement() = (842, GetStringFunc("tcAttributeIsNotValidForLanguageElement",",,,") ) /// Optional arguments cannot be used in custom attributes - /// (Originally from ..\FSComp.txt:677) + /// (Originally from ..\FSComp.txt:676) static member tcOptionalArgumentsCannotBeUsedInCustomAttribute() = (843, GetStringFunc("tcOptionalArgumentsCannotBeUsedInCustomAttribute",",,,") ) /// This property cannot be set - /// (Originally from ..\FSComp.txt:678) + /// (Originally from ..\FSComp.txt:677) static member tcPropertyCannotBeSet0() = (844, GetStringFunc("tcPropertyCannotBeSet0",",,,") ) /// This property or field was not found on this custom attribute type - /// (Originally from ..\FSComp.txt:679) + /// (Originally from ..\FSComp.txt:678) static member tcPropertyOrFieldNotFoundInAttribute() = (845, GetStringFunc("tcPropertyOrFieldNotFoundInAttribute",",,,") ) /// A custom attribute must be a reference type - /// (Originally from ..\FSComp.txt:680) + /// (Originally from ..\FSComp.txt:679) 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:681) + /// (Originally from ..\FSComp.txt:680) static member tcCustomAttributeArgumentMismatch() = (847, GetStringFunc("tcCustomAttributeArgumentMismatch",",,,") ) /// A custom attribute must invoke an object constructor - /// (Originally from ..\FSComp.txt:682) + /// (Originally from ..\FSComp.txt:681) static member tcCustomAttributeMustInvokeConstructor() = (848, GetStringFunc("tcCustomAttributeMustInvokeConstructor",",,,") ) /// Attribute expressions must be calls to object constructors - /// (Originally from ..\FSComp.txt:683) + /// (Originally from ..\FSComp.txt:682) static member tcAttributeExpressionsMustBeConstructorCalls() = (849, GetStringFunc("tcAttributeExpressionsMustBeConstructorCalls",",,,") ) /// This attribute cannot be used in this version of F# - /// (Originally from ..\FSComp.txt:684) + /// (Originally from ..\FSComp.txt:683) static member tcUnsupportedAttribute() = (850, GetStringFunc("tcUnsupportedAttribute",",,,") ) /// Invalid inline specification - /// (Originally from ..\FSComp.txt:685) + /// (Originally from ..\FSComp.txt:684) static member tcInvalidInlineSpecification() = (851, GetStringFunc("tcInvalidInlineSpecification",",,,") ) /// 'use' bindings must be of the form 'use = ' - /// (Originally from ..\FSComp.txt:686) + /// (Originally from ..\FSComp.txt:685) 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:687) + /// (Originally from ..\FSComp.txt:686) static member tcAbstractMembersIllegalInAugmentation() = (853, GetStringFunc("tcAbstractMembersIllegalInAugmentation",",,,") ) /// Method overrides and interface implementations are not permitted here - /// (Originally from ..\FSComp.txt:688) + /// (Originally from ..\FSComp.txt:687) static member tcMethodOverridesIllegalHere() = (854, GetStringFunc("tcMethodOverridesIllegalHere",",,,") ) /// No abstract or interface member was found that corresponds to this override - /// (Originally from ..\FSComp.txt:689) + /// (Originally from ..\FSComp.txt:688) 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:690) + /// (Originally from ..\FSComp.txt:689) static member tcOverrideArityMismatch(a0 : System.String) = (856, GetStringFunc("tcOverrideArityMismatch",",,,%s,,,") a0) /// This method already has a default implementation - /// (Originally from ..\FSComp.txt:691) + /// (Originally from ..\FSComp.txt:690) static member tcDefaultImplementationAlreadyExists() = (857, GetStringFunc("tcDefaultImplementationAlreadyExists",",,,") ) /// The method implemented by this default is ambiguous - /// (Originally from ..\FSComp.txt:692) + /// (Originally from ..\FSComp.txt:691) static member tcDefaultAmbiguous() = (858, GetStringFunc("tcDefaultAmbiguous",",,,") ) /// No abstract property was found that corresponds to this override - /// (Originally from ..\FSComp.txt:693) + /// (Originally from ..\FSComp.txt:692) 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:694) + /// (Originally from ..\FSComp.txt:693) static member tcAbstractPropertyMissingGetOrSet(a0 : System.String) = (860, GetStringFunc("tcAbstractPropertyMissingGetOrSet",",,,%s,,,") a0) /// Invalid signature for set member - /// (Originally from ..\FSComp.txt:695) + /// (Originally from ..\FSComp.txt:694) 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:696) + /// (Originally from ..\FSComp.txt:695) 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:697) + /// (Originally from ..\FSComp.txt:696) static member tcNewMemberHidesAbstractMemberWithSuffix(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMemberWithSuffix",",,,%s,,,") a0) /// Interfaces cannot contain definitions of static initializers - /// (Originally from ..\FSComp.txt:698) + /// (Originally from ..\FSComp.txt:697) static member tcStaticInitializersIllegalInInterface() = (865, GetStringFunc("tcStaticInitializersIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of object constructors - /// (Originally from ..\FSComp.txt:699) + /// (Originally from ..\FSComp.txt:698) static member tcObjectConstructorsIllegalInInterface() = (866, GetStringFunc("tcObjectConstructorsIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of member overrides - /// (Originally from ..\FSComp.txt:700) + /// (Originally from ..\FSComp.txt:699) 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:701) + /// (Originally from ..\FSComp.txt:700) static member tcConcreteMembersIllegalInInterface() = (868, GetStringFunc("tcConcreteMembersIllegalInInterface",",,,") ) /// Constructors cannot be specified in exception augmentations - /// (Originally from ..\FSComp.txt:702) + /// (Originally from ..\FSComp.txt:701) 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:703) + /// (Originally from ..\FSComp.txt:702) static member tcStructsCannotHaveConstructorWithNoArguments() = (870, GetStringFunc("tcStructsCannotHaveConstructorWithNoArguments",",,,") ) /// Constructors cannot be defined for this type - /// (Originally from ..\FSComp.txt:704) + /// (Originally from ..\FSComp.txt:703) 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:705) + /// (Originally from ..\FSComp.txt:704) static member tcRecursiveBindingsWithMembersMustBeDirectAugmentation() = (872, GetStringFunc("tcRecursiveBindingsWithMembersMustBeDirectAugmentation",",,,") ) /// Only simple variable patterns can be bound in 'let rec' constructs - /// (Originally from ..\FSComp.txt:706) + /// (Originally from ..\FSComp.txt:705) static member tcOnlySimplePatternsInLetRec() = (873, GetStringFunc("tcOnlySimplePatternsInLetRec",",,,") ) /// Only record fields and simple, non-recursive 'let' bindings may be marked mutable - /// (Originally from ..\FSComp.txt:707) + /// (Originally from ..\FSComp.txt:706) static member tcOnlyRecordFieldsAndSimpleLetCanBeMutable() = (874, GetStringFunc("tcOnlyRecordFieldsAndSimpleLetCanBeMutable",",,,") ) /// This member is not sufficiently generic - /// (Originally from ..\FSComp.txt:708) + /// (Originally from ..\FSComp.txt:707) 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:709) + /// (Originally from ..\FSComp.txt:708) 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:710) + /// (Originally from ..\FSComp.txt:709) 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:711) + /// (Originally from ..\FSComp.txt:710) static member tcThreadStaticAndContextStaticMustBeStatic() = (878, GetStringFunc("tcThreadStaticAndContextStaticMustBeStatic",",,,") ) /// Volatile fields must be marked 'mutable' and cannot be thread-static - /// (Originally from ..\FSComp.txt:712) + /// (Originally from ..\FSComp.txt:711) 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:713) + /// (Originally from ..\FSComp.txt:712) 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:714) + /// (Originally from ..\FSComp.txt:713) static member tcStaticValFieldsMustBeMutableAndPrivate() = (881, GetStringFunc("tcStaticValFieldsMustBeMutableAndPrivate",",,,") ) /// This field requires a name - /// (Originally from ..\FSComp.txt:715) + /// (Originally from ..\FSComp.txt:714) static member tcFieldRequiresName() = (882, GetStringFunc("tcFieldRequiresName",",,,") ) /// Invalid namespace, module, type or union case name - /// (Originally from ..\FSComp.txt:716) + /// (Originally from ..\FSComp.txt:715) 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:717) + /// (Originally from ..\FSComp.txt:716) 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:718) + /// (Originally from ..\FSComp.txt:717) static member tcReturnTypesForUnionMustBeSameAsType() = (885, GetStringFunc("tcReturnTypesForUnionMustBeSameAsType",",,,") ) /// This is not a valid value for an enumeration literal - /// (Originally from ..\FSComp.txt:719) + /// (Originally from ..\FSComp.txt:718) static member tcInvalidEnumerationLiteral() = (886, GetStringFunc("tcInvalidEnumerationLiteral",",,,") ) /// The type '%s' is not an interface type - /// (Originally from ..\FSComp.txt:720) + /// (Originally from ..\FSComp.txt:719) static member tcTypeIsNotInterfaceType1(a0 : System.String) = (887, GetStringFunc("tcTypeIsNotInterfaceType1",",,,%s,,,") a0) /// Duplicate specification of an interface - /// (Originally from ..\FSComp.txt:721) + /// (Originally from ..\FSComp.txt:720) static member tcDuplicateSpecOfInterface() = (888, GetStringFunc("tcDuplicateSpecOfInterface",",,,") ) /// A field/val declaration is not permitted here - /// (Originally from ..\FSComp.txt:722) + /// (Originally from ..\FSComp.txt:721) static member tcFieldValIllegalHere() = (889, GetStringFunc("tcFieldValIllegalHere",",,,") ) /// A inheritance declaration is not permitted here - /// (Originally from ..\FSComp.txt:723) + /// (Originally from ..\FSComp.txt:722) 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:724) + /// (Originally from ..\FSComp.txt:723) 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:725) + /// (Originally from ..\FSComp.txt:724) 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:726) + /// (Originally from ..\FSComp.txt:725) static member tcLocalClassBindingsCannotBeInline() = (894, GetStringFunc("tcLocalClassBindingsCannotBeInline",",,,") ) /// Type abbreviations cannot have members - /// (Originally from ..\FSComp.txt:727) + /// (Originally from ..\FSComp.txt:726) 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:728) + /// (Originally from ..\FSComp.txt:727) static member tcTypeAbbreviationsCheckedAtCompileTime() = (GetStringFunc("tcTypeAbbreviationsCheckedAtCompileTime",",,,") ) /// Enumerations cannot have members - /// (Originally from ..\FSComp.txt:729) + /// (Originally from ..\FSComp.txt:728) static member tcEnumerationsMayNotHaveMembers() = (896, GetStringFunc("tcEnumerationsMayNotHaveMembers",",,,") ) /// Measure declarations may have only static members - /// (Originally from ..\FSComp.txt:730) + /// (Originally from ..\FSComp.txt:729) 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:731) + /// (Originally from ..\FSComp.txt:730) 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:732) + /// (Originally from ..\FSComp.txt:731) 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:733) + /// (Originally from ..\FSComp.txt:732) static member tcStaticLetBindingsRequireClassesWithImplicitConstructors() = (902, GetStringFunc("tcStaticLetBindingsRequireClassesWithImplicitConstructors",",,,") ) /// Measure declarations may have only static members: constructors are not available - /// (Originally from ..\FSComp.txt:734) + /// (Originally from ..\FSComp.txt:733) static member tcMeasureDeclarationsRequireStaticMembersNotConstructors() = (904, GetStringFunc("tcMeasureDeclarationsRequireStaticMembersNotConstructors",",,,") ) /// A member and a local class binding both have the name '%s' - /// (Originally from ..\FSComp.txt:735) + /// (Originally from ..\FSComp.txt:734) static member tcMemberAndLocalClassBindingHaveSameName(a0 : System.String) = (905, GetStringFunc("tcMemberAndLocalClassBindingHaveSameName",",,,%s,,,") a0) /// Type abbreviations cannot have interface declarations - /// (Originally from ..\FSComp.txt:736) + /// (Originally from ..\FSComp.txt:735) static member tcTypeAbbreviationsCannotHaveInterfaceDeclaration() = (906, GetStringFunc("tcTypeAbbreviationsCannotHaveInterfaceDeclaration",",,,") ) /// Enumerations cannot have interface declarations - /// (Originally from ..\FSComp.txt:737) + /// (Originally from ..\FSComp.txt:736) static member tcEnumerationsCannotHaveInterfaceDeclaration() = (907, GetStringFunc("tcEnumerationsCannotHaveInterfaceDeclaration",",,,") ) /// This type is not an interface type - /// (Originally from ..\FSComp.txt:738) + /// (Originally from ..\FSComp.txt:737) static member tcTypeIsNotInterfaceType0() = (908, GetStringFunc("tcTypeIsNotInterfaceType0",",,,") ) /// All implemented interfaces should be declared on the initial declaration of the type - /// (Originally from ..\FSComp.txt:739) + /// (Originally from ..\FSComp.txt:738) 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:740) + /// (Originally from ..\FSComp.txt:739) static member tcDefaultImplementationForInterfaceHasAlreadyBeenAdded() = (910, GetStringFunc("tcDefaultImplementationForInterfaceHasAlreadyBeenAdded",",,,") ) /// This member is not permitted in an interface implementation - /// (Originally from ..\FSComp.txt:741) + /// (Originally from ..\FSComp.txt:740) static member tcMemberNotPermittedInInterfaceImplementation() = (911, GetStringFunc("tcMemberNotPermittedInInterfaceImplementation",",,,") ) /// This declaration element is not permitted in an augmentation - /// (Originally from ..\FSComp.txt:742) + /// (Originally from ..\FSComp.txt:741) static member tcDeclarationElementNotPermittedInAugmentation() = (912, GetStringFunc("tcDeclarationElementNotPermittedInAugmentation",",,,") ) /// Types cannot contain nested type definitions - /// (Originally from ..\FSComp.txt:743) + /// (Originally from ..\FSComp.txt:742) static member tcTypesCannotContainNestedTypes() = (913, GetStringFunc("tcTypesCannotContainNestedTypes",",,,") ) /// type, exception or module - /// (Originally from ..\FSComp.txt:744) + /// (Originally from ..\FSComp.txt:743) static member tcTypeExceptionOrModule() = (GetStringFunc("tcTypeExceptionOrModule",",,,") ) /// type or module - /// (Originally from ..\FSComp.txt:745) + /// (Originally from ..\FSComp.txt:744) 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:746) + /// (Originally from ..\FSComp.txt:745) 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:747) + /// (Originally from ..\FSComp.txt:746) static member tcImplementsIEquatableExplicitly(a0 : System.String) = (915, GetStringFunc("tcImplementsIEquatableExplicitly",",,,%s,,,") a0) /// Explicit type specifications cannot be used for exception constructors - /// (Originally from ..\FSComp.txt:748) + /// (Originally from ..\FSComp.txt:747) static member tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors() = (916, GetStringFunc("tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors",",,,") ) /// Exception abbreviations should not have argument lists - /// (Originally from ..\FSComp.txt:749) + /// (Originally from ..\FSComp.txt:748) static member tcExceptionAbbreviationsShouldNotHaveArgumentList() = (917, GetStringFunc("tcExceptionAbbreviationsShouldNotHaveArgumentList",",,,") ) /// Abbreviations for Common IL exceptions cannot take arguments - /// (Originally from ..\FSComp.txt:750) + /// (Originally from ..\FSComp.txt:749) static member tcAbbreviationsFordotNetExceptionsCannotTakeArguments() = (918, GetStringFunc("tcAbbreviationsFordotNetExceptionsCannotTakeArguments",",,,") ) /// Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception - /// (Originally from ..\FSComp.txt:751) + /// (Originally from ..\FSComp.txt:750) static member tcExceptionAbbreviationsMustReferToValidExceptions() = (919, GetStringFunc("tcExceptionAbbreviationsMustReferToValidExceptions",",,,") ) /// Abbreviations for Common IL exception types must have a matching object constructor - /// (Originally from ..\FSComp.txt:752) + /// (Originally from ..\FSComp.txt:751) static member tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor() = (920, GetStringFunc("tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor",",,,") ) /// Not an exception - /// (Originally from ..\FSComp.txt:753) + /// (Originally from ..\FSComp.txt:752) static member tcNotAnException() = (921, GetStringFunc("tcNotAnException",",,,") ) /// Invalid module name - /// (Originally from ..\FSComp.txt:755) + /// (Originally from ..\FSComp.txt:754) static member tcInvalidModuleName() = (924, GetStringFunc("tcInvalidModuleName",",,,") ) /// Invalid type extension - /// (Originally from ..\FSComp.txt:756) + /// (Originally from ..\FSComp.txt:755) static member tcInvalidTypeExtension() = (925, GetStringFunc("tcInvalidTypeExtension",",,,") ) /// The attributes of this type specify multiple kinds for the type - /// (Originally from ..\FSComp.txt:757) + /// (Originally from ..\FSComp.txt:756) 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:758) + /// (Originally from ..\FSComp.txt:757) static member tcKindOfTypeSpecifiedDoesNotMatchDefinition() = (927, GetStringFunc("tcKindOfTypeSpecifiedDoesNotMatchDefinition",",,,") ) /// Measure definitions cannot have type parameters - /// (Originally from ..\FSComp.txt:759) + /// (Originally from ..\FSComp.txt:758) static member tcMeasureDefinitionsCannotHaveTypeParameters() = (928, GetStringFunc("tcMeasureDefinitionsCannotHaveTypeParameters",",,,") ) /// This type requires a definition - /// (Originally from ..\FSComp.txt:760) + /// (Originally from ..\FSComp.txt:759) 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:761) + /// (Originally from ..\FSComp.txt:760) static member tcTypeAbbreviationHasTypeParametersMissingOnType() = (GetStringFunc("tcTypeAbbreviationHasTypeParametersMissingOnType",",,,") ) /// Structs, interfaces, enums and delegates cannot inherit from other types - /// (Originally from ..\FSComp.txt:762) + /// (Originally from ..\FSComp.txt:761) static member tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes() = (931, GetStringFunc("tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes",",,,") ) /// Types cannot inherit from multiple concrete types - /// (Originally from ..\FSComp.txt:763) + /// (Originally from ..\FSComp.txt:762) static member tcTypesCannotInheritFromMultipleConcreteTypes() = (932, GetStringFunc("tcTypesCannotInheritFromMultipleConcreteTypes",",,,") ) /// Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute - /// (Originally from ..\FSComp.txt:764) + /// (Originally from ..\FSComp.txt:763) 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:765) + /// (Originally from ..\FSComp.txt:764) static member tcAllowNullTypesMayOnlyInheritFromAllowNullTypes() = (935, GetStringFunc("tcAllowNullTypesMayOnlyInheritFromAllowNullTypes",",,,") ) /// Generic types cannot be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:766) + /// (Originally from ..\FSComp.txt:765) static member tcGenericTypesCannotHaveStructLayout() = (936, GetStringFunc("tcGenericTypesCannotHaveStructLayout",",,,") ) /// Only structs and classes without primary constructors may be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:767) + /// (Originally from ..\FSComp.txt:766) 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:768) + /// (Originally from ..\FSComp.txt:767) static member tcRepresentationOfTypeHiddenBySignature() = (938, GetStringFunc("tcRepresentationOfTypeHiddenBySignature",",,,") ) /// Only classes may be given the 'AbstractClass' attribute - /// (Originally from ..\FSComp.txt:769) + /// (Originally from ..\FSComp.txt:768) static member tcOnlyClassesCanHaveAbstract() = (939, GetStringFunc("tcOnlyClassesCanHaveAbstract",",,,") ) /// Only types representing units-of-measure may be given the 'Measure' attribute - /// (Originally from ..\FSComp.txt:770) + /// (Originally from ..\FSComp.txt:769) static member tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure() = (940, GetStringFunc("tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure",",,,") ) /// Accessibility modifiers are not permitted on overrides or interface implementations - /// (Originally from ..\FSComp.txt:771) + /// (Originally from ..\FSComp.txt:770) static member tcOverridesCannotHaveVisibilityDeclarations() = (941, GetStringFunc("tcOverridesCannotHaveVisibilityDeclarations",",,,") ) /// Discriminated union types are always sealed - /// (Originally from ..\FSComp.txt:772) + /// (Originally from ..\FSComp.txt:771) static member tcTypesAreAlwaysSealedDU() = (942, GetStringFunc("tcTypesAreAlwaysSealedDU",",,,") ) /// Record types are always sealed - /// (Originally from ..\FSComp.txt:773) + /// (Originally from ..\FSComp.txt:772) static member tcTypesAreAlwaysSealedRecord() = (942, GetStringFunc("tcTypesAreAlwaysSealedRecord",",,,") ) /// Assembly code types are always sealed - /// (Originally from ..\FSComp.txt:774) + /// (Originally from ..\FSComp.txt:773) static member tcTypesAreAlwaysSealedAssemblyCode() = (942, GetStringFunc("tcTypesAreAlwaysSealedAssemblyCode",",,,") ) /// Struct types are always sealed - /// (Originally from ..\FSComp.txt:775) + /// (Originally from ..\FSComp.txt:774) static member tcTypesAreAlwaysSealedStruct() = (942, GetStringFunc("tcTypesAreAlwaysSealedStruct",",,,") ) /// Delegate types are always sealed - /// (Originally from ..\FSComp.txt:776) + /// (Originally from ..\FSComp.txt:775) static member tcTypesAreAlwaysSealedDelegate() = (942, GetStringFunc("tcTypesAreAlwaysSealedDelegate",",,,") ) /// Enum types are always sealed - /// (Originally from ..\FSComp.txt:777) + /// (Originally from ..\FSComp.txt:776) static member tcTypesAreAlwaysSealedEnum() = (942, GetStringFunc("tcTypesAreAlwaysSealedEnum",",,,") ) /// Interface types and delegate types cannot contain fields - /// (Originally from ..\FSComp.txt:778) + /// (Originally from ..\FSComp.txt:777) static member tcInterfaceTypesAndDelegatesCannotContainFields() = (943, GetStringFunc("tcInterfaceTypesAndDelegatesCannotContainFields",",,,") ) /// Abbreviated types cannot be given the 'Sealed' attribute - /// (Originally from ..\FSComp.txt:779) + /// (Originally from ..\FSComp.txt:778) static member tcAbbreviatedTypesCannotBeSealed() = (944, GetStringFunc("tcAbbreviatedTypesCannotBeSealed",",,,") ) /// Cannot inherit a sealed type - /// (Originally from ..\FSComp.txt:780) + /// (Originally from ..\FSComp.txt:779) static member tcCannotInheritFromSealedType() = (945, GetStringFunc("tcCannotInheritFromSealedType",",,,") ) /// Cannot inherit from interface type. Use interface ... with instead. - /// (Originally from ..\FSComp.txt:781) + /// (Originally from ..\FSComp.txt:780) static member tcCannotInheritFromInterfaceType() = (946, GetStringFunc("tcCannotInheritFromInterfaceType",",,,") ) /// Struct types cannot contain abstract members - /// (Originally from ..\FSComp.txt:782) + /// (Originally from ..\FSComp.txt:781) static member tcStructTypesCannotContainAbstractMembers() = (947, GetStringFunc("tcStructTypesCannotContainAbstractMembers",",,,") ) /// Interface types cannot be sealed - /// (Originally from ..\FSComp.txt:783) + /// (Originally from ..\FSComp.txt:782) static member tcInterfaceTypesCannotBeSealed() = (948, GetStringFunc("tcInterfaceTypesCannotBeSealed",",,,") ) /// Delegate specifications must be of the form 'typ -> typ' - /// (Originally from ..\FSComp.txt:784) + /// (Originally from ..\FSComp.txt:783) 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:785) + /// (Originally from ..\FSComp.txt:784) 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:786) + /// (Originally from ..\FSComp.txt:785) static member tcInvalidTypeForLiteralEnumeration() = (951, GetStringFunc("tcInvalidTypeForLiteralEnumeration",",,,") ) /// This type definition involves an immediate cyclic reference through an abbreviation - /// (Originally from ..\FSComp.txt:788) + /// (Originally from ..\FSComp.txt:787) 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:789) + /// (Originally from ..\FSComp.txt:788) 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:790) + /// (Originally from ..\FSComp.txt:789) 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:791) + /// (Originally from ..\FSComp.txt:790) 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:792) + /// (Originally from ..\FSComp.txt:791) 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:793) + /// (Originally from ..\FSComp.txt:792) static member tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit() = (959, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit",",,,") ) /// 'let' and 'do' bindings must come before member and interface definitions in type definitions - /// (Originally from ..\FSComp.txt:794) + /// (Originally from ..\FSComp.txt:793) 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:795) + /// (Originally from ..\FSComp.txt:794) 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:796) + /// (Originally from ..\FSComp.txt:795) 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:797) + /// (Originally from ..\FSComp.txt:796) static member tcLetAndDoRequiresImplicitConstructionSequence() = (963, GetStringFunc("tcLetAndDoRequiresImplicitConstructionSequence",",,,") ) /// Type abbreviations cannot have augmentations - /// (Originally from ..\FSComp.txt:798) + /// (Originally from ..\FSComp.txt:797) static member tcTypeAbbreviationsCannotHaveAugmentations() = (964, GetStringFunc("tcTypeAbbreviationsCannotHaveAugmentations",",,,") ) /// The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace. - /// (Originally from ..\FSComp.txt:799) + /// (Originally from ..\FSComp.txt:798) 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:800) + /// (Originally from ..\FSComp.txt:799) 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:801) + /// (Originally from ..\FSComp.txt:800) 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:804) + /// (Originally from ..\FSComp.txt:803) static member tcAttributeAutoOpenWasIgnored(a0 : System.String, a1 : System.String) = (970, GetStringFunc("tcAttributeAutoOpenWasIgnored",",,,%s,,,%s,,,") a0 a1) /// Undefined value '%s' - /// (Originally from ..\FSComp.txt:805) + /// (Originally from ..\FSComp.txt:804) static member ilUndefinedValue(a0 : System.String) = (971, GetStringFunc("ilUndefinedValue",",,,%s,,,") a0) /// Label %s not found - /// (Originally from ..\FSComp.txt:806) + /// (Originally from ..\FSComp.txt:805) static member ilLabelNotFound(a0 : System.String) = (972, GetStringFunc("ilLabelNotFound",",,,%s,,,") a0) /// Incorrect number of type arguments to local call - /// (Originally from ..\FSComp.txt:807) + /// (Originally from ..\FSComp.txt:806) static member ilIncorrectNumberOfTypeArguments() = (973, GetStringFunc("ilIncorrectNumberOfTypeArguments",",,,") ) /// Dynamic invocation of %s is not supported - /// (Originally from ..\FSComp.txt:808) + /// (Originally from ..\FSComp.txt:807) static member ilDynamicInvocationNotSupported(a0 : System.String) = (GetStringFunc("ilDynamicInvocationNotSupported",",,,%s,,,") a0) /// Taking the address of a literal field is invalid - /// (Originally from ..\FSComp.txt:809) + /// (Originally from ..\FSComp.txt:808) 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:810) + /// (Originally from ..\FSComp.txt:809) 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:811) + /// (Originally from ..\FSComp.txt:810) static member ilCustomMarshallersCannotBeUsedInFSharp() = (980, GetStringFunc("ilCustomMarshallersCannotBeUsedInFSharp",",,,") ) /// The MarshalAs attribute could not be decoded - /// (Originally from ..\FSComp.txt:812) + /// (Originally from ..\FSComp.txt:811) 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:813) + /// (Originally from ..\FSComp.txt:812) static member ilSignatureForExternalFunctionContainsTypeParameters() = (982, GetStringFunc("ilSignatureForExternalFunctionContainsTypeParameters",",,,") ) /// The DllImport attribute could not be decoded - /// (Originally from ..\FSComp.txt:814) + /// (Originally from ..\FSComp.txt:813) static member ilDllImportAttributeCouldNotBeDecoded() = (983, GetStringFunc("ilDllImportAttributeCouldNotBeDecoded",",,,") ) /// Literal fields cannot be set - /// (Originally from ..\FSComp.txt:815) + /// (Originally from ..\FSComp.txt:814) 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:816) + /// (Originally from ..\FSComp.txt:815) static member ilStaticMethodIsNotLambda(a0 : System.String) = (985, GetStringFunc("ilStaticMethodIsNotLambda",",,,%s,,,") a0) /// Mutable variables cannot escape their method - /// (Originally from ..\FSComp.txt:817) + /// (Originally from ..\FSComp.txt:816) static member ilMutableVariablesCannotEscapeMethod() = (986, GetStringFunc("ilMutableVariablesCannotEscapeMethod",",,,") ) /// Compiler error: unexpected unrealized value - /// (Originally from ..\FSComp.txt:818) + /// (Originally from ..\FSComp.txt:817) static member ilUnexpectedUnrealizedValue() = (987, GetStringFunc("ilUnexpectedUnrealizedValue",",,,") ) /// Main module of program is empty: nothing will happen when it is run - /// (Originally from ..\FSComp.txt:819) + /// (Originally from ..\FSComp.txt:818) static member ilMainModuleEmpty() = (988, GetStringFunc("ilMainModuleEmpty",",,,") ) /// This type cannot be used for a literal field - /// (Originally from ..\FSComp.txt:820) + /// (Originally from ..\FSComp.txt:819) static member ilTypeCannotBeUsedForLiteralField() = (989, GetStringFunc("ilTypeCannotBeUsedForLiteralField",",,,") ) /// Unexpected GetSet annotation on a property - /// (Originally from ..\FSComp.txt:821) + /// (Originally from ..\FSComp.txt:820) static member ilUnexpectedGetSetAnnotation() = (990, GetStringFunc("ilUnexpectedGetSetAnnotation",",,,") ) /// The FieldOffset attribute could not be decoded - /// (Originally from ..\FSComp.txt:822) + /// (Originally from ..\FSComp.txt:821) static member ilFieldOffsetAttributeCouldNotBeDecoded() = (991, GetStringFunc("ilFieldOffsetAttributeCouldNotBeDecoded",",,,") ) /// The StructLayout attribute could not be decoded - /// (Originally from ..\FSComp.txt:823) + /// (Originally from ..\FSComp.txt:822) static member ilStructLayoutAttributeCouldNotBeDecoded() = (992, GetStringFunc("ilStructLayoutAttributeCouldNotBeDecoded",",,,") ) /// The DefaultAugmentation attribute could not be decoded - /// (Originally from ..\FSComp.txt:824) + /// (Originally from ..\FSComp.txt:823) static member ilDefaultAugmentationAttributeCouldNotBeDecoded() = (993, GetStringFunc("ilDefaultAugmentationAttributeCouldNotBeDecoded",",,,") ) /// Reflected definitions cannot contain uses of the prefix splice operator '%%' - /// (Originally from ..\FSComp.txt:825) + /// (Originally from ..\FSComp.txt:824) static member ilReflectedDefinitionsCannotUseSliceOperator() = (994, GetStringFunc("ilReflectedDefinitionsCannotUseSliceOperator",",,,") ) /// Problem with codepage '%d': %s - /// (Originally from ..\FSComp.txt:826) + /// (Originally from ..\FSComp.txt:825) 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:827) + /// (Originally from ..\FSComp.txt:826) 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:828) + /// (Originally from ..\FSComp.txt:827) static member optsCopyrightCommunity() = (GetStringFunc("optsCopyrightCommunity",",,,") ) /// Name of the output file (Short form: -o) - /// (Originally from ..\FSComp.txt:829) + /// (Originally from ..\FSComp.txt:828) static member optsNameOfOutputFile() = (GetStringFunc("optsNameOfOutputFile",",,,") ) /// Build a console executable - /// (Originally from ..\FSComp.txt:830) + /// (Originally from ..\FSComp.txt:829) static member optsBuildConsole() = (GetStringFunc("optsBuildConsole",",,,") ) /// Build a Windows executable - /// (Originally from ..\FSComp.txt:831) + /// (Originally from ..\FSComp.txt:830) static member optsBuildWindows() = (GetStringFunc("optsBuildWindows",",,,") ) /// Build a library (Short form: -a) - /// (Originally from ..\FSComp.txt:832) + /// (Originally from ..\FSComp.txt:831) static member optsBuildLibrary() = (GetStringFunc("optsBuildLibrary",",,,") ) /// Build a module that can be added to another assembly - /// (Originally from ..\FSComp.txt:833) + /// (Originally from ..\FSComp.txt:832) static member optsBuildModule() = (GetStringFunc("optsBuildModule",",,,") ) /// Delay-sign the assembly using only the public portion of the strong name key - /// (Originally from ..\FSComp.txt:834) + /// (Originally from ..\FSComp.txt:833) 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:835) + /// (Originally from ..\FSComp.txt:834) static member optsPublicSign() = (GetStringFunc("optsPublicSign",",,,") ) /// Write the xmldoc of the assembly to the given file - /// (Originally from ..\FSComp.txt:836) + /// (Originally from ..\FSComp.txt:835) static member optsWriteXml() = (GetStringFunc("optsWriteXml",",,,") ) /// Specify a strong name key file - /// (Originally from ..\FSComp.txt:837) + /// (Originally from ..\FSComp.txt:836) static member optsStrongKeyFile() = (GetStringFunc("optsStrongKeyFile",",,,") ) /// Specify a strong name key container - /// (Originally from ..\FSComp.txt:838) + /// (Originally from ..\FSComp.txt:837) 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:839) + /// (Originally from ..\FSComp.txt:838) 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:840) + /// (Originally from ..\FSComp.txt:839) static member optsNoOpt() = (GetStringFunc("optsNoOpt",",,,") ) /// Don't add a resource to the generated assembly containing F#-specific metadata - /// (Originally from ..\FSComp.txt:841) + /// (Originally from ..\FSComp.txt:840) static member optsNoInterface() = (GetStringFunc("optsNoInterface",",,,") ) /// Print the inferred interface of the assembly to a file - /// (Originally from ..\FSComp.txt:842) + /// (Originally from ..\FSComp.txt:841) static member optsSig() = (GetStringFunc("optsSig",",,,") ) /// Reference an assembly (Short form: -r) - /// (Originally from ..\FSComp.txt:843) + /// (Originally from ..\FSComp.txt:842) static member optsReference() = (GetStringFunc("optsReference",",,,") ) /// Specify a Win32 resource file (.res) - /// (Originally from ..\FSComp.txt:844) + /// (Originally from ..\FSComp.txt:843) static member optsWin32res() = (GetStringFunc("optsWin32res",",,,") ) /// Specify a Win32 manifest file - /// (Originally from ..\FSComp.txt:845) + /// (Originally from ..\FSComp.txt:844) static member optsWin32manifest() = (GetStringFunc("optsWin32manifest",",,,") ) /// Do not include the default Win32 manifest - /// (Originally from ..\FSComp.txt:846) + /// (Originally from ..\FSComp.txt:845) static member optsNowin32manifest() = (GetStringFunc("optsNowin32manifest",",,,") ) /// Embed all source files in the portable PDB file - /// (Originally from ..\FSComp.txt:847) + /// (Originally from ..\FSComp.txt:846) static member optsEmbedAllSource() = (GetStringFunc("optsEmbedAllSource",",,,") ) /// Embed specific source files in the portable PDB file - /// (Originally from ..\FSComp.txt:848) + /// (Originally from ..\FSComp.txt:847) static member optsEmbedSource() = (GetStringFunc("optsEmbedSource",",,,") ) /// Source link information file to embed in the portable PDB file - /// (Originally from ..\FSComp.txt:849) + /// (Originally from ..\FSComp.txt:848) static member optsSourceLink() = (GetStringFunc("optsSourceLink",",,,") ) /// --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:850) + /// (Originally from ..\FSComp.txt:849) static member optsEmbeddedSourceRequirePortablePDBs() = (1501, GetStringFunc("optsEmbeddedSourceRequirePortablePDBs",",,,") ) /// --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:851) + /// (Originally from ..\FSComp.txt:850) static member optsSourceLinkRequirePortablePDBs() = (1502, GetStringFunc("optsSourceLinkRequirePortablePDBs",",,,") ) /// Source file is too large to embed in a portable PDB - /// (Originally from ..\FSComp.txt:852) + /// (Originally from ..\FSComp.txt:851) static member srcFileTooLarge() = (GetStringFunc("srcFileTooLarge",",,,") ) /// Embed the specified managed resource - /// (Originally from ..\FSComp.txt:853) + /// (Originally from ..\FSComp.txt:852) static member optsResource() = (GetStringFunc("optsResource",",,,") ) /// Link the specified resource to this assembly where the resinfo format is [,[,public|private]] - /// (Originally from ..\FSComp.txt:854) + /// (Originally from ..\FSComp.txt:853) static member optsLinkresource() = (GetStringFunc("optsLinkresource",",,,") ) /// Emit debug information (Short form: -g) - /// (Originally from ..\FSComp.txt:855) + /// (Originally from ..\FSComp.txt:854) 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:856) + /// (Originally from ..\FSComp.txt:855) static member optsDebug(a0 : System.String) = (GetStringFunc("optsDebug",",,,%s,,,") a0) /// Enable optimizations (Short form: -O) - /// (Originally from ..\FSComp.txt:857) + /// (Originally from ..\FSComp.txt:856) static member optsOptimize() = (GetStringFunc("optsOptimize",",,,") ) /// Enable or disable tailcalls - /// (Originally from ..\FSComp.txt:858) + /// (Originally from ..\FSComp.txt:857) static member optsTailcalls() = (GetStringFunc("optsTailcalls",",,,") ) /// Produce a deterministic assembly (including module version GUID and timestamp) - /// (Originally from ..\FSComp.txt:859) + /// (Originally from ..\FSComp.txt:858) static member optsDeterministic() = (GetStringFunc("optsDeterministic",",,,") ) /// Enable or disable cross-module optimizations - /// (Originally from ..\FSComp.txt:860) + /// (Originally from ..\FSComp.txt:859) static member optsCrossoptimize() = (GetStringFunc("optsCrossoptimize",",,,") ) /// Report all warnings as errors - /// (Originally from ..\FSComp.txt:861) + /// (Originally from ..\FSComp.txt:860) static member optsWarnaserrorPM() = (GetStringFunc("optsWarnaserrorPM",",,,") ) /// Report specific warnings as errors - /// (Originally from ..\FSComp.txt:862) + /// (Originally from ..\FSComp.txt:861) static member optsWarnaserror() = (GetStringFunc("optsWarnaserror",",,,") ) /// Set a warning level (0-5) - /// (Originally from ..\FSComp.txt:863) + /// (Originally from ..\FSComp.txt:862) static member optsWarn() = (GetStringFunc("optsWarn",",,,") ) /// Disable specific warning messages - /// (Originally from ..\FSComp.txt:864) + /// (Originally from ..\FSComp.txt:863) static member optsNowarn() = (GetStringFunc("optsNowarn",",,,") ) /// Enable specific warnings that may be off by default - /// (Originally from ..\FSComp.txt:865) + /// (Originally from ..\FSComp.txt:864) static member optsWarnOn() = (GetStringFunc("optsWarnOn",",,,") ) /// Generate overflow checks - /// (Originally from ..\FSComp.txt:866) + /// (Originally from ..\FSComp.txt:865) static member optsChecked() = (GetStringFunc("optsChecked",",,,") ) /// Define conditional compilation symbols (Short form: -d) - /// (Originally from ..\FSComp.txt:867) + /// (Originally from ..\FSComp.txt:866) static member optsDefine() = (GetStringFunc("optsDefine",",,,") ) /// Ignore ML compatibility warnings - /// (Originally from ..\FSComp.txt:868) + /// (Originally from ..\FSComp.txt:867) static member optsMlcompatibility() = (GetStringFunc("optsMlcompatibility",",,,") ) /// Suppress compiler copyright message - /// (Originally from ..\FSComp.txt:869) + /// (Originally from ..\FSComp.txt:868) static member optsNologo() = (GetStringFunc("optsNologo",",,,") ) /// Display this usage message (Short form: -?) - /// (Originally from ..\FSComp.txt:870) + /// (Originally from ..\FSComp.txt:869) static member optsHelp() = (GetStringFunc("optsHelp",",,,") ) /// Read response file for more options - /// (Originally from ..\FSComp.txt:871) + /// (Originally from ..\FSComp.txt:870) static member optsResponseFile() = (GetStringFunc("optsResponseFile",",,,") ) /// Specify the codepage used to read source files - /// (Originally from ..\FSComp.txt:872) + /// (Originally from ..\FSComp.txt:871) static member optsCodepage() = (GetStringFunc("optsCodepage",",,,") ) /// Output messages in UTF-8 encoding - /// (Originally from ..\FSComp.txt:873) + /// (Originally from ..\FSComp.txt:872) static member optsUtf8output() = (GetStringFunc("optsUtf8output",",,,") ) /// Output messages with fully qualified paths - /// (Originally from ..\FSComp.txt:874) + /// (Originally from ..\FSComp.txt:873) 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:875) + /// (Originally from ..\FSComp.txt:874) static member optsLib() = (GetStringFunc("optsLib",",,,") ) /// Base address for the library to be built - /// (Originally from ..\FSComp.txt:876) + /// (Originally from ..\FSComp.txt:875) static member optsBaseaddress() = (GetStringFunc("optsBaseaddress",",,,") ) /// Do not reference the default CLI assemblies by default - /// (Originally from ..\FSComp.txt:877) + /// (Originally from ..\FSComp.txt:876) 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:878) + /// (Originally from ..\FSComp.txt:877) 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:879) + /// (Originally from ..\FSComp.txt:878) static member optsStaticlink() = (GetStringFunc("optsStaticlink",",,,") ) /// Use a resident background compilation service to improve compiler startup times. - /// (Originally from ..\FSComp.txt:880) + /// (Originally from ..\FSComp.txt:879) static member optsResident() = (GetStringFunc("optsResident",",,,") ) /// Name the output debug file - /// (Originally from ..\FSComp.txt:881) + /// (Originally from ..\FSComp.txt:880) static member optsPdb() = (GetStringFunc("optsPdb",",,,") ) /// Resolve assembly references using directory-based rules rather than MSBuild resolution - /// (Originally from ..\FSComp.txt:882) + /// (Originally from ..\FSComp.txt:881) static member optsSimpleresolution() = (GetStringFunc("optsSimpleresolution",",,,") ) /// Unrecognized target '%s', expected 'exe', 'winexe', 'library' or 'module' - /// (Originally from ..\FSComp.txt:883) + /// (Originally from ..\FSComp.txt:882) static member optsUnrecognizedTarget(a0 : System.String) = (1048, GetStringFunc("optsUnrecognizedTarget",",,,%s,,,") a0) /// Unrecognized debug type '%s', expected 'pdbonly' or 'full' - /// (Originally from ..\FSComp.txt:884) + /// (Originally from ..\FSComp.txt:883) static member optsUnrecognizedDebugType(a0 : System.String) = (1049, GetStringFunc("optsUnrecognizedDebugType",",,,%s,,,") a0) /// Invalid warning level '%d' - /// (Originally from ..\FSComp.txt:885) + /// (Originally from ..\FSComp.txt:884) static member optsInvalidWarningLevel(a0 : System.Int32) = (1050, GetStringFunc("optsInvalidWarningLevel",",,,%d,,,") a0) /// Short form of '%s' - /// (Originally from ..\FSComp.txt:886) + /// (Originally from ..\FSComp.txt:885) 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:887) + /// (Originally from ..\FSComp.txt:886) static member optsClirootDeprecatedMsg() = (GetStringFunc("optsClirootDeprecatedMsg",",,,") ) /// Use to override where the compiler looks for mscorlib.dll and framework components - /// (Originally from ..\FSComp.txt:888) + /// (Originally from ..\FSComp.txt:887) static member optsClirootDescription() = (GetStringFunc("optsClirootDescription",",,,") ) /// - OUTPUT FILES - - /// (Originally from ..\FSComp.txt:889) + /// (Originally from ..\FSComp.txt:888) static member optsHelpBannerOutputFiles() = (GetStringFunc("optsHelpBannerOutputFiles",",,,") ) /// - INPUT FILES - - /// (Originally from ..\FSComp.txt:890) + /// (Originally from ..\FSComp.txt:889) static member optsHelpBannerInputFiles() = (GetStringFunc("optsHelpBannerInputFiles",",,,") ) /// - RESOURCES - - /// (Originally from ..\FSComp.txt:891) + /// (Originally from ..\FSComp.txt:890) static member optsHelpBannerResources() = (GetStringFunc("optsHelpBannerResources",",,,") ) /// - CODE GENERATION - - /// (Originally from ..\FSComp.txt:892) + /// (Originally from ..\FSComp.txt:891) static member optsHelpBannerCodeGen() = (GetStringFunc("optsHelpBannerCodeGen",",,,") ) /// - ADVANCED - - /// (Originally from ..\FSComp.txt:893) + /// (Originally from ..\FSComp.txt:892) static member optsHelpBannerAdvanced() = (GetStringFunc("optsHelpBannerAdvanced",",,,") ) /// - MISCELLANEOUS - - /// (Originally from ..\FSComp.txt:894) + /// (Originally from ..\FSComp.txt:893) static member optsHelpBannerMisc() = (GetStringFunc("optsHelpBannerMisc",",,,") ) /// - LANGUAGE - - /// (Originally from ..\FSComp.txt:895) + /// (Originally from ..\FSComp.txt:894) static member optsHelpBannerLanguage() = (GetStringFunc("optsHelpBannerLanguage",",,,") ) /// - ERRORS AND WARNINGS - - /// (Originally from ..\FSComp.txt:896) + /// (Originally from ..\FSComp.txt:895) static member optsHelpBannerErrsAndWarns() = (GetStringFunc("optsHelpBannerErrsAndWarns",",,,") ) /// Unknown --test argument: '%s' - /// (Originally from ..\FSComp.txt:897) + /// (Originally from ..\FSComp.txt:896) 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:898) + /// (Originally from ..\FSComp.txt:897) 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:899) + /// (Originally from ..\FSComp.txt:898) static member optsInternalNoDescription(a0 : System.String) = (GetStringFunc("optsInternalNoDescription",",,,%s,,,") a0) /// The command-line option '%s' has been deprecated - /// (Originally from ..\FSComp.txt:900) + /// (Originally from ..\FSComp.txt:899) 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:901) + /// (Originally from ..\FSComp.txt:900) 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:902) + /// (Originally from ..\FSComp.txt:901) static member optsDCLOHtmlDoc(a0 : System.String) = (GetStringFunc("optsDCLOHtmlDoc",",,,%s,,,") a0) /// Output warning and error messages in color - /// (Originally from ..\FSComp.txt:903) + /// (Originally from ..\FSComp.txt:902) static member optsConsoleColors() = (GetStringFunc("optsConsoleColors",",,,") ) /// Enable high-entropy ASLR - /// (Originally from ..\FSComp.txt:904) + /// (Originally from ..\FSComp.txt:903) static member optsUseHighEntropyVA() = (GetStringFunc("optsUseHighEntropyVA",",,,") ) /// Specify subsystem version of this assembly - /// (Originally from ..\FSComp.txt:905) + /// (Originally from ..\FSComp.txt:904) 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:906) + /// (Originally from ..\FSComp.txt:905) static member optsTargetProfile() = (GetStringFunc("optsTargetProfile",",,,") ) /// Emit debug information in quotations - /// (Originally from ..\FSComp.txt:907) + /// (Originally from ..\FSComp.txt:906) static member optsEmitDebugInfoInQuotations() = (GetStringFunc("optsEmitDebugInfoInQuotations",",,,") ) /// Specify the preferred output language culture name (e.g. es-ES, ja-JP) - /// (Originally from ..\FSComp.txt:908) + /// (Originally from ..\FSComp.txt:907) static member optsPreferredUiLang() = (GetStringFunc("optsPreferredUiLang",",,,") ) /// Don't copy FSharp.Core.dll along the produced binaries - /// (Originally from ..\FSComp.txt:909) + /// (Originally from ..\FSComp.txt:908) static member optsNoCopyFsharpCore() = (GetStringFunc("optsNoCopyFsharpCore",",,,") ) /// Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater. - /// (Originally from ..\FSComp.txt:910) + /// (Originally from ..\FSComp.txt:909) 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:911) + /// (Originally from ..\FSComp.txt:910) static member optsInvalidTargetProfile(a0 : System.String) = (1052, GetStringFunc("optsInvalidTargetProfile",",,,%s,,,") a0) /// Full name - /// (Originally from ..\FSComp.txt:912) + /// (Originally from ..\FSComp.txt:911) static member typeInfoFullName() = (GetStringFunc("typeInfoFullName",",,,") ) /// and %d other overloads - /// (Originally from ..\FSComp.txt:916) + /// (Originally from ..\FSComp.txt:915) static member typeInfoOtherOverloads(a0 : System.Int32) = (GetStringFunc("typeInfoOtherOverloads",",,,%d,,,") a0) /// union case - /// (Originally from ..\FSComp.txt:917) + /// (Originally from ..\FSComp.txt:916) static member typeInfoUnionCase() = (GetStringFunc("typeInfoUnionCase",",,,") ) /// active pattern result - /// (Originally from ..\FSComp.txt:918) + /// (Originally from ..\FSComp.txt:917) static member typeInfoActivePatternResult() = (GetStringFunc("typeInfoActivePatternResult",",,,") ) /// active recognizer - /// (Originally from ..\FSComp.txt:919) + /// (Originally from ..\FSComp.txt:918) static member typeInfoActiveRecognizer() = (GetStringFunc("typeInfoActiveRecognizer",",,,") ) /// field - /// (Originally from ..\FSComp.txt:920) + /// (Originally from ..\FSComp.txt:919) static member typeInfoField() = (GetStringFunc("typeInfoField",",,,") ) /// event - /// (Originally from ..\FSComp.txt:921) + /// (Originally from ..\FSComp.txt:920) static member typeInfoEvent() = (GetStringFunc("typeInfoEvent",",,,") ) /// property - /// (Originally from ..\FSComp.txt:922) + /// (Originally from ..\FSComp.txt:921) static member typeInfoProperty() = (GetStringFunc("typeInfoProperty",",,,") ) /// extension - /// (Originally from ..\FSComp.txt:923) + /// (Originally from ..\FSComp.txt:922) static member typeInfoExtension() = (GetStringFunc("typeInfoExtension",",,,") ) /// custom operation - /// (Originally from ..\FSComp.txt:924) + /// (Originally from ..\FSComp.txt:923) static member typeInfoCustomOperation() = (GetStringFunc("typeInfoCustomOperation",",,,") ) /// argument - /// (Originally from ..\FSComp.txt:925) + /// (Originally from ..\FSComp.txt:924) static member typeInfoArgument() = (GetStringFunc("typeInfoArgument",",,,") ) /// patvar - /// (Originally from ..\FSComp.txt:926) + /// (Originally from ..\FSComp.txt:925) static member typeInfoPatternVariable() = (GetStringFunc("typeInfoPatternVariable",",,,") ) /// namespace - /// (Originally from ..\FSComp.txt:927) + /// (Originally from ..\FSComp.txt:926) static member typeInfoNamespace() = (GetStringFunc("typeInfoNamespace",",,,") ) /// module - /// (Originally from ..\FSComp.txt:928) + /// (Originally from ..\FSComp.txt:927) static member typeInfoModule() = (GetStringFunc("typeInfoModule",",,,") ) /// namespace/module - /// (Originally from ..\FSComp.txt:929) + /// (Originally from ..\FSComp.txt:928) static member typeInfoNamespaceOrModule() = (GetStringFunc("typeInfoNamespaceOrModule",",,,") ) /// from %s - /// (Originally from ..\FSComp.txt:930) + /// (Originally from ..\FSComp.txt:929) static member typeInfoFromFirst(a0 : System.String) = (GetStringFunc("typeInfoFromFirst",",,,%s,,,") a0) /// also from %s - /// (Originally from ..\FSComp.txt:931) + /// (Originally from ..\FSComp.txt:930) static member typeInfoFromNext(a0 : System.String) = (GetStringFunc("typeInfoFromNext",",,,%s,,,") a0) /// generated property - /// (Originally from ..\FSComp.txt:932) + /// (Originally from ..\FSComp.txt:931) static member typeInfoGeneratedProperty() = (GetStringFunc("typeInfoGeneratedProperty",",,,") ) /// generated type - /// (Originally from ..\FSComp.txt:933) + /// (Originally from ..\FSComp.txt:932) static member typeInfoGeneratedType() = (GetStringFunc("typeInfoGeneratedType",",,,") ) /// Found by AssemblyFolders registry key - /// (Originally from ..\FSComp.txt:934) + /// (Originally from ..\FSComp.txt:933) static member assemblyResolutionFoundByAssemblyFoldersKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersKey",",,,") ) /// Found by AssemblyFoldersEx registry key - /// (Originally from ..\FSComp.txt:935) + /// (Originally from ..\FSComp.txt:934) static member assemblyResolutionFoundByAssemblyFoldersExKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersExKey",",,,") ) /// .NET Framework - /// (Originally from ..\FSComp.txt:936) + /// (Originally from ..\FSComp.txt:935) static member assemblyResolutionNetFramework() = (GetStringFunc("assemblyResolutionNetFramework",",,,") ) /// Global Assembly Cache - /// (Originally from ..\FSComp.txt:937) + /// (Originally from ..\FSComp.txt:936) static member assemblyResolutionGAC() = (GetStringFunc("assemblyResolutionGAC",",,,") ) /// Recursive class hierarchy in type '%s' - /// (Originally from ..\FSComp.txt:938) + /// (Originally from ..\FSComp.txt:937) static member recursiveClassHierarchy(a0 : System.String) = (1089, GetStringFunc("recursiveClassHierarchy",",,,%s,,,") a0) /// Invalid recursive reference to an abstract slot - /// (Originally from ..\FSComp.txt:939) + /// (Originally from ..\FSComp.txt:938) 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:940) + /// (Originally from ..\FSComp.txt:939) 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:941) + /// (Originally from ..\FSComp.txt:940) 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:942) + /// (Originally from ..\FSComp.txt:941) 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:943) + /// (Originally from ..\FSComp.txt:942) 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:944) + /// (Originally from ..\FSComp.txt:943) 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:945) + /// (Originally from ..\FSComp.txt:944) 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:946) + /// (Originally from ..\FSComp.txt:945) static member structOrClassFieldIsNotAccessible(a0 : System.String) = (1097, GetStringFunc("structOrClassFieldIsNotAccessible",",,,%s,,,") a0) /// This construct is experimental - /// (Originally from ..\FSComp.txt:947) + /// (Originally from ..\FSComp.txt:946) static member experimentalConstruct() = (GetStringFunc("experimentalConstruct",",,,") ) /// No Invoke methods found for delegate type - /// (Originally from ..\FSComp.txt:948) + /// (Originally from ..\FSComp.txt:947) static member noInvokeMethodsFound() = (1099, GetStringFunc("noInvokeMethodsFound",",,,") ) /// More than one Invoke method found for delegate type - /// (Originally from ..\FSComp.txt:949) + /// (Originally from ..\FSComp.txt:948) static member moreThanOneInvokeMethodFound() = (GetStringFunc("moreThanOneInvokeMethodFound",",,,") ) /// Delegates are not allowed to have curried signatures - /// (Originally from ..\FSComp.txt:950) + /// (Originally from ..\FSComp.txt:949) static member delegatesNotAllowedToHaveCurriedSignatures() = (1101, GetStringFunc("delegatesNotAllowedToHaveCurriedSignatures",",,,") ) /// Unexpected Expr.TyChoose - /// (Originally from ..\FSComp.txt:951) + /// (Originally from ..\FSComp.txt:950) 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:952) + /// (Originally from ..\FSComp.txt:951) static member tlrLambdaLiftingOptimizationsNotApplied() = (1103, GetStringFunc("tlrLambdaLiftingOptimizationsNotApplied",",,,") ) /// Identifiers containing '@' are reserved for use in F# code generation - /// (Originally from ..\FSComp.txt:953) + /// (Originally from ..\FSComp.txt:952) static member lexhlpIdentifiersContainingAtSymbolReserved() = (1104, GetStringFunc("lexhlpIdentifiersContainingAtSymbolReserved",",,,") ) /// The identifier '%s' is reserved for future use by F# - /// (Originally from ..\FSComp.txt:954) + /// (Originally from ..\FSComp.txt:953) static member lexhlpIdentifierReserved(a0 : System.String) = (GetStringFunc("lexhlpIdentifierReserved",",,,%s,,,") a0) /// Missing variable '%s' - /// (Originally from ..\FSComp.txt:955) + /// (Originally from ..\FSComp.txt:954) static member patcMissingVariable(a0 : System.String) = (1106, GetStringFunc("patcMissingVariable",",,,%s,,,") a0) /// Partial active patterns may only generate one result - /// (Originally from ..\FSComp.txt:956) + /// (Originally from ..\FSComp.txt:955) 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:957) + /// (Originally from ..\FSComp.txt:956) 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:958) + /// (Originally from ..\FSComp.txt:957) 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:959) + /// (Originally from ..\FSComp.txt:958) 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:960) + /// (Originally from ..\FSComp.txt:959) 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:961) + /// (Originally from ..\FSComp.txt:960) 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:962) + /// (Originally from ..\FSComp.txt:961) 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:963) + /// (Originally from ..\FSComp.txt:962) static member optValueMarkedInlineButWasNotBoundInTheOptEnv(a0 : System.String) = (1114, GetStringFunc("optValueMarkedInlineButWasNotBoundInTheOptEnv",",,,%s,,,") a0) /// Local value %s not found during optimization - /// (Originally from ..\FSComp.txt:964) + /// (Originally from ..\FSComp.txt:963) static member optLocalValueNotFoundDuringOptimization(a0 : System.String) = (1115, GetStringFunc("optLocalValueNotFoundDuringOptimization",",,,%s,,,") a0) /// A value marked as 'inline' has an unexpected value - /// (Originally from ..\FSComp.txt:965) + /// (Originally from ..\FSComp.txt:964) static member optValueMarkedInlineHasUnexpectedValue() = (1116, GetStringFunc("optValueMarkedInlineHasUnexpectedValue",",,,") ) /// A value marked as 'inline' could not be inlined - /// (Originally from ..\FSComp.txt:966) + /// (Originally from ..\FSComp.txt:965) 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:967) + /// (Originally from ..\FSComp.txt:966) static member optFailedToInlineValue(a0 : System.String) = (1118, GetStringFunc("optFailedToInlineValue",",,,%s,,,") a0) /// Recursive ValValue %s - /// (Originally from ..\FSComp.txt:968) + /// (Originally from ..\FSComp.txt:967) 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:969) + /// (Originally from ..\FSComp.txt:968) 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:970) + /// (Originally from ..\FSComp.txt:969) 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:971) + /// (Originally from ..\FSComp.txt:970) static member lexfltSeparatorTokensOfPatternMatchMisaligned() = (GetStringFunc("lexfltSeparatorTokensOfPatternMatchMisaligned",",,,") ) /// Invalid module/expression/type - /// (Originally from ..\FSComp.txt:972) + /// (Originally from ..\FSComp.txt:971) 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:973) + /// (Originally from ..\FSComp.txt:972) 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:974) + /// (Originally from ..\FSComp.txt:973) 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:975) + /// (Originally from ..\FSComp.txt:974) static member nrGlobalUsedOnlyAsFirstName() = (1126, GetStringFunc("nrGlobalUsedOnlyAsFirstName",",,,") ) /// This is not a constructor or literal, or a constructor is being used incorrectly - /// (Originally from ..\FSComp.txt:976) + /// (Originally from ..\FSComp.txt:975) static member nrIsNotConstructorOrLiteral() = (1127, GetStringFunc("nrIsNotConstructorOrLiteral",",,,") ) /// Unexpected empty long identifier - /// (Originally from ..\FSComp.txt:977) + /// (Originally from ..\FSComp.txt:976) static member nrUnexpectedEmptyLongId() = (1128, GetStringFunc("nrUnexpectedEmptyLongId",",,,") ) /// The record type '%s' does not contain a label '%s'. - /// (Originally from ..\FSComp.txt:978) + /// (Originally from ..\FSComp.txt:977) static member nrRecordDoesNotContainSuchLabel(a0 : System.String, a1 : System.String) = (1129, GetStringFunc("nrRecordDoesNotContainSuchLabel",",,,%s,,,%s,,,") a0 a1) /// Invalid field label - /// (Originally from ..\FSComp.txt:979) + /// (Originally from ..\FSComp.txt:978) static member nrInvalidFieldLabel() = (1130, GetStringFunc("nrInvalidFieldLabel",",,,") ) /// Invalid expression '%s' - /// (Originally from ..\FSComp.txt:980) + /// (Originally from ..\FSComp.txt:979) static member nrInvalidExpression(a0 : System.String) = (1132, GetStringFunc("nrInvalidExpression",",,,%s,,,") a0) /// No constructors are available for the type '%s' - /// (Originally from ..\FSComp.txt:981) + /// (Originally from ..\FSComp.txt:980) 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:982) + /// (Originally from ..\FSComp.txt:981) 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:983) + /// (Originally from ..\FSComp.txt:982) 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:984) + /// (Originally from ..\FSComp.txt:983) 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:985) + /// (Originally from ..\FSComp.txt:984) 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:989) + /// (Originally from ..\FSComp.txt:988) static member lexCharNotAllowedInOperatorNames(a0 : System.String) = (GetStringFunc("lexCharNotAllowedInOperatorNames",",,,%s,,,") a0) /// Unexpected character '%s' - /// (Originally from ..\FSComp.txt:990) + /// (Originally from ..\FSComp.txt:989) 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:991) + /// (Originally from ..\FSComp.txt:990) static member lexByteArrayCannotEncode() = (1140, GetStringFunc("lexByteArrayCannotEncode",",,,") ) /// Identifiers followed by '%s' are reserved for future use - /// (Originally from ..\FSComp.txt:992) + /// (Originally from ..\FSComp.txt:991) 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:993) + /// (Originally from ..\FSComp.txt:992) static member lexOutsideEightBitSigned() = (1142, GetStringFunc("lexOutsideEightBitSigned",",,,") ) /// This number is outside the allowable range for hexadecimal 8-bit signed integers - /// (Originally from ..\FSComp.txt:994) + /// (Originally from ..\FSComp.txt:993) static member lexOutsideEightBitSignedHex() = (1143, GetStringFunc("lexOutsideEightBitSignedHex",",,,") ) /// This number is outside the allowable range for 8-bit unsigned integers - /// (Originally from ..\FSComp.txt:995) + /// (Originally from ..\FSComp.txt:994) static member lexOutsideEightBitUnsigned() = (1144, GetStringFunc("lexOutsideEightBitUnsigned",",,,") ) /// This number is outside the allowable range for 16-bit signed integers - /// (Originally from ..\FSComp.txt:996) + /// (Originally from ..\FSComp.txt:995) static member lexOutsideSixteenBitSigned() = (1145, GetStringFunc("lexOutsideSixteenBitSigned",",,,") ) /// This number is outside the allowable range for 16-bit unsigned integers - /// (Originally from ..\FSComp.txt:997) + /// (Originally from ..\FSComp.txt:996) static member lexOutsideSixteenBitUnsigned() = (1146, GetStringFunc("lexOutsideSixteenBitUnsigned",",,,") ) /// This number is outside the allowable range for 32-bit signed integers - /// (Originally from ..\FSComp.txt:998) + /// (Originally from ..\FSComp.txt:997) static member lexOutsideThirtyTwoBitSigned() = (1147, GetStringFunc("lexOutsideThirtyTwoBitSigned",",,,") ) /// This number is outside the allowable range for 32-bit unsigned integers - /// (Originally from ..\FSComp.txt:999) + /// (Originally from ..\FSComp.txt:998) static member lexOutsideThirtyTwoBitUnsigned() = (1148, GetStringFunc("lexOutsideThirtyTwoBitUnsigned",",,,") ) /// This number is outside the allowable range for 64-bit signed integers - /// (Originally from ..\FSComp.txt:1000) + /// (Originally from ..\FSComp.txt:999) static member lexOutsideSixtyFourBitSigned() = (1149, GetStringFunc("lexOutsideSixtyFourBitSigned",",,,") ) /// This number is outside the allowable range for 64-bit unsigned integers - /// (Originally from ..\FSComp.txt:1001) + /// (Originally from ..\FSComp.txt:1000) static member lexOutsideSixtyFourBitUnsigned() = (1150, GetStringFunc("lexOutsideSixtyFourBitUnsigned",",,,") ) /// This number is outside the allowable range for signed native integers - /// (Originally from ..\FSComp.txt:1002) + /// (Originally from ..\FSComp.txt:1001) static member lexOutsideNativeSigned() = (1151, GetStringFunc("lexOutsideNativeSigned",",,,") ) /// This number is outside the allowable range for unsigned native integers - /// (Originally from ..\FSComp.txt:1003) + /// (Originally from ..\FSComp.txt:1002) static member lexOutsideNativeUnsigned() = (1152, GetStringFunc("lexOutsideNativeUnsigned",",,,") ) /// Invalid floating point number - /// (Originally from ..\FSComp.txt:1004) + /// (Originally from ..\FSComp.txt:1003) static member lexInvalidFloat() = (1153, GetStringFunc("lexInvalidFloat",",,,") ) /// This number is outside the allowable range for decimal literals - /// (Originally from ..\FSComp.txt:1005) + /// (Originally from ..\FSComp.txt:1004) static member lexOusideDecimal() = (1154, GetStringFunc("lexOusideDecimal",",,,") ) /// This number is outside the allowable range for 32-bit floats - /// (Originally from ..\FSComp.txt:1006) + /// (Originally from ..\FSComp.txt:1005) 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:1007) + /// (Originally from ..\FSComp.txt:1006) static member lexInvalidNumericLiteral() = (1156, GetStringFunc("lexInvalidNumericLiteral",",,,") ) /// This is not a valid byte literal - /// (Originally from ..\FSComp.txt:1008) + /// (Originally from ..\FSComp.txt:1007) static member lexInvalidByteLiteral() = (1157, GetStringFunc("lexInvalidByteLiteral",",,,") ) /// This is not a valid character literal - /// (Originally from ..\FSComp.txt:1009) + /// (Originally from ..\FSComp.txt:1008) static member lexInvalidCharLiteral() = (1158, GetStringFunc("lexInvalidCharLiteral",",,,") ) /// This Unicode encoding is only valid in string literals - /// (Originally from ..\FSComp.txt:1010) + /// (Originally from ..\FSComp.txt:1009) static member lexThisUnicodeOnlyInStringLiterals() = (1159, GetStringFunc("lexThisUnicodeOnlyInStringLiterals",",,,") ) /// This token is reserved for future use - /// (Originally from ..\FSComp.txt:1011) + /// (Originally from ..\FSComp.txt:1010) static member lexTokenReserved() = (1160, GetStringFunc("lexTokenReserved",",,,") ) /// TABs are not allowed in F# code unless the #indent \"off\" option is used - /// (Originally from ..\FSComp.txt:1012) + /// (Originally from ..\FSComp.txt:1011) static member lexTabsNotAllowed() = (1161, GetStringFunc("lexTabsNotAllowed",",,,") ) /// Invalid line number: '%s' - /// (Originally from ..\FSComp.txt:1013) + /// (Originally from ..\FSComp.txt:1012) 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:1014) + /// (Originally from ..\FSComp.txt:1013) static member lexHashIfMustBeFirst() = (1163, GetStringFunc("lexHashIfMustBeFirst",",,,") ) /// #else has no matching #if - /// (Originally from ..\FSComp.txt:1015) + /// (Originally from ..\FSComp.txt:1014) static member lexHashElseNoMatchingIf() = (GetStringFunc("lexHashElseNoMatchingIf",",,,") ) /// #endif required for #else - /// (Originally from ..\FSComp.txt:1016) + /// (Originally from ..\FSComp.txt:1015) static member lexHashEndifRequiredForElse() = (GetStringFunc("lexHashEndifRequiredForElse",",,,") ) /// #else directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1017) + /// (Originally from ..\FSComp.txt:1016) static member lexHashElseMustBeFirst() = (1166, GetStringFunc("lexHashElseMustBeFirst",",,,") ) /// #endif has no matching #if - /// (Originally from ..\FSComp.txt:1018) + /// (Originally from ..\FSComp.txt:1017) static member lexHashEndingNoMatchingIf() = (GetStringFunc("lexHashEndingNoMatchingIf",",,,") ) /// #endif directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1019) + /// (Originally from ..\FSComp.txt:1018) static member lexHashEndifMustBeFirst() = (1168, GetStringFunc("lexHashEndifMustBeFirst",",,,") ) /// #if directive should be immediately followed by an identifier - /// (Originally from ..\FSComp.txt:1020) + /// (Originally from ..\FSComp.txt:1019) static member lexHashIfMustHaveIdent() = (1169, GetStringFunc("lexHashIfMustHaveIdent",",,,") ) /// Syntax error. Wrong nested #endif, unexpected tokens before it. - /// (Originally from ..\FSComp.txt:1021) + /// (Originally from ..\FSComp.txt:1020) static member lexWrongNestedHashEndif() = (1170, GetStringFunc("lexWrongNestedHashEndif",",,,") ) /// #! may only appear as the first line at the start of a file. - /// (Originally from ..\FSComp.txt:1022) + /// (Originally from ..\FSComp.txt:1021) static member lexHashBangMustBeFirstInFile() = (GetStringFunc("lexHashBangMustBeFirstInFile",",,,") ) /// Expected single line comment or end of line - /// (Originally from ..\FSComp.txt:1023) + /// (Originally from ..\FSComp.txt:1022) 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:1024) + /// (Originally from ..\FSComp.txt:1023) 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:1025) + /// (Originally from ..\FSComp.txt:1024) 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:1026) + /// (Originally from ..\FSComp.txt:1025) 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:1027) + /// (Originally from ..\FSComp.txt:1026) 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:1028) + /// (Originally from ..\FSComp.txt:1027) 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:1029) + /// (Originally from ..\FSComp.txt:1028) 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:1030) + /// (Originally from ..\FSComp.txt:1029) 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:1031) + /// (Originally from ..\FSComp.txt:1030) 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:1032) + /// (Originally from ..\FSComp.txt:1031) 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:1033) + /// (Originally from ..\FSComp.txt:1032) 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:1034) + /// (Originally from ..\FSComp.txt:1033) 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:1035) + /// (Originally from ..\FSComp.txt:1034) 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:1036) + /// (Originally from ..\FSComp.txt:1035) static member tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly() = (1181, GetStringFunc("tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly",",,,") ) /// The value '%s' is unused - /// (Originally from ..\FSComp.txt:1037) + /// (Originally from ..\FSComp.txt:1036) 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:1038) + /// (Originally from ..\FSComp.txt:1037) 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:1039) + /// (Originally from ..\FSComp.txt:1038) static member parsGetterAtMostOneArgument() = (1184, GetStringFunc("parsGetterAtMostOneArgument",",,,") ) /// A setter property may have at most two argument groups - /// (Originally from ..\FSComp.txt:1040) + /// (Originally from ..\FSComp.txt:1039) static member parsSetterAtMostTwoArguments() = (1185, GetStringFunc("parsSetterAtMostTwoArguments",",,,") ) /// Invalid property getter or setter - /// (Originally from ..\FSComp.txt:1041) + /// (Originally from ..\FSComp.txt:1040) static member parsInvalidProperty() = (1186, GetStringFunc("parsInvalidProperty",",,,") ) /// An indexer property must be given at least one argument - /// (Originally from ..\FSComp.txt:1042) + /// (Originally from ..\FSComp.txt:1041) 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:1043) + /// (Originally from ..\FSComp.txt:1042) 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:1044) + /// (Originally from ..\FSComp.txt:1043) 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:1045) + /// (Originally from ..\FSComp.txt:1044) 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:1046) + /// (Originally from ..\FSComp.txt:1045) static member parsNonAtomicType() = (GetStringFunc("parsNonAtomicType",",,,") ) /// The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s' - /// (Originally from ..\FSComp.txt:1049) + /// (Originally from ..\FSComp.txt:1048) 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:1050) + /// (Originally from ..\FSComp.txt:1049) 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:1051) + /// (Originally from ..\FSComp.txt:1050) 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:1052) + /// (Originally from ..\FSComp.txt:1051) 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:1053) + /// (Originally from ..\FSComp.txt:1052) 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:1054) + /// (Originally from ..\FSComp.txt:1053) 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:1055) + /// (Originally from ..\FSComp.txt:1054) static member tcAttribArgsDiffer(a0 : System.String) = (1200, GetStringFunc("tcAttribArgsDiffer",",,,%s,,,") a0) /// Cannot call an abstract base member: '%s' - /// (Originally from ..\FSComp.txt:1056) + /// (Originally from ..\FSComp.txt:1055) 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:1057) + /// (Originally from ..\FSComp.txt:1056) 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:1060) + /// (Originally from ..\FSComp.txt:1059) 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:1062) + /// (Originally from ..\FSComp.txt:1061) 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:1063) + /// (Originally from ..\FSComp.txt:1062) static member tcInterfacesShouldUseInheritNotInterface() = (1207, GetStringFunc("tcInterfacesShouldUseInheritNotInterface",",,,") ) /// Invalid prefix operator - /// (Originally from ..\FSComp.txt:1064) + /// (Originally from ..\FSComp.txt:1063) static member parsInvalidPrefixOperator() = (1208, GetStringFunc("parsInvalidPrefixOperator",",,,") ) /// Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. - /// (Originally from ..\FSComp.txt:1065) + /// (Originally from ..\FSComp.txt:1064) static member parsInvalidPrefixOperatorDefinition() = (1208, GetStringFunc("parsInvalidPrefixOperatorDefinition",",,,") ) /// The file extensions '.ml' and '.mli' are for ML compatibility - /// (Originally from ..\FSComp.txt:1066) + /// (Originally from ..\FSComp.txt:1065) static member buildCompilingExtensionIsForML() = (GetStringFunc("buildCompilingExtensionIsForML",",,,") ) /// Consider using a file with extension '.ml' or '.mli' instead - /// (Originally from ..\FSComp.txt:1067) + /// (Originally from ..\FSComp.txt:1066) static member lexIndentOffForML() = (GetStringFunc("lexIndentOffForML",",,,") ) /// Active pattern '%s' is not a function - /// (Originally from ..\FSComp.txt:1068) + /// (Originally from ..\FSComp.txt:1067) 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:1069) + /// (Originally from ..\FSComp.txt:1068) 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:1070) + /// (Originally from ..\FSComp.txt:1069) 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:1071) + /// (Originally from ..\FSComp.txt:1070) static member tcOptionalArgsMustComeAfterNonOptionalArgs() = (1212, GetStringFunc("tcOptionalArgsMustComeAfterNonOptionalArgs",",,,") ) /// Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes - /// (Originally from ..\FSComp.txt:1072) + /// (Originally from ..\FSComp.txt:1071) 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:1074) + /// (Originally from ..\FSComp.txt:1073) 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:1075) + /// (Originally from ..\FSComp.txt:1074) static member ilwriteMDBFileNameCannotBeChangedWarning() = (1216, GetStringFunc("ilwriteMDBFileNameCannotBeChangedWarning",",,,") ) /// MDB generation failed. Could not find compatible member %s - /// (Originally from ..\FSComp.txt:1076) + /// (Originally from ..\FSComp.txt:1075) 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:1077) + /// (Originally from ..\FSComp.txt:1076) static member ilwriteErrorCreatingMdb() = (1218, GetStringFunc("ilwriteErrorCreatingMdb",",,,") ) /// The union case named '%s' conflicts with the generated type '%s' - /// (Originally from ..\FSComp.txt:1078) + /// (Originally from ..\FSComp.txt:1077) 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:1079) + /// (Originally from ..\FSComp.txt:1078) 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:1080) + /// (Originally from ..\FSComp.txt:1079) 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:1081) + /// (Originally from ..\FSComp.txt:1080) 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:1082) + /// (Originally from ..\FSComp.txt:1081) 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:1083) + /// (Originally from ..\FSComp.txt:1082) 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:1084) + /// (Originally from ..\FSComp.txt:1083) 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:1085) + /// (Originally from ..\FSComp.txt:1084) 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:1086) + /// (Originally from ..\FSComp.txt:1085) 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:1087) + /// (Originally from ..\FSComp.txt:1086) 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:1088) + /// (Originally from ..\FSComp.txt:1087) 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:1089) + /// (Originally from ..\FSComp.txt:1088) static member parsEofInTripleQuoteStringInComment() = (1233, GetStringFunc("parsEofInTripleQuoteStringInComment",",,,") ) /// This type test or downcast will ignore the unit-of-measure '%s' - /// (Originally from ..\FSComp.txt:1090) + /// (Originally from ..\FSComp.txt:1089) static member tcTypeTestLosesMeasures(a0 : System.String) = (1240, GetStringFunc("tcTypeTestLosesMeasures",",,,%s,,,") a0) /// Expected type argument or static argument - /// (Originally from ..\FSComp.txt:1091) + /// (Originally from ..\FSComp.txt:1090) static member parsMissingTypeArgs() = (1241, GetStringFunc("parsMissingTypeArgs",",,,") ) /// Unmatched '<'. Expected closing '>' - /// (Originally from ..\FSComp.txt:1092) + /// (Originally from ..\FSComp.txt:1091) 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:1093) + /// (Originally from ..\FSComp.txt:1092) static member parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString() = (1243, GetStringFunc("parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString",",,,") ) /// Attempted to parse this as an operator name, but failed - /// (Originally from ..\FSComp.txt:1094) + /// (Originally from ..\FSComp.txt:1093) static member parsErrorParsingAsOperatorName() = (1244, GetStringFunc("parsErrorParsingAsOperatorName",",,,") ) /// \U%s is not a valid Unicode character escape sequence - /// (Originally from ..\FSComp.txt:1095) + /// (Originally from ..\FSComp.txt:1094) 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:1096) + /// (Originally from ..\FSComp.txt:1095) 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:1097) + /// (Originally from ..\FSComp.txt:1096) 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:1099) + /// (Originally from ..\FSComp.txt:1098) static member toolLocationHelperUnsupportedFrameworkVersion(a0 : System.String) = (1300, GetStringFunc("toolLocationHelperUnsupportedFrameworkVersion",",,,%s,,,") a0) /// Invalid Magic value in CLR Header - /// (Originally from ..\FSComp.txt:1103) + /// (Originally from ..\FSComp.txt:1102) static member ilSignInvalidMagicValue() = (1301, GetStringFunc("ilSignInvalidMagicValue",",,,") ) /// Bad image format - /// (Originally from ..\FSComp.txt:1104) + /// (Originally from ..\FSComp.txt:1103) static member ilSignBadImageFormat() = (1302, GetStringFunc("ilSignBadImageFormat",",,,") ) /// Private key expected - /// (Originally from ..\FSComp.txt:1105) + /// (Originally from ..\FSComp.txt:1104) static member ilSignPrivateKeyExpected() = (1303, GetStringFunc("ilSignPrivateKeyExpected",",,,") ) /// RSA key expected - /// (Originally from ..\FSComp.txt:1106) + /// (Originally from ..\FSComp.txt:1105) static member ilSignRsaKeyExpected() = (1304, GetStringFunc("ilSignRsaKeyExpected",",,,") ) /// Invalid bit Length - /// (Originally from ..\FSComp.txt:1107) + /// (Originally from ..\FSComp.txt:1106) static member ilSignInvalidBitLen() = (1305, GetStringFunc("ilSignInvalidBitLen",",,,") ) /// Invalid RSAParameters structure - '{0}' expected - /// (Originally from ..\FSComp.txt:1108) + /// (Originally from ..\FSComp.txt:1107) static member ilSignInvalidRSAParams() = (1306, GetStringFunc("ilSignInvalidRSAParams",",,,") ) /// Invalid algId - 'Exponent' expected - /// (Originally from ..\FSComp.txt:1109) + /// (Originally from ..\FSComp.txt:1108) static member ilSignInvalidAlgId() = (1307, GetStringFunc("ilSignInvalidAlgId",",,,") ) /// Invalid signature size - /// (Originally from ..\FSComp.txt:1110) + /// (Originally from ..\FSComp.txt:1109) static member ilSignInvalidSignatureSize() = (1308, GetStringFunc("ilSignInvalidSignatureSize",",,,") ) /// No signature directory - /// (Originally from ..\FSComp.txt:1111) + /// (Originally from ..\FSComp.txt:1110) static member ilSignNoSignatureDirectory() = (1309, GetStringFunc("ilSignNoSignatureDirectory",",,,") ) /// Invalid Public Key blob - /// (Originally from ..\FSComp.txt:1112) + /// (Originally from ..\FSComp.txt:1111) static member ilSignInvalidPKBlob() = (1310, GetStringFunc("ilSignInvalidPKBlob",",,,") ) /// Exiting - too many errors - /// (Originally from ..\FSComp.txt:1114) + /// (Originally from ..\FSComp.txt:1113) static member fscTooManyErrors() = (GetStringFunc("fscTooManyErrors",",,,") ) /// The documentation file has no .xml suffix - /// (Originally from ..\FSComp.txt:1115) + /// (Originally from ..\FSComp.txt:1114) static member docfileNoXmlSuffix() = (2001, GetStringFunc("docfileNoXmlSuffix",",,,") ) /// No implementation files specified - /// (Originally from ..\FSComp.txt:1116) + /// (Originally from ..\FSComp.txt:1115) static member fscNoImplementationFiles() = (2002, GetStringFunc("fscNoImplementationFiles",",,,") ) /// An %s specified version '%s', but this value is invalid and has been ignored - /// (Originally from ..\FSComp.txt:1117) + /// (Originally from ..\FSComp.txt:1116) 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:1118) + /// (Originally from ..\FSComp.txt:1117) 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:1119) + /// (Originally from ..\FSComp.txt:1118) 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:1120) + /// (Originally from ..\FSComp.txt:1119) static member fscQuotationLiteralsStaticLinking0() = (2006, GetStringFunc("fscQuotationLiteralsStaticLinking0",",,,") ) /// Static linking may not include a .EXE - /// (Originally from ..\FSComp.txt:1121) + /// (Originally from ..\FSComp.txt:1120) static member fscStaticLinkingNoEXE() = (2007, GetStringFunc("fscStaticLinkingNoEXE",",,,") ) /// Static linking may not include a mixed managed/unmanaged DLL - /// (Originally from ..\FSComp.txt:1122) + /// (Originally from ..\FSComp.txt:1121) static member fscStaticLinkingNoMixedDLL() = (2008, GetStringFunc("fscStaticLinkingNoMixedDLL",",,,") ) /// Ignoring mixed managed/unmanaged assembly '%s' during static linking - /// (Originally from ..\FSComp.txt:1123) + /// (Originally from ..\FSComp.txt:1122) 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:1124) + /// (Originally from ..\FSComp.txt:1123) 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:1125) + /// (Originally from ..\FSComp.txt:1124) static member fscAssemblyNotFoundInDependencySet(a0 : System.String) = (2012, GetStringFunc("fscAssemblyNotFoundInDependencySet",",,,%s,,,") a0) /// The key file '%s' could not be opened - /// (Originally from ..\FSComp.txt:1126) + /// (Originally from ..\FSComp.txt:1125) static member fscKeyFileCouldNotBeOpened(a0 : System.String) = (2013, GetStringFunc("fscKeyFileCouldNotBeOpened",",,,%s,,,") a0) /// A problem occurred writing the binary '%s': %s - /// (Originally from ..\FSComp.txt:1127) + /// (Originally from ..\FSComp.txt:1126) 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:1128) + /// (Originally from ..\FSComp.txt:1127) 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:1129) + /// (Originally from ..\FSComp.txt:1128) 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:1130) + /// (Originally from ..\FSComp.txt:1129) 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:1131) + /// (Originally from ..\FSComp.txt:1130) 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:1132) + /// (Originally from ..\FSComp.txt:1131) 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:1133) + /// (Originally from ..\FSComp.txt:1132) 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:1134) + /// (Originally from ..\FSComp.txt:1133) static member fscRemotingError() = (2021, GetStringFunc("fscRemotingError",",,,") ) /// Problem with filename '%s': Illegal characters in path. - /// (Originally from ..\FSComp.txt:1135) + /// (Originally from ..\FSComp.txt:1134) 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:1136) + /// (Originally from ..\FSComp.txt:1135) 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:1137) + /// (Originally from ..\FSComp.txt:1136) 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:1138) + /// (Originally from ..\FSComp.txt:1137) 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:1139) + /// (Originally from ..\FSComp.txt:1138) static member fscDeterministicDebugRequiresPortablePdb() = (2026, GetStringFunc("fscDeterministicDebugRequiresPortablePdb",",,,") ) /// Character '%s' is not allowed in provided namespace name '%s' - /// (Originally from ..\FSComp.txt:1140) + /// (Originally from ..\FSComp.txt:1139) 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:1141) + /// (Originally from ..\FSComp.txt:1140) static member etNullOrEmptyMemberName(a0 : System.String) = (3001, GetStringFunc("etNullOrEmptyMemberName",",,,%s,,,") a0) /// The provided type '%s' returned a null member - /// (Originally from ..\FSComp.txt:1142) + /// (Originally from ..\FSComp.txt:1141) 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:1143) + /// (Originally from ..\FSComp.txt:1142) 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:1144) + /// (Originally from ..\FSComp.txt:1143) 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:1145) + /// (Originally from ..\FSComp.txt:1144) 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:1146) + /// (Originally from ..\FSComp.txt:1145) 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:1147) + /// (Originally from ..\FSComp.txt:1146) 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:1148) + /// (Originally from ..\FSComp.txt:1147) 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:1149) + /// (Originally from ..\FSComp.txt:1148) 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:1150) + /// (Originally from ..\FSComp.txt:1149) 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:1151) + /// (Originally from ..\FSComp.txt:1150) 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:1152) + /// (Originally from ..\FSComp.txt:1151) 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:1153) + /// (Originally from ..\FSComp.txt:1152) 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:1154) + /// (Originally from ..\FSComp.txt:1153) 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:1155) + /// (Originally from ..\FSComp.txt:1154) 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:1156) + /// (Originally from ..\FSComp.txt:1155) static member etOneOrMoreErrorsSeenDuringExtensionTypeSetting() = (3020, GetStringFunc("etOneOrMoreErrorsSeenDuringExtensionTypeSetting",",,,") ) /// Unexpected exception from provided type '%s' member '%s': %s - /// (Originally from ..\FSComp.txt:1157) + /// (Originally from ..\FSComp.txt:1156) 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:1158) + /// (Originally from ..\FSComp.txt:1157) 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:1159) + /// (Originally from ..\FSComp.txt:1158) 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:1160) + /// (Originally from ..\FSComp.txt:1159) 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:1161) + /// (Originally from ..\FSComp.txt:1160) 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:1162) + /// (Originally from ..\FSComp.txt:1161) 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:1163) + /// (Originally from ..\FSComp.txt:1162) 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:1164) + /// (Originally from ..\FSComp.txt:1163) static member etProviderDoesNotHaveValidConstructor() = (3032, GetStringFunc("etProviderDoesNotHaveValidConstructor",",,,") ) /// The type provider '%s' reported an error: %s - /// (Originally from ..\FSComp.txt:1165) + /// (Originally from ..\FSComp.txt:1164) 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:1166) + /// (Originally from ..\FSComp.txt:1165) 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:1167) + /// (Originally from ..\FSComp.txt:1166) 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:1168) + /// (Originally from ..\FSComp.txt:1167) 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:1169) + /// (Originally from ..\FSComp.txt:1168) 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:1170) + /// (Originally from ..\FSComp.txt:1169) 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:1171) + /// (Originally from ..\FSComp.txt:1170) 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:1172) + /// (Originally from ..\FSComp.txt:1171) 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:1173) + /// (Originally from ..\FSComp.txt:1172) static member etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters() = (3044, GetStringFunc("etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters",",,,") ) /// Invalid static argument to provided type. Expected an argument of kind '%s'. - /// (Originally from ..\FSComp.txt:1174) + /// (Originally from ..\FSComp.txt:1173) 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:1175) + /// (Originally from ..\FSComp.txt:1174) 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:1176) + /// (Originally from ..\FSComp.txt:1175) 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:1177) + /// (Originally from ..\FSComp.txt:1176) static member invalidNamespaceForProvidedType() = (GetStringFunc("invalidNamespaceForProvidedType",",,,") ) /// invalid full name for provided type - /// (Originally from ..\FSComp.txt:1178) + /// (Originally from ..\FSComp.txt:1177) static member invalidFullNameForProvidedType() = (GetStringFunc("invalidFullNameForProvidedType",",,,") ) /// The type provider returned 'null', which is not a valid return value from '%s' - /// (Originally from ..\FSComp.txt:1180) + /// (Originally from ..\FSComp.txt:1179) static member etProviderReturnedNull(a0 : System.String) = (3051, GetStringFunc("etProviderReturnedNull",",,,%s,,,") a0) /// The type provider constructor has thrown an exception: %s - /// (Originally from ..\FSComp.txt:1181) + /// (Originally from ..\FSComp.txt:1180) static member etTypeProviderConstructorException(a0 : System.String) = (3053, GetStringFunc("etTypeProviderConstructorException",",,,%s,,,") a0) /// Type provider '%s' returned null from GetInvokerExpression. - /// (Originally from ..\FSComp.txt:1182) + /// (Originally from ..\FSComp.txt:1181) 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:1183) + /// (Originally from ..\FSComp.txt:1182) 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:1184) + /// (Originally from ..\FSComp.txt:1183) 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:1185) + /// (Originally from ..\FSComp.txt:1184) 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:1186) + /// (Originally from ..\FSComp.txt:1185) 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:1187) + /// (Originally from ..\FSComp.txt:1186) 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:1188) + /// (Originally from ..\FSComp.txt:1187) 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:1189) + /// (Originally from ..\FSComp.txt:1188) 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:1190) + /// (Originally from ..\FSComp.txt:1189) 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:1191) + /// (Originally from ..\FSComp.txt:1190) 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:1192) + /// (Originally from ..\FSComp.txt:1191) 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:1193) + /// (Originally from ..\FSComp.txt:1192) 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:1194) + /// (Originally from ..\FSComp.txt:1193) 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:1195) + /// (Originally from ..\FSComp.txt:1194) 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:1196) + /// (Originally from ..\FSComp.txt:1195) 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:1197) + /// (Originally from ..\FSComp.txt:1196) 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:1198) + /// (Originally from ..\FSComp.txt:1197) 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:1199) + /// (Originally from ..\FSComp.txt:1198) 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:1200) + /// (Originally from ..\FSComp.txt:1199) 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:1201) + /// (Originally from ..\FSComp.txt:1200) 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:1202) + /// (Originally from ..\FSComp.txt:1201) 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:1203) + /// (Originally from ..\FSComp.txt:1202) static member etStaticParameterAlreadyHasValue(a0 : System.String) = (3083, GetStringFunc("etStaticParameterAlreadyHasValue",",,,%s,,,") a0) /// Multiple static parameters exist with name '%s' - /// (Originally from ..\FSComp.txt:1204) + /// (Originally from ..\FSComp.txt:1203) 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:1205) + /// (Originally from ..\FSComp.txt:1204) 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:1206) + /// (Originally from ..\FSComp.txt:1205) 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:1207) + /// (Originally from ..\FSComp.txt:1206) 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:1208) + /// (Originally from ..\FSComp.txt:1207) static member tcIfThenElseMayNotBeUsedWithinQueries() = (3090, GetStringFunc("tcIfThenElseMayNotBeUsedWithinQueries",",,,") ) /// Invalid argument to 'methodhandleof' during codegen - /// (Originally from ..\FSComp.txt:1209) + /// (Originally from ..\FSComp.txt:1208) 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:1210) + /// (Originally from ..\FSComp.txt:1209) 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:1211) + /// (Originally from ..\FSComp.txt:1210) 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:1212) + /// (Originally from ..\FSComp.txt:1211) 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:1213) + /// (Originally from ..\FSComp.txt:1212) 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:1214) + /// (Originally from ..\FSComp.txt:1213) 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:1215) + /// (Originally from ..\FSComp.txt:1214) 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:1216) + /// (Originally from ..\FSComp.txt:1215) static member customOperationTextLikeZip(a0 : System.String) = (GetStringFunc("customOperationTextLikeZip",",,,%s,,,") a0) /// '%s' must be followed by a variable name. Usage: %s. - /// (Originally from ..\FSComp.txt:1217) + /// (Originally from ..\FSComp.txt:1216) 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:1218) + /// (Originally from ..\FSComp.txt:1217) 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:1219) + /// (Originally from ..\FSComp.txt:1218) 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:1220) + /// (Originally from ..\FSComp.txt:1219) 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:1221) + /// (Originally from ..\FSComp.txt:1220) static member parsExpectedExpressionAfterToken() = (3100, GetStringFunc("parsExpectedExpressionAfterToken",",,,") ) /// Expected a type after this point - /// (Originally from ..\FSComp.txt:1222) + /// (Originally from ..\FSComp.txt:1221) static member parsExpectedTypeAfterToken() = (3101, GetStringFunc("parsExpectedTypeAfterToken",",,,") ) /// Unmatched '[<'. Expected closing '>]' - /// (Originally from ..\FSComp.txt:1223) + /// (Originally from ..\FSComp.txt:1222) static member parsUnmatchedLBrackLess() = (3102, GetStringFunc("parsUnmatchedLBrackLess",",,,") ) /// Unexpected end of input in 'match' expression. Expected 'match with | -> | -> ...'. - /// (Originally from ..\FSComp.txt:1224) + /// (Originally from ..\FSComp.txt:1223) static member parsUnexpectedEndOfFileMatch() = (3103, GetStringFunc("parsUnexpectedEndOfFileMatch",",,,") ) /// Unexpected end of input in 'try' expression. Expected 'try with ' or 'try finally '. - /// (Originally from ..\FSComp.txt:1225) + /// (Originally from ..\FSComp.txt:1224) static member parsUnexpectedEndOfFileTry() = (3104, GetStringFunc("parsUnexpectedEndOfFileTry",",,,") ) /// Unexpected end of input in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1226) + /// (Originally from ..\FSComp.txt:1225) static member parsUnexpectedEndOfFileWhile() = (3105, GetStringFunc("parsUnexpectedEndOfFileWhile",",,,") ) /// Unexpected end of input in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1227) + /// (Originally from ..\FSComp.txt:1226) static member parsUnexpectedEndOfFileFor() = (3106, GetStringFunc("parsUnexpectedEndOfFileFor",",,,") ) /// Unexpected end of input in 'match' or 'try' expression - /// (Originally from ..\FSComp.txt:1228) + /// (Originally from ..\FSComp.txt:1227) 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:1229) + /// (Originally from ..\FSComp.txt:1228) 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:1230) + /// (Originally from ..\FSComp.txt:1229) static member parsUnexpectedEndOfFileElse() = (3109, GetStringFunc("parsUnexpectedEndOfFileElse",",,,") ) /// Unexpected end of input in body of lambda expression. Expected 'fun ... -> '. - /// (Originally from ..\FSComp.txt:1231) + /// (Originally from ..\FSComp.txt:1230) static member parsUnexpectedEndOfFileFunBody() = (3110, GetStringFunc("parsUnexpectedEndOfFileFunBody",",,,") ) /// Unexpected end of input in type arguments - /// (Originally from ..\FSComp.txt:1232) + /// (Originally from ..\FSComp.txt:1231) static member parsUnexpectedEndOfFileTypeArgs() = (3111, GetStringFunc("parsUnexpectedEndOfFileTypeArgs",",,,") ) /// Unexpected end of input in type signature - /// (Originally from ..\FSComp.txt:1233) + /// (Originally from ..\FSComp.txt:1232) static member parsUnexpectedEndOfFileTypeSignature() = (3112, GetStringFunc("parsUnexpectedEndOfFileTypeSignature",",,,") ) /// Unexpected end of input in type definition - /// (Originally from ..\FSComp.txt:1234) + /// (Originally from ..\FSComp.txt:1233) static member parsUnexpectedEndOfFileTypeDefinition() = (3113, GetStringFunc("parsUnexpectedEndOfFileTypeDefinition",",,,") ) /// Unexpected end of input in object members - /// (Originally from ..\FSComp.txt:1235) + /// (Originally from ..\FSComp.txt:1234) static member parsUnexpectedEndOfFileObjectMembers() = (3114, GetStringFunc("parsUnexpectedEndOfFileObjectMembers",",,,") ) /// Unexpected end of input in value, function or member definition - /// (Originally from ..\FSComp.txt:1236) + /// (Originally from ..\FSComp.txt:1235) static member parsUnexpectedEndOfFileDefinition() = (3115, GetStringFunc("parsUnexpectedEndOfFileDefinition",",,,") ) /// Unexpected end of input in expression - /// (Originally from ..\FSComp.txt:1237) + /// (Originally from ..\FSComp.txt:1236) static member parsUnexpectedEndOfFileExpression() = (3116, GetStringFunc("parsUnexpectedEndOfFileExpression",",,,") ) /// Unexpected end of type. Expected a name after this point. - /// (Originally from ..\FSComp.txt:1238) + /// (Originally from ..\FSComp.txt:1237) 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:1239) + /// (Originally from ..\FSComp.txt:1238) 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:1240) + /// (Originally from ..\FSComp.txt:1239) 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:1241) + /// (Originally from ..\FSComp.txt:1240) 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:1242) + /// (Originally from ..\FSComp.txt:1241) static member parsUnmatchedUse() = (3121, GetStringFunc("parsUnmatchedUse",",,,") ) /// Missing 'do' in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1243) + /// (Originally from ..\FSComp.txt:1242) static member parsWhileDoExpected() = (3122, GetStringFunc("parsWhileDoExpected",",,,") ) /// Missing 'do' in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1244) + /// (Originally from ..\FSComp.txt:1243) static member parsForDoExpected() = (3123, GetStringFunc("parsForDoExpected",",,,") ) /// Invalid join relation in '%s'. Expected 'expr expr', where is =, =?, ?= or ?=?. - /// (Originally from ..\FSComp.txt:1245) + /// (Originally from ..\FSComp.txt:1244) static member tcInvalidRelationInJoin(a0 : System.String) = (3125, GetStringFunc("tcInvalidRelationInJoin",",,,%s,,,") a0) /// Calls - /// (Originally from ..\FSComp.txt:1246) + /// (Originally from ..\FSComp.txt:1245) 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:1247) + /// (Originally from ..\FSComp.txt:1246) 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:1248) + /// (Originally from ..\FSComp.txt:1247) 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:1249) + /// (Originally from ..\FSComp.txt:1248) 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:1250) + /// (Originally from ..\FSComp.txt:1249) 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:1251) + /// (Originally from ..\FSComp.txt:1250) static member tcIntoNeedsRestOfQuery() = (3129, GetStringFunc("tcIntoNeedsRestOfQuery",",,,") ) /// The operator '%s' does not accept the use of 'into' - /// (Originally from ..\FSComp.txt:1252) + /// (Originally from ..\FSComp.txt:1251) 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:1253) + /// (Originally from ..\FSComp.txt:1252) 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:1254) + /// (Originally from ..\FSComp.txt:1253) 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:1255) + /// (Originally from ..\FSComp.txt:1254) 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:1256) + /// (Originally from ..\FSComp.txt:1255) 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:1257) + /// (Originally from ..\FSComp.txt:1256) static member parsMutableOnAutoPropertyShouldBeGetSetNotJustSet() = (3135, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSetNotJustSet",",,,") ) /// Type '%s' is illegal because in byref, T cannot contain byref types. - /// (Originally from ..\FSComp.txt:1258) + /// (Originally from ..\FSComp.txt:1257) 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:1259) + /// (Originally from ..\FSComp.txt:1258) 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:1260) + /// (Originally from ..\FSComp.txt:1259) static member tcNoIntegerForLoopInQuery() = (3139, GetStringFunc("tcNoIntegerForLoopInQuery",",,,") ) /// 'while' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1261) + /// (Originally from ..\FSComp.txt:1260) static member tcNoWhileInQuery() = (3140, GetStringFunc("tcNoWhileInQuery",",,,") ) /// 'try/finally' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1262) + /// (Originally from ..\FSComp.txt:1261) static member tcNoTryFinallyInQuery() = (3141, GetStringFunc("tcNoTryFinallyInQuery",",,,") ) /// 'use' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1263) + /// (Originally from ..\FSComp.txt:1262) static member tcUseMayNotBeUsedInQueries() = (3142, GetStringFunc("tcUseMayNotBeUsedInQueries",",,,") ) /// 'let!', 'use!' and 'do!' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1264) + /// (Originally from ..\FSComp.txt:1263) static member tcBindMayNotBeUsedInQueries() = (3143, GetStringFunc("tcBindMayNotBeUsedInQueries",",,,") ) /// 'return' and 'return!' may not be used in queries - /// (Originally from ..\FSComp.txt:1265) + /// (Originally from ..\FSComp.txt:1264) 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:1266) + /// (Originally from ..\FSComp.txt:1265) static member tcUnrecognizedQueryOperator() = (3145, GetStringFunc("tcUnrecognizedQueryOperator",",,,") ) /// 'try/with' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1267) + /// (Originally from ..\FSComp.txt:1266) 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:1268) + /// (Originally from ..\FSComp.txt:1267) 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:1269) + /// (Originally from ..\FSComp.txt:1268) 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:1270) + /// (Originally from ..\FSComp.txt:1269) 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:1271) + /// (Originally from ..\FSComp.txt:1270) static member invalidPlatformTarget() = (3150, GetStringFunc("invalidPlatformTarget",",,,") ) /// This member, function or value declaration may not be declared 'inline' - /// (Originally from ..\FSComp.txt:1272) + /// (Originally from ..\FSComp.txt:1271) 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:1273) + /// (Originally from ..\FSComp.txt:1272) 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:1274) + /// (Originally from ..\FSComp.txt:1273) 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:1275) + /// (Originally from ..\FSComp.txt:1274) static member crefNoSetOfHole() = (3155, GetStringFunc("crefNoSetOfHole",",,,") ) /// + 1 overload - /// (Originally from ..\FSComp.txt:1276) + /// (Originally from ..\FSComp.txt:1275) static member nicePrintOtherOverloads1() = (GetStringFunc("nicePrintOtherOverloads1",",,,") ) /// + %d overloads - /// (Originally from ..\FSComp.txt:1277) + /// (Originally from ..\FSComp.txt:1276) static member nicePrintOtherOverloadsN(a0 : System.Int32) = (GetStringFunc("nicePrintOtherOverloadsN",",,,%d,,,") a0) /// Erased to - /// (Originally from ..\FSComp.txt:1278) + /// (Originally from ..\FSComp.txt:1277) static member erasedTo() = (GetStringFunc("erasedTo",",,,") ) /// Unexpected token '%s' or incomplete expression - /// (Originally from ..\FSComp.txt:1279) + /// (Originally from ..\FSComp.txt:1278) 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:1280) + /// (Originally from ..\FSComp.txt:1279) static member parsAttributeOnIncompleteCode() = (3158, GetStringFunc("parsAttributeOnIncompleteCode",",,,") ) /// Type name cannot be empty. - /// (Originally from ..\FSComp.txt:1281) + /// (Originally from ..\FSComp.txt:1280) static member parsTypeNameCannotBeEmpty() = (3159, GetStringFunc("parsTypeNameCannotBeEmpty",",,,") ) /// Problem reading assembly '%s': %s - /// (Originally from ..\FSComp.txt:1282) + /// (Originally from ..\FSComp.txt:1281) 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:1283) + /// (Originally from ..\FSComp.txt:1282) static member tcTPFieldMustBeLiteral() = (3161, GetStringFunc("tcTPFieldMustBeLiteral",",,,") ) /// (loading description...) - /// (Originally from ..\FSComp.txt:1284) + /// (Originally from ..\FSComp.txt:1283) static member loadingDescription() = (GetStringFunc("loadingDescription",",,,") ) /// (description unavailable...) - /// (Originally from ..\FSComp.txt:1285) + /// (Originally from ..\FSComp.txt:1284) 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:1286) + /// (Originally from ..\FSComp.txt:1285) static member chkTyparMultipleClassConstraints() = (3162, GetStringFunc("chkTyparMultipleClassConstraints",",,,") ) /// 'match' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1287) + /// (Originally from ..\FSComp.txt:1286) 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:1288) + /// (Originally from ..\FSComp.txt:1287) 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:1289) + /// (Originally from ..\FSComp.txt:1288) static member cannotResolveNullableOperators(a0 : System.String) = (3165, GetStringFunc("cannotResolveNullableOperators",",,,%s,,,") a0) /// '%s' must be followed by 'in'. Usage: %s. - /// (Originally from ..\FSComp.txt:1290) + /// (Originally from ..\FSComp.txt:1289) 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:1291) + /// (Originally from ..\FSComp.txt:1290) static member parsIllegalMemberVarInObjectImplementation() = (3168, GetStringFunc("parsIllegalMemberVarInObjectImplementation",",,,") ) /// Copy-and-update record expressions must include at least one field. - /// (Originally from ..\FSComp.txt:1292) + /// (Originally from ..\FSComp.txt:1291) static member tcEmptyCopyAndUpdateRecordInvalid() = (3169, GetStringFunc("tcEmptyCopyAndUpdateRecordInvalid",",,,") ) /// '_' cannot be used as field name - /// (Originally from ..\FSComp.txt:1293) + /// (Originally from ..\FSComp.txt:1292) 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:1294) + /// (Originally from ..\FSComp.txt:1293) 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:1295) + /// (Originally from ..\FSComp.txt:1294) 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:1296) + /// (Originally from ..\FSComp.txt:1295) 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:1297) + /// (Originally from ..\FSComp.txt:1296) static member tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) /// Union case/exception field '%s' cannot be used more than once. - /// (Originally from ..\FSComp.txt:1298) + /// (Originally from ..\FSComp.txt:1297) static member tcUnionCaseFieldCannotBeUsedMoreThanOnce(a0 : System.String) = (3175, GetStringFunc("tcUnionCaseFieldCannotBeUsedMoreThanOnce",",,,%s,,,") a0) /// Named field '%s' is used more than once. - /// (Originally from ..\FSComp.txt:1299) + /// (Originally from ..\FSComp.txt:1298) 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:1300) + /// (Originally from ..\FSComp.txt:1299) 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:1301) + /// (Originally from ..\FSComp.txt:1300) static member tastConstantExpressionOverflow() = (3177, GetStringFunc("tastConstantExpressionOverflow",",,,") ) /// This is not valid literal expression. The [] attribute will be ignored. - /// (Originally from ..\FSComp.txt:1302) + /// (Originally from ..\FSComp.txt:1301) static member tcIllegalStructTypeForConstantExpression() = (3178, GetStringFunc("tcIllegalStructTypeForConstantExpression",",,,") ) /// System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. - /// (Originally from ..\FSComp.txt:1303) + /// (Originally from ..\FSComp.txt:1302) 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:1304) + /// (Originally from ..\FSComp.txt:1303) 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:1305) + /// (Originally from ..\FSComp.txt:1304) static member estApplyStaticArgumentsForMethodNotImplemented() = (GetStringFunc("estApplyStaticArgumentsForMethodNotImplemented",",,,") ) /// An error occured applying the static arguments to a provided method - /// (Originally from ..\FSComp.txt:1306) + /// (Originally from ..\FSComp.txt:1305) static member etErrorApplyingStaticArgumentsToMethod() = (3181, GetStringFunc("etErrorApplyingStaticArgumentsToMethod",",,,") ) /// Unexpected character '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1307) + /// (Originally from ..\FSComp.txt:1306) static member pplexUnexpectedChar(a0 : System.String) = (3182, GetStringFunc("pplexUnexpectedChar",",,,%s,,,") a0) /// Unexpected token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1308) + /// (Originally from ..\FSComp.txt:1307) static member ppparsUnexpectedToken(a0 : System.String) = (3183, GetStringFunc("ppparsUnexpectedToken",",,,%s,,,") a0) /// Incomplete preprocessor expression - /// (Originally from ..\FSComp.txt:1309) + /// (Originally from ..\FSComp.txt:1308) static member ppparsIncompleteExpression() = (3184, GetStringFunc("ppparsIncompleteExpression",",,,") ) /// Missing token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1310) + /// (Originally from ..\FSComp.txt:1309) 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:1311) + /// (Originally from ..\FSComp.txt:1310) 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:1312) + /// (Originally from ..\FSComp.txt:1311) 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:1313) + /// (Originally from ..\FSComp.txt:1312) static member checkNotSufficientlyGenericBecauseOfScopeAnon() = (3188, GetStringFunc("checkNotSufficientlyGenericBecauseOfScopeAnon",",,,") ) /// Redundant arguments are being ignored in function '%s'. Expected %d but got %d arguments. - /// (Originally from ..\FSComp.txt:1314) + /// (Originally from ..\FSComp.txt:1313) 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:1315) + /// (Originally from ..\FSComp.txt:1314) static member checkLowercaseLiteralBindingInPattern(a0 : System.String) = (3190, GetStringFunc("checkLowercaseLiteralBindingInPattern",",,,%s,,,") a0) /// This literal pattern does not take arguments - /// (Originally from ..\FSComp.txt:1316) + /// (Originally from ..\FSComp.txt:1315) 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:1317) + /// (Originally from ..\FSComp.txt:1316) static member tcConstructorsIllegalInAugmentation() = (3192, GetStringFunc("tcConstructorsIllegalInAugmentation",",,,") ) /// Invalid response file '%s' ( '%s' ) - /// (Originally from ..\FSComp.txt:1318) + /// (Originally from ..\FSComp.txt:1317) 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:1319) + /// (Originally from ..\FSComp.txt:1318) 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:1320) + /// (Originally from ..\FSComp.txt:1319) static member optsResponseFileNameInvalid(a0 : System.String) = (3195, GetStringFunc("optsResponseFileNameInvalid",",,,%s,,,") a0) /// Cannot find FSharp.Core.dll in compiler's directory - /// (Originally from ..\FSComp.txt:1321) + /// (Originally from ..\FSComp.txt:1320) static member fsharpCoreNotFoundToBeCopied() = (3196, GetStringFunc("fsharpCoreNotFoundToBeCopied",",,,") ) /// One tuple type is a struct tuple, the other is a reference tuple - /// (Originally from ..\FSComp.txt:1322) + /// (Originally from ..\FSComp.txt:1321) static member tcTupleStructMismatch() = (GetStringFunc("tcTupleStructMismatch",",,,") ) /// This provided method requires static parameters - /// (Originally from ..\FSComp.txt:1323) + /// (Originally from ..\FSComp.txt:1322) 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:1324) + /// (Originally from ..\FSComp.txt:1323) 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:1325) + /// (Originally from ..\FSComp.txt:1324) 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:1326) + /// (Originally from ..\FSComp.txt:1325) static member tcRecImplied() = (3199, GetStringFunc("tcRecImplied",",,,") ) /// In a recursive declaration group, 'open' declarations must come first in each module - /// (Originally from ..\FSComp.txt:1327) + /// (Originally from ..\FSComp.txt:1326) 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:1328) + /// (Originally from ..\FSComp.txt:1327) static member tcModuleAbbrevFirstInMutRec() = (3201, GetStringFunc("tcModuleAbbrevFirstInMutRec",",,,") ) /// This declaration is not supported in recursive declaration groups - /// (Originally from ..\FSComp.txt:1329) + /// (Originally from ..\FSComp.txt:1328) static member tcUnsupportedMutRecDecl() = (3202, GetStringFunc("tcUnsupportedMutRecDecl",",,,") ) /// Invalid use of 'rec' keyword - /// (Originally from ..\FSComp.txt:1330) + /// (Originally from ..\FSComp.txt:1329) 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:1331) + /// (Originally from ..\FSComp.txt:1330) 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:1332) + /// (Originally from ..\FSComp.txt:1331) 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:1333) + /// (Originally from ..\FSComp.txt:1332) static member tcFixedNotAllowed() = (3207, GetStringFunc("tcFixedNotAllowed",",,,") ) /// Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - /// (Originally from ..\FSComp.txt:1334) + /// (Originally from ..\FSComp.txt:1333) static member tcCouldNotFindOffsetToStringData() = (3208, GetStringFunc("tcCouldNotFindOffsetToStringData",",,,") ) /// The address of the variable '%s' cannot be used at this point. A method or function may not return the address of this local value. - /// (Originally from ..\FSComp.txt:1335) + /// (Originally from ..\FSComp.txt:1334) static member chkNoByrefReturnOfLocal(a0 : System.String) = (3209, GetStringFunc("chkNoByrefReturnOfLocal",",,,%s,,,") a0) /// %s is an active pattern and cannot be treated as a discriminated union case with named fields. - /// (Originally from ..\FSComp.txt:1336) + /// (Originally from ..\FSComp.txt:1335) 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:1337) + /// (Originally from ..\FSComp.txt:1336) static member DefaultParameterValueNotAppropriateForArgument() = (3211, GetStringFunc("DefaultParameterValueNotAppropriateForArgument",",,,") ) /// The system type '%s' was required but no referenced system DLL contained this type - /// (Originally from ..\FSComp.txt:1338) + /// (Originally from ..\FSComp.txt:1337) 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:1339) + /// (Originally from ..\FSComp.txt:1338) 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:1340) + /// (Originally from ..\FSComp.txt:1339) 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:1341) + /// (Originally from ..\FSComp.txt:1340) static member parsUnexpectedSymbolEqualsInsteadOfIn() = (3215, GetStringFunc("parsUnexpectedSymbolEqualsInsteadOfIn",",,,") ) /// 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:1342) + /// (Originally from ..\FSComp.txt:1341) static member keywordDescriptionAbstract() = (GetStringFunc("keywordDescriptionAbstract",",,,") ) /// Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - /// (Originally from ..\FSComp.txt:1343) + /// (Originally from ..\FSComp.txt:1342) 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:1344) + /// (Originally from ..\FSComp.txt:1343) static member keywordDescriptionAs() = (GetStringFunc("keywordDescriptionAs",",,,") ) /// Used to verify code during debugging. - /// (Originally from ..\FSComp.txt:1345) + /// (Originally from ..\FSComp.txt:1344) static member keywordDescriptionAssert() = (GetStringFunc("keywordDescriptionAssert",",,,") ) /// Used as the name of the base class object. - /// (Originally from ..\FSComp.txt:1346) + /// (Originally from ..\FSComp.txt:1345) static member keywordDescriptionBase() = (GetStringFunc("keywordDescriptionBase",",,,") ) /// In verbose syntax, indicates the start of a code block. - /// (Originally from ..\FSComp.txt:1347) + /// (Originally from ..\FSComp.txt:1346) static member keywordDescriptionBegin() = (GetStringFunc("keywordDescriptionBegin",",,,") ) /// In verbose syntax, indicates the start of a class definition. - /// (Originally from ..\FSComp.txt:1348) + /// (Originally from ..\FSComp.txt:1347) 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:1349) + /// (Originally from ..\FSComp.txt:1348) static member keywordDescriptionDefault() = (GetStringFunc("keywordDescriptionDefault",",,,") ) /// Used to declare a delegate. - /// (Originally from ..\FSComp.txt:1350) + /// (Originally from ..\FSComp.txt:1349) static member keywordDescriptionDelegate() = (GetStringFunc("keywordDescriptionDelegate",",,,") ) /// Used in looping constructs or to execute imperative code. - /// (Originally from ..\FSComp.txt:1351) + /// (Originally from ..\FSComp.txt:1350) static member keywordDescriptionDo() = (GetStringFunc("keywordDescriptionDo",",,,") ) /// In verbose syntax, indicates the end of a block of code in a looping expression. - /// (Originally from ..\FSComp.txt:1352) + /// (Originally from ..\FSComp.txt:1351) static member keywordDescriptionDone() = (GetStringFunc("keywordDescriptionDone",",,,") ) /// Used to convert to a type that is lower in the inheritance chain. - /// (Originally from ..\FSComp.txt:1353) + /// (Originally from ..\FSComp.txt:1352) static member keywordDescriptionDowncast() = (GetStringFunc("keywordDescriptionDowncast",",,,") ) /// In a for expression, used when counting in reverse. - /// (Originally from ..\FSComp.txt:1354) + /// (Originally from ..\FSComp.txt:1353) static member keywordDescriptionDownto() = (GetStringFunc("keywordDescriptionDownto",",,,") ) /// Used in conditional branching. A short form of else if. - /// (Originally from ..\FSComp.txt:1355) + /// (Originally from ..\FSComp.txt:1354) static member keywordDescriptionElif() = (GetStringFunc("keywordDescriptionElif",",,,") ) /// Used in conditional branching. - /// (Originally from ..\FSComp.txt:1356) + /// (Originally from ..\FSComp.txt:1355) 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:1357) + /// (Originally from ..\FSComp.txt:1356) static member keywordDescriptionEnd() = (GetStringFunc("keywordDescriptionEnd",",,,") ) /// Used to declare an exception type. - /// (Originally from ..\FSComp.txt:1358) + /// (Originally from ..\FSComp.txt:1357) static member keywordDescriptionException() = (GetStringFunc("keywordDescriptionException",",,,") ) /// Indicates that a declared program element is defined in another binary or assembly. - /// (Originally from ..\FSComp.txt:1359) + /// (Originally from ..\FSComp.txt:1358) static member keywordDescriptionExtern() = (GetStringFunc("keywordDescriptionExtern",",,,") ) /// Used as a Boolean literal. - /// (Originally from ..\FSComp.txt:1360) + /// (Originally from ..\FSComp.txt:1359) 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:1361) + /// (Originally from ..\FSComp.txt:1360) static member keywordDescriptionFinally() = (GetStringFunc("keywordDescriptionFinally",",,,") ) /// Used in looping constructs. - /// (Originally from ..\FSComp.txt:1362) + /// (Originally from ..\FSComp.txt:1361) static member keywordDescriptionFor() = (GetStringFunc("keywordDescriptionFor",",,,") ) /// Used in lambda expressions, also known as anonymous functions. - /// (Originally from ..\FSComp.txt:1363) + /// (Originally from ..\FSComp.txt:1362) 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:1364) + /// (Originally from ..\FSComp.txt:1363) static member keywordDescriptionFunction() = (GetStringFunc("keywordDescriptionFunction",",,,") ) /// Used to reference the top-level .NET namespace. - /// (Originally from ..\FSComp.txt:1365) + /// (Originally from ..\FSComp.txt:1364) static member keywordDescriptionGlobal() = (GetStringFunc("keywordDescriptionGlobal",",,,") ) /// Used in conditional branching constructs. - /// (Originally from ..\FSComp.txt:1366) + /// (Originally from ..\FSComp.txt:1365) static member keywordDescriptionIf() = (GetStringFunc("keywordDescriptionIf",",,,") ) /// Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. - /// (Originally from ..\FSComp.txt:1367) + /// (Originally from ..\FSComp.txt:1366) static member keywordDescriptionIn() = (GetStringFunc("keywordDescriptionIn",",,,") ) /// Used to specify a base class or base interface. - /// (Originally from ..\FSComp.txt:1368) + /// (Originally from ..\FSComp.txt:1367) static member keywordDescriptionInherit() = (GetStringFunc("keywordDescriptionInherit",",,,") ) /// Used to indicate a function that should be integrated directly into the caller's code. - /// (Originally from ..\FSComp.txt:1369) + /// (Originally from ..\FSComp.txt:1368) static member keywordDescriptionInline() = (GetStringFunc("keywordDescriptionInline",",,,") ) /// Used to declare and implement interfaces. - /// (Originally from ..\FSComp.txt:1370) + /// (Originally from ..\FSComp.txt:1369) static member keywordDescriptionInterface() = (GetStringFunc("keywordDescriptionInterface",",,,") ) /// Used to specify that a member is visible inside an assembly but not outside it. - /// (Originally from ..\FSComp.txt:1371) + /// (Originally from ..\FSComp.txt:1370) 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:1372) + /// (Originally from ..\FSComp.txt:1371) static member keywordDescriptionLazy() = (GetStringFunc("keywordDescriptionLazy",",,,") ) /// Used to associate, or bind, a name to a value or function. - /// (Originally from ..\FSComp.txt:1373) + /// (Originally from ..\FSComp.txt:1372) static member keywordDescriptionLet() = (GetStringFunc("keywordDescriptionLet",",,,") ) /// Used in asynchronous workflows to bind a name to the result of an asynchronous computation, or, in other computation expressions, used to bind a name to a result, which is of the computation type. - /// (Originally from ..\FSComp.txt:1374) + /// (Originally from ..\FSComp.txt:1373) static member keywordDescriptionLetBang() = (GetStringFunc("keywordDescriptionLetBang",",,,") ) /// Used to branch by comparing a value to a pattern. - /// (Originally from ..\FSComp.txt:1375) + /// (Originally from ..\FSComp.txt:1374) static member keywordDescriptionMatch() = (GetStringFunc("keywordDescriptionMatch",",,,") ) /// Used to declare a property or method in an object type. - /// (Originally from ..\FSComp.txt:1376) + /// (Originally from ..\FSComp.txt:1375) 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:1376) 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:1377) 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:1378) 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:1379) 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:1380) 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:1381) 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:1382) 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:1383) 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:1384) 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:1385) 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:1386) static member keywordDescriptionPrivate() = (GetStringFunc("keywordDescriptionPrivate",",,,") ) /// Allows access to a member from outside the type. - /// (Originally from ..\FSComp.txt:1388) + /// (Originally from ..\FSComp.txt:1387) static member keywordDescriptionPublic() = (GetStringFunc("keywordDescriptionPublic",",,,") ) /// Used to indicate that a function is recursive. - /// (Originally from ..\FSComp.txt:1389) + /// (Originally from ..\FSComp.txt:1388) static member keywordDescriptionRec() = (GetStringFunc("keywordDescriptionRec",",,,") ) /// Used to indicate a value to provide as the result of a computation expression. - /// (Originally from ..\FSComp.txt:1390) + /// (Originally from ..\FSComp.txt:1389) static member keywordDescriptionReturn() = (GetStringFunc("keywordDescriptionReturn",",,,") ) /// Used to indicate a computation expression that, when evaluated, provides the result of the containing computation expression. - /// (Originally from ..\FSComp.txt:1391) + /// (Originally from ..\FSComp.txt:1390) 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:1391) 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:1392) 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:1393) 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:1394) static member keywordDescriptionThen() = (GetStringFunc("keywordDescriptionThen",",,,") ) /// Used in for loops to indicate a range. - /// (Originally from ..\FSComp.txt:1396) + /// (Originally from ..\FSComp.txt:1395) 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:1396) 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:1397) 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:1398) static member keywordDescriptionUpcast() = (GetStringFunc("keywordDescriptionUpcast",",,,") ) /// Used instead of let for values that require Dispose to be called to free resources. - /// (Originally from ..\FSComp.txt:1400) + /// (Originally from ..\FSComp.txt:1399) static member keywordDescriptionUse() = (GetStringFunc("keywordDescriptionUse",",,,") ) /// Used instead of let! in asynchronous workflows and other computation expressions for values that require Dispose to be called to free resources. - /// (Originally from ..\FSComp.txt:1401) + /// (Originally from ..\FSComp.txt:1400) 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:1401) 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:1402) 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:1403) static member keywordDescriptionWhen() = (GetStringFunc("keywordDescriptionWhen",",,,") ) /// Introduces a looping construct. - /// (Originally from ..\FSComp.txt:1405) + /// (Originally from ..\FSComp.txt:1404) 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:1405) 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:1406) 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:1407) 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:1408) static member keywordDescriptionRightArrow() = (GetStringFunc("keywordDescriptionRightArrow",",,,") ) /// Assigns a value to a variable. - /// (Originally from ..\FSComp.txt:1410) + /// (Originally from ..\FSComp.txt:1409) 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:1410) 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:1411) static member keywordDescriptionDynamicCast() = (GetStringFunc("keywordDescriptionDynamicCast",",,,") ) /// Delimits a typed code quotation. - /// (Originally from ..\FSComp.txt:1413) + /// (Originally from ..\FSComp.txt:1412) static member keywordDescriptionTypedQuotation() = (GetStringFunc("keywordDescriptionTypedQuotation",",,,") ) /// Delimits a untyped code quotation. - /// (Originally from ..\FSComp.txt:1414) + /// (Originally from ..\FSComp.txt:1413) 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:1414) 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:1415) 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:1416) static member descriptionWordIs() = (GetStringFunc("descriptionWordIs",",,,") ) /// This value is not a function and cannot be applied. - /// (Originally from ..\FSComp.txt:1418) + /// (Originally from ..\FSComp.txt:1417) 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:1418) 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:1419) static member notAFunctionButMaybeIndexer() = (GetStringFunc("notAFunctionButMaybeIndexer",",,,") ) /// - /// (Originally from ..\FSComp.txt:1421) + /// (Originally from ..\FSComp.txt:1420) 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:1421) 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:1422) 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:1423) 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:1424) 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:1425) + 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:1426) + static member implicitlyDiscardedSequenceInSequenceExpression(a0 : System.String) = (3222, GetStringFunc("implicitlyDiscardedSequenceInSequenceExpression",",,,%s,,,") a0) + /// The struct type '%s' has been assumed to be immutable. + /// (Originally from ..\FSComp.txt:1427) + static member tcStructTypeAssumedImmutable(a0 : System.String) = (3223, GetStringFunc("tcStructTypeAssumedImmutable",",,,%s,,,") a0) + /// Likely mutation of a constant expression. Consider using a mutable local, e.g. 'let mutable x = ...'. + /// (Originally from ..\FSComp.txt:1428) + static member tastLikelyMutationOfConstant() = (3224, GetStringFunc("tastLikelyMutationOfConstant",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -4466,7 +4475,6 @@ type internal SR private() = ignore(GetString("FieldNotContainedLiteralsDiffer")) ignore(GetString("FieldNotContainedTypesDiffer")) ignore(GetString("typrelCannotResolveImplicitGenericInstantiation")) - ignore(GetString("typrelCannotResolveAmbiguityInOverloadedOperator")) ignore(GetString("typrelCannotResolveAmbiguityInPrintf")) ignore(GetString("typrelCannotResolveAmbiguityInEnum")) ignore(GetString("typrelCannotResolveAmbiguityInDelegate")) @@ -5702,4 +5710,8 @@ type internal SR private() = ignore(GetString("ArgumentsInSigAndImplMismatch")) ignore(GetString("pickleUnexpectedNonZero")) ignore(GetString("tcTupleMemberNotNormallyUsed")) + ignore(GetString("implicitlyDiscardedInSequenceExpression")) + ignore(GetString("implicitlyDiscardedSequenceInSequenceExpression")) + ignore(GetString("tcStructTypeAssumedImmutable")) + ignore(GetString("tastLikelyMutationOfConstant")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 6ea0731264b..77112516547 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -597,9 +597,6 @@ The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '{0}' and '{1}'. Consider using type annotations to resolve the ambiguity - - Could not resolve the ambiguity inherent in the use of the operator '{0}' at or near this program point. Consider using type annotations to resolve the ambiguity. - Could not resolve the ambiguity inherent in the use of a 'printf'-style format string @@ -1120,7 +1117,7 @@ The member or object constructor '{0}' is not {1} - The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from within inner lambda expressions, object expressions or computation expressions (such as async { }). If {0} is a protected member, consider creating a member in this type that calls it. {0} is not a static method @@ -4303,6 +4300,17 @@ An error occurred while reading the F# metadata of assembly '{0}'. 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. + + This expression returns a value of type '{0}' 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'. + + + This expression returns a value of type '{0}' 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!'. + + + The struct type '{0}' has been assumed to be immutable. + + + Likely mutation of a constant expression. Consider using a mutable local, e.g. 'let mutable x = ...'. This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs b/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs index 94cd9e3b429..26307e2ef42 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs @@ -16,14 +16,14 @@ type internal SR private() = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index ef26074ad54..a9f459e9a28 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -608,9 +608,6 @@ InteractiveSession\fsi.fs - - Misc/InternalsVisibleTo.fs - Misc/MSBuildReferenceResolver.fs @@ -619,7 +616,6 @@ Misc/LegacyHostedCompilerForTesting.fs - @@ -641,7 +637,7 @@ - + diff --git a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj index 4b53785231f..58de6435821 100644 --- a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj +++ b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj @@ -20,7 +20,7 @@ Microsoft and F# Software Foundation Visual F# Compiler FSharp functional programming -rc-$(BuildRevision.Trim())-0 - 4.2.0$(PreReleaseSuffix) + 10.1.1$(PreReleaseSuffix) -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=1.1.0" -prop "diasymreaderportablepdbversion=1.2.0" diff --git a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj index 9865e2a06e7..da0e1ac7a36 100644 --- a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj +++ b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj @@ -8,7 +8,6 @@ FSharp.Core $(NoWarn);45;55;62;75;1204 true - true $(DefineConstants);FSHARP_CORE $(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1 diff --git a/src/buildfromsource/Fsc/AssemblyInfo.fs b/src/buildfromsource/Fsc/AssemblyInfo.fs index 287c7e56925..22b900dc0bc 100644 --- a/src/buildfromsource/Fsc/AssemblyInfo.fs +++ b/src/buildfromsource/Fsc/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] +[] +[] [] do() diff --git a/src/buildfromsource/Fsc/Fsc.fsproj b/src/buildfromsource/Fsc/Fsc.fsproj index 5ee390de338..cfe3031f564 100644 --- a/src/buildfromsource/Fsc/Fsc.fsproj +++ b/src/buildfromsource/Fsc/Fsc.fsproj @@ -9,13 +9,11 @@ fsc $(NoWarn);45;55;62;75;1204 true - $(DefineConstants);COMPILER $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 - Resources/AssemblyInfo.fs diff --git a/src/buildfromsource/Fsi/AssemblyInfo.fs b/src/buildfromsource/Fsi/AssemblyInfo.fs index 38908a4cab8..30f157707b7 100644 --- a/src/buildfromsource/Fsi/AssemblyInfo.fs +++ b/src/buildfromsource/Fsi/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Reflection [] [] [] -[] -[] +[] +[] [] do() diff --git a/src/buildfromsource/Fsi/Fsi.fsproj b/src/buildfromsource/Fsi/Fsi.fsproj index 4f0dc3aed48..1819b51100b 100644 --- a/src/buildfromsource/Fsi/Fsi.fsproj +++ b/src/buildfromsource/Fsi/Fsi.fsproj @@ -9,7 +9,7 @@ fsi $(NoWarn);45;55;62;75;1204 true - $(DefineConstants);BUILD_FROM_SOURCE;COMPILER + $(DefineConstants);BUILD_FROM_SOURCE $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 diff --git a/src/buildtools/fslex/fslexast.fs b/src/buildtools/fslex/fslexast.fs index 96619645dd8..db9727cb970 100644 --- a/src/buildtools/fslex/fslexast.fs +++ b/src/buildtools/fslex/fslexast.fs @@ -1,6 +1,6 @@ (* (c) Microsoft Corporation 2005-2008. *) -module FsLexYacc.FsLex.AST +module internal FsLexYacc.FsLex.AST open System.Collections.Generic open Microsoft.FSharp.Text diff --git a/src/buildtools/fssrgen/fssrgen.fsx b/src/buildtools/fssrgen/fssrgen.fsx index 0bee9b79e11..4fe5bbb38e1 100644 --- a/src/buildtools/fssrgen/fssrgen.fsx +++ b/src/buildtools/fssrgen/fssrgen.fsx @@ -229,14 +229,14 @@ let StringBoilerPlate filename = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index d95a68a394c..2f51c59d172 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -400,6 +400,7 @@ let warningOn err level specificWarnOn = | 1182 -> false // chkUnusedValue - off by default | 3218 -> false // ArgumentsInSigAndImplMismatch - off by default | 3180 -> false // abImplicitHeapAllocation - off by default + | 3223 -> false // tcStructTypeAssumedImmutable - off by default | _ -> level >= GetWarningLevel err let SplitRelatedDiagnostics(err:PhasedDiagnostic) = @@ -532,11 +533,11 @@ let UseOfAddressOfOperatorE() = DeclareResourceString("UseOfAddressOfOperator", let DefensiveCopyWarningE() = DeclareResourceString("DefensiveCopyWarning", "%s") let DeprecatedThreadStaticBindingWarningE() = DeclareResourceString("DeprecatedThreadStaticBindingWarning", "") let FunctionValueUnexpectedE() = DeclareResourceString("FunctionValueUnexpected", "%s") -let UnitTypeExpectedE() = DeclareResourceString("UnitTypeExpected", "") -let UnitTypeExpectedWithEqualityE() = DeclareResourceString("UnitTypeExpectedWithEquality", "") -let UnitTypeExpectedWithPossiblePropertySetterE() = DeclareResourceString("UnitTypeExpectedWithPossiblePropertySetter", "%s%s") -let UnitTypeExpectedWithPossibleAssignmentE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignment", "%s") -let UnitTypeExpectedWithPossibleAssignmentToMutableE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignmentToMutable", "%s") +let UnitTypeExpectedE() = DeclareResourceString("UnitTypeExpected", "%s") +let UnitTypeExpectedWithEqualityE() = DeclareResourceString("UnitTypeExpectedWithEquality", "%s") +let UnitTypeExpectedWithPossiblePropertySetterE() = DeclareResourceString("UnitTypeExpectedWithPossiblePropertySetter", "%s%s%s") +let UnitTypeExpectedWithPossibleAssignmentE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignment", "%s%s") +let UnitTypeExpectedWithPossibleAssignmentToMutableE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignmentToMutable", "%s%s") let RecursiveUseCheckedAtRuntimeE() = DeclareResourceString("RecursiveUseCheckedAtRuntime", "") let LetRecUnsound1E() = DeclareResourceString("LetRecUnsound1", "%s") let LetRecUnsound2E() = DeclareResourceString("LetRecUnsound2", "%s%s") @@ -699,7 +700,7 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = os.Append(System.Environment.NewLine + FSComp.SR.derefInsteadOfNot()) |> ignore | _ -> os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs) |> ignore - | ErrorFromAddingTypeEquation(_, _, _, _, ((ConstraintSolverTypesNotInEqualityRelation (_, _, _, _, _, contextInfo) ) as e), _) when contextInfo <> ContextInfo.NoContext -> + | ErrorFromAddingTypeEquation(_, _, _, _, ((ConstraintSolverTypesNotInEqualityRelation (_, _, _, _, _, contextInfo) ) as e), _) when (match contextInfo with ContextInfo.NoContext -> false | _ -> true) -> OutputExceptionR os e | ErrorFromAddingTypeEquation(_, _, _, _, ((ConstraintSolverTypesNotInSubsumptionRelation _ | ConstraintSolverError _ ) as e), _) -> @@ -1292,28 +1293,32 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = os.Append(DeprecatedThreadStaticBindingWarningE().Format) |> ignore | FunctionValueUnexpected (denv, ty, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - os.Append(FunctionValueUnexpectedE().Format (NicePrint.stringOfTy denv ty)) |> ignore + let errorText = FunctionValueUnexpectedE().Format (NicePrint.stringOfTy denv ty) + os.Append errorText |> ignore - | UnitTypeExpected (_, _, _) -> - let warningText = UnitTypeExpectedE().Format + | UnitTypeExpected (denv, ty, _) -> + let ty, _cxs = PrettyTypes.PrettifyType denv.g ty + let warningText = UnitTypeExpectedE().Format (NicePrint.stringOfTy denv ty) os.Append warningText |> ignore - | UnitTypeExpectedWithEquality (_) -> - let warningText = UnitTypeExpectedWithEqualityE().Format + | UnitTypeExpectedWithEquality (denv, ty, _) -> + let ty, _cxs = PrettyTypes.PrettifyType denv.g ty + let warningText = UnitTypeExpectedWithEqualityE().Format (NicePrint.stringOfTy denv ty) os.Append warningText |> ignore - | UnitTypeExpectedWithPossiblePropertySetter (_, _, bindingName, propertyName, _) -> - let warningText = UnitTypeExpectedWithPossiblePropertySetterE().Format bindingName propertyName + | UnitTypeExpectedWithPossiblePropertySetter (denv, ty, bindingName, propertyName, _) -> + let ty, _cxs = PrettyTypes.PrettifyType denv.g ty + let warningText = UnitTypeExpectedWithPossiblePropertySetterE().Format (NicePrint.stringOfTy denv ty) bindingName propertyName os.Append warningText |> ignore - | UnitTypeExpectedWithPossibleAssignment (_, _, isAlreadyMutable, bindingName, _) -> + | UnitTypeExpectedWithPossibleAssignment (denv, ty, isAlreadyMutable, bindingName, _) -> + let ty, _cxs = PrettyTypes.PrettifyType denv.g ty let warningText = if isAlreadyMutable then - UnitTypeExpectedWithPossibleAssignmentToMutableE().Format bindingName + UnitTypeExpectedWithPossibleAssignmentToMutableE().Format (NicePrint.stringOfTy denv ty) bindingName else - UnitTypeExpectedWithPossibleAssignmentE().Format bindingName + UnitTypeExpectedWithPossibleAssignmentE().Format (NicePrint.stringOfTy denv ty) bindingName os.Append warningText |> ignore | RecursiveUseCheckedAtRuntime _ -> @@ -2283,9 +2288,7 @@ type TcConfigBuilder = mutable optSettings : Optimizer.OptimizationSettings mutable emitTailcalls : bool mutable deterministic : bool -#if PREFERRED_UI_LANG mutable preferredUiLang: string option -#endif mutable lcid : int option mutable productNameForBannerText : string /// show the MS (c) notice, e.g. with help or fsi? @@ -2444,9 +2447,7 @@ type TcConfigBuilder = optSettings = Optimizer.OptimizationSettings.Defaults emitTailcalls = true deterministic = false -#if PREFERRED_UI_LANG preferredUiLang = None -#endif lcid = None // See bug 6071 for product banner spec productNameForBannerText = FSComp.SR.buildProductName(FSharpEnvironment.FSharpBannerVersion) @@ -2627,7 +2628,7 @@ let OpenILBinary(filename, optimizeForMemory, openBinariesInMemory, ilGlobalsOpt ILBinaryReader.OpenILModuleReaderAfterReadingAllBytes filename opts else let location = -#if !FX_RESHAPED_REFLECTION_CORECLR // shadow copy not supported +#if !FX_RESHAPED_REFLECTION // shadow copy not supported // In order to use memory mapped files on the shadow copied version of the Assembly, we `preload the assembly // We swallow all exceptions so that we do not change the exception contract of this API if shadowCopyReferences then @@ -2793,7 +2794,8 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = // Look for an explicit reference to FSharp.Core and use that to compute fsharpBinariesDir // FUTURE: remove this, we only read the binary for the exception it raises let fsharpBinariesDirValue = -#if FX_NO_SIMPLIFIED_LOADER +// NOTE: It's not clear why this behaviour has been changed for the NETSTANDARD compilations of the F# compiler +#if NETSTANDARD1_6 || NETSTANDARD2_0 data.defaultFSharpBinariesDir #else match fslibExplicitFilenameOpt with @@ -2910,9 +2912,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.optSettings = data.optSettings member x.emitTailcalls = data.emitTailcalls member x.deterministic = data.deterministic -#if PREFERRED_UI_LANG member x.preferredUiLang = data.preferredUiLang -#endif member x.lcid = data.lcid member x.optsOn = data.optsOn member x.productNameForBannerText = data.productNameForBannerText @@ -2957,7 +2957,8 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = yield tcConfig.MakePathAbsolute x | None -> -#if FSI_TODO_NETCORE // there is no really good notion of runtime directory on .NETCore +// "there is no really good notion of runtime directory on .NETCore" +#if NETSTANDARD1_6 || NETSTANDARD2_0 let runtimeRoot = Path.GetDirectoryName(typeof.Assembly.Location) #else let runtimeRoot = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() @@ -4287,7 +4288,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti // specified in the attributes |> List.distinctBy (fun s -> try Path.GetFileNameWithoutExtension(s) with _ -> s) - if designTimeAssemblyNames.Length > 0 then + if not (List.isEmpty designTimeAssemblyNames) then // Find the SystemRuntimeAssemblyVersion value to report in the TypeProviderConfig. let primaryAssemblyVersion = diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index ad6a7f1648e..1d7d2b1f775 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -331,9 +331,7 @@ type TcConfigBuilder = mutable optSettings : Optimizer.OptimizationSettings mutable emitTailcalls: bool mutable deterministic: bool -#if PREFERRED_UI_LANG mutable preferredUiLang: string option -#endif mutable lcid : int option mutable productNameForBannerText: string mutable showBanner : bool @@ -481,11 +479,7 @@ type TcConfig = member optSettings : Optimizer.OptimizationSettings member emitTailcalls: bool member deterministic: bool -#if PREFERRED_UI_LANG member preferredUiLang: string option -#else - member lcid : int option -#endif member optsOn : bool member productNameForBannerText: string member showBanner : bool diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 1c78fd9aa33..dd4ea4e1ef6 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -470,7 +470,13 @@ let SetDebugSwitch (tcConfigB : TcConfigBuilder) (dtype : string option) (s : Op | "portable" -> tcConfigB.portablePDB <- true; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- true; tcConfigB.ignoreSymbolStoreSequencePoints <- true | "pdbonly" -> tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- false | "embedded" -> tcConfigB.portablePDB <- true; tcConfigB.embeddedPDB <- true; tcConfigB.jitTracking <- true; tcConfigB.ignoreSymbolStoreSequencePoints <- true +#if FX_NO_PDB_WRITER + // When building on the coreclr, full means portable + | "full" -> tcConfigB.portablePDB <- true; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- true +#else | "full" -> tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- true +#endif + | _ -> error(Error(FSComp.SR.optsUnrecognizedDebugType(s), rangeCmdArgs)) | None -> tcConfigB.portablePDB <- false; tcConfigB.embeddedPDB <- false; tcConfigB.jitTracking <- s = OptionSwitch.On; tcConfigB.debuginfo <- s = OptionSwitch.On @@ -739,10 +745,8 @@ let codePageFlag (tcConfigB : TcConfigBuilder) = tcConfigB.inputCodePage <- Some(n)), None, Some (FSComp.SR.optsCodepage())) -#if PREFERRED_UI_LANG let preferredUiLang (tcConfigB: TcConfigBuilder) = CompilerOption("preferreduilang", tagString, OptionString (fun s -> tcConfigB.preferredUiLang <- Some(s)), None, Some(FSComp.SR.optsPreferredUiLang())) -#endif let utf8OutputFlag (tcConfigB: TcConfigBuilder) = CompilerOption("utf8output", tagNone, OptionUnit (fun () -> tcConfigB.utf8output <- true), None, @@ -771,9 +775,7 @@ let advancedFlagsBoth tcConfigB = [ yield codePageFlag tcConfigB yield utf8OutputFlag tcConfigB -#if PREFERRED_UI_LANG yield preferredUiLang tcConfigB -#endif yield fullPathsFlag tcConfigB yield libFlag tcConfigB yield CompilerOption("simpleresolution", @@ -849,11 +851,7 @@ let testFlag tcConfigB = let vsSpecificFlags (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 -#if PREFERRED_UI_LANG CompilerOption("LCID", tagInt, OptionInt (fun _n -> ()), None, None) -#else - CompilerOption("LCID", tagInt, OptionInt (fun n -> tcConfigB.lcid <- Some(n)), None, None) -#endif CompilerOption("flaterrors", tagNone, OptionUnit (fun () -> tcConfigB.flatErrors <- true), None, None) CompilerOption("sqmsessionguid", tagNone, OptionString (fun s -> tcConfigB.sqmSessionGuid <- try System.Guid(s) |> Some with e -> None), None, None) CompilerOption("gccerrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.GccErrors), None, None) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 336eea3e28a..8b1cea8c9f5 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -142,6 +142,8 @@ type ContextInfo = | FollowingPatternMatchClause of range /// The type equation comes from a pattern match guard. | PatternMatchGuard of range +/// The type equation comes from a sequence expression. +| SequenceExpression of TType exception ConstraintSolverTupleDiffLengths of DisplayEnv * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of ContextInfo * DisplayEnv * TType * TType * range * range @@ -357,7 +359,7 @@ let FilterEachThenUndo f meths = trace.Undo() match CheckNoErrorsAndGetWarnings res with | None -> None - | Some warns -> Some (calledMeth, warns.Length, trace)) + | Some warns -> Some (calledMeth, warns, trace)) let ShowAccessDomain ad = match ad with @@ -2192,8 +2194,8 @@ and ResolveOverloading (ArgsEquivInsideUndo csenv cx.IsSome) reqdRetTyOpt calledMeth) with - | [(calledMeth, _, _)] -> - Some calledMeth, CompleteD, NoTrace // Can't re-play the trace since ArgsEquivInsideUndo was used + | [(calledMeth, warns, _)] -> + Some calledMeth, OkResult (warns, ()), NoTrace // Can't re-play the trace since ArgsEquivInsideUndo was used | _ -> // Now determine the applicable methods. @@ -2253,8 +2255,8 @@ and ResolveOverloading None, ErrorD (failOverloading (FSComp.SR.csNoOverloadsFound methodName) errors), NoTrace - | [(calledMeth, _, t)] -> - Some calledMeth, CompleteD, WithTrace t + | [(calledMeth, warns, t)] -> + Some calledMeth, OkResult (warns, ()), WithTrace t | applicableMeths -> @@ -2290,7 +2292,9 @@ and ResolveOverloading if c <> 0 then c else 0 - let better (candidate:CalledMeth<_>, candidateWarnCount, _) (other:CalledMeth<_>, otherWarnCount, _) = + let better (candidate:CalledMeth<_>, candidateWarnings, _) (other:CalledMeth<_>, otherwarnings, _) = + let candidateWarnCount = List.length candidateWarnings + let otherWarnCount = List.length otherwarnings // Prefer methods that don't give "this code is less generic" warnings // Note: Relies on 'compare' respecting true > false let c = compare (candidateWarnCount = 0) (otherWarnCount = 0) @@ -2381,7 +2385,7 @@ and ResolveOverloading else None) match bestMethods with - | [(calledMeth, _, t)] -> Some calledMeth, CompleteD, WithTrace t + | [(calledMeth, warns, t)] -> Some calledMeth, OkResult (warns, ()), WithTrace t | bestMethods -> let methodNames = let methods = diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 022dd0930bf..b483c00fb05 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -70,7 +70,8 @@ type ContextInfo = | FollowingPatternMatchClause of range /// The type equation comes from a pattern match guard. | PatternMatchGuard of range - +/// The type equation comes from a sequence expression. +| SequenceExpression of TType exception ConstraintSolverTupleDiffLengths of DisplayEnv * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of ContextInfo * DisplayEnv * TType * TType * range * range diff --git a/src/fsharp/ErrorLogger.fs b/src/fsharp/ErrorLogger.fs index e654fd67e47..fdce9b55223 100755 --- a/src/fsharp/ErrorLogger.fs +++ b/src/fsharp/ErrorLogger.fs @@ -2,11 +2,7 @@ module public Microsoft.FSharp.Compiler.ErrorLogger -open Internal.Utilities open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics -open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library -open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.Range open System @@ -109,23 +105,23 @@ exception ErrorWithSuggestions of (int * string) * range * string * Suggestions let inline protectAssemblyExploration dflt f = try f() - with - | UnresolvedPathReferenceNoRange _ -> dflt - | _ -> reraise() + with + | UnresolvedPathReferenceNoRange _ -> dflt + | _ -> reraise() let inline protectAssemblyExplorationF dflt f = try f() - with - | UnresolvedPathReferenceNoRange (asmName, path) -> dflt(asmName, path) - | _ -> reraise() + with + | UnresolvedPathReferenceNoRange (asmName, path) -> dflt(asmName, path) + | _ -> reraise() let inline protectAssemblyExplorationNoReraise dflt1 dflt2 f = try f() - with - | UnresolvedPathReferenceNoRange _ -> dflt1 - | _ -> dflt2 + with + | UnresolvedPathReferenceNoRange _ -> dflt1 + | _ -> dflt2 // Attach a range if this is a range dual exception. let rec AttachRange m (exn:exn) = @@ -150,20 +146,22 @@ type Exiter = let QuitProcessExiter = { new Exiter with - member x.Exit(n) = + member __.Exit(n) = try System.Environment.Exit(n) with _ -> () - failwithf "%s" <| FSComp.SR.elSysEnvExitDidntExit() } + FSComp.SR.elSysEnvExitDidntExit() + |> failwith } /// Closed enumeration of build phases. +[] type BuildPhase = | DefaultPhase | Compile | Parameter | Parse | TypeCheck | CodeGen - | Optimize | IlxGen | IlGen | Output + | Optimize | IlxGen | IlGen | Output | Interactive // An error seen during interactive execution /// Literal build phase subcategory strings. @@ -212,17 +210,17 @@ type PhasedDiagnostic = /// member pe.Subcategory() = match pe.Phase with - | DefaultPhase -> BuildPhaseSubcategory.DefaultPhase - | Compile -> BuildPhaseSubcategory.Compile - | Parameter -> BuildPhaseSubcategory.Parameter - | Parse -> BuildPhaseSubcategory.Parse - | TypeCheck -> BuildPhaseSubcategory.TypeCheck - | CodeGen -> BuildPhaseSubcategory.CodeGen - | Optimize -> BuildPhaseSubcategory.Optimize - | IlxGen -> BuildPhaseSubcategory.IlxGen - | IlGen -> BuildPhaseSubcategory.IlGen - | Output -> BuildPhaseSubcategory.Output - | Interactive -> BuildPhaseSubcategory.Interactive + | BuildPhase.DefaultPhase -> BuildPhaseSubcategory.DefaultPhase + | BuildPhase.Compile -> BuildPhaseSubcategory.Compile + | BuildPhase.Parameter -> BuildPhaseSubcategory.Parameter + | BuildPhase.Parse -> BuildPhaseSubcategory.Parse + | BuildPhase.TypeCheck -> BuildPhaseSubcategory.TypeCheck + | BuildPhase.CodeGen -> BuildPhaseSubcategory.CodeGen + | BuildPhase.Optimize -> BuildPhaseSubcategory.Optimize + | BuildPhase.IlxGen -> BuildPhaseSubcategory.IlxGen + | BuildPhase.IlGen -> BuildPhaseSubcategory.IlGen + | BuildPhase.Output -> BuildPhaseSubcategory.Output + | BuildPhase.Interactive -> BuildPhaseSubcategory.Interactive /// Return true if the textual phase given is from the compile part of the build process. /// This set needs to be equal to the set of subcategories that the language service can produce. @@ -256,7 +254,7 @@ type PhasedDiagnostic = member pe.IsPhaseInCompile() = let isPhaseInCompile = match pe.Phase with - | Compile | Parameter | Parse | TypeCheck -> true + | BuildPhase.Compile | BuildPhase.Parameter | BuildPhase.Parse | BuildPhase.TypeCheck -> true | _ -> false // Sanity check ensures that Phase matches Subcategory #if DEBUG @@ -274,7 +272,7 @@ type ErrorLogger(nameForDebugging:string) = // The 'Impl' factoring enables a developer to place a breakpoint at the non-Impl // code just below and get a breakpoint for all error logger implementations. abstract DiagnosticSink: phasedError: PhasedDiagnostic * isError: bool -> unit - member this.DebugDisplay() = sprintf "ErrorLogger(%s)" nameForDebugging + member __.DebugDisplay() = sprintf "ErrorLogger(%s)" nameForDebugging let DiscardErrorsLogger = { new ErrorLogger("DiscardErrorsLogger") with @@ -337,7 +335,7 @@ module ErrorLoggerExtensions = try let preserveStackTrace = typeof.GetMethod("InternalPreserveStackTrace", BindingFlags.Instance ||| BindingFlags.NonPublic) preserveStackTrace.Invoke(exn, null) |> ignore - with e-> + with _ -> // This is probably only the mono case. System.Diagnostics.Debug.Assert(false, "Could not preserve stack trace for watson exception.") () @@ -411,7 +409,7 @@ module ErrorLoggerExtensions = x.ErrorR (AttachRange m exn) // may raise exceptions, e.g. an fsi error sink raises StopProcessing. ReraiseIfWatsonable(exn) with - | ReportedError _ | WrappedError(ReportedError _, _) -> () + | ReportedError _ | WrappedError(ReportedError _, _) -> () member x.StopProcessingRecovery (exn:exn) (m:range) = // Do standard error recovery. @@ -421,10 +419,11 @@ module ErrorLoggerExtensions = match exn with | StopProcessing | WrappedError(StopProcessing, _) -> () // suppress, so skip error recovery. | _ -> - try x.ErrorRecovery exn m + try + x.ErrorRecovery exn m with - | StopProcessing | WrappedError(StopProcessing, _) -> () // catch, e.g. raised by DiagnosticSink. - | ReportedError _ | WrappedError(ReportedError _, _) -> () // catch, but not expected unless ErrorRecovery is changed. + | StopProcessing | WrappedError(StopProcessing, _) -> () // catch, e.g. raised by DiagnosticSink. + | ReportedError _ | WrappedError(ReportedError _, _) -> () // catch, but not expected unless ErrorRecovery is changed. member x.ErrorRecoveryNoRange (exn:exn) = x.ErrorRecovery exn range0 @@ -445,13 +444,13 @@ let PushErrorLoggerPhaseUntilUnwind(errorLoggerTransformer : ErrorLogger -> #Err let newInstalled = ref true let newIsInstalled() = if !newInstalled then () else (assert false; (); (*failwith "error logger used after unwind"*)) // REVIEW: ok to throw? let chkErrorLogger = { new ErrorLogger("PushErrorLoggerPhaseUntilUnwind") with - member x.DiagnosticSink(phasedError, isError) = newIsInstalled(); newErrorLogger.DiagnosticSink(phasedError, isError) - member x.ErrorCount = newIsInstalled(); newErrorLogger.ErrorCount } + member __.DiagnosticSink(phasedError, isError) = newIsInstalled(); newErrorLogger.DiagnosticSink(phasedError, isError) + member __.ErrorCount = newIsInstalled(); newErrorLogger.ErrorCount } CompileThreadStatic.ErrorLogger <- chkErrorLogger { new System.IDisposable with - member x.Dispose() = + member __.Dispose() = CompileThreadStatic.ErrorLogger <- oldErrorLogger newInstalled := false } @@ -461,13 +460,13 @@ let SetThreadErrorLoggerNoUnwind(errorLogger) = CompileThreadStatic.ErrorLog // Global functions are still used by parser and TAST ops. /// Raises an exception with error recovery and returns unit. -let errorR exn = CompileThreadStatic.ErrorLogger.ErrorR exn +let errorR exn = CompileThreadStatic.ErrorLogger.ErrorR exn /// Raises a warning with error recovery and returns unit. let warning exn = CompileThreadStatic.ErrorLogger.Warning exn /// Raises a special exception and returns 'T - can be caught later at an errorRecovery point. -let error exn = CompileThreadStatic.ErrorLogger.Error exn +let error exn = CompileThreadStatic.ErrorLogger.Error exn /// Simulates an error. For test purposes only. let simulateError (p : PhasedDiagnostic) = CompileThreadStatic.ErrorLogger.SimulateError p @@ -497,8 +496,8 @@ let suppressErrorReporting f = try let errorLogger = { new ErrorLogger("suppressErrorReporting") with - member x.DiagnosticSink(_phasedError, _isError) = () - member x.ErrorCount = 0 } + member __.DiagnosticSink(_phasedError, _isError) = () + member __.ErrorCount = 0 } SetThreadErrorLoggerNoUnwind(errorLogger) f() finally diff --git a/src/fsharp/ExtensionTyping.fs b/src/fsharp/ExtensionTyping.fs index d348e13c585..b1d46b8eba7 100755 --- a/src/fsharp/ExtensionTyping.fs +++ b/src/fsharp/ExtensionTyping.fs @@ -38,6 +38,7 @@ module internal ExtensionTyping = // Specify the tooling-compatible fragments of a path such as: // typeproviders/fsharp41/net461/MyProvider.DesignTime.dll + // tools/fsharp41/net461/MyProvider.DesignTime.dll // See https://github.com/Microsoft/visualfsharp/issues/3736 // Represents the FF#-compiler <-> type provider protocol. @@ -55,16 +56,12 @@ module internal ExtensionTyping = System.Diagnostics.Debug.Assert(false, "Couldn't determine runtime tooling context, assuming it supports at least .NET Standard 2.0") [ "netstandard2.0"] - // When significant new processor types appear add a new moniker here. Note that use of this qualifier will be very rare - // and we don't expect different design-time assemblies will be needed for different architectures very often. Some - // exceptions may be design-time components for type providers for systems such as Python or R. - let toolingCompatibleArch() = if sizeof = 8 then "x64" else "x86" + let toolingCompatiblePaths() = [ for protocol in toolingCompatibleTypeProviderProtocolMonikers() do - for netRuntime in toolingCompatibleVersions() do - let dir = Path.Combine("typeproviders", protocol, netRuntime) - yield Path.Combine(dir, toolingCompatibleArch()) - yield dir + for netRuntime in toolingCompatibleVersions() do + yield Path.Combine("typeproviders", protocol, netRuntime) + yield Path.Combine("tools", protocol, netRuntime) ] /// Load a the design-time part of a type-provider into the host process, and look for types diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 2ca518ff532..1c61f809961 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1422,3 +1422,7 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3218,ArgumentsInSigAndImplMismatch,"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." 3219,pickleUnexpectedNonZero,"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." 3220,tcTupleMemberNotNormallyUsed,"This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead." +3221,implicitlyDiscardedInSequenceExpression,"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'." +3222,implicitlyDiscardedSequenceInSequenceExpression,"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!'." +3223,tcStructTypeAssumedImmutable,"The struct type '%s' has been assumed to be immutable." +3224,tastLikelyMutationOfConstant,"Likely mutation of a constant expression. Consider using a mutable local, e.g. 'let mutable x = ...'." diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index 29df23d2296..eb8a8f975cf 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -886,19 +886,19 @@ This expression is a function value, i.e. is missing arguments. Its type is {0}. - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. This recursive use will be checked for initialization-soundness at runtime. This warning is usually harmless, and may be suppressed by using '#nowarn "21"' or '--nowarn:21'. diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj index 8aba433807d..fa539c3c2b6 100644 --- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj +++ b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj @@ -9,9 +9,8 @@ Library - FSharp.Build-proto + FSharp.Build true - BUILDING_WITH_LKG;$(DefineConstants) LKG {D8BC791F-C1A9-49DC-9432-0F3090537555} @@ -40,30 +39,21 @@ WriteCodeFragment.fs - - Microsoft.FSharp-proto.targets - Microsoft.FSharp-proto.targets - {BuildSuffix} - -proto - - - Microsoft.Portable.FSharp-proto.targets - Microsoft.Portable.FSharp-proto.targets - {BuildSuffix} - -proto - - - Microsoft.FSharp.NetSdk-proto.props - Microsoft.FSharp.NetSdk-proto.props - {BuildSuffix} - -proto - - - Microsoft.FSharp.NetSdk-proto.targets - Microsoft.FSharp.NetSdk-proto.targets - {BuildSuffix} - -proto - + + Microsoft.FSharp.Targets + + + Microsoft.Portable.FSharp.Targets + + + Microsoft.FSharp.NetSdk.props + + + Microsoft.FSharp.NetSdk.targets + + + Microsoft.FSharp.Overrides.NetSdk.targets + @@ -72,7 +62,7 @@ - + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll @@ -90,5 +80,19 @@ FSharp.Core + + + $(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 + + diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index 8afac8cfdbd..fa3c7006638 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -33,35 +33,20 @@ - - Microsoft.FSharp.Targets - {BuildSuffix} - - - - Microsoft.Portable.FSharp.Targets - {BuildSuffix} - - - - Microsoft.FSharp.NetSdk.props - {BuildSuffix} - - - - Microsoft.FSharp.NetSdk.targets - {BuildSuffix} - - + + + + + - + - + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll @@ -75,6 +60,20 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.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} diff --git a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs index 3746f94adc8..8be55fda907 100644 --- a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs +++ b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs @@ -239,14 +239,14 @@ open Printf // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t @@ -348,14 +348,16 @@ open Printf let outFilename = Path.Combine(_outputPath, justfilename + ".fs") let outXmlFilename = Path.Combine(_outputPath, justfilename + ".resx") - if File.Exists(outFilename) && - File.Exists(outXmlFilename) && - File.Exists(filename) && - File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outFilename) && - File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outXmlFilename) then - printMessage (sprintf "Skipping generation of %s and %s since up-to-date" outFilename outXmlFilename) + let condition1 = File.Exists(outFilename) + let condition2 = condition1 && File.Exists(outXmlFilename) + let condition3 = condition2 && File.Exists(filename) + let condition4 = condition3 && (File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outFilename)) + let condition5 = condition4 && (File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outXmlFilename) ) + if condition5 then + printMessage (sprintf "Skipping generation of %s and %s from %s since up-to-date" outFilename outXmlFilename filename) Some (filename, outFilename, outXmlFilename) else + printMessage (sprintf "Generating %s and %s from %s, because condition %d is false, see FSharpEmbedResourceText.fs in the F# source" outFilename outXmlFilename filename (if not condition1 then 1 elif not condition2 then 2 elif not condition3 then 3 elif not condition4 then 4 else 5) ) printMessage (sprintf "Reading %s" filename) let lines = File.ReadAllLines(filename) diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets index 93b116b7618..341c9e4bd2a 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets @@ -73,4 +73,31 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and + + $(TargetsForTfmSpecificContentInPackage);PackageFSharpDesignTimeTools + + + + + fsharp41 + tools + + + + + + + <_ResolvedProjectOutputFiles + Include="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/*" + Exclude="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/FSharp.Core.dll;%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/System.ValueTuple.dll" + Condition="'%(_ResolvedProjectReferencePaths.IsFSharpDesignTimeProvider)' == 'true'"> + %(_ResolvedProjectReferencePaths.NearestTargetFramework) + + + + $(FSharpToolsDirectory)/$(FSharpDesignTimeProtocol)/%(_ResolvedProjectOutputFiles.NearestTargetFramework)/%(_ResolvedProjectOutputFiles.FileName)%(_ResolvedProjectOutputFiles.Extension) + + + + diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets new file mode 100644 index 00000000000..ce837dbf213 --- /dev/null +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets @@ -0,0 +1,36 @@ + + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets index 4274f54af2a..bed6e890810 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets @@ -21,11 +21,11 @@ this file. $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - + + + + + true diff --git a/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets index d0a3df1cbce..54491a3c2a5 100644 --- a/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets +++ b/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets @@ -15,8 +15,8 @@ - - + + diff --git a/src/fsharp/FSharp.Compiler.Interactive.Settings/InternalsVisibleTo.fs b/src/fsharp/FSharp.Compiler.Interactive.Settings/InternalsVisibleTo.fs deleted file mode 100644 index 3071a74b616..00000000000 --- a/src/fsharp/FSharp.Compiler.Interactive.Settings/InternalsVisibleTo.fs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.FSharp -open System.Reflection -[] -[] -[] - -do() - diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index b9aebe79526..25aa3782ff5 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -644,17 +644,17 @@ FSIstrings.txt - InteractiveSession\fsi.fsi + InteractiveSession/fsi.fsi - InteractiveSession\fsi.fs + InteractiveSession/fsi.fs - + Misc/MSBuildReferenceResolver.fs - + Misc/LegacyHostedCompilerForTesting.fs @@ -683,9 +683,11 @@ ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - ..\..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll true + + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec index 3b663e8d3d5..f245cf71c96 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec @@ -33,7 +33,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json index 09cfefb19fc..51cef4f7ef2 100644 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ b/src/fsharp/FSharp.Compiler.Private/project.json @@ -19,7 +19,7 @@ "System.Threading.ThreadPool": "4.3.0", "Microsoft.DiaSymReader.PortablePdb": "1.2.0", "Microsoft.DiaSymReader": "1.1.0", - "System.ValueTuple": "4.3.1" + "System.ValueTuple": "4.4.0" }, "runtimes": { "win7-x86": { }, diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props index ca04df941be..0fa6de691de 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props @@ -15,6 +15,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin -rtm-$(BuildRevision.Trim())-0 $(FSPackageVersion)$(PreReleaseSuffix) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" + + diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets index d6715e4aa35..77715c61129 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets @@ -15,8 +15,6 @@ - - @@ -34,7 +32,7 @@ Outputs='$(FSharpSourcesRoot)\$(Configuration)\artifacts\$(PackageVersion)\"%(PackageNuspec.Filename)).nupkg'> - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" -prop "githeadsha=$(GitHeadSha)" diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index bc4d6151105..c70df6f21e5 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -4,7 +4,8 @@ Microsoft.FSharp.Compiler .NET Core compatible version of the fsharp compiler fsc.exe. - Supported Platforms: - .NET Core (.netstandard1.6) + Supported Platforms: - .NET Core (.netstandard1.6). + Commit hash: $githeadsha$. en-US true @@ -32,7 +33,7 @@ - + @@ -41,8 +42,9 @@ - + + @@ -63,8 +65,9 @@ - + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 0782573e054..f34a02e644e 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -31,7 +31,7 @@ - + @@ -55,8 +55,9 @@ - + + diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 4bdef1b8ed1..9eed52354c7 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -11,6 +11,7 @@ .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) netstandard2.0 (netstandard2.0) + Commit hash: $githeadsha$. en-US $version$ diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index f8dc68b0c9e..d14d40aeda2 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -61,7 +61,7 @@ $(FSharpCoreLatestTargetPackageVersion) $(FSharpCoreLatestTargetMajorVersion) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(GitHeadSha)" diff --git a/src/fsharp/FSharp.Core/FSharp.Core.fsproj b/src/fsharp/FSharp.Core/FSharp.Core.fsproj index b5e1f0d9dbc..1da4c6da6d6 100644 --- a/src/fsharp/FSharp.Core/FSharp.Core.fsproj +++ b/src/fsharp/FSharp.Core/FSharp.Core.fsproj @@ -20,7 +20,6 @@ 0x05000000 true true - true $(OtherFlags) --warnon:1182 --compiling-fslib --extraoptimizationloops:1 $(OtherFlags) --warnon:3218 $(OtherFlags) --maxerrors:20 @@ -34,8 +33,8 @@ PreserveNewest - - + + false diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index a158389b7fd..de563815769 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -1270,7 +1270,6 @@ namespace Microsoft.FSharp.Collections let count' = Operators.min count len Microsoft.FSharp.Primitives.Basics.Array.subUnchecked 0 count' array -#if !FX_NO_TPL_PARALLEL module Parallel = open System.Threading.Tasks @@ -1380,4 +1379,3 @@ namespace Microsoft.FSharp.Collections iFalse <- iFalse + 1 res1, res2 -#endif diff --git a/src/fsharp/FSharp.Core/array.fsi b/src/fsharp/FSharp.Core/array.fsi index 57fbd543a37..714f253a052 100644 --- a/src/fsharp/FSharp.Core/array.fsi +++ b/src/fsharp/FSharp.Core/array.fsi @@ -1110,7 +1110,6 @@ namespace Microsoft.FSharp.Collections [] val zip3: array1:'T1[] -> array2:'T2[] -> array3:'T3[] -> ('T1 * 'T2 * 'T3)[] -#if !FX_NO_TPL_PARALLEL /// Provides parallel operations on arrays module Parallel = @@ -1206,4 +1205,3 @@ namespace Microsoft.FSharp.Collections /// Thrown when the input array is null. [] val partition : predicate:('T -> bool) -> array:'T[] -> 'T[] * 'T[] -#endif diff --git a/src/fsharp/FSharp.Core/array2.fs b/src/fsharp/FSharp.Core/array2.fs index ec06deb96f1..d6836475f7e 100644 --- a/src/fsharp/FSharp.Core/array2.fs +++ b/src/fsharp/FSharp.Core/array2.fs @@ -53,7 +53,7 @@ namespace Microsoft.FSharp.Collections [] let zeroCreateBased (base1:int) (base2:int) (length1:int) (length2:int) = if (base1 = 0 && base2 = 0) then -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 zeroCreate length1 length2 #else // Note: this overload is available on Compact Framework and Silverlight, but not Portable diff --git a/src/fsharp/FSharp.Core/control.fs b/src/fsharp/FSharp.Core/control.fs index aac964744e9..6be535a316e 100644 --- a/src/fsharp/FSharp.Core/control.fs +++ b/src/fsharp/FSharp.Core/control.fs @@ -154,33 +154,6 @@ namespace Microsoft.FSharp.Control | _ -> failwith "Internal error: attempting to install continuation twice" -#if FSCORE_PORTABLE_NEW - // Imitation of desktop functionality for .NETCore - // 1. QueueUserWorkItem reimplemented as Task.Run - // 2. Thread.CurrentThread type in the code is typically used to check if continuation is called on the same thread that initiated the async computation - // if this condition holds we may decide to invoke continuation directly rather than queueing it. - // Thread type here is barely a wrapper over CurrentManagedThreadId value - it should be enough to uniquely identify the actual thread - - [] - type internal WaitCallback = WaitCallback of (obj -> unit) - - type ThreadPool = - static member QueueUserWorkItem(WaitCallback(cb), state : obj) = - System.Threading.Tasks.Task.Run (fun () -> cb(state)) |> ignore - true - - [] - type Thread(threadId : int) = - static member CurrentThread = Thread(Environment.CurrentManagedThreadId) - member this.ThreadId = threadId - override this.GetHashCode() = threadId - override this.Equals(other : obj) = - match other with - | :? Thread as other -> threadId = other.ThreadId - | _ -> false - -#endif - type TrampolineHolder() as this = let mutable trampoline = null @@ -356,21 +329,13 @@ namespace Microsoft.FSharp.Control - // Reify exceptional results as exceptions + /// Reify exceptional results as exceptions let commit res = match res with | Ok res -> res | Error edi -> edi.ThrowAny() | Canceled exn -> raise exn - // Reify exceptional results as exceptionsJIT 64 doesn't always take tailcalls correctly - - let commitWithPossibleTimeout res = - match res with - | None -> raise (System.TimeoutException()) - | Some res -> commit res - - //---------------------------------- // PRIMITIVE ASYNC INVOCATION @@ -740,11 +705,15 @@ namespace Microsoft.FSharp.Control [] type ResultCell<'T>() = let mutable result = None + // The continuations for the result let mutable savedConts : list> = [] + // The WaitHandle event for the result. Only created if needed, and set to null when disposed. let mutable resEvent = null + let mutable disposed = false + // All writers of result are protected by lock on syncRoot. let syncRoot = new Object() @@ -779,13 +748,11 @@ namespace Microsoft.FSharp.Control interface IDisposable with member x.Dispose() = x.Close() // ; System.GC.SuppressFinalize(x) - member x.GrabResult() = match result with | Some res -> res | None -> failwith "Unexpected no result" - /// Record the result in the ResultCell. member x.RegisterResult (res:'T, reuseThread) = let grabbedConts = @@ -822,7 +789,10 @@ namespace Microsoft.FSharp.Control member x.ResultAvailable = result.IsSome - member x.AwaitResult = + /// Await the result of a result cell, without a direct timeout or direct + /// cancellation. That is, the underlying computation must fill the result + /// if cancellation or timeout occurs. + member x.AwaitResult_NoDirectCancelOrTimeout = unprotectedPrimitive(fun args -> // Check if a result is available synchronously let resOpt = @@ -887,10 +857,10 @@ namespace Microsoft.FSharp.Control // If timeout is provided, we govern the async by our own CTS, to cancel // when execution times out. Otherwise, the user-supplied token governs the async. match timeout with - | None -> token,None - | Some _ -> - let subSource = new LinkedSubSource(token) - subSource.Token, Some subSource + | None -> token, None + | Some _ -> + let subSource = new LinkedSubSource(token) + subSource.Token, Some subSource use resultCell = new ResultCell>() queueAsync @@ -1233,24 +1203,6 @@ namespace Microsoft.FSharp.Control let token = defaultArg cancellationToken defaultCancellationTokenSource.Token CancellationTokenOps.StartWithContinuations(token, computation, id, (fun edi -> edi.ThrowAny()), ignore) -#if FSCORE_PORTABLE_NEW - static member Sleep(dueTime : int) : Async = - // use combo protectedPrimitiveWithResync + continueWith instead of AwaitTask so we can pass cancellation token to the Delay task - unprotectedPrimitiveWithResync ( fun ({ aux = aux} as args) -> - let mutable edi = null - - let task = - try - Task.Delay(dueTime, aux.token) - with exn -> - edi <- ExceptionDispatchInfo.RestoreOrCapture(exn) - null - - match edi with - | null -> TaskHelpers.continueWithUnit (task, args, true) - | _ -> aux.econt edi - ) -#else static member Sleep(millisecondsDueTime) : Async = unprotectedPrimitiveWithResync (fun ({ aux = aux } as args) -> let timer = ref (None : Timer option) @@ -1296,9 +1248,9 @@ namespace Microsoft.FSharp.Control | _ -> aux.econt edi ) -#endif - static member AwaitWaitHandle(waitHandle:WaitHandle,?millisecondsTimeout:int) = + /// Wait for a wait handle. Both timeout and cancellation are supported + static member AwaitWaitHandle(waitHandle: WaitHandle, ?millisecondsTimeout:int) = let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite if millisecondsTimeout = 0 then async.Delay(fun () -> @@ -1358,61 +1310,61 @@ namespace Microsoft.FSharp.Control return! Async.AwaitWaitHandle(iar.AsyncWaitHandle, ?millisecondsTimeout=millisecondsTimeout) } - /// Await the result of a result cell without a timeout - static member ReifyResult(result:AsyncImplResult<'T>) : Async<'T> = + /// Bind the result of a result cell, calling the appropriate continuation. + static member BindResult(result: AsyncImplResult<'T>) : Async<'T> = unprotectedPrimitive(fun ({ aux = aux } as args) -> (match result with | Ok v -> args.cont v | Error exn -> aux.econt exn | Canceled exn -> aux.ccont exn) ) - /// Await the result of a result cell without a timeout - static member AwaitAndReifyResult(resultCell:ResultCell>) : Async<'T> = + /// Await and use the result of a result cell. The resulting async doesn't support cancellation + /// or timeout directly, rather the underlying computation must fill the result if cancellation + /// or timeout occurs. + static member AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell: ResultCell>) : Async<'T> = async { - let! result = resultCell.AwaitResult - return! Async.ReifyResult(result) + let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout + return! Async.BindResult(result) } - - - /// Await the result of a result cell without a timeout - /// - /// Always resyncs to the synchronization context if needed, by virtue of it being built - /// from primitives which resync. - static member AsyncWaitAsyncWithTimeout(innerCTS : CancellationTokenSource, resultCell:ResultCell>,millisecondsTimeout) : Async<'T> = + /// Await the result of a result cell belonging to a child computation. The resulting async supports timeout and if + /// it happens the child computation will be cancelled. The resulting async doesn't support cancellation + /// directly, rather the underlying computation must fill the result if cancellation occurs. + static member AwaitAndBindChildResult(innerCTS: CancellationTokenSource, resultCell: ResultCell>, millisecondsTimeout) : Async<'T> = match millisecondsTimeout with | None | Some -1 -> - resultCell |> Async.AwaitAndReifyResult + resultCell |> Async.AwaitAndBindResult_NoDirectCancelOrTimeout | Some 0 -> async { if resultCell.ResultAvailable then return commit (resultCell.GrabResult()) else - return commitWithPossibleTimeout None } + return raise (System.TimeoutException()) } | _ -> async { try if resultCell.ResultAvailable then return commit (resultCell.GrabResult()) else - let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(),?millisecondsTimeout=millisecondsTimeout) + let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(), ?millisecondsTimeout=millisecondsTimeout) if ok then - return commitWithPossibleTimeout (Some (resultCell.GrabResult())) + return commit (resultCell.GrabResult()) else // timed out // issue cancellation signal innerCTS.Cancel() // wait for computation to quiesce let! _ = Async.AwaitWaitHandle (resultCell.GetWaitHandle()) - return commitWithPossibleTimeout None + return raise (System.TimeoutException()) finally resultCell.Close() } - static member FromBeginEnd(beginAction,endAction,?cancelAction): Async<'T> = + static member FromBeginEnd(beginAction, endAction, ?cancelAction): Async<'T> = async { let! cancellationToken = getCancellationToken() let resultCell = new ResultCell<_>() let once = Once() let registration : CancellationTokenRegistration = + let onCancel (_:obj) = // Call the cancellation routine match cancelAction with @@ -1427,7 +1379,9 @@ namespace Microsoft.FSharp.Control // If we get an exception from a cooperative cancellation function // we assume the operation has already completed. try cancel() with _ -> () + cancellationToken.Register(Action(onCancel), null) + let callback = new System.AsyncCallback(fun iar -> if not iar.CompletedSynchronously then @@ -1451,15 +1405,15 @@ namespace Microsoft.FSharp.Control // ResultCell allows a race and throws away whichever comes last. resultCell.RegisterResult(res,reuseThread=true) |> unfake else ()) - - let (iar:IAsyncResult) = beginAction (callback,(null:obj)) if iar.CompletedSynchronously then registration.Dispose() return endAction iar else - return! Async.AwaitAndReifyResult(resultCell) } + // Note: ok to use "NoDirectCancel" here because cancellation has been registered above + // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method + return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell) } static member FromBeginEnd(arg,beginAction,endAction,?cancelAction): Async<'T> = @@ -1602,7 +1556,7 @@ namespace Microsoft.FSharp.Control // ResultCell allows a race and throws away whichever comes last. resultCell.RegisterResult(res,reuseThread=true) |> unfake) and del = -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let invokeMeth = (typeof>).GetMethod("Invoke", BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.Instance) System.Delegate.CreateDelegate(typeof<'Delegate>, obj, invokeMeth) :?> 'Delegate #else @@ -1613,7 +1567,9 @@ namespace Microsoft.FSharp.Control event.AddHandler(del) // Return the async computation that allows us to await the result - return! Async.AwaitAndReifyResult(resultCell) } + // Note: ok to use "NoDirectCancel" here because cancellation has been registered above + // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method + return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell) } type Async with static member Ignore (computation: Async<'T>) = bindA computation (fun _ -> doneA) @@ -1643,7 +1599,7 @@ namespace Microsoft.FSharp.Control computation |> unfake - return Async.AsyncWaitAsyncWithTimeout(innerCTS, resultCell,millisecondsTimeout) } + return Async.AwaitAndBindChildResult(innerCTS, resultCell, millisecondsTimeout) } static member SwitchToContext syncContext = async { match syncContext with @@ -1727,10 +1683,6 @@ namespace Microsoft.FSharp.Control Async.FromBeginEnd (buffer,offset,count,stream.BeginWrite,stream.EndWrite) #endif - type System.Threading.WaitHandle with - member waitHandle.AsyncWaitOne(?millisecondsTimeout:int) = // only used internally, not a public API - Async.AwaitWaitHandle(waitHandle,?millisecondsTimeout=millisecondsTimeout) - type IObservable<'Args> with [] // give the extension member a 'nice', unmangled compiled name, unique within this module @@ -1761,7 +1713,7 @@ namespace Microsoft.FSharp.Control | :? System.Net.WebException as webExn when webExn.Status = System.Net.WebExceptionStatus.RequestCanceled && !canceled -> - Async.ReifyResult(AsyncImplResult.Canceled (OperationCanceledException webExn.Message)) + Async.BindResult(AsyncImplResult.Canceled (OperationCanceledException webExn.Message)) | _ -> edi.ThrowAny()) @@ -1837,7 +1789,10 @@ namespace Microsoft.FSharp.Control ) start a1 Choice1Of2 start a2 Choice2Of2 - let! result = c.AwaitResult + // Note: It is ok to use "NoDirectCancel" here because the started computations use the same + // cancellation token and will register a cancelled result if cancellation occurs. + // Note: It is ok to use "NoDirectTimeout" here because there is no specific timeout log to this routine. + let! result = c.AwaitResult_NoDirectCancelOrTimeout return! reify result } let timeout msec cancellationToken = @@ -1851,7 +1806,10 @@ namespace Microsoft.FSharp.Control exceptionContinuation=ignore, cancellationContinuation=ignore, cancellationToken = cancellationToken) - c.AwaitResult + // Note: It is ok to use "NoDirectCancel" here because the started computations use the same + // cancellation token and will register a cancelled result if cancellation occurs. + // Note: It is ok to use "NoDirectTimeout" here because the child compuation above looks after the timeout. + c.AwaitResult_NoDirectCancelOrTimeout [] [] @@ -1900,7 +1858,7 @@ namespace Microsoft.FSharp.Control failwith "multiple waiting reader continuations for mailbox") let waitOneWithCancellation(timeout) = - ensurePulse().AsyncWaitOne(millisecondsTimeout=timeout) + Async.AwaitWaitHandle(ensurePulse(), millisecondsTimeout=timeout) let waitOne(timeout) = if timeout < 0 && not cancellationSupported then @@ -2171,36 +2129,34 @@ namespace Microsoft.FSharp.Control let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> // Note the ResultCell may have been disposed if the operation // timed out. In this case RegisterResult drops the result on the floor. - resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) + resultCell.RegisterResult(reply, reuseThread=false) |> unfake)) mailbox.Post(msg) match timeout with - | Threading.Timeout.Infinite -> - async { let! result = resultCell.AwaitResult - return Some(result) - } + | Threading.Timeout.Infinite when not cancellationSupported -> + async { let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout + return Some result } - | _ -> - async { use _disposeCell = resultCell - let! ok = resultCell.GetWaitHandle().AsyncWaitOne(millisecondsTimeout=timeout) - let res = (if ok then Some(resultCell.GrabResult()) else None) - return res } + | _ -> + async { use _disposeCell = resultCell + let! ok = Async.AwaitWaitHandle(resultCell.GetWaitHandle(), millisecondsTimeout=timeout) + let res = (if ok then Some(resultCell.GrabResult()) else None) + return res } member x.PostAndAsyncReply(buildMessage, ?timeout:int) = let timeout = defaultArg timeout defaultTimeout match timeout with - | Threading.Timeout.Infinite -> - // Nothing to dispose, no wait handles used - let resultCell = new ResultCell<_>() - let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) - mailbox.Post(msg) - resultCell.AwaitResult - | _ -> - let asyncReply = x.PostAndTryAsyncReply(buildMessage,timeout=timeout) - async { let! res = asyncReply - match res with - | None -> return! raise (TimeoutException(SR.GetString(SR.mailboxProcessorPostAndAsyncReplyTimedOut))) - | Some res -> return res - } + | Threading.Timeout.Infinite when not cancellationSupported -> + // Nothing to dispose, no wait handles used + let resultCell = new ResultCell<_>() + let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) + mailbox.Post(msg) + resultCell.AwaitResult_NoDirectCancelOrTimeout + | _ -> + let asyncReply = x.PostAndTryAsyncReply(buildMessage,timeout=timeout) + async { let! res = asyncReply + match res with + | None -> return! raise (TimeoutException(SR.GetString(SR.mailboxProcessorPostAndAsyncReplyTimedOut))) + | Some res -> return res } member x.Receive(?timeout) = mailbox.Receive(timeout=defaultArg timeout defaultTimeout) member x.TryReceive(?timeout) = mailbox.TryReceive(timeout=defaultArg timeout defaultTimeout) diff --git a/src/fsharp/FSharp.Core/math/z.fs b/src/fsharp/FSharp.Core/math/z.fs index 05271434918..1a33c9588f2 100644 --- a/src/fsharp/FSharp.Core/math/z.fs +++ b/src/fsharp/FSharp.Core/math/z.fs @@ -19,8 +19,7 @@ namespace System.Numerics // NOTE: 0 has two repns (+1,0) or (-1,0). [] [] -#if FX_PORTABLE_OR_NETSTANDARD -#else +#if !NETSTANDARD1_6 [] #endif type BigInteger(signInt:int, v : BigNat) = diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 6fc939898c3..6d013312673 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -961,11 +961,11 @@ namespace Microsoft.FSharp.Core let c = int64Order lenx1 leny1 if c <> 0 then c else let basex0 = int64 (x.GetLowerBound(0)) - let basex1 = int64 (x.GetLowerBound(1)) let basey0 = int64 (y.GetLowerBound(0)) - let basey1 = int64 (y.GetLowerBound(1)) let c = int64Order basex0 basey0 if c <> 0 then c else + let basex1 = int64 (x.GetLowerBound(1)) + let basey1 = int64 (y.GetLowerBound(1)) let c = int64Order basex1 basey1 if c <> 0 then c else let rec check0 i = @@ -3043,30 +3043,35 @@ namespace Microsoft.FSharp.Collections // List (debug view) //------------------------------------------------------------------------- - and + and ListDebugView<'T>(l:list<'T>) = - let ListDebugViewMaxLength = 50 - let rec count l n = - match l with - | [] -> n - | _::t -> if n > ListDebugViewMaxLength then n else count t (n+1) + let ListDebugViewMaxLength = 50 // default displayed Max Length + let ListDebugViewMaxFullLength = 5000 // display only when FullList opened (5000 is a super big display used to cut-off an infinite list or undebuggably huge one) + let rec count l n max = + match l with + | [] -> n + | _::t -> if n > max then n else count t (n+1) max - [] - member x.Items = - let n = count l 0 - let items = zeroCreate n + let items length = + let items = zeroCreate length let rec copy (items: 'T[]) l i = match l with | [] -> () | h::t -> - if i < n then + if i < length then SetArray items i h copy items t (i+1) copy items l 0 items + [] + member x.Items = items (count l 0 ListDebugViewMaxLength) + + [] + member x._FullList = items (count l 0 ListDebugViewMaxFullLength) + type ResizeArray<'T> = System.Collections.Generic.List<'T> //------------------------------------------------------------------------- @@ -3218,7 +3223,7 @@ namespace Microsoft.FSharp.Collections interface System.Collections.IEnumerable with member l.GetEnumerator() = (PrivateListHelpers.mkListEnumerator l :> System.Collections.IEnumerator) - + interface IReadOnlyCollection<'T> with member l.Count = l.Length @@ -3641,11 +3646,14 @@ namespace Microsoft.FSharp.Core | (h::t) -> match list2 with | [] -> list1 - | _ -> - let res = [h] - let lastCons = PrivateListHelpers.appendToFreshConsTail res t - PrivateListHelpers.setFreshConsTail lastCons list2 - res + | _ -> + match t with + | [] -> h :: list2 + | _ -> + let res = [h] + let lastCons = PrivateListHelpers.appendToFreshConsTail res t + PrivateListHelpers.setFreshConsTail lastCons list2 + res [] let incr cell = cell.contents <- cell.contents + 1 @@ -4159,7 +4167,7 @@ namespace Microsoft.FSharp.Core else (# "ceq" e1 e1 : int #) when ^T : float32 = if (# "clt" e1 e2 : bool #) then (-1) elif (# "cgt" e1 e2 : bool #) then (1) - elif (# "ceq" e1 e2 : bool #) then (1) + elif (# "ceq" e1 e2 : bool #) then (0) elif (# "ceq" e2 e2 : bool #) then (-1) else (# "ceq" e1 e1 : int #) when ^T : char = if (# "clt.un" e1 e2 : bool #) then (-1) else (# "cgt.un" e1 e2 : int #) diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 3b8d5d05261..20d81ca9ad2 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1704,7 +1704,7 @@ namespace Microsoft.FSharp.Collections interface System.Collections.IEnumerable interface System.Collections.Generic.IReadOnlyCollection<'T> interface System.Collections.Generic.IReadOnlyList<'T> - + /// An abbreviation for the type of immutable singly-linked lists. /// /// Use the constructors [] and :: (infix) to create values of this type, or diff --git a/src/fsharp/FSharp.Core/quotations.fs b/src/fsharp/FSharp.Core/quotations.fs index 8c78edd8e03..992bbe54f62 100644 --- a/src/fsharp/FSharp.Core/quotations.fs +++ b/src/fsharp/FSharp.Core/quotations.fs @@ -990,7 +990,7 @@ module Patterns = let resT = instFormal tyargTs rty let methInfo = try -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION match parentT.GetMethod(nm,argTs) with #else match parentT.GetMethod(nm,staticOrInstanceBindingFlags,null,argTs,null) with @@ -1022,7 +1022,7 @@ module Patterns = let tyArgs = List.toArray tyArgs let methInfo = try -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION match ty.GetMethod(nm, argTypes) with #else match ty.GetMethod(nm,staticOrInstanceBindingFlags,null, argTypes,null) with @@ -1145,7 +1145,7 @@ module Patterns = let typ = mkNamedType(tc,tyargs) let argtyps : Type list = argTypes |> inst tyargs let retType : Type = retType |> inst tyargs |> removeVoid -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION try typ.GetProperty(propName, staticOrInstanceBindingFlags) with :? AmbiguousMatchException -> null // more than one property found with the specified name and matching binding constraints - return null to initiate manual search @@ -1164,7 +1164,7 @@ module Patterns = let bindGenericCtor (tc:Type,argTypes:Instantiable) = let argtyps = instFormal (getGenericArguments tc) argTypes -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let argTypes = Array.ofList argtyps tc.GetConstructor(argTypes) |> bindCtorBySearchIfCandidateIsNull tc argTypes @@ -1176,7 +1176,7 @@ module Patterns = let bindCtor (tc,argTypes:Instantiable,tyargs) = let typ = mkNamedType(tc,tyargs) let argtyps = argTypes |> inst tyargs -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let argTypes = Array.ofList argtyps typ.GetConstructor(argTypes) |> bindCtorBySearchIfCandidateIsNull typ argTypes diff --git a/src/fsharp/FSharp.Core/reflect.fs b/src/fsharp/FSharp.Core/reflect.fs index 4c69ddca0b3..78528294f5c 100644 --- a/src/fsharp/FSharp.Core/reflect.fs +++ b/src/fsharp/FSharp.Core/reflect.fs @@ -15,11 +15,7 @@ open Microsoft.FSharp.Primitives.Basics module internal ReflectionUtils = -#if FX_NO_SYSTEM_BINDINGFLAGS - type BindingFlags = Microsoft.FSharp.Core.ReflectionAdapters.BindingFlags -#else type BindingFlags = System.Reflection.BindingFlags -#endif let toBindingFlags allowAccessToNonPublicMembers = if allowAccessToNonPublicMembers then @@ -59,7 +55,7 @@ module internal Impl = //----------------------------------------------------------------- // GENERAL UTILITIES -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let instanceFieldFlags = BindingFlags.Instance let instancePropertyFlags = BindingFlags.Instance let staticPropertyFlags = BindingFlags.Static @@ -79,7 +75,7 @@ module internal Impl = let getInstancePropertyReader (typ: Type,propName,bindingFlags) = match getInstancePropertyInfo(typ, propName, bindingFlags) with | null -> None -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION | prop -> Some(fun (obj:obj) -> prop.GetValue(obj,null)) #else | prop -> Some(fun (obj:obj) -> prop.GetValue(obj,instancePropertyFlags ||| bindingFlags,null,null,null)) @@ -288,7 +284,7 @@ module internal Impl = let getUnionCaseRecordReader (typ:Type,tag:int,bindingFlags) = let props = fieldsPropsOfUnionCase(typ,tag,bindingFlags) -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION (fun (obj:obj) -> props |> Array.map (fun prop -> prop.GetValue(obj,null))) #else (fun (obj:obj) -> props |> Array.map (fun prop -> prop.GetValue(obj,bindingFlags,null,null,null))) @@ -305,7 +301,7 @@ module internal Impl = | Some reader -> (fun (obj:obj) -> reader obj :?> int) | None -> (fun (obj:obj) -> -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let m2b = typ.GetMethod("GetTag", [| typ |]) #else let m2b = typ.GetMethod("GetTag", BindingFlags.Static ||| bindingFlags, null, [| typ |], null) @@ -314,7 +310,7 @@ module internal Impl = let getUnionTagMemberInfo (typ:Type,bindingFlags) = match getInstancePropertyInfo (typ,"Tag",bindingFlags) with -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION | null -> (typ.GetMethod("GetTag") :> MemberInfo) #else | null -> (typ.GetMethod("GetTag",BindingFlags.Static ||| bindingFlags) :> MemberInfo) @@ -338,7 +334,7 @@ module internal Impl = let getUnionCaseConstructor (typ:Type,tag:int,bindingFlags) = let meth = getUnionCaseConstructorMethod (typ,tag,bindingFlags) (fun args -> -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION meth.Invoke(null,args)) #else meth.Invoke(null,BindingFlags.Static ||| BindingFlags.InvokeMethod ||| bindingFlags,null,args,null)) @@ -451,11 +447,11 @@ module internal Impl = // Item1, Item2, ..., Item // Item1, Item2, ..., Item, Rest // The PropertyInfo may not come back in order, so ensure ordering here. -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 assert(maxTuple < 10) // Alphasort will only works for upto 9 items: Item1, Item10, Item2, Item3, ..., Item9, Rest #endif let props = props |> Array.sortBy (fun p -> p.Name) // they are not always in alphabetic order -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 assert(props.Length <= maxTuple) assert(let haveNames = props |> Array.map (fun p -> p.Name) let expectNames = Array.init props.Length (fun i -> let j = i+1 // index j = 1,2,..,props.Length <= maxTuple @@ -473,11 +469,11 @@ module internal Impl = // Item1, Item2, ..., Item // Item1, Item2, ..., Item, Rest // The PropertyInfo may not come back in order, so ensure ordering here. -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 assert(maxTuple < 10) // Alphasort will only works for upto 9 items: Item1, Item10, Item2, Item3, ..., Item9, Rest #endif let fields = fields |> Array.sortBy (fun fi -> fi.Name) // they are not always in alphabetic order -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 assert(fields.Length <= maxTuple) assert(let haveNames = fields |> Array.map (fun fi -> fi.Name) let expectNames = Array.init fields.Length (fun i -> let j = i+1 // index j = 1,2,..,fields.Length <= maxTuple @@ -488,36 +484,34 @@ module internal Impl = #endif fields - let getTupleConstructorMethod(typ:Type,bindingFlags) = + let getTupleConstructorMethod (typ:Type) = let ctor = if typ.IsValueType then - let fields = typ.GetFields(bindingFlags) |> orderTupleFields -#if FX_PORTABLE_OR_NETSTANDARD - ignore bindingFlags + let fields = typ.GetFields (instanceFieldFlags ||| BindingFlags.Public) |> orderTupleFields +#if FX_RESHAPED_REFLECTION typ.GetConstructor(fields |> Array.map (fun fi -> fi.FieldType)) #else - typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,fields |> Array.map (fun fi -> fi.FieldType),null) + typ.GetConstructor(BindingFlags.Public ||| BindingFlags.Instance,null,fields |> Array.map (fun fi -> fi.FieldType),null) #endif else let props = typ.GetProperties() |> orderTupleProperties -#if FX_PORTABLE_OR_NETSTANDARD - ignore bindingFlags +#if FX_RESHAPED_REFLECTION typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType)) #else - typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,props |> Array.map (fun p -> p.PropertyType),null) + typ.GetConstructor(BindingFlags.Public ||| BindingFlags.Instance,null,props |> Array.map (fun p -> p.PropertyType),null) #endif match ctor with | null -> raise <| ArgumentException(String.Format(SR.GetString(SR.invalidTupleTypeConstructorNotDefined), typ.FullName)) | _ -> () ctor - let getTupleCtor(typ:Type,bindingFlags) = - let ctor = getTupleConstructorMethod(typ,bindingFlags) + let getTupleCtor(typ:Type) = + let ctor = getTupleConstructorMethod typ (fun (args:obj[]) -> -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION ctor.Invoke(args)) #else - ctor.Invoke(BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| bindingFlags,null,args,null)) + ctor.Invoke(BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public, null, args, null)) #endif let rec getTupleReader (typ:Type) = @@ -525,7 +519,7 @@ module internal Impl = // Get the reader for the outer tuple record let reader = if typ.IsValueType then - let fields = (typ.GetFields(instanceFieldFlags ||| BindingFlags.Public) |> orderTupleFields) + let fields = (typ.GetFields (instanceFieldFlags ||| BindingFlags.Public) |> orderTupleFields) ((fun (obj:obj) -> fields |> Array.map (fun field -> field.GetValue(obj)))) else let props = (typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties) @@ -542,7 +536,7 @@ module internal Impl = let rec getTupleConstructor (typ:Type) = let etys = typ.GetGenericArguments() - let maker1 = getTupleCtor (typ,BindingFlags.Public) + let maker1 = getTupleCtor typ if etys.Length < maxTuple then maker1 else @@ -554,7 +548,7 @@ module internal Impl = let getTupleConstructorInfo (typ:Type) = let etys = typ.GetGenericArguments() - let maker1 = getTupleConstructorMethod (typ,BindingFlags.Public) + let maker1 = getTupleConstructorMethod typ if etys.Length < maxTuple then maker1,None else @@ -626,7 +620,7 @@ module internal Impl = let getRecordConstructorMethod(typ:Type,bindingFlags) = let props = fieldPropsOfRecordType(typ,bindingFlags) -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let ctor = typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType)) #else let ctor = typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,props |> Array.map (fun p -> p.PropertyType),null) @@ -639,7 +633,7 @@ module internal Impl = let getRecordConstructor(typ:Type,bindingFlags) = let ctor = getRecordConstructorMethod(typ,bindingFlags) (fun (args:obj[]) -> -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION ctor.Invoke(args)) #else ctor.Invoke(BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| bindingFlags,null,args,null)) diff --git a/src/fsharp/FSharp.Core/reflect.fsi b/src/fsharp/FSharp.Core/reflect.fsi index eb0240a1fdb..99d4e491891 100644 --- a/src/fsharp/FSharp.Core/reflect.fsi +++ b/src/fsharp/FSharp.Core/reflect.fsi @@ -70,8 +70,6 @@ type FSharpValue = /// A function to read the specified field from the record. static member PreComputeRecordFieldReader : info:PropertyInfo -> (obj -> obj) -// These APIs are only internal for portable profile, 7,78 and 259 of FSHarp.Core.dll --- those profiles System.Reflection.BindingFlags -#if !FX_NO_SYSTEM_BINDINGFLAGS /// Creates an instance of a record type. /// /// Assumes the given input is a record type. @@ -188,7 +186,6 @@ type FSharpValue = /// Thrown when the input type is not an F# exception. /// The fields from the given exception. static member GetExceptionFields: exn:obj * ?bindingFlags:BindingFlags -> obj[] -#endif /// Creates an instance of a tuple type /// @@ -263,7 +260,6 @@ type FSharpValue = /// Contains operations associated with constructing and analyzing F# types such as records, unions and tuples type FSharpType = -#if !FX_NO_SYSTEM_BINDINGFLAGS /// Reads all the fields from a record value, in declaration order /// /// Assumes the given input is a record value. If not, ArgumentException is raised. @@ -309,8 +305,6 @@ type FSharpType = /// True if the type check is an F# exception. static member IsExceptionRepresentation: exceptionType:Type * ?bindingFlags:BindingFlags -> bool -#endif - /// Returns a System.Type representing the F# function type with the given domain and range /// The input type of the function. /// The output type of the function. @@ -529,9 +523,5 @@ namespace Microsoft.FSharp.Reflection open Microsoft.FSharp.Core module internal ReflectionUtils = -#if FX_NO_SYSTEM_BINDINGFLAGS - type BindingFlags = ReflectionAdapters.BindingFlags -#else type BindingFlags = System.Reflection.BindingFlags -#endif val toBindingFlags : allowAccessToNonPublicMembers : bool -> BindingFlags \ No newline at end of file diff --git a/src/fsharp/FSharp.Core/set.fs b/src/fsharp/FSharp.Core/set.fs index 72ac3ed9088..85c04a2c241 100644 --- a/src/fsharp/FSharp.Core/set.fs +++ b/src/fsharp/FSharp.Core/set.fs @@ -816,12 +816,6 @@ namespace Microsoft.FSharp.Collections [] let count (set: Set<'T>) = set.Count - [] - let minimumElement (set: Set<'T>) = set.MinimumElement - - [] - let maximumElement (set: Set<'T>) = set.MaximumElement - [] let ofList elements = Set(List.toSeq elements) diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index fd3d209e512..96dbedfa117 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -10,10 +10,8 @@ x86 Exe $(NoWarn);62 - fsc-proto + fsc NO_EXTENSIONTYPING;$(DefineConstants) - BUILDING_PROTO;$(DefineConstants) - BUILDING_WITH_LKG;$(DefineConstants) COMPILER;$(DefineConstants) $(NoWarn);35;44;62;9;60;86;47;1203 LKG @@ -438,7 +436,10 @@ fsc.fs - + + Service/SimulatedMSBuildReferenceResolver.fs + + MSBuildReferenceResolver.fs @@ -466,14 +467,14 @@ $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core - + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj index 7550e3257ae..9cb4d2df14f 100644 --- a/src/fsharp/Fsc/Fsc.fsproj +++ b/src/fsharp/Fsc/Fsc.fsproj @@ -20,7 +20,6 @@ Exe $(NoWarn);62 fsc - COMPILER;$(DefineConstants) true $(OtherFlags) --warnon:1182 diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 4de82a8d7e6..ed07bc51d72 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -7,6 +7,7 @@ module internal Microsoft.FSharp.Compiler.IlxGen open System.IO +open System.Reflection open System.Collections.Generic open Internal.Utilities open Internal.Utilities.Collections @@ -16,7 +17,6 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types -open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics open Microsoft.FSharp.Compiler.AbstractIL.Internal.BinaryConstants open Microsoft.FSharp.Compiler @@ -34,13 +34,11 @@ open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.TypeRelations open Microsoft.FSharp.Compiler.TypeChecker open Microsoft.FSharp.Compiler.Infos -open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types let IsNonErasedTypar (tp:Typar) = not tp.IsErased let DropErasedTypars (tps:Typar list) = tps |> List.filter IsNonErasedTypar -let DropErasedTyargs tys = tys |> List.filter (fun ty -> match ty with TType_measure _ -> false | _ -> true) -let AddSpecialNameFlag (mdef:ILMethodDef) = { mdef with IsSpecialName = true } +let DropErasedTyargs tys = tys |> List.filter (fun ty -> match ty with TType_measure _ -> false | _ -> true) let AddNonUserCompilerGeneratedAttribs (g: TcGlobals) (mdef:ILMethodDef) = g.AddMethodGeneratedAttributes mdef @@ -66,7 +64,7 @@ let mkLdfldMethodDef (ilMethName,reprAccess,isStatic,ilTy,ilFieldName,ilPropType mkILNonGenericStaticMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody(true,[],2,nonBranchingInstrsToCode [mkNormalLdsfld ilFieldSpec],None)) else mkILNonGenericInstanceMethod (ilMethName,reprAccess,[],ilReturn,mkMethodBody (true,[],2,nonBranchingInstrsToCode [ mkLdarg0; mkNormalLdfld ilFieldSpec],None)) - ilMethodDef |> AddSpecialNameFlag + ilMethodDef.WithSpecialName let ChooseParamNames fieldNamesAndTypes = let takenFieldNames = fieldNamesAndTypes |> List.map p23 |> Set.ofList @@ -1167,7 +1165,7 @@ type AssemblyBuilder(cenv:cenv) as mgbuf = let vtdef = mkRawDataValueTypeDef cenv.g.iltyp_ValueType (name,size,0us) let vtref = NestedTypeRefForCompLoc cloc vtdef.Name let vtspec = mkILTySpec(vtref,[]) - let vtdef = {vtdef with Access= ComputeTypeAccess vtref true} + let vtdef = vtdef.WithAccess(ComputeTypeAccess vtref true) mgbuf.AddTypeDef(vtref, vtdef, false, true, None) vtspec), keyComparer=HashIdentity.Structural) @@ -3522,31 +3520,14 @@ and bindBaseOrThisVarOpt cenv eenv baseValOpt = | None -> eenv | Some basev -> AddStorageForVal cenv.g (basev,notlazy (Arg 0)) eenv -and fixupVirtualSlotFlags mdef = - {mdef with - IsHideBySig=true - mdKind = (match mdef.mdKind with - | MethodKind.Virtual vinfo -> - MethodKind.Virtual - {vinfo with - IsCheckAccessOnOverride=false } - | _ -> failwith "fixupVirtualSlotFlags") } +and fixupVirtualSlotFlags (mdef:ILMethodDef) = + mdef.WithHideBySig() and renameMethodDef nameOfOverridingMethod (mdef : ILMethodDef) = {mdef with Name=nameOfOverridingMethod } -and fixupMethodImplFlags mdef = - {mdef with - Access=ILMemberAccess.Private - IsHideBySig=true - mdKind=(match mdef.mdKind with - | MethodKind.Virtual vinfo -> - MethodKind.Virtual - {vinfo with - IsCheckAccessOnOverride=false - IsFinal=true - IsNewSlot=true } - | _ -> failwith "fixupMethodImpl") } +and fixupMethodImplFlags (mdef:ILMethodDef) = + mdef.WithAccess(ILMemberAccess.Private).WithHideBySig().WithFinal(true).WithNewSlot and GenObjectMethod cenv eenvinner (cgbuf:CodeGenBuffer) useMethodImpl tmethod = @@ -3735,27 +3716,19 @@ and GenClosureTypeDefs cenv (tref:ILTypeRef, ilGenParams, attrs, ilCloFreeVars, let td = { Name = tref.Name Layout = ILTypeDefLayout.Auto - Access = ComputeTypeAccess tref true + Attributes = enum 0 GenericParams = ilGenParams CustomAttrs = mkILCustomAttrs(attrs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ]) Fields = emptyILFields - InitSemantics=ILTypeInit.BeforeField - IsSealed=true - IsAbstract=false - tdKind=ILTypeDefKind.Class Events= emptyILEvents Properties = emptyILProperties Methods= mkILMethods mdefs - MethodImpls= mkILMethodImpls mimpls - IsSerializable=true - IsComInterop= false - IsSpecialName= true + MethodImpls= mkILMethodImpls mimpls NestedTypes=emptyILTypeDefs - Encoding= ILDefaultPInvokeEncoding.Auto Implements = ilIntfTys Extends= Some ext - SecurityDecls= emptyILSecurityDecls - HasSecurity=false } + SecurityDecls= emptyILSecurityDecls } + let td = td.WithSealed(true).WithSerializable(true).WithSpecialName(true).WithAccess(ComputeTypeAccess tref true).WithLayout(ILTypeDefLayout.Auto).WithEncoding(ILDefaultPInvokeEncoding.Auto).WithInitSemantics(ILTypeInit.BeforeField) let tdefs = EraseClosures.convIlxClosureDef cenv.g.ilxPubCloEnv tref.Enclosing td cloInfo tdefs @@ -3787,31 +3760,22 @@ and GenLambdaClosure cenv (cgbuf:CodeGenBuffer) eenv isLocalTypeFunc selfv expr let ilContractCtor = mkILNonGenericEmptyCtor None cenv.g.ilg.typ_Object let ilContractMeths = [ilContractCtor; mkILGenericVirtualMethod("DirectInvoke",ILMemberAccess.Assembly,ilContractMethTyargs,[],mkILReturn ilContractFormalRetTy, MethodBody.Abstract) ] - let ilContractTypeDef = { Name = ilContractTypeRef.Name Layout = ILTypeDefLayout.Auto - Access = ComputeTypeAccess ilContractTypeRef true + Attributes = enum 0 GenericParams = ilContractGenericParams CustomAttrs = mkILCustomAttrs [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ] Fields = emptyILFields - InitSemantics=ILTypeInit.BeforeField - IsSealed=false // the contract type is an abstract type and not sealed - IsAbstract=true // the contract type is an abstract type - tdKind=ILTypeDefKind.Class Events= emptyILEvents Properties = emptyILProperties Methods= mkILMethods ilContractMeths - MethodImpls= emptyILMethodImpls - IsSerializable=true - IsComInterop=false - IsSpecialName= true + MethodImpls= emptyILMethodImpls NestedTypes=emptyILTypeDefs - Encoding= ILDefaultPInvokeEncoding.Auto Implements = [] Extends= Some cenv.g.ilg.typ_Object - SecurityDecls= emptyILSecurityDecls - HasSecurity=false } + SecurityDecls= emptyILSecurityDecls } + let ilContractTypeDef = ilContractTypeDef.WithAbstract(true).WithAccess(ComputeTypeAccess ilContractTypeRef true).WithSerializable(true).WithSpecialName(true).WithLayout(ILTypeDefLayout.Auto).WithInitSemantics(ILTypeInit.BeforeField).WithEncoding(ILDefaultPInvokeEncoding.Auto) // the contract type is an abstract type and not sealed cgbuf.mgbuf.AddTypeDef(ilContractTypeRef, ilContractTypeDef, false, false, None) let ilCtorBody = mkILMethodBody (true,[],8,nonBranchingInstrsToCode (mkCallBaseConstructor(ilContractTy,[])), None ) @@ -4682,6 +4646,12 @@ and ComputeMemberAccessRestrictedBySig eenv vspec = not vspec.IsMemberOrModuleBinding || // anything that's not a module or member binding gets assembly visibility vspec.IsIncrClassGeneratedMember // compiler generated members for class function 'let' bindings get assembly visibility ComputeMemberAccess isHidden +and ComputeMethodAccessRestrictedBySig eenv vspec = + let isHidden = + IsHiddenVal eenv.sigToImplRemapInfo vspec || // anything hidden by a signature gets assembly visibility + not vspec.IsMemberOrModuleBinding || // anything that's not a module or member binding gets assembly visibility + vspec.IsIncrClassGeneratedMember // compiler generated members for class function 'let' bindings get assembly visibility + ComputeMemberAccess isHidden and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) startScopeMarkOpt = @@ -4694,7 +4664,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let eenv = {eenv with letBoundVars= (mkLocalValRef vspec) :: eenv.letBoundVars} - let access = ComputeMemberAccessRestrictedBySig eenv vspec + let access = ComputeMethodAccessRestrictedBySig eenv vspec // Workaround for .NET and Visual Studio restriction w.r.t debugger type proxys // Mark internal constructors in internal classes as public. @@ -4731,8 +4701,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilTy = ilGetterMethSpec.FormalReturnType let ilPropDef = { Name = PrettyNaming.ChopPropertyName ilGetterMethSpec.Name - IsRTSpecialName = false - IsSpecialName = false + Attributes = PropertyAttributes.None SetMethod = None GetMethod = Some ilGetterMethSpec.MethodRef CallingConv = ILThisConvention.Static @@ -4744,8 +4713,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilMethodDef = let ilMethodBody = MethodBody.IL(CodeGenMethodForExpr cenv cgbuf.mgbuf (SPSuppress, [], ilGetterMethSpec.Name, eenv, 0, 0, rhsExpr, Return)) - mkILStaticMethod ([], ilGetterMethSpec.Name, access, [], mkILReturn ilTy, ilMethodBody) - |> AddSpecialNameFlag + (mkILStaticMethod ([], ilGetterMethSpec.Name, access, [], mkILReturn ilTy, ilMethodBody)).WithSpecialName |> AddNonUserCompilerGeneratedAttribs cenv.g CountMethodDef() @@ -4772,15 +4740,12 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilFieldDef = mkILStaticField (fspec.Name, fty, None, None, access) let ilFieldDef = match vref.LiteralValue with - | Some konst -> { ilFieldDef with IsLiteral=true; LiteralValue= Some(GenFieldInit m konst) } + | Some konst -> ilFieldDef.WithLiteralDefaultValue( Some (GenFieldInit m konst) ) | None -> ilFieldDef let ilFieldDef = let isClassInitializer = (cgbuf.MethodName = ".cctor") - if mut || cenv.opts.isInteractiveItExpr || not isClassInitializer || hasLiteralAttr then - ilFieldDef - else - {ilFieldDef with IsInitOnly=true } + ilFieldDef.WithInitOnly(not (mut || cenv.opts.isInteractiveItExpr || not isClassInitializer || hasLiteralAttr)) let ilAttribs = if not hasLiteralAttr then @@ -4810,8 +4775,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta |> GenAttrs cenv eenv // property only gets attributes that target properties let ilPropDef = { Name=ilPropName - IsRTSpecialName=false - IsSpecialName=false + Attributes = PropertyAttributes.None SetMethod=if mut || cenv.opts.isInteractiveItExpr then Some ilSetterMethRef else None GetMethod=Some ilGetterMethRef CallingConv=ILThisConvention.Static @@ -4823,14 +4787,12 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let getterMethod = mkILStaticMethod([],ilGetterMethRef.Name,access,[],mkILReturn fty, - mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkNormalLdsfld fspec ],None)) - |> AddSpecialNameFlag + mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkNormalLdsfld fspec ],None)).WithSpecialName cgbuf.mgbuf.AddMethodDef(ilTypeRefForProperty,getterMethod) if mut || cenv.opts.isInteractiveItExpr then let setterMethod = mkILStaticMethod([],ilSetterMethRef.Name,access,[mkILParamNamed("value",fty)],mkILReturn ILType.Void, - mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkLdarg0;mkNormalStsfld fspec],None)) - |> AddSpecialNameFlag + mkMethodBody(true,[],2,nonBranchingInstrsToCode [ mkLdarg0;mkNormalStsfld fspec],None)).WithSpecialName cgbuf.mgbuf.AddMethodDef(ilTypeRefForProperty,setterMethod) GenBindingRhs cenv cgbuf eenv sp vspec rhsExpr @@ -4969,7 +4931,8 @@ and GenMarshal cenv attribs = error(Error(FSComp.SR.ilCustomMarshallersCannotBeUsedInFSharp(),m)) (* ILNativeType.Custom of bytes * string * string * bytes (* GUID,nativeTypeName,custMarshallerName,cookieString *) *) //ILNativeType.Error - | 0x2D -> ILNativeType.Error + | 0x2D -> ILNativeType.Error + | 0x30 -> ILNativeType.LPUTF8STR | _ -> ILNativeType.Empty Some(decodeUnmanagedType unmanagedType), otherAttribs | Some (Attrib(_,_,_,_,_,_,m)) -> @@ -5051,16 +5014,15 @@ and GenReturnInfo cenv eenv ilRetTy (retInfo : ArgReprInfo) : ILReturn = and GenPropertyForMethodDef compileAsInstance tref mdef (v:Val) (memberInfo:ValMemberInfo) ilArgTys ilPropTy ilAttrs compiledName = let name = match compiledName with | Some n -> n | _ -> v.PropertyName in (* chop "get_" *) - { Name=name - IsRTSpecialName=false - IsSpecialName=false - SetMethod=(if memberInfo.MemberFlags.MemberKind= MemberKind.PropertySet then Some(mkRefToILMethod(tref,mdef)) else None) - GetMethod=(if memberInfo.MemberFlags.MemberKind= MemberKind.PropertyGet then Some(mkRefToILMethod(tref,mdef)) else None) - CallingConv=(if compileAsInstance then ILThisConvention.Instance else ILThisConvention.Static) - Type=ilPropTy - Init=None + { Name = name + Attributes = PropertyAttributes.None + SetMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertySet then Some(mkRefToILMethod(tref,mdef)) else None) + GetMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertyGet then Some(mkRefToILMethod(tref,mdef)) else None) + CallingConv = (if compileAsInstance then ILThisConvention.Instance else ILThisConvention.Static) + Type = ilPropTy + Init = None Args = ilArgTys - CustomAttrs=ilAttrs } + CustomAttrs = ilAttrs } and GenEventForProperty cenv eenvForMeth (mspec:ILMethodSpec) (v:Val) ilAttrsThatGoOnPrimaryItem m returnTy = let evname = v.PropertyName @@ -5070,9 +5032,8 @@ and GenEventForProperty cenv eenvForMeth (mspec:ILMethodSpec) (v:Val) ilAttrsTha let addMethRef = mkILMethRef (ilThisTy.TypeRef,mspec.CallingConv,"add_" + evname,0,[ilDelegateTy],ILType.Void) let removeMethRef = mkILMethRef (ilThisTy.TypeRef,mspec.CallingConv,"remove_" + evname,0,[ilDelegateTy],ILType.Void) { Type = Some(ilDelegateTy) - Name= evname - IsRTSpecialName=false - IsSpecialName=false + Name= evname + Attributes = EventAttributes.None AddMethod = addMethRef RemoveMethod = removeMethRef FireMethod= None @@ -5179,7 +5140,7 @@ and GenMethodForBinding // Now generate the code. - let hasPreserveSigNamedArg,ilMethodBody,_hasDllImport = + let hasPreserveSigNamedArg,ilMethodBody,hasDllImport = match TryFindFSharpAttributeOpt cenv.g cenv.g.attrib_DllImportAttribute v.Attribs with | Some (Attrib(_,_,[ AttribStringArg(dll) ],namedArgs,_,_,m)) -> if not (isNil tps) then error(Error(FSComp.SR.ilSignatureForExternalFunctionContainsTypeParameters(),m)) @@ -5225,7 +5186,7 @@ and GenMethodForBinding let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttributes - let secDecls = if securityAttributes.Length > 0 then (mkILSecurityDecls permissionSets) else (emptyILSecurityDecls) + let secDecls = if List.isEmpty securityAttributes then emptyILSecurityDecls else mkILSecurityDecls permissionSets // Do not push the attributes to the method for events and properties let ilAttrsCompilerGenerated = if v.IsCompilerGenerated then [ cenv.g.CompilerGeneratedAttribute ] else [] @@ -5240,18 +5201,15 @@ and GenMethodForBinding let methName = mspec.Name let tref = mspec.MethodRef.DeclaringTypeRef - let EmitTheMethodDef mdef = + let EmitTheMethodDef (mdef:ILMethodDef) = // Does the function have an explicit [] attribute? let isExplicitEntryPoint = HasFSharpAttribute cenv.g cenv.g.attrib_EntryPointAttribute attrs - - let mdef = - {mdef with - IsPreserveSig = hasPreserveSigImplFlag || hasPreserveSigNamedArg - IsSynchronized = hasSynchronizedImplFlag + + let mdef = mdef.WithSecurity(not (List.isEmpty securityAttributes)).WithPInvoke(hasDllImport) + let mdef = mdef.WithPreserveSig(hasPreserveSigImplFlag || hasPreserveSigNamedArg).WithSynchronized(hasSynchronizedImplFlag).WithNoInlining(hasNoInliningFlag).WithAggressiveInlining(hasAggressiveInliningImplFlag) + let mdef = + { mdef with IsEntryPoint = isExplicitEntryPoint - IsNoInline = hasNoInliningFlag - IsAggressiveInline = hasAggressiveInliningImplFlag - HasSecurity = mdef.HasSecurity || (securityAttributes.Length > 0) SecurityDecls = secDecls } let mdef = @@ -5261,7 +5219,7 @@ and GenMethodForBinding mdef.Name.StartsWith("|",System.StringComparison.Ordinal) || // event add/remove method v.val_flags.IsGeneratedEventVal then - {mdef with IsSpecialName=true} + mdef.WithSpecialName else mdef CountMethodDef() @@ -5313,12 +5271,9 @@ and GenMethodForBinding not tcref.Deref.IsFSharpDelegateTycon let mdef = - {mdef with - mdKind=match mdef.mdKind with - | MethodKind.Virtual vinfo -> - MethodKind.Virtual {vinfo with IsFinal=memberInfo.MemberFlags.IsFinal - IsAbstract=isAbstract } - | k -> k } + if mdef.IsVirtual then + mdef.WithFinal(memberInfo.MemberFlags.IsFinal).WithAbstract(isAbstract) + else mdef match memberInfo.MemberFlags.MemberKind with @@ -5345,8 +5300,7 @@ and GenMethodForBinding cgbuf.mgbuf.AddOrMergePropertyDef(tref,ilPropDef,m) // Add the special name flag for all properties - let mdef = mdef |> AddSpecialNameFlag - let mdef = { mdef with CustomAttrs= mkILCustomAttrs ((GenAttrs cenv eenv attrsAppliedToGetterOrSetter) @ sourceNameAttribs @ ilAttrsCompilerGenerated) } + let mdef = { mdef.WithSpecialName with CustomAttrs= mkILCustomAttrs ((GenAttrs cenv eenv attrsAppliedToGetterOrSetter) @ sourceNameAttribs @ ilAttrsCompilerGenerated) } EmitTheMethodDef mdef | _ -> let mdef = { mdef with CustomAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated) } @@ -5811,7 +5765,7 @@ and GenTypeDefForCompLoc (cenv, eenv, mgbuf: AssemblyBuilder, cloc, hidden, attr then [ ] else [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Module)])), initTrigger) - let tdef = { tdef with IsSealed=true; IsAbstract=true } + let tdef = tdef.WithSealed(true).WithAbstract(true) mgbuf.AddTypeDef(tref, tdef, eliminateIfEmpty, addAtEnd, None) @@ -6099,16 +6053,10 @@ and GenAbstractBinding cenv eenv tref (vref:ValRef) = let mdef = fixupVirtualSlotFlags mdef let mdef = - {mdef with - IsPreserveSig=hasPreserveSigImplFlag - IsSynchronized=hasSynchronizedImplFlag - IsNoInline=hasNoInliningFlag - IsAggressiveInline=hasAggressiveInliningImplFlag - mdKind=match mdef.mdKind with - | MethodKind.Virtual vinfo -> - MethodKind.Virtual {vinfo with IsFinal=memberInfo.MemberFlags.IsFinal - IsAbstract=memberInfo.MemberFlags.IsDispatchSlot } - | k -> k } + if mdef.IsVirtual then + mdef.WithFinal(memberInfo.MemberFlags.IsFinal).WithAbstract(memberInfo.MemberFlags.IsDispatchSlot) + else mdef + let mdef = mdef.WithPreserveSig(hasPreserveSigImplFlag).WithSynchronized(hasSynchronizedImplFlag).WithNoInlining(hasNoInliningFlag).WithAggressiveInlining(hasAggressiveInliningImplFlag) match memberInfo.MemberFlags.MemberKind with | MemberKind.ClassConstructor @@ -6129,7 +6077,7 @@ and GenAbstractBinding cenv eenv tref (vref:ValRef) = let ilPropTy = GenType cenv.amap m eenvForMeth.tyenv vtyp let ilArgTys = v |> ArgInfosOfPropertyVal cenv.g |> List.map fst |> GenTypes cenv.amap m eenvForMeth.tyenv GenPropertyForMethodDef compileAsInstance tref mdef v memberInfo ilArgTys ilPropTy (mkILCustomAttrs ilAttrs) None - let mdef = mdef |> AddSpecialNameFlag + let mdef = mdef.WithSpecialName [mdef], [ilPropDef],[] else @@ -6288,7 +6236,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = not (HasFSharpAttribute cenv.g cenv.g.attrib_DebuggerTypeProxyAttribute tycon.Attribs)) let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttrs - let secDecls = if securityAttrs.Length > 0 then (mkILSecurityDecls permissionSets) else (emptyILSecurityDecls) + let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets let ilDebugDisplayAttributes = [ yield! GenAttrs cenv eenv debugDisplayAttrs @@ -6313,8 +6261,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | TTyconClass -> ILTypeDefKind.Class | TTyconStruct -> ILTypeDefKind.ValueType | TTyconInterface -> ILTypeDefKind.Interface - | TTyconEnum -> ILTypeDefKind.Enum - | TTyconDelegate _ -> ILTypeDefKind.Delegate + | TTyconEnum -> ILTypeDefKind.Enum + | TTyconDelegate _ -> ILTypeDefKind.Delegate | TRecdRepr _ | TUnionRepr _ when tycon.IsStructOrEnumTycon -> ILTypeDefKind.ValueType | _ -> ILTypeDefKind.Class @@ -6390,20 +6338,26 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | TRecdRepr _ when not useGenuineField -> [ cenv.g.DebuggerBrowsableNeverAttribute ] // hide fields in records in debug display | _ -> [] // don't hide fields in classes in debug display - yield + let access = ComputeMemberAccess isFieldHidden + let literalValue = Option.map (GenFieldInit m) fspec.LiteralValue + + let fdef = { Name = ilFieldName Type = ilPropType - IsStatic = isStatic - Access = ComputeMemberAccess isFieldHidden - Data = None - LiteralValue = Option.map (GenFieldInit m) fspec.LiteralValue + Attributes = enum 0 + Data = None + LiteralValue = None Offset = ilFieldOffset - IsSpecialName = (ilFieldName="value__" && tycon.IsEnumTycon) - Marshal = ilFieldMarshal - NotSerialized = ilNotSerialized - IsInitOnly = false - IsLiteral = fspec.LiteralValue.IsSome + Marshal = None CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs) } + let fdef = + fdef.WithAccess(access) + .WithStatic(isStatic) + .WithSpecialName(ilFieldName="value__" && tycon.IsEnumTycon) + .WithNotSerialized(ilNotSerialized) + .WithLiteralDefaultValue(literalValue) + .WithFieldMarshal(ilFieldMarshal) + yield fdef if requiresExtraField then yield mkILInstanceField("__dummy",cenv.g.ilg.typ_Int32,None,ILMemberAccess.Assembly) ] @@ -6418,8 +6372,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let ilFieldAttrs = GenAttrs cenv eenv propAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i] yield { Name = ilPropName - IsRTSpecialName = false - IsSpecialName = false + Attributes = PropertyAttributes.None SetMethod = (if ilHasSetter then Some(mkILMethRef(tref,ilCallingConv,"set_" + ilPropName,0,[ilPropType],ILType.Void)) else None) GetMethod = Some(mkILMethRef(tref,ilCallingConv,"get_" + ilPropName,0,[],ilPropType)) CallingConv = ilCallingConv.ThisConv @@ -6456,7 +6409,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = mkILNonGenericInstanceMethod (ilMethName,iLAccess,ilParams,ilReturn, mkMethodBody(true,[],2,nonBranchingInstrsToCode ([ mkLdarg0;mkLdarg 1us;mkNormalStfld ilFieldSpec]),None)) - yield ilMethodDef |> AddSpecialNameFlag + yield ilMethodDef.WithSpecialName if generateDebugDisplayAttribute then let (|Lazy|) (x:Lazy<_>) = x.Force() @@ -6495,7 +6448,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = yield mkNormalLdobj ilThisTy ] @ callInstrs), None)) - yield ilMethodDef |> AddSpecialNameFlag |> AddNonUserCompilerGeneratedAttribs cenv.g + yield ilMethodDef.WithSpecialName |> AddNonUserCompilerGeneratedAttribs cenv.g | None,_ -> //printfn "sprintf not found" () @@ -6549,8 +6502,8 @@ 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,typ,ctps,mtps,paraml,returnTy)) [] [] - for ilMethodDef in mkILDelegateMethods cenv.g.ilg (cenv.g.iltyp_AsyncCallback, cenv.g.iltyp_IAsyncResult) (p,r) do - yield { ilMethodDef with Access=reprAccess } + for ilMethodDef in mkILDelegateMethods reprAccess cenv.g.ilg (cenv.g.iltyp_AsyncCallback, cenv.g.iltyp_IAsyncResult) (p,r) do + yield ilMethodDef | _ -> () | TUnionRepr _ when not (tycon.HasMember cenv.g "ToString" []) -> @@ -6567,9 +6520,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = match tycon.TypeReprInfo with | TILObjectRepr _ -> - let td = tycon.ILTyconRawMetadata - {td with Access = access - CustomAttrs = mkILCustomAttrs ilCustomAttrs + let td = tycon.ILTyconRawMetadata.WithAccess(access) + {td with CustomAttrs = mkILCustomAttrs ilCustomAttrs GenericParams = ilGenParams }, None | TRecdRepr _ | TFSharpObjectRepr _ as tyconRepr -> @@ -6599,7 +6551,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = // before the main method even starts. let typeDefTrigger = if eenv.isFinalFile || tycon.TyparsNoRange.IsEmpty then - ILTypeInit.OnAny + ILTypeInit.OnAny else ILTypeInit.BeforeField @@ -6610,11 +6562,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = // Set some the extra entries in the definition let isTheSealedAttribute = tyconRefEq cenv.g tcref cenv.g.attrib_SealedAttribute.TyconRef - let tdef = { tdef with IsSealed = isSealedTy cenv.g thisTy || isTheSealedAttribute - IsSerializable = isSerializable - MethodImpls=mkILMethodImpls methodImpls - IsAbstract=isAbstract - IsComInterop=isComInteropTy cenv.g thisTy } + let tdef = tdef.WithSealed(isSealedTy cenv.g thisTy || isTheSealedAttribute).WithSerializable(isSerializable).WithAbstract(isAbstract).WithImport(isComInteropTy cenv.g thisTy) + let tdef = { tdef with MethodImpls=mkILMethodImpls methodImpls } let tdLayout,tdEncoding = match TryFindFSharpAttribute cenv.g cenv.g.attrib_StructLayoutAttribute tycon.Attribs with @@ -6652,9 +6601,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = // In that case we generate a dummy field instead (cenv.opts.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) then - ILTypeDefLayout.Sequential { Size=None; Pack=None }, ILDefaultPInvokeEncoding.Ansi + ILTypeDefLayout.Sequential { Size=None; Pack=None }, ILDefaultPInvokeEncoding.Ansi else - ILTypeDefLayout.Sequential { Size=Some 1; Pack=Some 0us }, ILDefaultPInvokeEncoding.Ansi + ILTypeDefLayout.Sequential { Size=Some 1; Pack=Some 0us }, ILDefaultPInvokeEncoding.Ansi | _ -> ILTypeDefLayout.Auto, ILDefaultPInvokeEncoding.Ansi @@ -6671,14 +6620,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = match fdef.Offset with | Some _ -> errorR(Error(FSComp.SR.ilFieldHasOffsetForSequentialLayout(), (trimRangeToLine m))) | _ -> () - + match tdLayout with | ILTypeDefLayout.Explicit(_) -> List.iter validateExplicit ilFieldDefs - | ILTypeDefLayout.Sequential(_) -> List.iter validateSequential ilFieldDefs + | ILTypeDefLayout.Sequential(_) -> List.iter validateSequential ilFieldDefs | _ -> () - let tdef = { tdef with tdKind = ilTypeDefKind; Layout=tdLayout; Encoding=tdEncoding } - let tdef = match ilTypeDefKind with ILTypeDefKind.Interface -> { tdef with Extends = None; IsAbstract=true } | _ -> tdef + let tdef = tdef.WithKind(ilTypeDefKind).WithLayout(tdLayout).WithEncoding(tdEncoding) tdef, None | TUnionRepr _ -> @@ -6703,14 +6651,14 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = // Structs with no instance fields get size 1, pack 0 ILTypeDefLayout.Sequential { Size=Some 1; Pack=Some 0us } else - ILTypeDefLayout.Sequential { Size=None; Pack=None } + ILTypeDefLayout.Sequential { Size=None; Pack=None } else ILTypeDefLayout.Auto let tdef = { Name = ilTypeName Layout = layout - Access = access + Attributes = enum 0 GenericParams = ilGenParams CustomAttrs = mkILCustomAttrs (ilCustomAttrs @ @@ -6718,24 +6666,16 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = (int (if hiddenRepr then SourceConstructFlags.SumType ||| SourceConstructFlags.NonPublicRepresentation else SourceConstructFlags.SumType)) ]) - InitSemantics=ILTypeInit.BeforeField - IsSealed=true - IsAbstract=false - tdKind= (if tycon.IsStructOrEnumTycon then ILTypeDefKind.ValueType else ILTypeDefKind.Class) Fields = ilFields Events= ilEvents Properties = ilProperties Methods= mkILMethods ilMethods - MethodImpls= mkILMethodImpls methodImpls - IsComInterop=false - IsSerializable= isSerializable - IsSpecialName= false + MethodImpls= mkILMethodImpls methodImpls NestedTypes=emptyILTypeDefs - Encoding= ILDefaultPInvokeEncoding.Auto Implements = ilIntfTys Extends= Some (if tycon.IsStructOrEnumTycon then cenv.g.iltyp_ValueType else cenv.g.ilg.typ_Object) - SecurityDecls= emptyILSecurityDecls - HasSecurity=false } + SecurityDecls= emptyILSecurityDecls }.WithLayout(layout).WithSerializable(isSerializable).WithSealed(true).WithEncoding(ILDefaultPInvokeEncoding.Auto).WithAccess(access).WithInitSemantics(ILTypeInit.BeforeField) + let tdef2 = cenv.g.eraseClassUnionDef tref tdef cuinfo // Discard the user-supplied (i.e. prim-type.fs) implementations of the get_Empty, get_IsEmpty, get_Value and get_None and Some methods. @@ -6756,7 +6696,10 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | _ -> failwith "??" - let tdef = {tdef with SecurityDecls= secDecls; HasSecurity=securityAttrs.Length > 0} + let tdef = tdef.WithHasSecurity(not (List.isEmpty securityAttrs)) + let tdef = + { tdef with + SecurityDecls = secDecls } mgbuf.AddTypeDef(tref, tdef, false, false, tdefDiscards) // If a non-generic type is written with "static let" and "static do" (i.e. it has a ".cctor") @@ -6792,14 +6735,13 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) = let ilMethodDef = mkLdfldMethodDef (ilMethName,reprAccess,false,ilThisTy,ilFieldName,ilPropType) let ilFieldDef = IL.mkILInstanceField(ilFieldName,ilPropType, None, ILMemberAccess.Assembly) let ilPropDef = - { Name=ilPropName - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None - GetMethod=Some(mkILMethRef(tref,ILCallingConv.Instance,ilMethName,0,[],ilPropType)) - CallingConv=ILThisConvention.Instance - Type=ilPropType - Init=None + { Name = ilPropName + Attributes = PropertyAttributes.None + SetMethod = None + GetMethod = Some(mkILMethRef(tref,ILCallingConv.Instance,ilMethName,0,[],ilPropType)) + CallingConv = ILThisConvention.Instance + Type = ilPropType + Init = None Args = [] CustomAttrs=mkILCustomAttrs (GenAttrs cenv eenv fld.PropertyAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i]) } yield (ilMethodDef,ilFieldDef,ilPropDef,(ilPropName,ilFieldName,ilPropType)) ] @@ -6878,7 +6820,7 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) = emptyILEvents, mkILCustomAttrs [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Exception)], ILTypeInit.BeforeField) - let tdef = { tdef with IsSerializable = true } + let tdef = tdef.WithSerializable(true) mgbuf.AddTypeDef(tref, tdef, false, false, None) diff --git a/src/fsharp/IlxGen.fsi b/src/fsharp/IlxGen.fsi index f3db0386983..f7a5071d146 100644 --- a/src/fsharp/IlxGen.fsi +++ b/src/fsharp/IlxGen.fsi @@ -18,21 +18,39 @@ type IlxGenBackend = [] type internal IlxGenOptions = { fragName : string + + /// Indicates if we are generating filter blocks generateFilterBlocks : bool + + /// Indicates if we should workaround old reflection emit bugs workAroundReflectionEmitBugs : bool + + /// Indicates if static array data should be emitted using static blobs emitConstantArraysUsingStaticDataBlobs : bool + /// If this is set, then the last module becomes the "main" module mainMethodInfo : Attribs option + + /// Indicates if local optimizations are active localOptimizationsAreOn : bool + + /// Indicates if we are generating debug symbols or not generateDebugSymbols : bool + + /// A flag to help test emit of debug information testFlagEmitFeeFeeAs100001 : bool + + /// Indicates which backend we are generating code for ilxBackend : IlxGenBackend + /// Indicates the code is being generated in FSI.EXE and is executed immediately after code generation /// This includes all interactively compiled code, including #load, definitions, and expressions isInteractive : bool + /// Indicates the code generated is an interactive 'it' expression. We generate a setter to allow clearing of the underlying /// storage, even though 'it' is not logically mutable isInteractiveItExpr : bool + /// Indicates that, whenever possible, use callvirt instead of call alwaysCallVirt : bool } diff --git a/src/fsharp/InfoReader.fs b/src/fsharp/InfoReader.fs index eabc0bf862c..bc01b946eeb 100644 --- a/src/fsharp/InfoReader.fs +++ b/src/fsharp/InfoReader.fs @@ -453,7 +453,7 @@ let rec GetIntrinsicConstructorInfosOfTypeAux (infoReader:InfoReader) m origTy m | ILTypeMetadata _ -> let tinfo = ILTypeInfo.FromType g origTy tinfo.RawMetadata.Methods.FindByName ".ctor" - |> List.filter (fun md -> match md.mdKind with MethodKind.Ctor -> true | _ -> false) + |> List.filter (fun md -> md.IsConstructor) |> List.map (fun mdef -> MethInfo.CreateILMeth (amap, m, origTy, mdef)) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> diff --git a/src/fsharp/LexFilter.fs b/src/fsharp/LexFilter.fs index 5b9deaf832e..c933a847bbb 100755 --- a/src/fsharp/LexFilter.fs +++ b/src/fsharp/LexFilter.fs @@ -444,7 +444,7 @@ type TokenTup = let (|TyparsCloseOp|_|) (txt:string) = let angles = txt |> Seq.takeWhile (fun c -> c = '>') |> Seq.toList let afterAngles = txt |> Seq.skipWhile (fun c -> c = '>') |> Seq.toList - if angles.Length = 0 then None else + if List.isEmpty angles then None else let afterOp = match (new System.String(Array.ofSeq afterAngles)) with diff --git a/src/fsharp/MSBuildReferenceResolver.fs b/src/fsharp/MSBuildReferenceResolver.fs index e703df8101f..804c6b74088 100644 --- a/src/fsharp/MSBuildReferenceResolver.fs +++ b/src/fsharp/MSBuildReferenceResolver.fs @@ -108,7 +108,7 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver let GetPathToDotNetFrameworkReferenceAssemblies(version) = -#if NETSTANDARD1_6 +#if NETSTANDARD1_6 || NETSTANDARD2_0 ignore version let r : string list = [] r diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 31e2c960f32..1f0b2e49bd9 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -530,22 +530,21 @@ let ComputeConstrainedCallInfo g amap m (objArgs,minfo:MethInfo) = /// Adjust the 'this' pointer before making a call /// Take the address of a struct, and coerce to an interface/base/constraint type if necessary let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = - let ccallInfo = ComputeConstrainedCallInfo g amap m (objArgs,minfo) - let mustTakeAddress = - (minfo.IsStruct && not minfo.IsExtensionMember) // don't take the address of a struct when passing to an extension member - || - (match ccallInfo with - | Some _ -> true - | None -> false) + let ccallInfo = ComputeConstrainedCallInfo g amap m (objArgs,minfo) + let wrap,objArgs = match objArgs with - | [objArgExpr] -> + | [objArgExpr] -> + let hasCallInfo = ccallInfo.IsSome + let mustTakeAddress = + (minfo.IsStruct && not minfo.IsExtensionMember) // don't take the address of a struct when passing to an extension member + || hasCallInfo let objArgTy = tyOfExpr g objArgExpr - let wrap,objArgExpr' = mkExprAddrOfExpr g mustTakeAddress (Option.isSome ccallInfo) isMutable objArgExpr None m + let wrap,objArgExpr' = 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' = - if Option.isNone ccallInfo && // minfo.IsExtensionMember && minfo.IsStruct && + if not hasCallInfo && // minfo.IsExtensionMember && minfo.IsStruct && not (TypeDefinitelySubsumesTypeNoCoercion 0 g amap m minfo.ApparentEnclosingType objArgTy) then mkCoerceExpr(objArgExpr',minfo.ApparentEnclosingType,m,objArgTy) else @@ -554,7 +553,7 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = wrap,[objArgExpr'] | _ -> - (fun x -> x), objArgs + id, objArgs let e,ety = f ccallInfo objArgs wrap e,ety @@ -579,7 +578,7 @@ let BuildILMethInfoCall g amap m isProp (minfo:ILMethInfo) valUseFlags minst dir let ilMethRef = minfo.ILMethodRef let newobj = ctor && (match valUseFlags with NormalValUse -> true | _ -> false) let exprTy = if ctor then minfo.ApparentEnclosingType else minfo.GetFSharpReturnTy(amap, m, minst) - let retTy = (if not ctor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy]) + let retTy = if not ctor && ilMethRef.ReturnType = ILType.Void then [] else [exprTy] let isDllImport = minfo.IsDllImport g Expr.Op(TOp.ILCall(useCallvirt,isProtected,valu,newobj,valUseFlags,isProp,isDllImport,ilMethRef,minfo.DeclaringTypeInst,minst,retTy),[],args,m), exprTy @@ -604,9 +603,7 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = ((args,vexprty), arities) ||> List.mapFold (fun (args,fty) arity -> match arity,args with | (0|1),[] when typeEquiv g (domainOfFunTy g fty) g.unit_ty -> mkUnit g m, (args, rangeOfFunTy g fty) - | 0,(arg::argst)-> - - + | 0,(arg::argst) -> warning(InternalError(sprintf "Unexpected zero arity, args = %s" (Layout.showL (Layout.sepListL (Layout.rightL (Layout.TaggedTextOps.tagText ";")) (List.map exprL args))),m)); arg, (argst, rangeOfFunTy g fty) | 1,(arg :: argst) -> arg, (argst, rangeOfFunTy g fty) @@ -673,9 +670,8 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap:Import.ImportMap, m:rang | _ -> match amap.g.knownFSharpCoreModules.TryGetValue(declaringEntity.LogicalName) with | true,modRef -> - match modRef.ModuleOrNamespaceType.AllValsByLogicalName |> Seq.tryPick (fun (KeyValue(_,v)) -> if v.CompiledName = methodName then Some v else None) with - | Some v -> Some (mkNestedValRef modRef v) - | None -> None + modRef.ModuleOrNamespaceType.AllValsByLogicalName + |> Seq.tryPick (fun (KeyValue(_,v)) -> if v.CompiledName = methodName then Some (mkNestedValRef modRef v) else None) | _ -> None else None @@ -693,13 +689,12 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap:Import.ImportMap, m:rang // objArgs: the 'this' argument, if any // args: the arguments, if any let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objArgs args = - let direct = IsBaseCall objArgs TakeObjAddrForMethodCall g amap minfo isMutable m objArgs (fun ccallInfo objArgs -> - let allArgs = (objArgs @ args) + let allArgs = objArgs @ args let valUseFlags = - if (direct && (match valUseFlags with NormalValUse -> true | _ -> false)) then + if direct && (match valUseFlags with NormalValUse -> true | _ -> false) then VSlotDirectCall else match ccallInfo with @@ -722,7 +717,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA // these calls are provided by the runtime and should not be called from the user code if isArrayTy g enclTy then let tpe = TypeProviderError(FSComp.SR.tcRuntimeSuppliedMethodCannotBeUsedInUserCode(minfo.DisplayName), providedMeth.TypeProviderDesignation, m) - error (tpe) + error tpe let valu = isStructTy g enclTy let isCtor = minfo.IsConstructor if minfo.IsClassConstructor then @@ -747,7 +742,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA elif isFunTy g enclTy then [ domainOfFunTy g enclTy; rangeOfFunTy g enclTy ] // provided expressions can call Invoke else minfo.DeclaringTypeInst let actualMethInst = minst - let retTy = (if not isCtor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy]) + let retTy = if not isCtor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy] let noTailCall = false let expr = Expr.Op(TOp.ILCall(useCallvirt,isProtected,valu,isNewObj,valUseFlags,isProp,noTailCall,ilMethRef,actualTypeInst,actualMethInst, retTy),[],allArgs,m) expr,exprTy @@ -1125,7 +1120,7 @@ module ProvidedMethodCalls = let targetMethInfo = ProvidedMeth(amap,ctor.PApply((fun ne -> upcast ne),m),None,m) let objArgs = [] let arguments = [ for ea in args.PApplyArray(id, "GetInvokerExpresson", m) -> exprToExpr ea ] - let callExpr = BuildMethodCall tcVal g amap Mutates.PossiblyMutates m false targetMethInfo isSuperInit [] objArgs arguments + let callExpr = BuildMethodCall tcVal g amap PossiblyMutates m false targetMethInfo isSuperInit [] objArgs arguments callExpr and addVar (v:Tainted) = @@ -1191,7 +1186,7 @@ module ProvidedMethodCalls = |> Array.map (fun pty -> eraseSystemType (amap,m,pty)) let paramVars = erasedParamTys - |> Array.mapi (fun i erasedParamTy -> erasedParamTy.PApply((fun ty -> ProvidedVar.Fresh("arg" + i.ToString(),ty)),m)) + |> Array.mapi (fun i erasedParamTy -> erasedParamTy.PApply((fun ty -> ProvidedVar.Fresh("arg" + i.ToString(),ty)),m)) // encode "this" as the first ParameterExpression, if applicable diff --git a/src/fsharp/MethodOverrides.fs b/src/fsharp/MethodOverrides.fs index fdaab282497..2ba55b7f75f 100644 --- a/src/fsharp/MethodOverrides.fs +++ b/src/fsharp/MethodOverrides.fs @@ -709,7 +709,7 @@ let GetAbstractMethInfosForSynMethodDecl(infoReader:InfoReader,ad,memberName:Ide GetIntrinsicMethInfosOfType infoReader (Some(memberName.idText), ad, AllowMultiIntfInstantiations.Yes) IgnoreOverrides bindm ty let dispatchSlots = minfos |> List.filter (fun minfo -> minfo.IsDispatchSlot) let topValSynArities = SynInfo.AritiesOfArgs valSynData - let topValSynArities = if topValSynArities.Length > 0 then topValSynArities.Tail else topValSynArities + let topValSynArities = if List.isEmpty topValSynArities then topValSynArities else topValSynArities.Tail let dispatchSlotsArityMatch = dispatchSlots |> List.filter (fun minfo -> minfo.NumArgs = topValSynArities) dispatchSlots,dispatchSlotsArityMatch diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index dcbc1f074ec..279bb145fe9 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -568,7 +568,7 @@ let AddValRefToNameEnv nenv (vref:ValRef) = /// Add a set of active pattern result tags to the environment. let AddActivePatternResultTagsToNameEnv (apinfo: PrettyNaming.ActivePatternInfo) nenv ty m = - if apinfo.Names.Length = 0 then nenv else + if List.isEmpty apinfo.Names then nenv else let apresl = List.indexed apinfo.Names { nenv with eUnqualifiedItems = @@ -675,13 +675,13 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g:TcGlobals) | _ -> Item.UnqualifiedType [tcref])) else tab - if isILOrRequiredQualifiedAccess || ucrefs.Length = 0 then + if isILOrRequiredQualifiedAccess || List.isEmpty ucrefs then tab else AddUnionCases2 bulkAddMode tab ucrefs let ePatItems = - if isILOrRequiredQualifiedAccess || ucrefs.Length = 0 then + if isILOrRequiredQualifiedAccess || List.isEmpty ucrefs then nenv.ePatItems else AddUnionCases1 nenv.ePatItems ucrefs @@ -1100,14 +1100,9 @@ let ResolveProvidedTypeNameInEntity (amap, m, typeName, modref: ModuleOrNamespac | TProvidedNamespaceExtensionPoint(resolutionEnvironment,resolvers) -> match modref.Deref.PublicPath with | Some(PubPath path) -> - let matches = resolvers |> List.map (fun r-> ExtensionTyping.TryResolveProvidedType(r,m,path,typeName)) - let tcrefs = - [ for st in matches do - match st with - | None -> () - | Some st -> - yield AddEntityForProvidedType (amap, modref, resolutionEnvironment, st, m) ] - tcrefs + resolvers + |> List.choose (fun r-> ExtensionTyping.TryResolveProvidedType(r,m,path,typeName)) + |> List.map (fun st -> AddEntityForProvidedType (amap, modref, resolutionEnvironment, st, m)) | None -> [] // We have a provided type, look up its nested types (populating them on-demand if necessary) @@ -1335,12 +1330,18 @@ let (|ActivePatternCaseUse|_|) (item:Item) = | Item.ActivePatternResult(ap, _, idx,_) -> Some (ap.Range, ap.Range, idx) | _ -> None +let tyconRefDefnHash (_g: TcGlobals) (eref1:EntityRef) = + hash eref1.LogicalName + let tyconRefDefnEq g (eref1:EntityRef) (eref2: EntityRef) = tyconRefEq g eref1 eref2 // Signature items considered equal to implementation items || ((eref1.DefinitionRange = eref2.DefinitionRange || eref1.SigRange = eref2.SigRange) && (eref1.LogicalName = eref2.LogicalName)) +let valRefDefnHash (_g: TcGlobals) (vref1:ValRef)= + hash vref1.DisplayName + let valRefDefnEq g (vref1:ValRef) (vref2: ValRef) = valRefEq g vref1 vref2 // Signature items considered equal to implementation items @@ -1415,6 +1416,23 @@ let ItemsAreEffectivelyEqual g orig other = | _ -> false +/// Given the Item 'orig' - returns function 'other : Item -> bool', that will yield true if other and orig represents the same item and false - otherwise +let ItemsAreEffectivelyEqualHash (g: TcGlobals) orig = + match orig with + | EntityUse tcref -> tyconRefDefnHash g tcref + | Item.TypeVar (nm,_)-> hash nm + | ValUse vref -> valRefDefnHash g vref + | ActivePatternCaseUse (_, _, idx)-> hash idx + | MethodUse minfo -> minfo.ComputeHashCode() + | PropertyUse pinfo -> pinfo.ComputeHashCode() + | Item.ArgName (id,_, _) -> hash id.idText + | ILFieldUse ilfinfo -> ilfinfo.ComputeHashCode() + | UnionCaseUse ucase -> hash ucase.CaseName + | RecordFieldUse (name, _) -> hash name + | EventUse einfo -> einfo.ComputeHashCode() + | Item.ModuleOrNamespaces _ -> 100013 + | _ -> 389329 + [] type CapturedNameResolution(p:pos, i:Item, tpinst, io:ItemOccurence, de:DisplayEnv, nre:NameResolutionEnv, ad:AccessorDomain, m:range) = member this.Pos = p @@ -1455,20 +1473,18 @@ type TcSymbolUseData = type TcSymbolUses(g, capturedNameResolutions : ResizeArray, formatSpecifierLocations: (range * int)[]) = // Make sure we only capture the information we really need to report symbol uses - let cnrs = [| for cnr in capturedNameResolutions -> { Item=cnr.Item; ItemOccurence=cnr.ItemOccurence; DisplayEnv=cnr.DisplayEnv; Range=cnr.Range } |] + let allUsesOfSymbols = [| for cnr in capturedNameResolutions -> { 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 cnr in cnrs do - if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item cnr.Item) then - yield (cnr.ItemOccurence, cnr.DisplayEnv, cnr.Range) |] + [| for symbolUse in allUsesOfSymbols do + if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item symbolUse.Item) then + yield symbolUse |] - member this.GetAllUsesOfSymbols() = - [| for cnr in cnrs do - yield (cnr.Item, cnr.ItemOccurence, cnr.DisplayEnv, cnr.Range) |] + member this.AllUsesOfSymbols = allUsesOfSymbols - member this.GetFormatSpecifierLocationsAndArity() = formatSpecifierLocations + member this.GetFormatSpecifierLocationsAndArity() = formatSpecifierLocations /// An accumulator for the results being emitted into the tcSink. @@ -1725,14 +1741,14 @@ let CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities // no explicit type instantiation typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && // some type arguments required on all types (note sorted by typar count above) - tcref.Typars(m).Length > 0 && + not (List.isEmpty (tcref.Typars m)) && // plausible types have different arities (tcrefs |> Seq.distinctBy (fun (_,tcref) -> tcref.Typars(m).Length) |> Seq.length > 1) -> [ for (resInfo,tcref) in tcrefs do let resInfo = resInfo.AddWarning (fun _typarChecker -> errorR(Error(FSComp.SR.nrTypeInstantiationNeededToDisambiguateTypesWithSameName(tcref.DisplayName, tcref.DisplayNameWithStaticParametersAndUnderscoreTypars),m))) yield (resInfo,tcref) ] - | [(resInfo,tcref)] when typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && tcref.Typars(m).Length > 0 && typeNameResInfo.ResolutionFlag = ResolveTypeNamesToTypeRefs -> + | [(resInfo,tcref)] when typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && not (List.isEmpty (tcref.Typars m)) && typeNameResInfo.ResolutionFlag = ResolveTypeNamesToTypeRefs -> let resInfo = resInfo.AddWarning (fun (ResultTyparChecker typarChecker) -> if not (typarChecker()) then @@ -1758,17 +1774,14 @@ let CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities //------------------------------------------------------------------------- /// Perform name resolution for an identifier which must resolve to be a namespace or module. -let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad (lid:Ident list) isOpenDecl = - match lid with - | [] -> NoResultsOrUsefulErrors - - | id :: rest when id.idText = MangledGlobalName -> - if isNil rest then +let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m first fullyQualified (nenv:NameResolutionEnv) ad (id:Ident) (rest:Ident list) isOpenDecl = + if first && id.idText = MangledGlobalName then + match rest with + | [] -> error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - else - ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m FullyQualified nenv ad rest isOpenDecl - - | id :: rest -> + | id2::rest2 -> + ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m false FullyQualified nenv ad id2 rest2 isOpenDecl + else let moduleOrNamespaces = nenv.ModulesAndNamespaces fullyQualified let namespaceNotFound = lazy( let suggestModulesAndNamespaces() = @@ -1820,23 +1833,24 @@ let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m fullyQualifie modrefs |> CollectResults2 atMostOne (fun modref -> if IsEntityAccessible amap m ad modref then - notifyNameResolution modref id.idRange + notifyNameResolution modref id.idRange look 1 modref modref.ModuleOrNamespaceType rest else raze (namespaceNotFound.Force())) | None -> raze (namespaceNotFound.Force()) -let ResolveLongIndentAsModuleOrNamespaceThen sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad lid isOpenDecl f = - match lid with - | [] -> NoResultsOrUsefulErrors - | id :: rest -> - match ResolveLongIndentAsModuleOrNamespace sink ResultCollectionSettings.AllResults amap m fullyQualified nenv ad [id] isOpenDecl with - | Result modrefs -> - modrefs |> CollectResults2 atMostOne (fun (depth,modref,mty) -> - let resInfo = ResolutionInfo.Empty.AddEntity(id.idRange,modref) - f resInfo (depth+1) id.idRange modref mty rest) - | Exception err -> Exception err +let ResolveLongIndentAsModuleOrNamespaceThen sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad id rest isOpenDecl f = + match ResolveLongIndentAsModuleOrNamespace sink ResultCollectionSettings.AllResults amap m true fullyQualified nenv ad id [] isOpenDecl with + | Result modrefs -> + match rest with + | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),id.idRange)) + | id2::rest2 -> + modrefs + |> CollectResults2 atMostOne (fun (depth,modref,mty) -> + let resInfo = ResolutionInfo.Empty.AddEntity(id.idRange,modref) + f resInfo (depth+1) id.idRange modref mty id2 rest2) + | Exception err -> Exception err //------------------------------------------------------------------------- // Bind name used in "new Foo.Bar(...)" constructs @@ -2048,155 +2062,156 @@ let GetRecordLabelsForType g nenv typ = // REVIEW: this shows up on performance logs. Consider for example endless resolutions of "List.map" to // the empty set of results, or "x.Length" for a list or array type. This indicates it could be worth adding a cache here. -let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo:ResolutionInfo) depth m ad (lid:Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) typ = +let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo:ResolutionInfo) depth m ad (id:Ident) (rest:Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) typ = let g = ncenv.g - match lid with - | [] -> error(InternalError("ResolveLongIdentInTypePrim",m)) - | id :: rest -> - let m = unionRanges m id.idRange - let nm = id.idText // used to filter the searches of the tables - let optFilter = Some nm // used to filter the searches of the tables - let contentsSearchAccessible = - let unionCaseSearch = - match lookupKind with - | LookupKind.Expr | LookupKind.Pattern -> TryFindUnionCaseOfType g typ nm - | _ -> None - - // Lookup: datatype constructors take precedence - match unionCaseSearch with - | Some ucase -> - OneResult (success(resInfo,Item.UnionCase(ucase,false),rest)) - | None -> - let isLookUpExpr = lookupKind = LookupKind.Expr - match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm,ad) findFlag m typ with - | Some (PropertyItem psets) when isLookUpExpr -> - let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m + let m = unionRanges m id.idRange + let nm = id.idText // used to filter the searches of the tables + let optFilter = Some nm // used to filter the searches of the tables + let contentsSearchAccessible = + let unionCaseSearch = + match lookupKind with + | LookupKind.Expr | LookupKind.Pattern -> TryFindUnionCaseOfType g typ nm + | _ -> None + + // Lookup: datatype constructors take precedence + match unionCaseSearch with + | Some ucase -> + OneResult (success(resInfo,Item.UnionCase(ucase,false),rest)) + | None -> + let isLookUpExpr = lookupKind = LookupKind.Expr + match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm,ad) findFlag m typ with + | Some (PropertyItem psets) when isLookUpExpr -> + let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m - // fold the available extension members into the overload resolution - let extensionPropInfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter,ad) m typ + // fold the available extension members into the overload resolution + let extensionPropInfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter,ad) m typ - // make sure to keep the intrinsic pinfos before the extension pinfos in the list, - // since later on this logic is used when giving preference to intrinsic definitions - 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 + // make sure to keep the intrinsic pinfos before the extension pinfos in the list, + // since later on this logic is used when giving preference to intrinsic definitions + 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 - // fold the available extension members into the overload resolution - let extensionMethInfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ + // fold the available extension members into the overload resolution + let extensionMethInfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ - success [resInfo,Item.MakeMethGroup (nm,minfos@extensionMethInfos),rest] - | Some (ILFieldItem (finfo:: _)) when (match lookupKind with LookupKind.Expr | LookupKind.Pattern -> true | _ -> false) -> - success [resInfo,Item.ILField finfo,rest] + success [resInfo,Item.MakeMethGroup (nm,minfos@extensionMethInfos),rest] + | Some (ILFieldItem (finfo:: _)) when (match lookupKind with LookupKind.Expr | LookupKind.Pattern -> true | _ -> false) -> + success [resInfo,Item.ILField finfo,rest] - | 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] - | _ -> + | 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 typ - if not (isNil pinfos) && isLookUpExpr then OneResult(success (resInfo,Item.Property (nm,pinfos),rest)) else - let minfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ + let pinfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter, ad) m typ + if not (isNil pinfos) && isLookUpExpr then OneResult(success (resInfo,Item.Property (nm,pinfos),rest)) else + let minfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ - if not (isNil minfos) && isLookUpExpr then - success [resInfo,Item.MakeMethGroup (nm,minfos),rest] - elif isTyparTy g typ then raze (IndeterminateType(unionRanges m id.idRange)) - else NoResultsOrUsefulErrors + if not (isNil minfos) && isLookUpExpr then + success [resInfo,Item.MakeMethGroup (nm,minfos),rest] + elif isTyparTy g typ then raze (IndeterminateType(unionRanges m id.idRange)) + else NoResultsOrUsefulErrors - match contentsSearchAccessible with - | Result res when not (isNil res) -> contentsSearchAccessible - | Exception _ -> contentsSearchAccessible - | _ -> + match contentsSearchAccessible with + | Result res when not (isNil res) -> contentsSearchAccessible + | Exception _ -> contentsSearchAccessible + | _ -> - let nestedSearchAccessible = - let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), true, m) typ - if isNil rest then - if isNil nestedTypes then - NoResultsOrUsefulErrors - else - match typeNameResInfo.ResolutionFlag with - | ResolveTypeNamesToCtors -> - nestedTypes - |> CollectAtMostOneResult (ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo m ad) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - | ResolveTypeNamesToTypeRefs -> - OneSuccess (resInfo,Item.Types (nm,nestedTypes),rest) + let nestedSearchAccessible = + match rest with + | [] -> + let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, typeNameResInfo.StaticArgsInfo, true, m) typ + if isNil nestedTypes then + NoResultsOrUsefulErrors else - ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad rest findFlag typeNameResInfo nestedTypes - - match nestedSearchAccessible with - | Result res when not (isNil res) -> nestedSearchAccessible - | _ -> - let suggestMembers() = - let suggestions1 = - ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (None, ad) m typ - |> List.map (fun p -> p.PropertyName) + match typeNameResInfo.ResolutionFlag with + | ResolveTypeNamesToCtors -> + nestedTypes + |> CollectAtMostOneResult (ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo m ad) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) + | ResolveTypeNamesToTypeRefs -> + OneSuccess (resInfo,Item.Types (nm,nestedTypes),rest) + | id2::rest2 -> + let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, TypeNameResolutionStaticArgsInfo.Indefinite, true, m) typ + ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad id2 rest2 findFlag typeNameResInfo nestedTypes + + match nestedSearchAccessible with + | Result res when not (isNil res) -> nestedSearchAccessible + | _ -> + let suggestMembers() = + let suggestions1 = + ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (None, ad) m typ + |> List.map (fun p -> p.PropertyName) - let suggestions2 = - ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv None m typ - |> List.map (fun m -> m.DisplayName) - - let suggestions3 = - GetIntrinsicPropInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ - |> List.map (fun p -> p.PropertyName) - - let suggestions4 = - GetIntrinsicMethInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ - |> List.filter (fun m -> not m.IsClassConstructor && not m.IsConstructor) - |> List.map (fun m -> m.DisplayName) - - let suggestions5 = GetRecordLabelsForType g nenv typ - - let suggestions6 = - match lookupKind with - | LookupKind.Expr | LookupKind.Pattern -> - if isAppTy g typ then - let tcref,_ = destAppTy g typ - tcref.UnionCasesArray - |> Array.map (fun uc -> uc.DisplayName) - else - [||] - | _ -> [||] + let suggestions2 = + ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv None m typ + |> List.map (fun m -> m.DisplayName) + + let suggestions3 = + GetIntrinsicPropInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ + |> List.map (fun p -> p.PropertyName) + + let suggestions4 = + GetIntrinsicMethInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ + |> List.filter (fun m -> not m.IsClassConstructor && not m.IsConstructor) + |> List.map (fun m -> m.DisplayName) + + let suggestions5 = GetRecordLabelsForType g nenv typ + + let suggestions6 = + match lookupKind with + | LookupKind.Expr | LookupKind.Pattern -> + if isAppTy g typ then + let tcref,_ = destAppTy g typ + tcref.UnionCasesArray + |> Array.map (fun uc -> uc.DisplayName) + else + [||] + | _ -> [||] - [ yield! suggestions1 - yield! suggestions2 - yield! suggestions3 - yield! suggestions4 - yield! suggestions5 - yield! suggestions6 ] - |> HashSet - - raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id, suggestMembers)) + [ yield! suggestions1 + yield! suggestions2 + yield! suggestions3 + yield! suggestions4 + yield! suggestions5 + yield! suggestions6 ] + |> HashSet + + raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id, suggestMembers)) -and ResolveLongIdentInNestedTypes (ncenv:NameResolver) nenv lookupKind resInfo depth id m ad lid findFlag typeNameResInfo typs = - typs |> CollectAtMostOneResult (fun typ -> +and ResolveLongIdentInNestedTypes (ncenv:NameResolver) nenv lookupKind resInfo depth id m ad (id2:Ident) (rest:Ident list) findFlag typeNameResInfo typs = + typs + |> CollectAtMostOneResult (fun typ -> let resInfo = if isAppTy ncenv.g typ then resInfo.AddEntity(id.idRange,tcrefOfAppTy ncenv.g typ) else resInfo - ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad lid findFlag typeNameResInfo typ + ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id2 rest findFlag typeNameResInfo typ |> AtMostOneResult m) /// Resolve a long identifier using type-qualified name resolution. -let ResolveLongIdentInType sink ncenv nenv lookupKind m ad lid findFlag typeNameResInfo typ = - let resInfo,item,rest = - ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad lid findFlag typeNameResInfo typ +let ResolveLongIdentInType sink ncenv nenv lookupKind m ad id findFlag typeNameResInfo typ = + let resInfo,item,rest = + ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad id [] findFlag typeNameResInfo typ |> AtMostOneResult m |> ForceRaise + ResolutionInfo.SendEntityPathToSink (sink,ncenv,nenv,ItemOccurence.UseInType,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) item,rest -let private ResolveLongIdentInTyconRef (ncenv:NameResolver) nenv lookupKind resInfo depth m ad lid typeNameResInfo tcref = +let private ResolveLongIdentInTyconRef (ncenv:NameResolver) nenv lookupKind resInfo depth m ad id rest typeNameResInfo tcref = #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a member! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) #endif let typ = FreshenTycon ncenv m tcref - typ |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad lid IgnoreOverrides typeNameResInfo + typ |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id rest IgnoreOverrides typeNameResInfo -let private ResolveLongIdentInTyconRefs atMostOne (ncenv:NameResolver) nenv lookupKind depth m ad lid typeNameResInfo idRange tcrefs = +let private ResolveLongIdentInTyconRefs atMostOne (ncenv:NameResolver) nenv lookupKind depth m ad id rest typeNameResInfo idRange tcrefs = tcrefs |> CollectResults2 atMostOne (fun (resInfo:ResolutionInfo,tcref) -> let resInfo = resInfo.AddEntity(idRange,tcref) - tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad lid typeNameResInfo |> AtMostOneResult m) + tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad id rest typeNameResInfo |> AtMostOneResult m) //------------------------------------------------------------------------- // ResolveExprLongIdentInModuleOrNamespace @@ -2206,116 +2221,115 @@ let (|AccessibleEntityRef|_|) amap m ad (modref: ModuleOrNamespaceRef) mspec = let eref = modref.NestedTyconRef mspec if IsEntityAccessible amap m ad eref then Some eref else None -let rec ResolveExprLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad resInfo depth m modref (mty:ModuleOrNamespaceType) (lid :Ident list) = +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 - match lid with - | [] -> raze(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | id :: rest -> - let m = unionRanges m id.idRange - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some 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) -> - success (resInfo,Item.ExnCase (modref.NestedTyconRef excon),rest) + let m = unionRanges m id.idRange + match mty.AllValsByLogicalName.TryFind(id.idText) with + | Some 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) -> + success (resInfo,Item.ExnCase (modref.NestedTyconRef excon),rest) + | _ -> + // Something in a discriminated union without RequireQualifiedAccess attribute? + let unionSearch,hasRequireQualifiedAccessAttribute = + match TryFindTypeWithUnionCase modref id with + | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let ucref = mkUnionCaseRef (modref.NestedTyconRef tycon) id.idText + let ucinfo = FreshenUnionCaseRef ncenv m ucref + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + success [resInfo,Item.UnionCase(ucinfo,hasRequireQualifiedAccessAttribute),rest],hasRequireQualifiedAccessAttribute + | _ -> NoResultsOrUsefulErrors,false + + match unionSearch with + | Result (res :: _) when not hasRequireQualifiedAccessAttribute -> success res | _ -> - // Something in a discriminated union without RequireQualifiedAccess attribute? - let unionSearch,hasRequireQualifiedAccessAttribute = - match TryFindTypeWithUnionCase modref id with - | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let ucref = mkUnionCaseRef (modref.NestedTyconRef tycon) id.idText - let ucinfo = FreshenUnionCaseRef ncenv m ucref - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - success [resInfo,Item.UnionCase(ucinfo,hasRequireQualifiedAccessAttribute),rest],hasRequireQualifiedAccessAttribute - | _ -> NoResultsOrUsefulErrors,false - - match unionSearch with - | Result (res :: _) when not hasRequireQualifiedAccessAttribute -> success res - | _ -> - // Something in a type? - let tyconSearch = - let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), modref) - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) - if not (isNil rest) then - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo (ResolveTypeNamesToTypeRefs,TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad rest typeNameResInfo id.idRange tcrefs - // Check if we've got some explicit type arguments - else - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - match typeNameResInfo.ResolutionFlag with - | ResolveTypeNamesToTypeRefs -> - success [ for (resInfo,tcref) in tcrefs do - let typ = FreshenTycon ncenv m tcref - let item = (resInfo,Item.Types(id.idText,[typ]),[]) - yield item ] - | ResolveTypeNamesToCtors -> - tcrefs - |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv m tcref) - |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - - match tyconSearch with - | Result (res :: _) -> success res + // Something in a type? + let tyconSearch = + let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), modref) + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) + match rest with + | id2::rest2 -> + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo (ResolveTypeNamesToTypeRefs,TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + // Check if we've got some explicit type arguments | _ -> + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + match typeNameResInfo.ResolutionFlag with + | ResolveTypeNamesToTypeRefs -> + success [ for (resInfo,tcref) in tcrefs do + let typ = FreshenTycon ncenv m tcref + let item = (resInfo,Item.Types(id.idText,[typ]),[]) + yield item ] + | ResolveTypeNamesToCtors -> + tcrefs + |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv m tcref) + |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - // Something in a sub-namespace or sub-module - let moduleSearch = - if not (isNil rest) then - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> - let resInfo = resInfo.AddEntity(id.idRange,submodref) + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest) - | _ -> - NoResultsOrUsefulErrors - else + // Something in a sub-namespace or sub-module + let moduleSearch = + match rest with + | id2::rest2 -> + match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(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) + | _ -> NoResultsOrUsefulErrors + | _ -> + NoResultsOrUsefulErrors - match tyconSearch +++ moduleSearch +++ unionSearch with - | Result [] -> - let suggestPossibleTypesAndNames() = - let types = - modref.ModuleOrNamespaceType.AllEntities - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef e)) - |> Seq.map (fun e -> e.DisplayName) - - let submodules = - mty.ModulesAndNamespacesByDemangledName - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + match tyconSearch +++ moduleSearch +++ unionSearch with + | Result [] -> + let suggestPossibleTypesAndNames() = + let types = + modref.ModuleOrNamespaceType.AllEntities + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef e)) + |> Seq.map (fun e -> e.DisplayName) + + let submodules = + mty.ModulesAndNamespacesByDemangledName + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - let unions = - modref.ModuleOrNamespaceType.AllEntities - |> Seq.collect (fun tycon -> - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - if hasRequireQualifiedAccessAttribute then - [||] - else - tycon.UnionCasesArray) - |> Seq.map (fun uc -> uc.DisplayName) - - let vals = - modref.ModuleOrNamespaceType.AllValsByLogicalName - |> Seq.filter (fun e -> IsValAccessible ad (mkNestedValRef modref e.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + let unions = + modref.ModuleOrNamespaceType.AllEntities + |> Seq.collect (fun tycon -> + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + if hasRequireQualifiedAccessAttribute then + [||] + else + tycon.UnionCasesArray) + |> Seq.map (fun uc -> uc.DisplayName) + + let vals = + modref.ModuleOrNamespaceType.AllValsByLogicalName + |> Seq.filter (fun e -> IsValAccessible ad (mkNestedValRef modref e.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - let exns = - modref.ModuleOrNamespaceType.ExceptionDefinitionsByDemangledName - |> Seq.filter (fun e -> IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef e.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + let exns = + modref.ModuleOrNamespaceType.ExceptionDefinitionsByDemangledName + |> Seq.filter (fun e -> IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef e.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - [ yield! types - yield! submodules - yield! unions - yield! vals - yield! exns ] - |> HashSet + [ yield! types + yield! submodules + yield! unions + yield! vals + yield! exns ] + |> HashSet - raze (UndefinedName(depth,FSComp.SR.undefinedNameValueConstructorNamespaceOrType,id,suggestPossibleTypesAndNames)) - | results -> AtMostOneResult id.idRange results + raze (UndefinedName(depth,FSComp.SR.undefinedNameValueConstructorNamespaceOrType,id,suggestPossibleTypesAndNames)) + | results -> AtMostOneResult id.idRange results /// An identifier has resolved to a type name in an expression (corresponding to one or more TyconRefs). /// Return either a set of constructors (later refined by overload resolution), or a set of TyconRefs. @@ -2335,328 +2349,328 @@ let ChooseTyconRefInExpr (ncenv:NameResolver, m, ad, nenv, id:Ident, typeNameRes /// Resolve F# "A.B.C" syntax in expressions /// Not all of the sequence will necessarily be swallowed, i.e. we return some identifiers /// that may represent further actions, e.g. further lookups. -let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) fullyQualified m ad nenv (typeNameResInfo:TypeNameResolutionInfo) lid isOpenDecl = +let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified m ad nenv (typeNameResInfo:TypeNameResolutionInfo) (id:Ident) (rest:Ident list) isOpenDecl = let resInfo = ResolutionInfo.Empty - match lid with - | [] -> error (Error(FSComp.SR.nrInvalidExpression(textOfLid lid), m)) - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | [id;next] when id.idText = MangledGlobalName -> - ResolveExprLongIdentPrim sink ncenv fullyQualified m ad nenv typeNameResInfo [next] isOpenDecl - - | id :: lid when id.idText = MangledGlobalName -> - ResolveExprLongIdentPrim sink ncenv FullyQualified m ad nenv typeNameResInfo lid isOpenDecl - - | [id] when fullyQualified <> FullyQualified -> - let typeError = ref None - // Single identifier. Lookup the unqualified names in the environment - let envSearch = - match nenv.eUnqualifiedItems.TryFind(id.idText) with - - // The name is a type name and it has not been clobbered by some other name - | Some (Item.UnqualifiedType tcrefs) -> + if first && id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | [next] -> + ResolveExprLongIdentPrim sink ncenv false fullyQualified m ad nenv typeNameResInfo next [] isOpenDecl + | id2::rest2 -> + ResolveExprLongIdentPrim sink ncenv false FullyQualified m ad nenv typeNameResInfo id2 rest2 isOpenDecl + else + if isNil rest && fullyQualified <> FullyQualified then + let typeError = ref None + // Single identifier. Lookup the unqualified names in the environment + let envSearch = + match nenv.eUnqualifiedItems.TryFind(id.idText) with + + // The name is a type name and it has not been clobbered by some other name + | Some (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 - let tcrefs = - tcrefs |> List.filter (fun tcref -> - typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo || - typeNameResInfo.StaticArgsInfo.NumStaticArgs = tcref.Typars(m).Length) + // Do not use type names from the environment if an explicit type instantiation is + // given and the number of type parameters do not match + let tcrefs = + tcrefs |> List.filter (fun tcref -> + typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo || + typeNameResInfo.StaticArgsInfo.NumStaticArgs = tcref.Typars(m).Length) - let search = ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) - match AtMostOneResult m search with - | Result _ as res -> - let resInfo,item,rest = ForceRaise res - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - Some(item,rest) - | Exception e -> typeError := Some e; None - - | Some res -> - Some (FreshenUnqualifiedItem ncenv m res, []) - | None -> - None - - match envSearch with - | Some res -> res - | None -> - let innerSearch = - // Check if it's a type name, e.g. a constructor call or a type instantiation - let ctorSearch = - let tcrefs = LookupTypeNameInEnvMaybeHaveArity fullyQualified id.idText typeNameResInfo nenv - ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) - - match ctorSearch with - | Result res when not (isNil res) -> ctorSearch - | _ -> - - let implicitOpSearch = - if IsMangledOpName id.idText then - success [(resInfo,Item.ImplicitOp(id, ref None),[])] - else - NoResultsOrUsefulErrors + let search = ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + match AtMostOneResult m search with + | Result _ as res -> + let resInfo,item,rest = ForceRaise res + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + Some(item,rest) + | Exception e -> typeError := Some e; None + + | Some res -> + Some (FreshenUnqualifiedItem ncenv m res, []) + | None -> + None - ctorSearch +++ implicitOpSearch + match envSearch with + | Some res -> res + | None -> + let innerSearch = + // Check if it's a type name, e.g. a constructor call or a type instantiation + let ctorSearch = + let tcrefs = LookupTypeNameInEnvMaybeHaveArity fullyQualified id.idText typeNameResInfo nenv + ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + + match ctorSearch with + | Result res when not (isNil res) -> ctorSearch + | _ -> - let resInfo,item,rest = - match AtMostOneResult m innerSearch with - | Result _ as res -> ForceRaise res - | _ -> - let failingCase = - match !typeError with - | Some e -> raze e - | _ -> - let suggestNamesAndTypes() = - let suggestedNames = - nenv.eUnqualifiedItems - |> Seq.map (fun e -> e.Value.DisplayName) - - let suggestedTypes = - nenv.TyconsByDemangledNameAndArity fullyQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) - - let suggestedModulesAndNamespaces = - nenv.ModulesAndNamespaces fullyQualified - |> Seq.collect (fun kv -> kv.Value) - |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) - |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) - - let unions = - // check if the user forgot to use qualified access - nenv.eTyconsByDemangledNameAndArity - |> Seq.choose (fun e -> - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute e.Value.Attribs - if not hasRequireQualifiedAccessAttribute then - None - else - if e.Value.IsUnionTycon && e.Value.UnionCasesArray |> Array.exists (fun c -> c.DisplayName = id.idText) then - Some e.Value - else - None) - |> Seq.map (fun t -> t.DisplayName + "." + id.idText) + let implicitOpSearch = + if IsMangledOpName id.idText then + success [(resInfo,Item.ImplicitOp(id, ref None),[])] + else + NoResultsOrUsefulErrors + + ctorSearch +++ implicitOpSearch + + let resInfo,item,rest = + match AtMostOneResult m innerSearch with + | Result _ as res -> ForceRaise res + | _ -> + let failingCase = + match !typeError with + | Some e -> raze e + | _ -> + let suggestNamesAndTypes() = + let suggestedNames = + nenv.eUnqualifiedItems + |> Seq.map (fun e -> e.Value.DisplayName) + + let suggestedTypes = + nenv.TyconsByDemangledNameAndArity fullyQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) + + let suggestedModulesAndNamespaces = + nenv.ModulesAndNamespaces fullyQualified + |> Seq.collect (fun kv -> kv.Value) + |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) + |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) + + let unions = + // check if the user forgot to use qualified access + nenv.eTyconsByDemangledNameAndArity + |> Seq.choose (fun e -> + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute e.Value.Attribs + if not hasRequireQualifiedAccessAttribute then + None + else + if e.Value.IsUnionTycon && e.Value.UnionCasesArray |> Array.exists (fun c -> c.DisplayName = id.idText) then + Some e.Value + else + None) + |> Seq.map (fun t -> t.DisplayName + "." + id.idText) - [ yield! suggestedNames - yield! suggestedTypes - yield! suggestedModulesAndNamespaces - yield! unions ] - |> HashSet + [ yield! suggestedNames + yield! suggestedTypes + yield! suggestedModulesAndNamespaces + yield! unions ] + |> HashSet - raze (UndefinedName(0,FSComp.SR.undefinedNameValueOfConstructor,id,suggestNamesAndTypes)) - ForceRaise failingCase + raze (UndefinedName(0,FSComp.SR.undefinedNameValueOfConstructor,id,suggestNamesAndTypes)) + ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - item,rest + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + item,rest - // A compound identifier. - // It still might be a value in the environment, or something in an F# module, namespace, type, or nested type - | id :: rest -> - - let m = unionRanges m id.idRange - // Values in the environment take total priority, but constructors do NOT for compound lookups, e.g. if someone in some imported - // module has defined a constructor "String" (common enough) then "String.foo" doesn't give an error saying 'constructors have no members' - // Instead we go lookup the String module or type. - let ValIsInEnv nm = - match fullyQualified with - | FullyQualified -> false - | _ -> - match nenv.eUnqualifiedItems.TryFind(nm) with - | Some(Item.Value _) -> true - | _ -> false + // A compound identifier. + // It still might be a value in the environment, or something in an F# module, namespace, type, or nested type + else + let m = unionRanges m id.idRange + // Values in the environment take total priority, but constructors do NOT for compound lookups, e.g. if someone in some imported + // module has defined a constructor "String" (common enough) then "String.foo" doesn't give an error saying 'constructors have no members' + // Instead we go lookup the String module or type. + let ValIsInEnv nm = + match fullyQualified with + | FullyQualified -> false + | _ -> + match nenv.eUnqualifiedItems.TryFind(nm) with + | Some(Item.Value _) -> true + | _ -> false - if ValIsInEnv id.idText then - nenv.eUnqualifiedItems.[id.idText], rest - else - // Otherwise modules are searched first. REVIEW: modules and types should be searched together. - // For each module referenced by 'id', search the module as if it were an F# module and/or a .NET namespace. - let moduleSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad lid isOpenDecl - (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad) - - // REVIEW: somewhat surprisingly, this shows up on performance traces, with tcrefs non-nil. - // This seems strange since we would expect in the vast majority of cases tcrefs is empty here. - let tyconSearch ad = - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad rest typeNameResInfo id.idRange tcrefs - - let search = - let moduleSearch = moduleSearch ad + if ValIsInEnv id.idText then + nenv.eUnqualifiedItems.[id.idText], rest + else + // Otherwise modules are searched first. REVIEW: modules and types should be searched together. + // For each module referenced by 'id', search the module as if it were an F# module and/or a .NET namespace. + let moduleSearch ad = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest isOpenDecl + (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad) + + // REVIEW: somewhat surprisingly, this shows up on performance traces, with tcrefs non-nil. + // This seems strange since we would expect in the vast majority of cases tcrefs is empty here. + let tyconSearch ad = + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + if isNil tcrefs then NoResultsOrUsefulErrors else + match rest with + | id2::rest2 -> + let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad id2 rest2 typeNameResInfo id.idRange tcrefs + | _ -> + NoResultsOrUsefulErrors + + let search = + let moduleSearch = moduleSearch ad - match moduleSearch with - | Result res when not (isNil res) -> moduleSearch - | _ -> - - let tyconSearch = tyconSearch ad - - match tyconSearch with - | Result res when not (isNil res) -> tyconSearch - | _ -> - - let envSearch = - match fullyQualified with - | FullyQualified -> - NoResultsOrUsefulErrors - | OpenQualified -> - match nenv.eUnqualifiedItems.TryFind id.idText with - | Some (Item.UnqualifiedType _) - | None -> NoResultsOrUsefulErrors - | Some res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) - - moduleSearch +++ tyconSearch +++ envSearch - - let resInfo,item,rest = - match AtMostOneResult m search with - | Result _ as res -> ForceRaise res - | _ -> - let innerSearch = - let moduleSearch = moduleSearch AccessibleFromSomeFSharpCode + match moduleSearch with + | Result res when not (isNil res) -> moduleSearch + | _ -> + + let tyconSearch = tyconSearch ad + + match tyconSearch with + | Result res when not (isNil res) -> tyconSearch + | _ -> + + let envSearch = + match fullyQualified with + | FullyQualified -> + NoResultsOrUsefulErrors + | OpenQualified -> + match nenv.eUnqualifiedItems.TryFind id.idText with + | Some (Item.UnqualifiedType _) + | None -> NoResultsOrUsefulErrors + | Some res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) + + moduleSearch +++ tyconSearch +++ envSearch + + let resInfo,item,rest = + match AtMostOneResult m search with + | Result _ as res -> ForceRaise res + | _ -> + let innerSearch = + let moduleSearch = moduleSearch AccessibleFromSomeFSharpCode - match moduleSearch with - | Result res when not (isNil res) -> moduleSearch - | _ -> + match moduleSearch with + | Result res when not (isNil res) -> moduleSearch + | _ -> - let tyconSearch = tyconSearch AccessibleFromSomeFSharpCode + let tyconSearch = tyconSearch AccessibleFromSomeFSharpCode - match tyconSearch with - | Result res when not (isNil res) -> tyconSearch - | _ -> + match tyconSearch with + | Result res when not (isNil res) -> tyconSearch + | _ -> - search +++ moduleSearch +++ tyconSearch + search +++ moduleSearch +++ tyconSearch - let suggestEverythingInScope() = - seq { yield! - nenv.ModulesAndNamespaces fullyQualified - |> Seq.collect (fun kv -> kv.Value) - |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) - |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) + let suggestEverythingInScope() = + seq { yield! + nenv.ModulesAndNamespaces fullyQualified + |> Seq.collect (fun kv -> kv.Value) + |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) + |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) - yield! - nenv.TyconsByDemangledNameAndArity fullyQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) - - yield! - nenv.eUnqualifiedItems - |> Seq.map (fun e -> e.Value.DisplayName) - } |> HashSet - - match innerSearch with - | Exception (UndefinedName(0,_,id1,suggestionsF)) when id.idRange = id1.idRange -> - let mergeSuggestions() = - let res = suggestEverythingInScope() - res.UnionWith(suggestionsF()) - res - - let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,mergeSuggestions)) - ForceRaise failingCase - | Exception err -> ForceRaise(Exception err) - | Result (res :: _) -> ForceRaise(Result res) - | Result [] -> - let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,suggestEverythingInScope)) - ForceRaise failingCase + yield! + nenv.TyconsByDemangledNameAndArity fullyQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) + + yield! + nenv.eUnqualifiedItems + |> Seq.map (fun e -> e.Value.DisplayName) + } |> HashSet + + match innerSearch with + | Exception (UndefinedName(0,_,id1,suggestionsF)) when id.idRange = id1.idRange -> + let mergeSuggestions() = + let res = suggestEverythingInScope() + res.UnionWith(suggestionsF()) + res + + let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,mergeSuggestions)) + ForceRaise failingCase + | Exception err -> ForceRaise(Exception err) + | Result (res :: _) -> ForceRaise(Result res) + | Result [] -> + let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,suggestEverythingInScope)) + ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - item,rest + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + item,rest let ResolveExprLongIdent sink (ncenv:NameResolver) m ad nenv typeNameResInfo lid = - ResolveExprLongIdentPrim sink ncenv OpenQualified m ad nenv typeNameResInfo lid false + match lid with + | [] -> error (Error(FSComp.SR.nrInvalidExpression(textOfLid lid), m)) + | id::rest -> ResolveExprLongIdentPrim sink ncenv true OpenQualified m ad nenv typeNameResInfo id rest false //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in patterns //------------------------------------------------------------------------- -let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv numTyArgsOpt ad resInfo depth m modref (mty:ModuleOrNamespaceType) (lid: Ident list) = - match lid with - | [] -> raze (InternalError("ResolvePatternLongIdentInModuleOrNamespace",m)) - | id :: rest -> - let m = unionRanges m id.idRange - match TryFindTypeWithUnionCase modref id with - | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let tcref = modref.NestedTyconRef tycon - let ucref = mkUnionCaseRef tcref id.idText - let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - 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) -> - 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 -> - success (resInfo,Item.ActivePatternCase apref,rest) - | _ -> - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> - success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) +let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv numTyArgsOpt ad resInfo depth m modref (mty:ModuleOrNamespaceType) (id:Ident) (rest: Ident list) = + let m = unionRanges m id.idRange + match TryFindTypeWithUnionCase modref id with + | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let tcref = modref.NestedTyconRef tycon + let ucref = mkUnionCaseRef tcref id.idText + let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + 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) -> + 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 -> + success (resInfo,Item.ActivePatternCase apref,rest) + | _ -> + match mty.AllValsByLogicalName.TryFind(id.idText) with + | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> + success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) + | _ -> + let tcrefs = lazy ( + LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) + |> List.map (fun tcref -> (resInfo,tcref))) + + // Something in a type? e.g. a literal field + let tyconSearch = + match rest with + | id2::rest2 -> + let tcrefs = tcrefs.Force() + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv:NameResolver) nenv LookupKind.Pattern (depth+1) m ad id2 rest2 numTyArgsOpt id.idRange tcrefs | _ -> - let tcrefs = lazy ( - LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) - |> List.map (fun tcref -> (resInfo,tcref))) + NoResultsOrUsefulErrors - // Something in a type? e.g. a literal field - let tyconSearch = - match lid with - | _ :: rest when not (isNil rest) -> - let tcrefs = tcrefs.Force() - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv:NameResolver) nenv LookupKind.Pattern (depth+1) m ad rest numTyArgsOpt id.idRange tcrefs - | _ -> - NoResultsOrUsefulErrors - - match tyconSearch with - | Result (res :: _) -> success res - | _ -> - - // Constructor of a type? - let ctorSearch = - if isNil rest then - tcrefs.Force() - |> List.map (fun (resInfo,tcref) -> (resInfo,FreshenTycon ncenv m tcref)) - |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - else - NoResultsOrUsefulErrors + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - match ctorSearch with - | Result (res :: _) -> success res - | _ -> + // Constructor of a type? + let ctorSearch = + if isNil rest then + tcrefs.Force() + |> List.map (fun (resInfo,tcref) -> (resInfo,FreshenTycon ncenv m tcref)) + |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) + else + NoResultsOrUsefulErrors - // Something in a sub-namespace or sub-module or nested-type - let moduleSearch = - if not (isNil rest) then - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(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 rest) - | _ -> - NoResultsOrUsefulErrors - else NoResultsOrUsefulErrors + match ctorSearch with + | Result (res :: _) -> success res + | _ -> - match tyconSearch +++ ctorSearch +++ moduleSearch with - | Result [] -> - let suggestPossibleTypes() = - let submodules = - mty.ModulesAndNamespacesByDemangledName - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) - |> Seq.collect (fun e -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) + // Something in a sub-namespace or sub-module or nested-type + let moduleSearch = + match rest with + | id2::rest2 -> + match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(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) + | _ -> + NoResultsOrUsefulErrors + | [] -> NoResultsOrUsefulErrors + + match tyconSearch +++ ctorSearch +++ moduleSearch with + | Result [] -> + let suggestPossibleTypes() = + let submodules = + mty.ModulesAndNamespacesByDemangledName + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) + |> Seq.collect (fun e -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) - let suggestedTypes = - nenv.TyconsByDemangledNameAndArity FullyQualifiedFlag.OpenQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) + let suggestedTypes = + nenv.TyconsByDemangledNameAndArity FullyQualifiedFlag.OpenQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) - [ yield! submodules - yield! suggestedTypes ] - |> HashSet + [ yield! submodules + yield! suggestedTypes ] + |> HashSet - raze (UndefinedName(depth,FSComp.SR.undefinedNameConstructorModuleOrNamespace,id,suggestPossibleTypes)) - | results -> AtMostOneResult id.idRange results + raze (UndefinedName(depth,FSComp.SR.undefinedNameConstructorModuleOrNamespace,id,suggestPossibleTypes)) + | results -> AtMostOneResult id.idRange results /// Used to report a warning condition for the use of upper-case identifiers in patterns exception UpperCaseIdentifierInPattern of range @@ -2665,59 +2679,78 @@ exception UpperCaseIdentifierInPattern of range type WarnOnUpperFlag = WarnOnUpperCase | AllIdsOK // Long ID in a pattern -let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt (lid:Ident list) = - match lid with - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | id :: lid when id.idText = MangledGlobalName -> - ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt lid - - // Single identifiers in patterns - | [id] when fullyQualified <> FullyQualified -> - // 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 - | _ -> - // Single identifiers in patterns - variable bindings - if not newDef && - (warnOnUpper = WarnOnUpperCase) && - id.idText.Length >= 3 && - System.Char.ToLowerInvariant id.idText.[0] <> id.idText.[0] then - warning(UpperCaseIdentifierInPattern(m)) - Item.NewDef id +let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt (id:Ident) (rest:Ident list) = + if id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | id2::rest2 -> + ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt id2 rest2 + else + // Single identifiers in patterns + if isNil rest && fullyQualified <> FullyQualified then + // 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 + | _ -> + // Single identifiers in patterns - variable bindings + if not newDef && + (warnOnUpper = WarnOnUpperCase) && + id.idText.Length >= 3 && + System.Char.ToLowerInvariant id.idText.[0] <> id.idText.[0] then + warning(UpperCaseIdentifierInPattern(m)) + Item.NewDef id - // Long identifiers in patterns - | _ -> - let moduleSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad lid false - (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) - let tyconSearch ad = - match lid with - | tn :: rest when not (isNil rest) -> - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified tn.idText nenv - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 tn.idRange ad rest numTyArgsOpt tn.idRange tcrefs - | _ -> - NoResultsOrUsefulErrors - let resInfo,res,rest = - match AtMostOneResult m (tyconSearch ad +++ moduleSearch ad) with - | Result _ as res -> ForceRaise res - | _ -> - ForceRaise (AtMostOneResult m (tyconSearch AccessibleFromSomeFSharpCode +++ moduleSearch AccessibleFromSomeFSharpCode)) - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) - - if not (isNil rest) then error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),(List.head rest).idRange)) - res + // Long identifiers in patterns + else + let moduleSearch ad = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest false + (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) + + let tyconSearch ad = + match rest with + | id2 :: rest2 -> + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 id.idRange ad id2 rest2 numTyArgsOpt id.idRange tcrefs + | _ -> + NoResultsOrUsefulErrors + + let resInfo,res,rest = + let tyconResult = tyconSearch ad + match tyconResult with + | Result (res :: _) -> res + | _ -> + + let moduleResult = moduleSearch ad + match moduleResult with + | Result (res :: _) -> res + | _ -> + + match AtMostOneResult m (tyconResult +++ moduleResult) with + | Result _ as res -> ForceRaise res + | _ -> + + let tyconResult = tyconSearch AccessibleFromSomeFSharpCode + match tyconResult with + | Result (res :: _) -> res + | _ -> + ForceRaise (AtMostOneResult m (tyconResult +++ moduleSearch AccessibleFromSomeFSharpCode)) + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) + + match rest with + | [] -> res + | element :: _ -> error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),element.idRange)) /// Resolve a long identifier when used in a pattern. let ResolvePatternLongIdent sink (ncenv:NameResolver) warnOnUpper newDef m ad nenv numTyArgsOpt (lid:Ident list) = - ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad nenv numTyArgsOpt lid + match lid with + | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad nenv numTyArgsOpt id rest //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in types @@ -2737,11 +2770,10 @@ let ResolveNestedTypeThroughAbbreviation (ncenv:NameResolver) (tcref: TyconRef) tcref /// Resolve a long identifier representing a type name -let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo:TypeNameResolutionInfo) ad resInfo genOk depth m (tcref: TyconRef) (lid: Ident list) = +let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo:TypeNameResolutionInfo) ad resInfo genOk depth m (tcref: TyconRef) (id:Ident) (rest: Ident list) = let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | [id] -> + match rest with + | [] -> #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a nested type! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) @@ -2759,7 +2791,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo |> HashSet raze (UndefinedName(depth,FSComp.SR.undefinedNameType,id,suggestTypes)) - | id::rest -> + | id2::rest2 -> #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a nested type! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) @@ -2772,7 +2804,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo.DropStaticArgsInfo, genOk, m) match tcrefs with - | _ :: _ -> tcrefs |> CollectAtMostOneResult (fun (resInfo,tcref) -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref rest) + | _ :: _ -> tcrefs |> CollectAtMostOneResult (fun (resInfo,tcref) -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref id2 rest2) | [] -> let suggestTypes() = tcref.ModuleOrNamespaceType.TypesByDemangledNameAndArity id.idRange @@ -2785,7 +2817,12 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo /// Resolve a long identifier representing a type name and report the result let ResolveTypeLongIdentInTyconRef sink (ncenv:NameResolver) nenv typeNameResInfo ad m tcref (lid: Ident list) = - let resInfo,tcref = ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref lid) + let resInfo,tcref = + match lid with + | [] -> + error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> + ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref id rest) ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) let item = Item.Types(tcref.DisplayName,[FreshenTycon ncenv m tcref]) CallNameResolutionSink sink (rangeOfLid lid,nenv,item,item,emptyTyparInst,ItemOccurence.UseInType,nenv.eDisplayEnv,ad) @@ -2803,16 +2840,15 @@ let SuggestTypeLongIdentInModuleOrNamespace depth (modref:ModuleOrNamespaceRef) UndefinedName(depth,errorTextF,id,suggestPossibleTypes) /// Resolve a long identifier representing a type in a module or namespace -let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameResolver) (typeNameResInfo: TypeNameResolutionInfo) ad genOk (resInfo:ResolutionInfo) depth m modref _mty (lid: Ident list) = - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | [id] -> +let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameResolver) (typeNameResInfo: TypeNameResolutionInfo) ad genOk (resInfo:ResolutionInfo) depth m modref _mty (id:Ident) (rest: Ident list) = + match rest with + | [] -> // On all paths except error reporting we have isSome(staticResInfo), hence get at most one result back let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, typeNameResInfo.StaticArgsInfo, modref) match tcrefs with | _ :: _ -> tcrefs |> CollectResults (fun tcref -> success(resInfo,tcref)) | [] -> raze (SuggestTypeLongIdentInModuleOrNamespace depth modref ncenv.amap ad m id) - | id::rest -> + | id2::rest2 -> let m = unionRanges m id.idRange let modulSearch = match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with @@ -2820,7 +2856,7 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes 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) - ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest + ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 | _ -> let suggestPossibleModules() = modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName @@ -2832,7 +2868,7 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes let tyconSearch = let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) match tcrefs with - | _ :: _ -> tcrefs |> CollectResults (fun tcref -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref rest) + | _ :: _ -> tcrefs |> CollectResults (fun tcref -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref id2 rest2) | [] -> let suggestTypes() = modref.ModuleOrNamespaceType.TypesByDemangledNameAndArity id.idRange @@ -2843,94 +2879,98 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes tyconSearch +++ modulSearch /// Resolve a long identifier representing a type -let rec ResolveTypeLongIdentPrim sink (ncenv:NameResolver) occurence fullyQualified m nenv ad (lid: Ident list) (staticResInfo: TypeNameResolutionStaticArgsInfo) genOk = +let rec ResolveTypeLongIdentPrim sink (ncenv:NameResolver) occurence first fullyQualified m nenv ad (id:Ident) (rest: Ident list) (staticResInfo: TypeNameResolutionStaticArgsInfo) genOk = let typeNameResInfo = TypeNameResolutionInfo.ResolveToTypeRefs staticResInfo - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | id :: lid when id.idText = MangledGlobalName -> - ResolveTypeLongIdentPrim sink ncenv occurence FullyQualified m nenv ad lid staticResInfo genOk - - | [id] -> - match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with - | Some res -> - let res = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities ([(ResolutionInfo.Empty,res)], typeNameResInfo, genOk, unionRanges m id.idRange) - assert (res.Length = 1) - success res.Head - | None -> - // For Good Error Reporting! - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv - match tcrefs with - | tcref :: _tcrefs -> - // Note: This path is only for error reporting - //CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities tcref rest typeNameResInfo m - success(ResolutionInfo.Empty,tcref) - | [] -> - let suggestPossibleTypes() = - nenv.TyconsByDemangledNameAndArity(fullyQualified) - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad kv.Value) - |> Seq.collect (fun e -> - match occurence with - | ItemOccurence.UseInAttribute -> - [yield e.Value.DisplayName - yield e.Value.DemangledModuleOrNamespaceName - if e.Value.DisplayName.EndsWith "Attribute" then - yield e.Value.DisplayName.Replace("Attribute","")] - | _ -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) - |> HashSet - - raze (UndefinedName(0,FSComp.SR.undefinedNameType,id,suggestPossibleTypes)) - - | id::rest -> - let m = unionRanges m id.idRange - let tyconSearch = - match fullyQualified with - | FullyQualified -> - NoResultsOrUsefulErrors - | OpenQualified -> - match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with - | Some tcref when IsEntityAccessible ncenv.amap m ad tcref -> - OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty genOk 1 m tcref rest) - | _ -> + if first && id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | id2::rest2 -> + ResolveTypeLongIdentPrim sink ncenv occurence false FullyQualified m nenv ad id2 rest2 staticResInfo genOk + else + match rest with + | [] -> + match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with + | Some res -> + let res = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities ([(ResolutionInfo.Empty,res)], typeNameResInfo, genOk, unionRanges m id.idRange) + assert (res.Length = 1) + success res.Head + | None -> + // For Good Error Reporting! + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + match tcrefs with + | tcref :: _tcrefs -> + // Note: This path is only for error reporting + //CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities tcref rest typeNameResInfo m + success(ResolutionInfo.Empty,tcref) + | [] -> + let suggestPossibleTypes() = + nenv.TyconsByDemangledNameAndArity(fullyQualified) + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad kv.Value) + |> Seq.collect (fun e -> + match occurence with + | ItemOccurence.UseInAttribute -> + [yield e.Value.DisplayName + yield e.Value.DemangledModuleOrNamespaceName + if e.Value.DisplayName.EndsWith "Attribute" then + yield e.Value.DisplayName.Replace("Attribute","")] + | _ -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) + |> HashSet + + raze (UndefinedName(0,FSComp.SR.undefinedNameType,id,suggestPossibleTypes)) + | id2::rest2 -> + let m2 = unionRanges m id.idRange + let tyconSearch = + match fullyQualified with + | FullyQualified -> NoResultsOrUsefulErrors + | OpenQualified -> + match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with + | Some tcref when IsEntityAccessible ncenv.amap m2 ad tcref -> + OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty genOk 1 m2 tcref id2 rest2) + | _ -> + NoResultsOrUsefulErrors - let modulSearch = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m fullyQualified nenv ad lid false - (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk) - |?> List.concat - - let modulSearchFailed() = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m fullyQualified nenv AccessibleFromSomeFSharpCode lid false - (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo.DropStaticArgsInfo AccessibleFromSomeFSharpCode genOk) - |?> List.concat - - let searchSoFar = tyconSearch +++ modulSearch - - match searchSoFar with - | Result results -> - // NOTE: we delay checking the CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities condition until right at the end after we've - // collected all possible resolutions of the type - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (results, typeNameResInfo, genOk, rangeOfLid lid) - match tcrefs with - | (resInfo,tcref) :: _ -> - // We've already reported the ambiguity, possibly as an error. Now just take the first possible result. - success(resInfo,tcref) - | [] -> - // failing case - report nice ambiguity errors even in this case - AtMostOneResult m ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, rangeOfLid lid))) + let modulSearch = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m2 fullyQualified nenv ad id rest false + (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk) + |?> List.concat + + let modulSearchFailed() = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m2 fullyQualified nenv AccessibleFromSomeFSharpCode id rest false + (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo.DropStaticArgsInfo AccessibleFromSomeFSharpCode genOk) + |?> List.concat + + let searchSoFar = tyconSearch +++ modulSearch + + match searchSoFar with + | Result results -> + // NOTE: we delay checking the CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities condition until right at the end after we've + // collected all possible resolutions of the type + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (results, typeNameResInfo, genOk, m) + match tcrefs with + | (resInfo,tcref) :: _ -> + // We've already reported the ambiguity, possibly as an error. Now just take the first possible result. + success(resInfo,tcref) + | [] -> + // failing case - report nice ambiguity errors even in this case + AtMostOneResult m2 ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, m))) - | _ -> - // failing case - report nice ambiguity errors even in this case - AtMostOneResult m ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, rangeOfLid lid))) + | _ -> + // failing case - report nice ambiguity errors even in this case + AtMostOneResult m2 ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, m))) /// Resolve a long identifier representing a type and report it let ResolveTypeLongIdent sink (ncenv:NameResolver) occurence fullyQualified nenv ad (lid: Ident list) staticResInfo genOk = let m = rangeOfLid lid - let res = ResolveTypeLongIdentPrim sink ncenv occurence fullyQualified m nenv ad lid staticResInfo genOk + let res = + match lid with + | [] -> + error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> + ResolveTypeLongIdentPrim sink ncenv occurence true fullyQualified m nenv ad id rest staticResInfo genOk + // Register the result as a name resolution match res with | Result (resInfo,tcref) -> @@ -2945,55 +2985,52 @@ let ResolveTypeLongIdent sink (ncenv:NameResolver) occurence fullyQualified nenv //------------------------------------------------------------------------- /// Resolve a long identifier representing a record field in a module or namespace -let rec ResolveFieldInModuleOrNamespace (ncenv:NameResolver) nenv ad (resInfo:ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (lid: Ident list) = +let rec ResolveFieldInModuleOrNamespace (ncenv:NameResolver) nenv ad (resInfo:ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (id:Ident) (rest: Ident list) = let typeNameResInfo = TypeNameResolutionInfo.Default - match lid with - | id::rest -> - let m = unionRanges m id.idRange - // search for module-qualified names, e.g. { Microsoft.FSharp.Core.contents = 1 } - let modulScopedFieldNames = - match TryFindTypeWithRecdField modref id with - | Some tycon when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - success [resInfo, FieldResolution(modref.RecdFieldRefInNestedTycon tycon id,showDeprecated), rest] - | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + let m = unionRanges m id.idRange + // search for module-qualified names, e.g. { Microsoft.FSharp.Core.contents = 1 } + let modulScopedFieldNames = + match TryFindTypeWithRecdField modref id with + | Some tycon when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + success [resInfo, FieldResolution(modref.RecdFieldRefInNestedTycon tycon id,showDeprecated), rest] + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - match modulScopedFieldNames with - | Result (res :: _) -> success res - | _ -> + match modulScopedFieldNames with + | Result (res :: _) -> success res + | _ -> - // search for type-qualified names, e.g. { Microsoft.FSharp.Core.Ref.contents = 1 } - let tyconSearch = - match lid with - | _tn:: rest when not (isNil rest) -> - let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad rest typeNameResInfo id.idRange tcrefs - // choose only fields - let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) - tyconSearch - | _ -> - NoResultsOrUsefulErrors + // search for type-qualified names, e.g. { Microsoft.FSharp.Core.Ref.contents = 1 } + let tyconSearch = + match rest with + | id2::rest2 -> + let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + // choose only fields + let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) + tyconSearch + | _ -> + NoResultsOrUsefulErrors - match tyconSearch with - | Result (res :: _) -> success res - | _ -> + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - // search for names in nested modules, e.g. { Microsoft.FSharp.Core.contents = 1 } - let modulSearch = - if not (isNil rest) then - match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(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 rest - |> OneResult - | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - else raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + // search for names in nested modules, e.g. { Microsoft.FSharp.Core.contents = 1 } + let modulSearch = + match rest with + | id2::rest2 -> + match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(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 + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - AtMostOneResult m (modulScopedFieldNames +++ tyconSearch +++ modulSearch) - | [] -> - error(InternalError("ResolveFieldInModuleOrNamespace",m)) + AtMostOneResult m (modulScopedFieldNames +++ tyconSearch +++ modulSearch) /// Suggest other labels of the same record let SuggestOtherLabelsOfSameRecordType g (nenv:NameResolutionEnv) typ (id:Ident) (allFields:Ident list) = @@ -3095,20 +3132,23 @@ let ResolveFieldPrim sink (ncenv:NameResolver) nenv ad typ (mp,id:Ident) allFiel let lid = (mp@[id]) let tyconSearch ad = match lid with - | tn:: (_ :: _ as rest) -> + | tn :: id2 :: rest2 -> let m = tn.idRange let tcrefs = LookupTypeNameInEnvNoArity OpenQualified tn.idText nenv if isNil tcrefs then NoResultsOrUsefulErrors else let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad rest typeNameResInfo tn.idRange tcrefs + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad id2 rest2 typeNameResInfo tn.idRange tcrefs // choose only fields let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) tyconSearch | _ -> NoResultsOrUsefulErrors - let modulSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m OpenQualified nenv ad lid false - (ResolveFieldInModuleOrNamespace ncenv nenv ad) + let modulSearch ad = + match lid with + | [] -> NoResultsOrUsefulErrors + | id2::rest2 -> + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m OpenQualified nenv ad id2 rest2 false + (ResolveFieldInModuleOrNamespace ncenv nenv ad) let search = let moduleSearch1 = modulSearch ad @@ -3164,9 +3204,9 @@ let FreshenRecdFieldRef (ncenv:NameResolver) m (rfref:RecdFieldRef) = /// determine any valid members // // QUERY (instantiationGenerator cleanup): it would be really nice not to flow instantiationGenerator to here. -let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ lid findFlag = +let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ (id:Ident) rest findFlag = let typeNameResInfo = TypeNameResolutionInfo.Default - let adhoctDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad lid findFlag typeNameResInfo typ) + let adhoctDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad id rest findFlag typeNameResInfo typ) match adhoctDotSearchAccessible with | Exception _ -> // If the dot is not resolved by adhoc overloading then look for a record field @@ -3176,23 +3216,19 @@ let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ lid findF if isAppTy ncenv.g typ then NoResultsOrUsefulErrors else - match lid with - // A unique record label access, e.g expr.field - | id::rest when nenv.eFieldLabels.ContainsKey(id.idText) -> - match nenv.eFieldLabels.[id.idText] with - | [] -> NoResultsOrUsefulErrors - | 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 - OneSuccess (ResolutionInfo.Empty,item,rest) - | _ -> NoResultsOrUsefulErrors + match nenv.eFieldLabels |> Map.tryFind id.idText with + | Some(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 + OneSuccess (ResolutionInfo.Empty,item,rest) + | _ -> NoResultsOrUsefulErrors let search = dotFieldIdSearch match AtMostOneResult m search with | Result _ as res -> ForceRaise res | _ -> - let adhocDotSearchAll = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode lid findFlag typeNameResInfo typ + let adhocDotSearchAll = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode id rest findFlag typeNameResInfo typ ForceRaise (AtMostOneResult m (search +++ adhocDotSearchAll)) | _ -> ForceRaise adhoctDotSearchAccessible @@ -3223,9 +3259,9 @@ let NeedsWorkAfterResolution namedItem = | Item.CtorGroup(_,minfos) -> minfos.Length > 1 || minfos |> List.exists (fun minfo -> not (isNil minfo.FormalMethodInst)) | Item.Property(_,pinfos) -> pinfos.Length > 1 | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) - | Item.Value vref | Item.CustomBuilder (_,vref) -> vref.Typars.Length > 0 + | Item.Value vref | Item.CustomBuilder (_,vref) -> not (List.isEmpty vref.Typars) | Item.CustomOperation (_,_,Some minfo) -> not (isNil minfo.FormalMethodInst) - | Item.ActivePatternCase apref -> apref.ActivePatternVal.Typars.Length > 0 + | Item.ActivePatternCase apref -> not (List.isEmpty apref.ActivePatternVal.Typars) | _ -> false /// Specifies additional work to do after an item has been processed further in type checking. @@ -3304,7 +3340,11 @@ let (|NonOverridable|_|) namedItem = /// Also called for 'GenericType.Bar' - for VS IntelliSense, we can filter out non-static members from method groups let ResolveExprDotLongIdentAndComputeRange (sink:TcResultsSink) (ncenv:NameResolver) wholem ad nenv typ lid findFlag thisIsActuallyATyAppNotAnExpr = let resolveExpr findFlag = - let resInfo,item,rest = ResolveExprDotLongIdent ncenv wholem ad nenv typ lid findFlag + let resInfo,item,rest = + match lid with + | id::rest -> + ResolveExprDotLongIdent ncenv wholem ad nenv typ id rest findFlag + | _ -> error(InternalError("ResolveExprDotLongIdentAndComputeRange",wholem)) let itemRange = ComputeItemRange wholem lid rest resInfo,item,rest,itemRange // "true" resolution diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index af3a4a6e3ce..326c310c573 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -251,6 +251,9 @@ type internal ItemOccurence = /// Check for equality, up to signature matching val ItemsAreEffectivelyEqual : TcGlobals -> Item -> Item -> bool +/// Hash compatible with ItemsAreEffectivelyEqual +val ItemsAreEffectivelyEqualHash : TcGlobals -> Item -> int + [] type internal CapturedNameResolution = /// line and column @@ -298,15 +301,22 @@ type internal TcResolutions = static member Empty : TcResolutions +[] +type TcSymbolUseData = + { Item: Item + ItemOccurence: ItemOccurence + DisplayEnv: DisplayEnv + Range: range } + [] /// Represents container for all name resolutions that were met so far when typechecking some particular file type internal TcSymbolUses = /// Get all the uses of a particular item within the file - member GetUsesOfSymbol : Item -> (ItemOccurence * DisplayEnv * range)[] + member GetUsesOfSymbol : Item -> TcSymbolUseData[] - /// Get all the uses of all items within the file - member GetAllUsesOfSymbols : unit -> (Item * ItemOccurence * DisplayEnv * range)[] + /// All the uses of all items within the file + member AllUsesOfSymbols : TcSymbolUseData[] /// Get the locations of all the printf format specifiers in the file member GetFormatSpecifierLocationsAndArity : unit -> (range * int)[] @@ -444,13 +454,13 @@ type ResultCollectionSettings = | AtMostOneResult /// Resolve a long identifier to a namespace or module. -val internal ResolveLongIndentAsModuleOrNamespace : TcResultsSink -> ResultCollectionSettings -> Import.ImportMap -> range -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident list -> isOpenDecl: bool -> ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list > +val internal ResolveLongIndentAsModuleOrNamespace : TcResultsSink -> ResultCollectionSettings -> Import.ImportMap -> range -> bool -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident -> Ident list -> isOpenDecl: bool -> ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list > /// Resolve a long identifier to an object constructor. val internal ResolveObjectConstructor : NameResolver -> DisplayEnv -> range -> AccessorDomain -> TType -> ResultOrException /// Resolve a long identifier using type-qualified name resolution. -val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident list -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list +val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list /// Resolve a long identifier when used in a pattern. val internal ResolvePatternLongIdent : TcResultsSink -> NameResolver -> WarnOnUpperFlag -> bool -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 85415c05901..d3116650608 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -71,9 +71,10 @@ module internal PrintUtilities = tcref.DisplayName // has no static params else tcref.DisplayName+"<...>" // shorten - if isAttribute then - defaultArg (String.tryDropSuffix name "Attribute") name - else name + if isAttribute && name.EndsWith "Attribute" then + String.dropSuffix name "Attribute" + else + name let tyconTextL = tagEntityRefName tcref demangled |> mkNav tcref.DefinitionRange @@ -415,16 +416,11 @@ module private PrintIL = | None -> aboveListL body - match typeDef.tdKind with - | ILTypeDefKind.Class - | ILTypeDefKind.ValueType - | ILTypeDefKind.Interface -> + if typeDef.IsClass || typeDef.IsStruct || typeDef.IsInterface then let pre = - match typeDef.tdKind with - | ILTypeDefKind.Class -> None - | ILTypeDefKind.ValueType -> Some WordL.keywordStruct - | ILTypeDefKind.Interface -> None - | _ -> failwith "unreachable" + if typeDef.IsStruct then Some WordL.keywordStruct + else None + let baseT = match typeDef.Extends with | Some b -> @@ -434,15 +430,14 @@ module private PrintIL = else [] | None -> // for interface show inherited interfaces - match typeDef.tdKind with - | ILTypeDefKind.Interface -> + if typeDef.IsInterface then typeDef.Implements |> List.choose (fun b -> let baseName = layoutILType denv ilTyparSubst b if isShowBase baseName then Some (WordL.keywordInherit ^^ baseName) else None ) - | _ -> [] + else [] let memberBlockLs (fieldDefs:ILFieldDefs, methodDefs:ILMethodDefs, propertyDefs:ILPropertyDefs, eventDefs:ILEventDefs) = let ctors = @@ -509,7 +504,7 @@ module private PrintIL = let post = WordL.keywordEnd renderL pre (baseT @ body @ types ) post - | ILTypeDefKind.Enum -> + elif typeDef.IsEnum then let fldsL = typeDef.Fields.AsList |> List.filter isShowEnumField @@ -518,7 +513,7 @@ module private PrintIL = renderL None fldsL emptyL - | ILTypeDefKind.Delegate -> + else // Delegate let rhs = match typeDef.Methods.AsList |> List.filter (fun m -> m.Name = "Invoke") with // the delegate delegates to the type of `Invoke` | m :: _ -> layoutILCallingSignature denv ilTyparSubst None m.CallingSignature @@ -660,9 +655,10 @@ module private PrintTypes = | ILAttrib ilMethRef -> let trimmedName = let name = ilMethRef.DeclaringTypeRef.Name - match String.tryDropSuffix name "Attribute" with - | Some shortName -> shortName - | None -> name + if name.EndsWith "Attribute" then + String.dropSuffix name "Attribute" + else + name let tref = ilMethRef.DeclaringTypeRef let tref = ILTypeRef.Create(scope= tref.Scope, enclosing=tref.Enclosing, name=trimmedName) PrintIL.layoutILTypeRef denv tref ++ argsL @@ -1281,7 +1277,7 @@ module InfoMemberPrinting = let paramDatas = minfo.GetParamDatas(amap, m, minst) let layout = layout ^^ - if isNil (List.concat paramDatas) then + if List.forall isNil paramDatas then WordL.structUnit else sepListL WordL.arrow (List.map ((List.map (layoutParamData denv)) >> sepListL WordL.star) paramDatas) diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index 88784272d39..02bdb066c14 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -33,7 +33,7 @@ open Microsoft.FSharp.Compiler.TypeRelations open System.Collections.Generic -#if BUILDING_PROTO +#if DEBUG let verboseOptimizationInfo = try not (System.String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable "FSHARP_verboseOptimizationInfo")) with _ -> false let verboseOptimizations = @@ -1261,9 +1261,9 @@ and OpHasEffect g op = | TOp.Recd (ctor, tcref) -> match ctor with | RecdExprIsObjInit -> true - | RecdExpr -> isRecdOrUnionOrStructTyconRefAllocObservable g tcref - | TOp.UnionCase ucref -> isRecdOrUnionOrStructTyconRefAllocObservable g ucref.TyconRef - | TOp.ExnConstr ecref -> isExnAllocObservable ecref + | RecdExpr -> isRecdOrUnionOrFSharpStructTyconRefMutable g tcref + | TOp.UnionCase ucref -> isRecdOrUnionOrFSharpStructTyconRefMutable g ucref.TyconRef + | TOp.ExnConstr ecref -> isExnMutable ecref | TOp.Bytes _ | TOp.UInt16s _ | TOp.Array -> true (* alloc observable *) | TOp.UnionCaseTagGet _ -> false | TOp.UnionCaseProof _ -> false @@ -2507,7 +2507,7 @@ and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m) false else true)))) -> - let isBaseCall = args.Length > 0 && + let isBaseCall = not (List.isEmpty args) && match args.[0] with | Expr.Val(vref, _, _) when vref.BaseOrThisInfo = BaseVal -> true | _ -> false @@ -2976,7 +2976,7 @@ and OptimizeBinding cenv isRec env (TBind(vref, expr, spBind)) = match cenv.g.system_MarshalByRefObject_tcref with | None -> false | Some mbrTyconRef -> - // Check we can deref system_MarshalByRefObject_tcref. When compiling against the Silverlight mscorlib we can't + // Check we can deref system_MarshalByRefObject_tcref if mbrTyconRef.TryDeref.IsSome then // Check if this is a subtype of MarshalByRefObject assert (cenv.g.system_MarshalByRefObject_typ.IsSome) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index e999a80912a..c22fb3f4098 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -1191,7 +1191,7 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = // If we've already recorded a definition then skip this match v.ReflectedDefinition with - | None -> v.val_defn <- Some bindRhs + | None -> v.SetValDefn bindRhs | Some _ -> () // Run the conversion process over the reflected definition to report any errors in the // front end rather than the back end. We currently re-run this during ilxgen.fs but there's diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 21d2fd06132..e4e8fc42521 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -291,7 +291,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = elif not (checkValInfo aenv (err denv) implVal sigVal) then false elif not (implVal.IsExtensionMember = sigVal.IsExtensionMember) then err denv (FSComp.SR.ValueNotContainedMutabilityExtensionsDiffer) elif not (checkMemberDatasConform (err denv) (implVal.Attribs, implVal,implVal.MemberInfo) (sigVal.Attribs,sigVal,sigVal.MemberInfo)) then false - else checkAttribs aenv implVal.Attribs sigVal.Attribs (fun attribs -> implVal.val_attribs <- attribs) + else checkAttribs aenv implVal.Attribs sigVal.Attribs (fun attribs -> implVal.SetAttribs attribs) and checkExnInfo err aenv implTypeRepr sigTypeRepr = diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs index c53c14fabce..4fac34e6184 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fs +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -18,7 +18,9 @@ let internal SimulatedMSBuildResolver = { new Resolver with member x.HighestInstalledNetFrameworkVersion() = let root = x.DotNetFrameworkReferenceAssembliesRootDirectory - if Directory.Exists(Path.Combine(root,"v4.7")) then "v4.7" + if Directory.Exists(Path.Combine(root,"v4.7.1")) then "v4.7.2" + elif Directory.Exists(Path.Combine(root,"v4.7.1")) then "v4.7.1" + elif Directory.Exists(Path.Combine(root,"v4.7")) then "v4.7" elif Directory.Exists(Path.Combine(root,"v4.6.2")) then "v4.6.2" elif Directory.Exists(Path.Combine(root,"v4.6.1")) then "v4.6.1" elif Directory.Exists(Path.Combine(root,"v4.6")) then "v4.6" @@ -28,9 +30,7 @@ let internal SimulatedMSBuildResolver = else "v4.5" member __.DotNetFrameworkReferenceAssembliesRootDirectory = -#if FX_RESHAPED_MSBUILD - "" -#else +#if !FX_RESHAPED_MSBUILD if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then let PF = match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with @@ -38,13 +38,13 @@ let internal SimulatedMSBuildResolver = | s -> s PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework" else - "" #endif + "" member __.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture, fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir, logMessage, logWarningOrError) = -#if !FX_RESHAPED_MSBUILD +#if !FX_NO_WIN_REGISTRY let registrySearchPaths() = [ let registryKey = @"Software\Microsoft\.NetFramework"; use key = Registry.LocalMachine.OpenSubKey(registryKey) @@ -79,7 +79,7 @@ let internal SimulatedMSBuildResolver = yield! explicitIncludeDirs yield fsharpCoreDir yield implicitIncludeDir -#if !FX_RESHAPED_MSBUILD +#if !FX_NO_WIN_REGISTRY if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then yield! registrySearchPaths() #endif diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 8b0b40299f8..9e5a08643b7 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -1451,7 +1451,7 @@ let tryDestRefTupleTy g ty = type UncurriedArgInfos = (TType * ArgReprInfo) list type CurriedArgInfos = (TType * ArgReprInfo) list list -// A 'tau' type is one with its type paramaeters stripped off +// A 'tau' type is one with its type parameters stripped off let GetTopTauTypeInFSharpForm g (curriedArgInfos: ArgReprInfo list list) tau m = let nArgInfos = curriedArgInfos.Length let argtys, rty = stripFunTyN g nArgInfos tau @@ -1591,7 +1591,7 @@ let isILInterfaceTycon (tycon:Tycon) = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsInterface #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Interface) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsInterface | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> false let rankOfArrayTy g ty = rankOfArrayTyconRef g (tcrefOfAppTy g ty) @@ -1623,7 +1623,7 @@ let isDelegateTy g ty = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsDelegate () #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Delegate) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsDelegate | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> match tryDestAppTy g ty with | Some tcref -> tcref.Deref.IsFSharpDelegateTycon @@ -1634,7 +1634,7 @@ let isInterfaceTy g ty = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsInterface #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Interface) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsInterface | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> isFSharpInterfaceTy g ty let isClassTy g ty = @@ -1642,7 +1642,7 @@ let isClassTy g ty = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsClass #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Class) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsClass | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> isFSharpClassTy g ty let isStructOrEnumTyconTy g ty = @@ -4632,14 +4632,23 @@ and remapValReprInfo g tmenv (ValReprInfo(tpNames, arginfosl, retInfo)) = and remapValData g tmenv (d: ValData) = let ty = d.val_type - let topValInfo = d.val_repr_info - let ty' = ty |> remapPossibleForallTy g tmenv + let topValInfo = d.ValReprInfo + let tyR = ty |> remapPossibleForallTy g tmenv + let declaringEntityR = d.DeclaringEntity |> remapParentRef tmenv + let reprInfoR = d.ValReprInfo |> Option.map (remapValReprInfo g tmenv) + let memberInfoR = d.MemberInfo |> Option.map (remapMemberInfo g d.val_range topValInfo ty tyR tmenv) + let attribsR = d.Attribs |> remapAttribs g tmenv { d with - val_type = ty'; - val_declaring_entity = d.val_declaring_entity |> remapParentRef tmenv; - val_repr_info = d.val_repr_info |> Option.map (remapValReprInfo g tmenv); - val_member_info = d.val_member_info |> Option.map (remapMemberInfo g d.val_range topValInfo ty ty' tmenv); - val_attribs = d.val_attribs |> remapAttribs g tmenv } + val_type = tyR + val_opt_data = + match d.val_opt_data with + | Some dd -> + Some { dd with + val_declaring_entity = declaringEntityR + val_repr_info = reprInfoR + val_member_info = memberInfoR + val_attribs = attribsR } + | None -> None } and remapParentRef tyenv p = match p with @@ -5021,14 +5030,19 @@ and copyAndRemapAndBindTyconsAndVals g compgen tmenv tycons vs = (tycons, tycons') ||> List.iter2 (fun tcd tcd' -> let tps', tmenvinner2 = tmenvCopyRemapAndBindTypars (remapAttribs g tmenvinner) tmenvinner (tcd.entity_typars.Force(tcd.entity_range)) - tcd'.entity_typars <- LazyWithContext.NotLazy tps'; - tcd'.entity_attribs <- tcd.entity_attribs |> remapAttribs g tmenvinner2; - tcd'.entity_tycon_repr <- tcd.entity_tycon_repr |> remapTyconRepr g tmenvinner2; - tcd'.entity_tycon_abbrev <- tcd.entity_tycon_abbrev |> Option.map (remapType tmenvinner2) ; - tcd'.entity_tycon_tcaug <- tcd.entity_tycon_tcaug |> remapTyconAug tmenvinner2 ; + tcd'.entity_typars <- LazyWithContext.NotLazy tps' + tcd'.entity_attribs <- tcd.entity_attribs |> remapAttribs g tmenvinner2 + tcd'.entity_tycon_repr <- tcd.entity_tycon_repr |> remapTyconRepr g tmenvinner2 + let typeAbbrevR = tcd.TypeAbbrev |> Option.map (remapType tmenvinner2) + tcd'.entity_tycon_tcaug <- tcd.entity_tycon_tcaug |> remapTyconAug tmenvinner2 tcd'.entity_modul_contents <- MaybeLazy.Strict (tcd.entity_modul_contents.Value - |> mapImmediateValsAndTycons lookupTycon lookupVal); - tcd'.entity_exn_info <- tcd.entity_exn_info |> remapTyconExnInfo g tmenvinner2) ; + |> mapImmediateValsAndTycons lookupTycon lookupVal) + let exnInfoR = tcd.ExceptionInfo |> remapTyconExnInfo g tmenvinner2 + match tcd'.entity_opt_data with + | Some optData -> tcd'.entity_opt_data <- Some { optData with entity_tycon_abbrev = typeAbbrevR; entity_exn_info = exnInfoR } + | _ -> + tcd'.SetTypeAbbrev typeAbbrevR + tcd'.SetExceptionInfo exnInfoR) tycons', vs', tmenvinner @@ -5196,24 +5210,24 @@ and remarkBind m (TBind(v, repr, _)) = // Reference semantics? //-------------------------------------------------------------------------- -let isRecdOrStructFieldAllocObservable (f:RecdField) = not f.IsStatic && f.IsMutable -let isUnionCaseAllocObservable (uc:UnionCase) = uc.FieldTable.FieldsByIndex |> Array.exists isRecdOrStructFieldAllocObservable -let isUnionCaseRefAllocObservable (uc:UnionCaseRef) = uc.UnionCase |> isUnionCaseAllocObservable +let isRecdOrStructFieldMutable (f:RecdField) = not f.IsStatic && f.IsMutable +let isUnionCaseMutable (uc:UnionCase) = uc.FieldTable.FieldsByIndex |> Array.exists isRecdOrStructFieldMutable +let isUnionCaseRefMutable (uc:UnionCaseRef) = uc.UnionCase |> isUnionCaseMutable -let isRecdOrUnionOrStructTyconAllocObservable (_g:TcGlobals) (tycon:Tycon) = +let isRecdOrUnionOrFSharpStructTyconRefMutable (_g: TcGlobals) (tcref : TyconRef) = + let tycon = tcref.Deref if tycon.IsUnionTycon then - tycon.UnionCasesArray |> Array.exists isUnionCaseAllocObservable - elif tycon.IsRecordTycon || tycon.IsStructOrEnumTycon then - tycon.AllFieldsArray |> Array.exists isRecdOrStructFieldAllocObservable + tycon.UnionCasesArray |> Array.exists isUnionCaseMutable + elif tycon.IsRecordTycon || tycon.IsFSharpStructOrEnumTycon then + tycon.AllFieldsArray |> Array.exists isRecdOrStructFieldMutable else false -let isRecdOrUnionOrStructTyconRefAllocObservable g (tcr : TyconRef) = isRecdOrUnionOrStructTyconAllocObservable g tcr.Deref // Although from the pure F# perspective exception values cannot be changed, the .NET // implementation of exception objects attaches a whole bunch of stack information to // each raised object. Hence we treat exception objects as if they have identity -let isExnAllocObservable (_ecref:TyconRef) = true +let isExnMutable (_ecref:TyconRef) = true // Some of the implementations of library functions on lists use mutation on the tail // of the cons cell. These cells are always private, i.e. not accessible by any other @@ -5529,16 +5543,31 @@ let mkAndSimplifyMatch spBind exprm matchm ty tree targets = // mkExprAddrOfExprAux //------------------------------------------------------------------------- -type Mutates = DefinitelyMutates | PossiblyMutates | NeverMutates +type Mutates = + | DefinitelyMutates + | LikelyMutates + | PossiblyMutates + | NeverMutates + exception DefensiveCopyWarning of string * range -let isRecdOrStructTyImmutable g ty = +// This is an approximation used to determine if we can take the address of an immutable value in some +// situations, or avoid a defensive copy in a PossiblyMutates operation. It is not, however, correct +// for .NET struct types, which may be mutable, but we are not aware if they +// are. Thus, all .NET struct types are effectively assumed to be immutable. +let isPossibleMutationAssumedImmutable g ty = + match tryDestAppTy g ty with + | None -> false + | Some tcref -> not (isRecdOrUnionOrFSharpStructTyconRefMutable g tcref) + +// This is a precise predicate: here, .NET struct types are assumed to be mutable, apart from two which are hardwired. +// In these cases we give an optional warning when there is a discrepancy between this and the above. +let isPossibleMutationDefinitelyImmutable g ty = match tryDestAppTy g ty with | None -> false | Some tcref -> - not (isRecdOrUnionOrStructTyconRefAllocObservable g tcref) || - tyconRefEq g tcref g.decimal_tcr || - tyconRefEq g tcref g.date_tcr + not (isRecdOrUnionOrFSharpStructTyconRefMutable g tcref) && + (not tcref.Deref.IsILStructTycon || tyconRefEq g tcref g.decimal_tcr || tyconRefEq g tcref g.date_tcr) // We can take the address of values of struct type even if the value is immutable // under certain conditions @@ -5551,18 +5580,23 @@ let isRecdOrStructTyImmutable g ty = // let g1 = A.G(1) // (fun () -> g1.x1) // -// Note: isRecdOrStructTyImmutable implies PossiblyMutates or NeverMutates -// // We only do this for true local or closure fields because we can't take addresses of immutable static // fields across assemblies. -let CanTakeAddressOfImmutableVal g (v:ValRef) mut = +let CanTakeAddressOfImmutableVal g (v:ValRef) mut m = // We can take the address of values of struct type if the operation doesn't mutate // and the value is a true local or closure field. not v.IsMutable && not v.IsMemberOrModuleBinding && (match mut with | NeverMutates -> true - | PossiblyMutates -> isRecdOrStructTyImmutable g v.Type + | LikelyMutates + | PossiblyMutates -> + let res = isPossibleMutationAssumedImmutable g v.Type + if res && not (isPossibleMutationDefinitelyImmutable g v.Type) then + if mut = LikelyMutates then + warning(Error(FSComp.SR.tastLikelyMutationOfConstant(), m)) + warning(Error(FSComp.SR.tcStructTypeAssumedImmutable((tcrefOfAppTy g v.Type).DisplayName), m)) + res | DefinitelyMutates -> false) let MustTakeAddressOfVal (g:TcGlobals) (v:ValRef) = @@ -5581,13 +5615,13 @@ let CanTakeAddressOfRecdFieldRef (g:TcGlobals) (rfref: RecdFieldRef) mut tinst = mut <> DefinitelyMutates && // We only do this if the field is defined in this assembly because we can't take addresses across assemblies for immutable fields entityRefInThisAssembly g.compilingFslib rfref.TyconRef && - isRecdOrStructTyImmutable g (actualTyOfRecdFieldRef rfref tinst) + isPossibleMutationAssumedImmutable g (actualTyOfRecdFieldRef rfref tinst) let CanTakeAddressOfUnionFieldRef (g:TcGlobals) (uref: UnionCaseRef) mut tinst cidx = mut <> DefinitelyMutates && // We only do this if the field is defined in this assembly because we can't take addresses across assemblies for immutable fields entityRefInThisAssembly g.compilingFslib uref.TyconRef && - isRecdOrStructTyImmutable g (actualTyOfUnionFieldRef uref cidx tinst) + isPossibleMutationAssumedImmutable g (actualTyOfUnionFieldRef uref cidx tinst) let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress mut e addrExprVal m = @@ -5598,7 +5632,7 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress None, exprForValRef m v // LVALUE: "x" where "x" is mutable local, mutable intra-assembly module/static binding, or operation doesn't mutate // Note: we can always take the address of mutable values - | Expr.Val(v, _, m) when MustTakeAddressOfVal g v || CanTakeAddressOfImmutableVal g v mut -> + | Expr.Val(v, _, m) when MustTakeAddressOfVal g v || CanTakeAddressOfImmutableVal g v mut m -> None, mkValAddr m v // LVALUE: "x" where "e.x" is record field. | Expr.Op (TOp.ValFieldGet rfref, tinst, [e], m) when MustTakeAddressOfRecdFieldRef rfref || CanTakeAddressOfRecdFieldRef g rfref mut tinst -> @@ -5654,11 +5688,11 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress // Give a nice error message for DefinitelyMutates on immutable values, or mutable values in other assemblies | Expr.Val(v, _, m) when mut = DefinitelyMutates -> - if isByrefTy g v.Type then error(Error(FSComp.SR.tastUnexpectedByRef(), m)); + if isByrefTy g v.Type then error(Error(FSComp.SR.tastUnexpectedByRef(), m)) if v.IsMutable then - error(Error(FSComp.SR.tastInvalidAddressOfMutableAcrossAssemblyBoundary(), m)); + error(Error(FSComp.SR.tastInvalidAddressOfMutableAcrossAssemblyBoundary(), m)) else - error(Error(FSComp.SR.tastValueMustBeLocalAndMutable(), m)); + error(Error(FSComp.SR.tastValueMustBeLocalAndMutable(), m)) | _ -> let ty = tyOfExpr g e @@ -5666,9 +5700,12 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress match mut with | NeverMutates -> () | DefinitelyMutates -> - errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)); + errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)) + | LikelyMutates -> + warning(Error(FSComp.SR.tastLikelyMutationOfConstant(), m)) + warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)) | PossiblyMutates -> - warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)); + warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)) let tmp, _ = match mut with | NeverMutates -> mkCompGenLocal m "copyOfStruct" ty @@ -6140,22 +6177,84 @@ let mkCallNewQuerySource (g:TcGlobals) m ty1 ty2 e1 = m let mkCallCreateEvent (g:TcGlobals) m ty1 ty2 e1 e2 e3 = mkApps g (typedExprForIntrinsic g m g.create_event_info, [[ty1;ty2]], [ e1;e2;e3 ], m) let mkCallGenericComparisonWithComparerOuter (g:TcGlobals) m ty comp e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_comparison_withc_outer_info, [[ty]], [ comp;e1;e2 ], m) -let mkCallEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.equals_operator_info, [[ty]], [ e1;e2 ], m) let mkCallGenericEqualityEROuter (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_equality_er_outer_info, [[ty]], [ e1;e2 ], m) let mkCallGenericEqualityWithComparerOuter (g:TcGlobals) m ty comp e1 e2 = mkApps g (typedExprForIntrinsic g m g.generic_equality_withc_outer_info, [[ty]], [comp;e1;e2], m) let mkCallGenericHashWithComparerOuter (g:TcGlobals) m ty comp e1 = mkApps g (typedExprForIntrinsic g m g.generic_hash_withc_outer_info, [[ty]], [comp;e1], m) -let mkCallSubtractionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_subtraction_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.equals_operator_info, [[ty]], [ e1;e2 ], m) +let mkCallNotEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.not_equals_operator, [[ty]], [ e1;e2 ], m) +let mkCallLessThanOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.less_than_operator, [[ty]], [ e1;e2 ], m) +let mkCallLessThanOrEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.less_than_or_equals_operator, [[ty]], [ e1;e2 ], m) +let mkCallGreaterThanOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.greater_than_operator, [[ty]], [ e1;e2 ], m) +let mkCallGreaterThanOrEqualsOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.greater_than_or_equals_operator, [[ty]], [ e1;e2 ], m) -let mkCallArrayLength (g:TcGlobals) m ty el = mkApps g (typedExprForIntrinsic g m g.array_length_info, [[ty]], [el], m) -let mkCallArrayGet (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; e2 ], m) +let mkCallAdditionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_addition_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallSubtractionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_subtraction_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallMultiplyOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_multiply_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallDivisionOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_division_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallModulusOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_modulus_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallBitwiseAndOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_and_info, [[ty]], [e1;e2], m) +let mkCallBitwiseOrOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_or_info, [[ty]], [e1;e2], m) +let mkCallBitwiseXorOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_xor_info, [[ty]], [e1;e2], m) +let mkCallShiftLeftOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_shift_left_info, [[ty]], [e1;e2], m) +let mkCallShiftRightOperator (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.bitwise_shift_right_info, [[ty]], [e1;e2], m) + +let mkCallUnaryNegOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unchecked_unary_minus_info, [[ty]], [e1], m) +let mkCallUnaryNotOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.bitwise_unary_not_info, [[ty]], [e1], m) + +let mkCallAdditionChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_addition_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallSubtractionChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_subtraction_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallMultiplyChecked (g:TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_multiply_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallUnaryNegChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.checked_unary_minus_info, [[ty]], [e1], m) + +let mkCallToByteChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.byte_checked_info, [[ty]], [e1], m) +let mkCallToSByteChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.sbyte_checked_info, [[ty]], [e1], m) +let mkCallToInt16Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int16_checked_info, [[ty]], [e1], m) +let mkCallToUInt16Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_checked_info, [[ty]], [e1], m) +let mkCallToIntChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_checked_info, [[ty]], [e1], m) +let mkCallToInt32Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_checked_info, [[ty]], [e1], m) +let mkCallToUInt32Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_checked_info, [[ty]], [e1], m) +let mkCallToInt64Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int64_checked_info, [[ty]], [e1], m) +let mkCallToUInt64Checked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint64_checked_info, [[ty]], [e1], m) +let mkCallToIntPtrChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.nativeint_checked_info, [[ty]], [e1], m) +let mkCallToUIntPtrChecked (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unativeint_checked_info, [[ty]], [e1], m) + +let mkCallToByteOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.byte_operator_info, [[ty]], [e1], m) +let mkCallToSByteOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.sbyte_operator_info, [[ty]], [e1], m) +let mkCallToInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int16_operator_info, [[ty]], [e1], m) +let mkCallToUInt16Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_operator_info, [[ty]], [e1], m) +let mkCallToIntOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_operator_info, [[ty]], [e1], m) +let mkCallToInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_operator_info, [[ty]], [e1], m) +let mkCallToUInt32Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_operator_info, [[ty]], [e1], m) +let mkCallToInt64Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int64_operator_info, [[ty]], [e1], m) +let mkCallToUInt64Operator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint64_operator_info, [[ty]], [e1], m) +let mkCallToSingleOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.float32_operator_info, [[ty]], [e1], m) +let mkCallToDoubleOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.float_operator_info, [[ty]], [e1], m) +let mkCallToIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.nativeint_operator_info, [[ty]], [e1], m) +let mkCallToUIntPtrOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.unativeint_operator_info, [[ty]], [e1], m) + +let mkCallToCharOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.char_operator_info, [[ty]], [e1], m) +let mkCallToEnumOperator (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.enum_operator_info, [[ty]], [e1], m) + +let mkCallArrayLength (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.array_length_info, [[ty]], [e1], m) +let mkCallArrayGet (g:TcGlobals) m ty e1 idx1 = mkApps g (typedExprForIntrinsic g m g.array_get_info, [[ty]], [ e1 ; idx1 ], m) let mkCallArray2DGet (g:TcGlobals) m ty e1 idx1 idx2 = mkApps g (typedExprForIntrinsic g m g.array2D_get_info, [[ty]], [ e1 ; idx1; idx2 ], m) let mkCallArray3DGet (g:TcGlobals) m ty e1 idx1 idx2 idx3 = mkApps g (typedExprForIntrinsic g m g.array3D_get_info, [[ty]], [ e1 ; idx1; idx2; idx3 ], m) let mkCallArray4DGet (g:TcGlobals) m ty e1 idx1 idx2 idx3 idx4 = mkApps g (typedExprForIntrinsic g m g.array4D_get_info, [[ty]], [ e1 ; idx1; idx2; idx3; idx4 ], m) +let mkCallArraySet (g:TcGlobals) m ty e1 idx1 v = mkApps g (typedExprForIntrinsic g m g.array_set_info, [[ty]], [ e1 ; idx1; v ], m) +let mkCallArray2DSet (g:TcGlobals) m ty e1 idx1 idx2 v = mkApps g (typedExprForIntrinsic g m g.array2D_set_info, [[ty]], [ e1 ; idx1; idx2; v ], m) +let mkCallArray3DSet (g:TcGlobals) m ty e1 idx1 idx2 idx3 v = mkApps g (typedExprForIntrinsic g m g.array3D_set_info, [[ty]], [ e1 ; idx1; idx2; idx3; v ], m) +let mkCallArray4DSet (g:TcGlobals) m ty e1 idx1 idx2 idx3 idx4 v = mkApps g (typedExprForIntrinsic g m g.array4D_set_info, [[ty]], [ e1 ; idx1; idx2; idx3; idx4; v ], m) + +let mkCallHash (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.hash_info, [[ty]], [ e1 ], m) +let mkCallBox (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.box_info, [[ty]], [ e1 ], m) +let mkCallIsNull (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.isnull_info, [[ty]], [ e1 ], m) +let mkCallIsNotNull (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.isnotnull_info, [[ty]], [ e1 ], m) +let mkCallRaise (g:TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.raise_info, [[ty]], [ e1 ], m) + let mkCallNewDecimal (g:TcGlobals) m (e1, e2, e3, e4, e5) = mkApps g (typedExprForIntrinsic g m g.new_decimal_info, [], [ e1;e2;e3;e4;e5 ], m) let mkCallNewFormat (g:TcGlobals) m aty bty cty dty ety e1 = mkApps g (typedExprForIntrinsic g m g.new_format_info, [[aty;bty;cty;dty;ety]], [ e1 ], m) -let mkCallRaise (g:TcGlobals) m aty e1 = mkApps g (typedExprForIntrinsic g m g.raise_info, [[aty]], [ e1 ], m) let TryEliminateDesugaredConstants g m c = match c with @@ -6935,8 +7034,8 @@ let etaExpandTypeLambda g m tps (tm, ty) = if isNil tps then tm else mkTypeLambda m tps (mkApps g ((tm, ty), [(List.map mkTyparTy tps)], [], m), ty) let AdjustValToTopVal (tmp:Val) parent valData = - tmp.SetValReprInfo (Some valData); - tmp.val_declaring_entity <- parent; + tmp.SetValReprInfo (Some valData) + tmp.SetDeclaringEntity parent tmp.SetIsMemberOrModuleBinding() /// For match with only one non-failing target T0, the other targets, T1... failing (say, raise exception). @@ -7702,17 +7801,26 @@ let MakeExportRemapping viewedCcu (mspec:ModuleOrNamespace) = let rec remapEntityDataToNonLocal g tmenv (d: Entity) = let tps', tmenvinner = tmenvCopyRemapAndBindTypars (remapAttribs g tmenv) tmenv (d.entity_typars.Force(d.entity_range)) - + let typarsR = LazyWithContext.NotLazy tps' + let attribsR = d.entity_attribs |> remapAttribs g tmenvinner + let tyconReprR = d.entity_tycon_repr |> remapTyconRepr g tmenvinner + let tyconAbbrevR = d.TypeAbbrev |> Option.map (remapType tmenvinner) + let tyconTcaugR = d.entity_tycon_tcaug |> remapTyconAug tmenvinner + let modulContentsR = + MaybeLazy.Strict (d.entity_modul_contents.Value + |> mapImmediateValsAndTycons (remapTyconToNonLocal g tmenv) (remapValToNonLocal g tmenv)) + let exnInfoR = d.ExceptionInfo |> remapTyconExnInfo g tmenvinner { d with - entity_typars = LazyWithContext.NotLazy tps'; - entity_attribs = d.entity_attribs |> remapAttribs g tmenvinner; - entity_tycon_repr = d.entity_tycon_repr |> remapTyconRepr g tmenvinner; - entity_tycon_abbrev = d.entity_tycon_abbrev |> Option.map (remapType tmenvinner) ; - entity_tycon_tcaug = d.entity_tycon_tcaug |> remapTyconAug tmenvinner ; - entity_modul_contents = - MaybeLazy.Strict (d.entity_modul_contents.Value - |> mapImmediateValsAndTycons (remapTyconToNonLocal g tmenv) (remapValToNonLocal g tmenv)); - entity_exn_info = d.entity_exn_info |> remapTyconExnInfo g tmenvinner} + entity_typars = typarsR + entity_attribs = attribsR + entity_tycon_repr = tyconReprR + entity_tycon_tcaug = tyconTcaugR + entity_modul_contents = modulContentsR + entity_opt_data = + match d.entity_opt_data with + | Some dd -> + Some { dd with entity_tycon_abbrev = tyconAbbrevR; entity_exn_info = exnInfoR } + | _ -> None } and remapTyconToNonLocal g tmenv x = x |> NewModifiedTycon (remapEntityDataToNonLocal g tmenv) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 467be96cddd..2c4e1287da8 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -262,7 +262,7 @@ val helpEnsureTypeHasMetadata : TcGlobals -> TType -> TType //------------------------------------------------------------------------- exception DefensiveCopyWarning of string * range -type Mutates = DefinitelyMutates | PossiblyMutates | NeverMutates +type Mutates = DefinitelyMutates | LikelyMutates | PossiblyMutates | NeverMutates val mkExprAddrOfExprAux : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr val mkExprAddrOfExpr : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr @@ -1090,9 +1090,9 @@ val TypeHasDefaultValue : TcGlobals -> range -> TType -> bool val isAbstractTycon : Tycon -> bool -val isUnionCaseRefAllocObservable : UnionCaseRef -> bool -val isRecdOrUnionOrStructTyconRefAllocObservable : TcGlobals -> TyconRef -> bool -val isExnAllocObservable : TyconRef -> bool +val isUnionCaseRefMutable : UnionCaseRef -> bool +val isRecdOrUnionOrFSharpStructTyconRefMutable : TcGlobals -> TyconRef -> bool +val isExnMutable : TyconRef -> bool val isUnionCaseFieldMutable : TcGlobals -> UnionCaseRef -> int -> bool val isExnFieldMutable : TyconRef -> int -> bool @@ -1221,15 +1221,77 @@ val mkCallArrayGet : TcGlobals -> range -> TType -> Expr -> Expr -> Ex 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 mkCallEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -val mkCallSubtractionOperator : 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 diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 3eb3ea37a48..118c14d33b8 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1706,23 +1706,23 @@ and p_rfield_table x st = and p_entity_spec_data (x:Entity) st = p_typar_specs (x.entity_typars.Force(x.entity_range)) st p_string x.entity_logical_name st - p_option p_string x.entity_compiled_name st + p_option p_string x.EntityCompiledName st p_range x.entity_range st p_option p_pubpath x.entity_pubpath st - p_access x.entity_accessiblity st - p_access x.entity_tycon_repr_accessibility st + p_access x.Accessibility st + p_access x.TypeReprAccessibility st p_attribs x.entity_attribs st let flagBit = p_tycon_repr x.entity_tycon_repr st - p_option p_typ x.entity_tycon_abbrev st + p_option p_typ x.TypeAbbrev st p_tcaug x.entity_tycon_tcaug st - p_string x.entity_xmldocsig st - p_kind x.entity_kind st + p_string System.String.Empty st + p_kind x.TypeOrMeasureKind st p_int64 (x.entity_flags.PickledBits ||| (if flagBit then EntityFlags.ReservedBitForPickleFormatTyconReprFlag else 0L)) st p_option p_cpath x.entity_cpath st p_maybe_lazy p_modul_typ x.entity_modul_contents st - p_exnc_repr x.entity_exn_info st + p_exnc_repr x.ExceptionInfo st if st.oInMem then - p_used_space1 (p_xmldoc x.entity_xmldoc) st + p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st @@ -1812,20 +1812,20 @@ and p_vrefFlags x st = and p_ValData x st = p_string x.val_logical_name st - p_option p_string x.val_compiled_name st + p_option p_string x.ValCompiledName st // only keep range information on published values, not on optimization data - p_ranges (if x.val_repr_info.IsSome then Some(x.val_range, x.DefinitionRange) else None) st + p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st p_typ x.val_type st p_int64 x.val_flags.PickledBits st - p_option p_member_info x.val_member_info st - p_attribs x.val_attribs st - p_option p_ValReprInfo x.val_repr_info st - p_string x.val_xmldocsig st - p_access x.val_access st - p_parentref x.val_declaring_entity st - p_option p_const x.val_const st + p_option p_member_info x.MemberInfo st + p_attribs x.Attribs st + p_option p_ValReprInfo x.ValReprInfo st + p_string x.XmlDocSig st + p_access x.Accessibility st + p_parentref x.DeclaringEntity st + p_option p_const x.LiteralValue st if st.oInMem then - p_used_space1 (p_xmldoc x.val_xmldoc) st + p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st @@ -1953,12 +1953,13 @@ and u_recdfield_spec st = rfield_xmldoc= defaultArg xmldoc XmlDoc.Empty rfield_xmldocsig=f rfield_access=g + rfield_name_generated = false rfield_other_range = None } and u_rfield_table st = MakeRecdFieldsTable (u_list u_recdfield_spec st) and u_entity_spec_data st : Entity = - let x1,x2a,x2b,x2c,x3,(x4a,x4b),x6,x7f,x8,x9,x10,x10b,x11,x12,x13,x14,x15 = + let x1,x2a,x2b,x2c,x3,(x4a,x4b),x6,x7f,x8,x9,_x10,x10b,x11,x12,x13,x14,x15 = u_tup17 u_typar_specs u_string @@ -1985,25 +1986,20 @@ and u_entity_spec_data st : Entity = { entity_typars=LazyWithContext.NotLazy x1 entity_stamp=newStamp() entity_logical_name=x2a - entity_compiled_name=x2b entity_range=x2c - entity_other_range=None entity_pubpath=x3 - entity_accessiblity=x4a - entity_tycon_repr_accessibility=x4b entity_attribs=x6 entity_tycon_repr=x7 - entity_tycon_abbrev=x8 entity_tycon_tcaug=x9 - entity_xmldoc= defaultArg x15 XmlDoc.Empty - entity_xmldocsig=x10 - entity_kind=x10b entity_flags=EntityFlags(x11) entity_cpath=x12 entity_modul_contents=MaybeLazy.Lazy x13 - entity_exn_info=x14 entity_il_repr_cache=newCache() - } + entity_opt_data= + match x2b, x10b, x15, x8, x4a, x4b, x14 with + | None, TyparKind.Type, None, None, TAccess [], TAccess [], TExnNone -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_compiled_name = x2b; entity_kind = x10b; entity_xmldoc= defaultArg x15 XmlDoc.Empty; entity_xmldocsig = System.String.Empty; entity_tycon_abbrev = x8; entity_accessiblity = x4a; entity_tycon_repr_accessibility = x4b; entity_exn_info = x14 } + } and u_tcaug st = let a1,a2,a3,b2,c,d,e,g,_space = @@ -2120,22 +2116,27 @@ and u_ValData st = (u_option u_const) (u_used_space1 u_xmldoc) st - { val_logical_name=x1 - val_compiled_name=x1z - val_range=(match x1a with None -> range0 | Some(a,_) -> a) - val_other_range=(match x1a with None -> None | Some(_,b) -> Some(b,true)) - val_type=x2 - val_stamp=newStamp() - val_flags=ValFlags(x4) - val_defn = None - val_member_info=x8 - val_attribs=x9 - val_repr_info=x10 - val_xmldoc= defaultArg x15 XmlDoc.Empty - val_xmldocsig=x12 - val_access=x13 - val_declaring_entity=x13b - val_const=x14 + + { val_logical_name = x1 + val_range = (match x1a with None -> range0 | Some(a,_) -> a) + val_type = x2 + val_stamp = newStamp() + val_flags = ValFlags(x4) + val_opt_data = + match x1z, x1a, x10, x14, x13, x15, x8, x13b, x12, x9 with + | None, None, None, None, TAccess [], None, None, ParentNone, "", [] -> None + | _ -> + Some { val_compiled_name = x1z + val_other_range = (match x1a with None -> None | Some(_,b) -> Some(b,true)) + val_defn = None + val_repr_info = x10 + val_const = x14 + val_access = x13 + val_xmldoc = defaultArg x15 XmlDoc.Empty + val_member_info = x8 + val_declaring_entity = x13b + val_xmldocsig = x12 + val_attribs = x9 } } and u_Val st = u_osgn_decl st.ivals u_ValData st diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 73434eb1002..72c8fbb0a75 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -290,12 +290,25 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d else "[" + (String.replicate (rank - 1) ",") + "]`1" mk_MFCore_tcref fslibCcu type_sig) + let v_byte_ty = mkNonGenericTy v_byte_tcr + let v_sbyte_ty = mkNonGenericTy v_sbyte_tcr + let v_int16_ty = mkNonGenericTy v_int16_tcr + let v_uint16_ty = mkNonGenericTy v_uint16_tcr + let v_int_ty = mkNonGenericTy v_int_tcr + let v_int32_ty = mkNonGenericTy v_int32_tcr + let v_uint32_ty = mkNonGenericTy v_uint32_tcr + let v_int64_ty = mkNonGenericTy v_int64_tcr + let v_uint64_ty = mkNonGenericTy v_uint64_tcr + let v_float32_ty = mkNonGenericTy v_float32_tcr + let v_float_ty = mkNonGenericTy v_float_tcr + let v_nativeint_ty = mkNonGenericTy v_nativeint_tcr + let v_unativeint_ty = mkNonGenericTy v_unativeint_tcr + + let v_enum_ty = mkNonGenericTy v_int_tcr let v_bool_ty = mkNonGenericTy v_bool_tcr - let v_int_ty = mkNonGenericTy v_int_tcr let v_char_ty = mkNonGenericTy v_char_tcr let v_obj_ty = mkNonGenericTy v_obj_tcr let v_string_ty = mkNonGenericTy v_string_tcr - let v_byte_ty = mkNonGenericTy v_byte_tcr let v_decimal_ty = mkSysNonGenericTy sys "Decimal" let v_unit_ty = mkNonGenericTy v_unit_tcr_nice let v_system_Type_typ = mkSysNonGenericTy sys "Type" @@ -510,7 +523,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_greater_than_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, CompileOpName ">" , None , None , [vara], mk_rel_sig varaTy) let v_greater_than_or_equals_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, CompileOpName ">=" , None , None , [vara], mk_rel_sig varaTy) - let v_enumOfValue_info = makeIntrinsicValRef(fslib_MFLanguagePrimitives_nleref, "EnumOfValue" , None , None , [vara; varb], ([[varaTy]], varbTy)) + let v_enumOfValue_info = makeIntrinsicValRef(fslib_MFLanguagePrimitives_nleref, "EnumOfValue" , None , None , [vara; varb], ([[varaTy]], varbTy)) let v_generic_comparison_withc_outer_info = makeIntrinsicValRef(fslib_MFLanguagePrimitives_nleref, "GenericComparisonWithComparer" , None , None , [vara], mk_compare_withc_sig varaTy) let v_generic_hash_withc_tuple2_info = makeIntrinsicValRef(fslib_MFHashCompare_nleref, "FastHashTuple2" , None , None , [vara;varb], mk_hash_withc_sig (decodeTupleTy tupInfoRef [varaTy; varbTy])) @@ -566,10 +579,50 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_unchecked_addition_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Addition" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) let v_unchecked_subtraction_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Subtraction" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) let v_unchecked_multiply_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Multiply" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) + let v_unchecked_division_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Division" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) + let v_unchecked_modulus_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Modulus" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) let v_unchecked_unary_plus_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_UnaryPlus" , None , None , [vara], mk_unop_ty varaTy) let v_unchecked_unary_minus_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_UnaryNegation" , None , None , [vara], mk_unop_ty varaTy) let v_unchecked_unary_not_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "not" , None , Some "Not" , [], mk_unop_ty v_bool_ty) + let v_checked_addition_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_Addition" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) + let v_checked_subtraction_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_Subtraction" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) + let v_checked_multiply_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_Multiply" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) + let v_checked_unary_minus_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_UnaryNegation" , None , None , [vara], mk_unop_ty varaTy) + + let v_byte_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "byte" , None , Some "ToByte", [vara], ([[varaTy]], v_byte_ty)) + let v_sbyte_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "sbyte" , None , Some "ToSByte", [vara], ([[varaTy]], v_sbyte_ty)) + let v_int16_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "int16" , None , Some "ToInt16", [vara], ([[varaTy]], v_int16_ty)) + let v_uint16_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "uint16" , None , Some "ToUInt16", [vara], ([[varaTy]], v_uint16_ty)) + let v_int_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "int" , None , Some "ToInt", [vara], ([[varaTy]], v_int_ty)) + let v_int32_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "int32" , None , Some "ToInt32", [vara], ([[varaTy]], v_int32_ty)) + let v_uint32_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "uint32" , None , Some "ToUInt32", [vara], ([[varaTy]], v_uint32_ty)) + let v_int64_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "int64" , None , Some "ToInt64", [vara], ([[varaTy]], v_int64_ty)) + let v_uint64_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "uint64" , None , Some "ToUInt64", [vara], ([[varaTy]], v_uint64_ty)) + let v_nativeint_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "nativeint" , None , Some "ToIntPtr", [vara], ([[varaTy]], v_nativeint_ty)) + let v_unativeint_checked_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "unativeint" , None , Some "ToUIntPtr", [vara], ([[varaTy]], v_unativeint_ty)) + + let v_byte_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "byte" , None , Some "ToByte", [vara], ([[varaTy]], v_byte_ty)) + let v_sbyte_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "sbyte" , None , Some "ToSByte", [vara], ([[varaTy]], v_sbyte_ty)) + let v_int16_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int16" , None , Some "ToInt16", [vara], ([[varaTy]], v_int16_ty)) + let v_uint16_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "uint16" , None , Some "ToUInt16", [vara], ([[varaTy]], v_uint16_ty)) + let v_int_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int" , None , Some "ToInt", [vara], ([[varaTy]], v_int_ty)) + let v_int32_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int32" , None , Some "ToInt32", [vara], ([[varaTy]], v_int32_ty)) + let v_uint32_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "uint32" , None , Some "ToUInt32", [vara], ([[varaTy]], v_uint32_ty)) + let v_int64_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "int64" , None , Some "ToInt64", [vara], ([[varaTy]], v_int64_ty)) + let v_uint64_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "uint64" , None , Some "ToUInt64", [vara], ([[varaTy]], v_uint64_ty)) + let v_float32_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "float32" , None , Some "ToSingle", [vara], ([[varaTy]], v_float32_ty)) + let v_float_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "float" , None , Some "ToDouble", [vara], ([[varaTy]], v_float_ty)) + let v_nativeint_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "nativeint" , None , Some "ToIntPtr", [vara], ([[varaTy]], v_nativeint_ty)) + let v_unativeint_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "unativeint" , None , Some "ToUIntPtr", [vara], ([[varaTy]], v_unativeint_ty)) + + let v_char_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "char" , None , Some "ToChar", [vara], ([[varaTy]], v_char_ty)) + let v_enum_operator_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "enum" , None , Some "ToEnum", [vara], ([[varaTy]], v_enum_ty)) + + let v_hash_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "hash" , None , Some "Hash" , [vara], ([[varaTy]], v_int_ty)) + let v_box_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "box" , None , Some "Box" , [vara], ([[varaTy]], v_obj_ty)) + let v_isnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNull" , None , Some "IsNull" , [vara], ([[varaTy]], v_bool_ty)) + let v_isnotnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNotNull" , None , Some "IsNotNull" , [vara], ([[varaTy]], v_bool_ty)) let v_raise_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "raise" , None , Some "Raise" , [vara], ([[mkSysNonGenericTy sys "Exception"]], varaTy)) let v_failwith_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "failwith" , None , Some "FailWith" , [vara], ([[v_string_ty]], varaTy)) let v_invalid_arg_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "invalidArg" , None , Some "InvalidArg" , [vara], ([[v_string_ty]; [v_string_ty]], varaTy)) @@ -583,13 +636,19 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_sizeof_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "sizeof" , None , Some "SizeOf" , [vara], ([], v_int_ty)) let v_unchecked_defaultof_info = makeIntrinsicValRef(fslib_MFOperatorsUnchecked_nleref, "defaultof" , None , Some "DefaultOf", [vara], ([], varaTy)) let v_typedefof_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "typedefof" , None , Some "TypeDefOf", [vara], ([], v_system_Type_typ)) - let v_enum_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "enum" , None , Some "ToEnum" , [vara], ([[v_int_ty]], varaTy)) let v_range_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Range" , None , None , [vara], ([[varaTy];[varaTy]], mkSeqTy varaTy)) let v_range_step_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_RangeStep" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy)) let v_range_int32_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt32" , None , None , [], ([[v_int_ty];[v_int_ty];[v_int_ty]], mkSeqTy v_int_ty)) + + let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty)) + let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy)) let v_array2D_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray2D" , None , None , [vara], ([[mkArrayType 2 varaTy];[v_int_ty]; [v_int_ty]], varaTy)) let v_array3D_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray3D" , None , None , [vara], ([[mkArrayType 3 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]], varaTy)) let v_array4D_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray4D" , None , None , [vara], ([[mkArrayType 4 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [v_int_ty]], varaTy)) + let v_array_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]; [varaTy]], v_unit_ty)) + let v_array2D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray2D" , None , None , [vara], ([[mkArrayType 2 varaTy];[v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty)) + let v_array3D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray3D" , None , None , [vara], ([[mkArrayType 3 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty)) + let v_array4D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray4D" , None , None , [vara], ([[mkArrayType 4 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty)) let v_seq_collect_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "collect" , None , Some "Collect", [vara;varb;varc], ([[varaTy --> varbTy]; [mkSeqTy varaTy]], mkSeqTy varcTy)) let v_seq_delay_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "delay" , None , Some "Delay" , [varb], ([[v_unit_ty --> mkSeqTy varbTy]], mkSeqTy varbTy)) @@ -616,14 +675,12 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_splice_expr_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "op_Splice" , None , None , [vara], ([[mkQuotedExprTy varaTy]], varaTy)) let v_splice_raw_expr_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "op_SpliceUntyped" , None , None , [vara], ([[mkRawQuotedExprTy]], varaTy)) let v_new_decimal_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "MakeDecimal" , None , None , [], ([[v_int_ty]; [v_int_ty]; [v_int_ty]; [v_bool_ty]; [v_byte_ty]], v_decimal_ty)) - let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy)) - let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty)) let v_deserialize_quoted_FSharp_20_plus_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "Deserialize" , Some "Expr" , None , [], ([[v_system_Type_typ ;mkListTy v_system_Type_typ ;mkListTy mkRawQuotedExprTy ; mkArrayType 1 v_byte_ty]], mkRawQuotedExprTy )) let v_deserialize_quoted_FSharp_40_plus_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "Deserialize40" , Some "Expr" , None , [], ([[v_system_Type_typ ;mkArrayType 1 v_system_Type_typ; mkArrayType 1 v_system_Type_typ; mkArrayType 1 mkRawQuotedExprTy; mkArrayType 1 v_byte_ty]], mkRawQuotedExprTy )) let v_cast_quotation_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "Cast" , Some "Expr" , None , [vara], ([[mkRawQuotedExprTy]], mkQuotedExprTy varaTy)) let v_lift_value_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "Value" , Some "Expr" , None , [vara], ([[varaTy]], mkRawQuotedExprTy)) let v_lift_value_with_name_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "ValueWithName" , Some "Expr" , None , [vara], ([[varaTy; v_string_ty]], mkRawQuotedExprTy)) - let v_lift_value_with_defn_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "WithValue" , Some "Expr" , None , [vara], ([[varaTy; mkQuotedExprTy varaTy]], mkQuotedExprTy varaTy)) + let v_lift_value_with_defn_info = makeIntrinsicValRef(fslib_MFQuotations_nleref, "WithValue" , Some "Expr" , None , [vara], ([[varaTy; mkQuotedExprTy varaTy]], mkQuotedExprTy varaTy)) let v_query_value_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "query" , None , None , [], ([], mkQueryBuilderTy) ) let v_query_run_value_info = makeIntrinsicValRef(fslib_MFQueryRunExtensionsLowPriority_nleref, "Run" , Some "QueryBuilder" , None , [vara], ([[mkQueryBuilderTy];[mkQuotedExprTy varaTy]], varaTy) ) let v_query_run_enumerable_info = makeIntrinsicValRef(fslib_MFQueryRunExtensionsHighPriority_nleref, "Run" , Some "QueryBuilder" , None , [vara], ([[mkQueryBuilderTy];[mkQuotedExprTy (mkQuerySourceTy varaTy (mkNonGenericTy v_tcref_System_Collections_IEnumerable)) ]], mkSeqTy varaTy) ) @@ -831,6 +888,8 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.expr_tcr = v_expr_tcr member __.raw_expr_tcr = v_raw_expr_tcr member __.nativeint_tcr = v_nativeint_tcr + member __.unativeint_tcr = v_unativeint_tcr + member __.int_tcr = v_int_tcr member __.int32_tcr = v_int32_tcr member __.int16_tcr = v_int16_tcr member __.int64_tcr = v_int64_tcr @@ -892,15 +951,15 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.choice5_tcr = v_choice5_tcr member __.choice6_tcr = v_choice6_tcr member __.choice7_tcr = v_choice7_tcr - member val nativeint_ty = mkNonGenericTy v_nativeint_tcr - member val unativeint_ty = mkNonGenericTy v_unativeint_tcr - member val int32_ty = mkNonGenericTy v_int32_tcr - member val int16_ty = mkNonGenericTy v_int16_tcr - member val int64_ty = mkNonGenericTy v_int64_tcr - member val uint16_ty = mkNonGenericTy v_uint16_tcr - member val uint32_ty = mkNonGenericTy v_uint32_tcr - member val uint64_ty = mkNonGenericTy v_uint64_tcr - member val sbyte_ty = mkNonGenericTy v_sbyte_tcr + member val nativeint_ty = v_nativeint_ty + member val unativeint_ty = v_unativeint_ty + member val int32_ty = v_int32_ty + member val int16_ty = v_int16_ty + member val int64_ty = v_int64_ty + member val uint16_ty = v_uint16_ty + member val uint32_ty = v_uint32_ty + member val uint64_ty = v_uint64_ty + member val sbyte_ty = v_sbyte_ty member __.byte_ty = v_byte_ty member __.bool_ty = v_bool_ty member __.int_ty = v_int_ty @@ -911,8 +970,8 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.decimal_ty = v_decimal_ty member val exn_ty = mkNonGenericTy v_exn_tcr - member val float_ty = mkNonGenericTy v_float_tcr - member val float32_ty = mkNonGenericTy v_float32_tcr + member val float_ty = v_float_ty + member val float32_ty = v_float32_ty /// Memoization table to help minimize the number of ILSourceDocument objects we create member __.memoize_file x = v_memoize_file.Apply x @@ -1134,7 +1193,56 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val unchecked_subtraction_vref = ValRefForIntrinsic v_unchecked_subtraction_info member val unchecked_multiply_vref = ValRefForIntrinsic v_unchecked_multiply_info member val unchecked_defaultof_vref = ValRefForIntrinsic v_unchecked_defaultof_info + + member __.bitwise_or_info = v_bitwise_or_info + member __.bitwise_and_info = v_bitwise_and_info + member __.bitwise_xor_info = v_bitwise_xor_info + member __.bitwise_unary_not_info = v_bitwise_unary_not_info + member __.bitwise_shift_left_info = v_bitwise_shift_left_info + member __.bitwise_shift_right_info = v_bitwise_shift_right_info + member __.unchecked_addition_info = v_unchecked_addition_info member __.unchecked_subtraction_info = v_unchecked_subtraction_info + member __.unchecked_multiply_info = v_unchecked_multiply_info + member __.unchecked_division_info = v_unchecked_division_info + member __.unchecked_modulus_info = v_unchecked_modulus_info + member __.unchecked_unary_plus_info = v_unchecked_unary_plus_info + member __.unchecked_unary_minus_info = v_unchecked_unary_minus_info + member __.unchecked_unary_not_info = v_unchecked_unary_not_info + + member __.checked_addition_info = v_checked_addition_info + member __.checked_subtraction_info = v_checked_subtraction_info + member __.checked_multiply_info = v_checked_multiply_info + member __.checked_unary_minus_info = v_checked_unary_minus_info + + member __.byte_checked_info = v_byte_checked_info + member __.sbyte_checked_info = v_sbyte_checked_info + member __.int16_checked_info = v_int16_checked_info + member __.uint16_checked_info = v_uint16_checked_info + member __.int_checked_info = v_int_checked_info + member __.int32_checked_info = v_int32_checked_info + member __.uint32_checked_info = v_uint32_checked_info + member __.int64_checked_info = v_int64_checked_info + member __.uint64_checked_info = v_uint64_checked_info + member __.nativeint_checked_info = v_nativeint_checked_info + member __.unativeint_checked_info = v_unativeint_checked_info + + member __.byte_operator_info = v_byte_operator_info + member __.sbyte_operator_info = v_sbyte_operator_info + member __.int16_operator_info = v_int16_operator_info + member __.uint16_operator_info = v_uint16_operator_info + member __.int_operator_info = v_int_operator_info + member __.int32_operator_info = v_int32_operator_info + member __.uint32_operator_info = v_uint32_operator_info + member __.int64_operator_info = v_int64_operator_info + member __.uint64_operator_info = v_uint64_operator_info + member __.float32_operator_info = v_float32_operator_info + member __.float_operator_info = v_float_operator_info + member __.nativeint_operator_info = v_nativeint_operator_info + member __.unativeint_operator_info = v_unativeint_operator_info + + member __.char_operator_info = v_char_operator_info + member __.enum_operator_info = v_enum_operator_info + member val compare_operator_vref = ValRefForIntrinsic v_compare_operator_info member val equals_operator_vref = ValRefForIntrinsic v_equals_operator_info member val equals_nullable_operator_vref = ValRefForIntrinsic v_equals_nullable_operator_info @@ -1153,7 +1261,17 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val invalid_op_vref = ValRefForIntrinsic v_invalid_op_info member val failwithf_vref = ValRefForIntrinsic v_failwithf_info - member __.equals_operator_info = v_equals_operator_info + member __.equals_operator_info = v_equals_operator_info + member __.not_equals_operator = v_not_equals_operator_info + member __.less_than_operator = v_less_than_operator_info + member __.less_than_or_equals_operator = v_less_than_or_equals_operator_info + member __.greater_than_operator = v_greater_than_operator_info + member __.greater_than_or_equals_operator = v_greater_than_or_equals_operator_info + + member __.hash_info = v_hash_info + member __.box_info = v_box_info + member __.isnull_info = v_isnull_info + member __.isnotnull_info = v_isnotnull_info member __.raise_info = v_raise_info member __.failwith_info = v_failwith_info member __.invalid_arg_info = v_invalid_arg_info @@ -1164,14 +1282,13 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.methodhandleof_info = v_methodhandleof_info member __.typeof_info = v_typeof_info member __.typedefof_info = v_typedefof_info - member __.array_length_info = v_array_length_info member val reraise_vref = ValRefForIntrinsic v_reraise_info member val methodhandleof_vref = ValRefForIntrinsic v_methodhandleof_info member val typeof_vref = ValRefForIntrinsic v_typeof_info member val sizeof_vref = ValRefForIntrinsic v_sizeof_info member val typedefof_vref = ValRefForIntrinsic v_typedefof_info - member val enum_vref = ValRefForIntrinsic v_enum_info + member val enum_vref = ValRefForIntrinsic v_enum_operator_info member val enumOfValue_vref = ValRefForIntrinsic v_enumOfValue_info member val range_op_vref = ValRefForIntrinsic v_range_op_info member val range_step_op_vref = ValRefForIntrinsic v_range_step_op_info @@ -1233,10 +1350,17 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.create_event_info = v_create_event_info member __.seq_to_list_info = v_seq_to_list_info member __.seq_to_array_info = v_seq_to_array_info + + member __.array_length_info = v_array_length_info member __.array_get_info = v_array_get_info - member __.array2D_get_info = v_array2D_get_info - member __.array3D_get_info = v_array3D_get_info - member __.array4D_get_info = v_array4D_get_info + member __.array2D_get_info = v_array2D_get_info + member __.array3D_get_info = v_array3D_get_info + member __.array4D_get_info = v_array4D_get_info + member __.array_set_info = v_array_set_info + member __.array2D_set_info = v_array2D_set_info + member __.array3D_set_info = v_array3D_set_info + member __.array4D_set_info = v_array4D_set_info + member __.deserialize_quoted_FSharp_20_plus_info = v_deserialize_quoted_FSharp_20_plus_info member __.deserialize_quoted_FSharp_40_plus_info = v_deserialize_quoted_FSharp_40_plus_info member __.cast_quotation_info = v_cast_quotation_info diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index fda1dbda1ab..c78ff2b6d67 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -174,7 +174,7 @@ let MethInfoChecks g amap isInstance tyargsOpt objArgs ad m (minfo:MethInfo) = if not (IsTypeAndMethInfoAccessible amap m adOriginal ad minfo) then error (Error (FSComp.SR.tcMethodNotAccessible(minfo.LogicalName), m)) - if isAnyTupleTy g minfo.ApparentEnclosingType then + if isAnyTupleTy g minfo.ApparentEnclosingType && not minfo.IsExtensionMember && (minfo.LogicalName.StartsWith "get_Item" || minfo.LogicalName.StartsWith "get_Rest") then warning (Error (FSComp.SR.tcTupleMemberNotNormallyUsed(), m)) CheckMethInfoAttributes g m tyargsOpt minfo |> CommitOperationResult @@ -388,11 +388,10 @@ let addInternalsAccessibility env (ccu:CcuThunk) = eAccessRights = computeAccessRights env.eAccessPath eInternalsVisibleCompPaths env.eFamilyType // update this computed field eInternalsVisibleCompPaths = compPath :: env.eInternalsVisibleCompPaths } -let ModifyNameResEnv f env = { env with eNameResEnv = f env.eNameResEnv } - let AddLocalValPrimitive (v:Val) env = - let env = ModifyNameResEnv (fun nenv -> AddValRefToNameEnv nenv (mkLocalValRef v)) env - { env with eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } + { env with + eNameResEnv = AddValRefToNameEnv env.eNameResEnv (mkLocalValRef v) + eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } let AddLocalValMap tcSink scopem (vals:Val NameMap) env = @@ -400,8 +399,9 @@ let AddLocalValMap tcSink scopem (vals:Val NameMap) env = if vals.IsEmpty then env else - let env = ModifyNameResEnv (AddValMapToNameEnv vals) env - { env with eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } + { env with + eNameResEnv = AddValMapToNameEnv vals env.eNameResEnv + eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env @@ -410,19 +410,21 @@ let AddLocalVals tcSink scopem (vals:Val list) env = if isNil vals then env else - let env = ModifyNameResEnv (AddValListToNameEnv vals) env - { env with eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } + { env with + eNameResEnv = AddValListToNameEnv vals env.eNameResEnv + eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env -let AddLocalVal tcSink scopem v env = - let env = ModifyNameResEnv (fun nenv -> AddValRefToNameEnv nenv (mkLocalValRef v)) env - let env = {env with eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } +let AddLocalVal tcSink scopem v env = + let env = { env with + eNameResEnv = AddValRefToNameEnv env.eNameResEnv (mkLocalValRef v) + eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env let AddLocalExnDefnAndReport tcSink scopem env (exnc:Tycon) = - let env = ModifyNameResEnv (fun nenv -> AddExceptionDeclsToNameEnv BulkAdd.No nenv (mkLocalEntityRef exnc)) env + let env = { env with eNameResEnv = AddExceptionDeclsToNameEnv BulkAdd.No env.eNameResEnv (mkLocalEntityRef exnc) } (* Also make VisualStudio think there is an identifier in scope at the range of the identifier text of its binding location *) CallEnvSink tcSink (exnc.Range, env.NameEnv, env.eAccessRights) CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) @@ -430,7 +432,7 @@ let AddLocalExnDefnAndReport tcSink scopem env (exnc:Tycon) = let AddLocalTyconRefs ownDefinition g amap m tcrefs env = if isNil tcrefs then env else - env |> ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.No ownDefinition g amap m false nenv tcrefs) + { env with eNameResEnv = AddTyconRefsToNameEnv BulkAdd.No ownDefinition g amap m false env.eNameResEnv tcrefs } let AddLocalTycons g amap m (tycons: Tycon list) env = if isNil tycons then env else @@ -448,14 +450,14 @@ let AddLocalTyconsAndReport tcSink scopem g amap m tycons env = let OpenModulesOrNamespaces tcSink g amap scopem root env mvvs openDeclaration = let env = if isNil mvvs then env else - ModifyNameResEnv (fun nenv -> AddModulesAndNamespacesContentsToNameEnv g amap env.eAccessRights scopem root nenv mvvs) env + { env with eNameResEnv = AddModulesAndNamespacesContentsToNameEnv g amap env.eAccessRights scopem root env.eNameResEnv mvvs } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) CallOpenDeclarationSink tcSink openDeclaration env let AddRootModuleOrNamespaceRefs g amap m env modrefs = if isNil modrefs then env else - ModifyNameResEnv (fun nenv -> AddModuleOrNamespaceRefsToNameEnv g amap m true env.eAccessRights nenv modrefs) env + { env with eNameResEnv = AddModuleOrNamespaceRefsToNameEnv g amap m true env.eAccessRights env.eNameResEnv modrefs } let AddNonLocalCcu g amap scopem env assemblyName (ccu:CcuThunk, internalsVisibleToAttributes) = @@ -476,7 +478,7 @@ let AddNonLocalCcu g amap scopem env assemblyName (ccu:CcuThunk, internalsVisib let env = AddRootModuleOrNamespaceRefs g amap scopem env modrefs let env = if isNil tcrefs then env else - ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.Yes false g amap scopem true nenv tcrefs) env + { env with eNameResEnv = AddTyconRefsToNameEnv BulkAdd.Yes false g amap scopem true env.eNameResEnv tcrefs } //CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env @@ -486,25 +488,26 @@ let AddLocalRootModuleOrNamespace tcSink g amap scopem env (mtyp:ModuleOrNamespa // Compute the top-rooted type definitions let tcrefs = mtyp.TypeAndExceptionDefinitions |> List.map mkLocalTyconRef let env = AddRootModuleOrNamespaceRefs g amap scopem env modrefs - let env = - if isNil tcrefs then env else - ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.No false g amap scopem true nenv tcrefs) env - let env = { env with eUngeneralizableItems = addFreeItemOfModuleTy mtyp env.eUngeneralizableItems } + let env = { env with + eNameResEnv = if isNil tcrefs then env.eNameResEnv else AddTyconRefsToNameEnv BulkAdd.No false g amap scopem true env.eNameResEnv tcrefs + eUngeneralizableItems = addFreeItemOfModuleTy mtyp env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env let AddModuleAbbreviationAndReport tcSink scopem id modrefs env = let env = if isNil modrefs then env else - ModifyNameResEnv (fun nenv -> AddModuleAbbrevToNameEnv id nenv modrefs) env + { env with eNameResEnv = AddModuleAbbrevToNameEnv id env.eNameResEnv modrefs } + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) let item = Item.ModuleOrNamespaces modrefs CallNameResolutionSink tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) env let AddLocalSubModule g amap m env (modul:ModuleOrNamespace) = - let env = ModifyNameResEnv (fun nenv -> AddModuleOrNamespaceRefToNameEnv g amap m false env.eAccessRights nenv (mkLocalModRef modul)) env - let env = { env with eUngeneralizableItems = addFreeItemOfModuleTy modul.ModuleOrNamespaceType env.eUngeneralizableItems } + let env = { env with + eNameResEnv = AddModuleOrNamespaceRefToNameEnv g amap m false env.eAccessRights env.eNameResEnv (mkLocalModRef modul) + eUngeneralizableItems = addFreeItemOfModuleTy modul.ModuleOrNamespaceType env.eUngeneralizableItems } env let AddLocalSubModuleAndReport tcSink scopem g amap m env (modul:ModuleOrNamespace) = @@ -518,7 +521,7 @@ let RegisterDeclaredTypars typars env = let AddDeclaredTypars check typars env = if isNil typars then env else - let env = ModifyNameResEnv (fun nenv -> AddDeclaredTyparsToNameEnv check nenv typars) env + let env = { env with eNameResEnv = AddDeclaredTyparsToNameEnv check env.eNameResEnv typars } RegisterDeclaredTypars typars env /// Compilation environment for typechecking a single file in an assembly. Contains the @@ -694,13 +697,16 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath env = | Some(_, rest) -> rest | None -> enclosingNamespacePath - let ad = env.eAccessRights - match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem OpenQualified env.eNameResEnv ad enclosingNamespacePathToOpen true with - | Result modrefs -> - let modrefs = List.map p23 modrefs - let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true) - OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl - | Exception _ -> env + match enclosingNamespacePathToOpen with + | id::rest -> + let ad = env.eAccessRights + match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem true OpenQualified env.eNameResEnv ad id rest true with + | Result modrefs -> + let modrefs = List.map p23 modrefs + let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true) + OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl + | Exception _ -> env + | _ -> env //------------------------------------------------------------------------- @@ -717,7 +723,8 @@ let ShrinkContext env oldRange newRange = | ContextInfo.ReturnInComputationExpression | ContextInfo.YieldInComputationExpression | ContextInfo.RuntimeTypeTest _ - | ContextInfo.DowncastUsedInsteadOfUpcast _ -> + | ContextInfo.DowncastUsedInsteadOfUpcast _ + | ContextInfo.SequenceExpression _ -> env | ContextInfo.CollectionElement (b,m) -> if m <> oldRange then env else @@ -793,8 +800,8 @@ let UnifyFunctionType extraInfo cenv denv mFunExpr ty = | None -> error (FunctionExpected(denv, ty, mFunExpr)) let ReportImplicitlyIgnoredBoolExpression denv m ty expr = - let checkExpr m exprOpt = - match exprOpt with + let checkExpr m expr = + match expr with | Expr.App(Expr.Val(vf, _, _), _, _, exprs, _) when vf.LogicalName = opNameEquals -> match exprs with | Expr.App(Expr.Val(propRef, _, _), _, _, Expr.Val(vf, _, _) :: _, _) :: _ -> @@ -821,17 +828,17 @@ let ReportImplicitlyIgnoredBoolExpression denv m ty expr = | _ -> UnitTypeExpected (denv, ty, m) match expr with - | Some(Expr.Let(_, Expr.Sequential(_, inner, _, _, _), _, _)) - | Some(Expr.Sequential(_, inner, _, _, _)) -> + | Expr.Let(_, Expr.Sequential(_, inner, _, _, _), _, _) + | Expr.Sequential(_, inner, _, _, _) -> let rec extractNext expr = match expr with | Expr.Sequential(_, inner, _, _, _) -> extractNext inner | _ -> checkExpr expr.Range expr extractNext inner - | Some expr -> checkExpr m expr - | _ -> UnitTypeExpected (denv, ty, m) + | expr -> checkExpr m expr -let UnifyUnitType cenv denv m ty exprOpt = +let UnifyUnitType cenv (env:TcEnv) m ty expr = + let denv = env.DisplayEnv if AddCxTypeEqualsTypeUndoIfFailed denv cenv.css m ty cenv.g.unit_ty then true else @@ -839,11 +846,26 @@ let UnifyUnitType cenv denv m ty exprOpt = let resultTy = NewInferenceType () if AddCxTypeEqualsTypeUndoIfFailed denv cenv.css m ty (domainTy --> resultTy) then warning (FunctionValueUnexpected(denv, ty, m)) - else - if not (typeEquiv cenv.g cenv.g.bool_ty ty) then - warning (UnitTypeExpected (denv, ty, m)) - else - warning (ReportImplicitlyIgnoredBoolExpression denv m ty exprOpt) + else + let reportImplicitlyDiscardError() = + if typeEquiv cenv.g cenv.g.bool_ty ty then + warning (ReportImplicitlyIgnoredBoolExpression denv m ty expr) + else + warning (UnitTypeExpected (denv, ty, m)) + + match env.eContextInfo with + | ContextInfo.SequenceExpression seqTy -> + let lifted = mkSeqTy cenv.g ty + if typeEquiv cenv.g seqTy lifted then + warning (Error (FSComp.SR.implicitlyDiscardedInSequenceExpression(NicePrint.prettyStringOfTy denv ty), m)) + else + if isListTy cenv.g ty || isArrayTy cenv.g ty || typeEquiv cenv.g seqTy ty then + warning (Error (FSComp.SR.implicitlyDiscardedSequenceInSequenceExpression(NicePrint.prettyStringOfTy denv ty), m)) + else + reportImplicitlyDiscardError() + | _ -> + reportImplicitlyDiscardError() + false //------------------------------------------------------------------------- @@ -1389,32 +1411,34 @@ let ComputeAccessAndCompPath env declKindOpt m vis overrideVis actualParent = let cpath = if accessModPermitted then Some env.eCompPath else None vis, cpath -let CheckForAbnormalOperatorNames cenv (idRange:range) opName isMember = - if (idRange.EndColumn - idRange.StartColumn <= 5) && - not cenv.g.compilingFslib +let CheckForAbnormalOperatorNames cenv (idRange:range) coreDisplayName (memberInfoOpt: ValMemberInfo option) = + if (idRange.EndColumn - idRange.StartColumn <= 5) && + not cenv.g.compilingFslib then - match opName with + let opName = DecompileOpName coreDisplayName + let isMember = memberInfoOpt.IsSome + match opName with | PrettyNaming.Relational -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational opName, idRange)) | PrettyNaming.Equality -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality opName, idRange)) | PrettyNaming.Control -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition opName, idRange)) | PrettyNaming.Indexer -> if not isMember then - error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition(opName), idRange)) + error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition opName, idRange)) | PrettyNaming.FixedTypes -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes opName, idRange)) | PrettyNaming.Other -> () let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValScheme(id, typeScheme, topValData, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, compgen, isIncrClass, isTyFunc, hasDeclaredTypars)), attrs, doc, konst, isGeneratedEventVal) = @@ -1521,7 +1545,7 @@ let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValSche (hasDeclaredTypars || inSig), isGeneratedEventVal, konst, actualParent) - CheckForAbnormalOperatorNames cenv id.idRange (DecompileOpName vspec.CoreDisplayName) (Option.isSome memberInfoOpt) + CheckForAbnormalOperatorNames cenv id.idRange vspec.CoreDisplayName memberInfoOpt PublishValueDefn cenv env declKind vspec @@ -1567,7 +1591,7 @@ let InstanceMembersNeedSafeInitCheck cenv m thisTy = let MakeSafeInitField (g: TcGlobals) env m isStatic = let id = ident(globalNng.FreshCompilerGeneratedName("init", m), m) let taccess = TAccess [env.eAccessPath] - NewRecdField isStatic None id g.int_ty true true [] [] XmlDoc.Empty taccess true + NewRecdField isStatic None id false g.int_ty true true [] [] XmlDoc.Empty taccess true // Make the "delayed reference" boolean value recording the safe initialization of a type in a hierarchy where there is a HasSelfReferentialConstructor let ComputeInstanceSafeInitInfo cenv env m thisTy = @@ -2145,13 +2169,13 @@ module GeneralizationHelpers = | Expr.Op(op, _, args, _) -> match op with | TOp.Tuple _ -> true - | TOp.UnionCase uc -> not (isUnionCaseRefAllocObservable uc) + | TOp.UnionCase uc -> not (isUnionCaseRefMutable uc) | TOp.Recd(ctorInfo, tcref) -> match ctorInfo with - | RecdExpr -> not (isRecdOrUnionOrStructTyconRefAllocObservable g tcref) + | RecdExpr -> not (isRecdOrUnionOrFSharpStructTyconRefMutable g tcref) | RecdExprIsObjInit -> false | TOp.Array -> isNil args - | TOp.ExnConstr ec -> not (isExnAllocObservable ec) + | TOp.ExnConstr ec -> not (isExnMutable ec) | TOp.ILAsm([], _) -> true @@ -2794,7 +2818,7 @@ let TcVal checkAttributes cenv env tpenv (vref:ValRef) optInst optAfterResolutio // If we have got an explicit instantiation then use that | Some(vrefFlags, checkTys) -> let checkInst (tinst:TypeInst) = - if not v.IsMember && not v.PermitsExplicitTypeInstantiation && tinst.Length > 0 && v.Typars.Length > 0 then + if not v.IsMember && not v.PermitsExplicitTypeInstantiation && not (List.isEmpty tinst) && not (List.isEmpty v.Typars) then warning(Error(FSComp.SR.tcDoesNotAllowExplicitTypeArguments(v.DisplayName), m)) match vrec with | ValInRecScope false -> @@ -5091,7 +5115,7 @@ and TcPatBindingName cenv env id ty isMemberThis vis1 topValData (inlineFlag, de // 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 // For non-left-most paths, we register the name resolutions here - if not isLeftMost && not vspec.IsCompilerGenerated && not (String.hasPrefix vspec.LogicalName "_") then + if not isLeftMost && not vspec.IsCompilerGenerated && not (vspec.LogicalName.StartsWith "_") then let item = Item.Value(mkLocalValRef vspec) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) @@ -5568,7 +5592,7 @@ and TcStmtThatCantBeCtorBody cenv env tpenv expr = and TcStmt cenv env tpenv synExpr = let expr, ty, tpenv = TcExprOfUnknownType cenv env tpenv synExpr let m = synExpr.Range - let wasUnit = UnifyUnitType cenv env.DisplayEnv m ty (Some expr) + let wasUnit = UnifyUnitType cenv env m ty expr if wasUnit then expr, tpenv else @@ -6784,7 +6808,7 @@ and TcConstExpr cenv overallTy env m tpenv c = let expr = let modName = "NumericLiteral" + suffix let ad = env.eAccessRights - match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap m OpenQualified env.eNameResEnv ad [ident (modName, m)] false with + match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap m true OpenQualified env.eNameResEnv ad (ident (modName, m)) [] false with | Result [] | Exception _ -> error(Error(FSComp.SR.tcNumericLiteralRequiresModule(modName), m)) | Result ((_, mref, _) :: _) -> @@ -7227,8 +7251,12 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv /// for all custom operations. This adds them to the completion lists and prevents them being used as values inside /// the query. let env = - env |> ModifyNameResEnv (fun nenv -> (nenv, customOperationMethods) ||> Seq.fold (fun nenv (nm, _, _, _, _, _, _, _, methInfo) -> - AddFakeNameToNameEnv nm nenv (Item.CustomOperation (nm, (fun () -> customOpUsageText (ident (nm, mBuilderVal))), Some methInfo)))) + if List.isEmpty customOperationMethods then env else + { env with + eNameResEnv = + (env.eNameResEnv, customOperationMethods) + ||> Seq.fold (fun nenv (nm, _, _, _, _, _, _, _, methInfo) -> + AddFakeNameToNameEnv nm nenv (Item.CustomOperation (nm, (fun () -> customOpUsageText (ident (nm, mBuilderVal))), Some methInfo))) } // Environment is needed for completions CallEnvSink cenv.tcSink (comp.Range, env.NameEnv, ad) @@ -7477,13 +7505,13 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv | StripApps(SingleIdent nm, [StripApps(SingleIdent nm2, args); arg2]) when PrettyNaming.IsInfixOperator nm.idText && expectedArgCountForCustomOperator nm2 > 0 && - args.Length > 0 -> + not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range arg2.Range errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments)) true | SynExpr.Tuple( (StripApps(SingleIdent nm2, args) :: _), _, m) when expectedArgCountForCustomOperator nm2 > 0 && - args.Length > 0 -> + not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range m.EndRange errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments)) true @@ -8256,6 +8284,7 @@ and TcSequenceExpression cenv env tpenv comp overallTy m = // seq { ...; expr } is treated as 'seq { ... ; expr; yield! Seq.empty }' // Note this means seq { ...; () } is treated as 'seq { ... ; (); yield! Seq.empty }' let m = comp.Range + let env = { env with eContextInfo = ContextInfo.SequenceExpression genOuterTy } let expr, tpenv = TcStmtThatCantBeCtorBody cenv env tpenv comp Expr.Sequential(expr, mkSeqEmpty cenv env m genOuterTy, NormalSeq, SuppressSequencePointOnStmtOfSequential, m), tpenv @@ -9031,9 +9060,28 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela match item with | Item.MethodGroup (methodName, minfos, _) -> let atomicFlag, tyargsOpt, args, delayed, tpenv = GetSynMemberApplicationArgs delayed tpenv - // We pass PossiblyMutates here because these may actually mutate a value type object - // To get better warnings we special case some of the few known mutate-a-struct method names - let mutates = (if methodName = "MoveNext" || methodName = "GetNextArg" then DefinitelyMutates else PossiblyMutates) + + // Work out whether the operation is a mutating one. + // See https://github.com/Microsoft/visualfsharp/issues/3923#issuecomment-345318094 for more details. + let mutates = + + // Diagnostic heuristic: In very early F# design we also decided to special case two method names as DefinitelyMutates. + // These occur on mutable structs used for iterators. + if methodName = "MoveNext" || methodName = "GetNextArg" then + DefinitelyMutates + + // Diagnostic heuristic: If the method name starts with "Set" or "set_" and has 'void' or 'unit' return type then we pass LikelyMutates, + // which will cause a strong (on-by-default) warning to be reported if the method is not used on a mutable struct value. + elif (methodName.StartsWith("Set") || methodName.StartsWith("set_")) && + minfos |> List.forall (fun minfo -> minfo.GetCompiledReturnTy(cenv.amap, mItem, minfo.FormalMethodInst) |> Option.isNone) then + LikelyMutates + + // All other operations are "PossiblyMutates" which generate + // - a strong (on-by-default) diagnostic for mutable F# structs. + // - a weak (off-by-default) diagnostic for .NET IL structs. + // See https://github.com/Microsoft/visualfsharp/issues/3923#issuecomment-345318094. + else + PossiblyMutates #if !NO_EXTENSIONTYPING match TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos, tyargsOpt, mExprAndItem, mItem) with @@ -10392,7 +10440,7 @@ and TcNormalizedBinding declKind (cenv:cenv) env tpenv overallTy safeThisValOpt let item = Item.ActivePatternResult(apinfo, cenv.g.unit_ty, i, tagRange) CallNameResolutionSink cenv.tcSink (tagRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights)) - ModifyNameResEnv (fun nenv -> AddActivePatternResultTagsToNameEnv apinfo nenv ty m) envinner + { envinner with eNameResEnv = AddActivePatternResultTagsToNameEnv apinfo envinner.eNameResEnv ty m } | None -> envinner @@ -10414,7 +10462,7 @@ and TcNormalizedBinding declKind (cenv:cenv) env tpenv overallTy safeThisValOpt else TcExprThatCantBeCtorBody cenv overallExprTy envinner tpenv rhsExpr) if bkind = StandaloneExpression && not cenv.isScript then - UnifyUnitType cenv env.DisplayEnv mBinding overallPatTy (Some rhsExprChecked) |> ignore + UnifyUnitType cenv env mBinding overallPatTy rhsExprChecked |> ignore // Fix up the r.h.s. expression for 'fixed' let rhsExprChecked = @@ -10606,13 +10654,13 @@ and TcAttribute canFail cenv (env: TcEnv) attrTgt (synAttr: SynAttribute) = attributeAssignedNamedItems |> List.map (fun (CallerNamedArg(id, CallerArg(argtyv, m, isOpt, callerArgExpr))) -> if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m)) let m = callerArgExpr.Range - let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad [id] IgnoreOverrides TypeNameResolutionInfo.Default ty + let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad id IgnoreOverrides TypeNameResolutionInfo.Default ty let nm, isProp, argty = match setterItem with | Item.Property (_, [pinfo]) -> if not pinfo.HasSetter then errorR(Error(FSComp.SR.tcPropertyCannotBeSet0(), m)) - id.idText, true, pinfo.GetPropertyType(cenv.amap, m) + id.idText, true, pinfo.GetPropertyType(cenv.amap, m) | Item.ILField finfo -> CheckILFieldInfoAccessible cenv.g cenv.amap m ad finfo CheckILFieldAttributes cenv.g finfo m @@ -11235,7 +11283,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue overridesOK isGeneratedEventVal cenv let prelimTyscheme = TypeScheme(enclosingDeclaredTypars@declaredTypars, ty) let partialValReprInfo = TranslateTopValSynInfo mBinding (TcAttributes cenv envinner) valSynInfo let topValInfo = UseSyntacticArity declKind prelimTyscheme partialValReprInfo - let hasDeclaredTypars = declaredTypars.Length > 0 + let hasDeclaredTypars = not (List.isEmpty declaredTypars) let prelimValScheme = ValScheme(bindingId, prelimTyscheme, topValInfo, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) // Check the literal r.h.s., if any @@ -11880,12 +11928,12 @@ module TcRecdUnionAndEnumDeclarations = begin | ParentNone -> vis | Parent tcref -> combineAccess vis tcref.TypeReprAccessibility - let MakeRecdFieldSpec _cenv env parent (isStatic, konst, ty', attrsForProperty, attrsForField, id, isMutable, vol, xmldoc, vis, m) = + let MakeRecdFieldSpec _cenv env parent (isStatic, konst, ty', attrsForProperty, attrsForField, id, nameGenerated, isMutable, vol, xmldoc, vis, m) = let vis, _ = ComputeAccessAndCompPath env None m vis None parent let vis = CombineReprAccess parent vis - NewRecdField isStatic konst id ty' isMutable vol attrsForProperty attrsForField xmldoc vis false + NewRecdField isStatic konst id nameGenerated ty' isMutable vol attrsForProperty attrsForField xmldoc vis false - let TcFieldDecl cenv env parent isIncrClass tpenv (isStatic, synAttrs, id, ty, isMutable, xmldoc, vis, m) = + let TcFieldDecl cenv env parent isIncrClass tpenv (isStatic, synAttrs, id, nameGenerated, ty, isMutable, xmldoc, vis, m) = let attrs, _ = TcAttributesWithPossibleTargets false cenv env AttributeTargets.FieldDecl synAttrs let attrsForProperty, attrsForField = attrs |> List.partition (fun (attrTargets, _) -> (attrTargets &&& AttributeTargets.Property) <> enum 0) let attrsForProperty = (List.map snd attrsForProperty) @@ -11904,7 +11952,7 @@ module TcRecdUnionAndEnumDeclarations = begin if isIncrClass && (not zeroInit || not isMutable) then errorR(Error(FSComp.SR.tcUninitializedValFieldsMustBeMutable(), m)) if isStatic && (not zeroInit || not isMutable || vis <> Some SynAccess.Private ) then errorR(Error(FSComp.SR.tcStaticValFieldsMustBeMutableAndPrivate(), m)) let konst = if zeroInit then Some Const.Zero else None - let rfspec = MakeRecdFieldSpec cenv env parent (isStatic, konst, ty', attrsForProperty, attrsForField, id, isMutable, isVolatile, xmldoc, vis, m) + let rfspec = MakeRecdFieldSpec cenv env parent (isStatic, konst, ty', attrsForProperty, attrsForField, id, nameGenerated, isMutable, isVolatile, xmldoc, vis, m) match parent with | Parent tcref when useGenuineField tcref.Deref rfspec -> // Recheck the attributes for errors if the definition only generates a field @@ -11915,7 +11963,7 @@ module TcRecdUnionAndEnumDeclarations = begin let TcAnonFieldDecl cenv env parent tpenv nm (Field(attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m)) = let id = (match idOpt with None -> mkSynId m nm | Some id -> id) - let f = TcFieldDecl cenv env parent false tpenv (isStatic, attribs, id, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) + let f = TcFieldDecl cenv env parent false tpenv (isStatic, attribs, id, idOpt.IsNone, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) match idOpt with | None -> () | Some id -> @@ -11927,7 +11975,7 @@ module TcRecdUnionAndEnumDeclarations = begin let TcNamedFieldDecl cenv env parent isIncrClass tpenv (Field(attribs, isStatic, id, ty, isMutable, xmldoc, vis, m)) = match id with | None -> error (Error(FSComp.SR.tcFieldRequiresName(), m)) - | Some(id) -> TcFieldDecl cenv env parent isIncrClass tpenv (isStatic, attribs, id, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) + | Some(id) -> TcFieldDecl cenv env parent isIncrClass tpenv (isStatic, attribs, id, false, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) let TcNamedFieldDecls cenv env parent isIncrClass tpenv fields = fields |> List.map (TcNamedFieldDecl cenv env parent isIncrClass tpenv) @@ -11990,7 +12038,7 @@ module TcRecdUnionAndEnumDeclarations = begin let rfields = argtys |> List.mapi (fun i (argty, argInfo) -> let id = (match argInfo.Name with Some id -> id | None -> mkSynId m (mkName nFields i)) - MakeRecdFieldSpec cenv env parent (false, None, argty, [], [], id, false, false, XmlDoc.Empty, None, m)) + MakeRecdFieldSpec cenv env parent (false, None, argty, [], [], id, argInfo.Name.IsNone, false, false, XmlDoc.Empty, None, m)) if not (typeEquiv cenv.g recordTy thisTy) then error(Error(FSComp.SR.tcReturnTypesForUnionMustBeSameAsType(), m)) rfields, recordTy @@ -12012,7 +12060,7 @@ module TcRecdUnionAndEnumDeclarations = begin let vis, _ = ComputeAccessAndCompPath env None m None None parent let vis = CombineReprAccess parent vis if id.idText = "value__" then errorR(Error(FSComp.SR.tcNotValidEnumCaseName(), id.idRange)) - NewRecdField true (Some v) id thisTy false false [] attrs (xmldoc.ToXmlDoc()) vis false + NewRecdField true (Some v) id false thisTy false false [] attrs (xmldoc.ToXmlDoc()) vis false let TcEnumDecls cenv env parent thisTy enumCases = let fieldTy = NewInferenceType () @@ -12055,10 +12103,13 @@ let TcTyconMemberSpecs cenv env containerInfo declKind tpenv (augSpfn: SynMember let TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap (longId : Ident list) = let ad = env.eAccessRights - let m = longId |> List.map (fun id -> id.idRange) |> List.reduce unionRanges - match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap m OpenQualified env.eNameResEnv ad longId true with - | Result res -> Result res - | Exception err -> raze err + match longId with + | [] -> Result [] + | id::rest -> + let m = longId |> List.map (fun id -> id.idRange) |> List.reduce unionRanges + match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap m true OpenQualified env.eNameResEnv ad id rest true with + | Result res -> Result res + | Exception err -> raze err let TcOpenDecl tcSink (g:TcGlobals) amap m scopem env (longId : Ident list) = let modrefs = ForceRaise (TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap longId) @@ -12267,7 +12318,7 @@ module IncrClassChecking = let taccess = TAccess [cpath] let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute v.Attribs - NewRecdField isStatic None id ty v.IsMutable isVolatile [(*no property attributes*)] v.Attribs v.XmlDoc taccess (*compiler generated:*)true + NewRecdField isStatic None id false ty v.IsMutable isVolatile [(*no property attributes*)] v.Attribs v.XmlDoc taccess (*compiler generated:*)true /// Indicates how is a 'let' bound value in a class with implicit construction is represented in /// the TAST ultimately produced by type checking. @@ -13555,16 +13606,21 @@ module MutRecBindingChecking = /// Check a "module X = A.B.C" module abbreviation declaration let TcModuleAbbrevDecl (cenv:cenv) scopem env (id, p, m) = let ad = env.eAccessRights - let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false) - let modrefs = mvvs |> List.map p23 - if modrefs.Length > 0 && modrefs |> List.forall (fun modref -> modref.IsNamespace) then + let resolved = + match p with + | [] -> Result [] + | id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false + let mvvs = ForceRaise resolved + if isNil mvvs then env else + let modrefs = mvvs |> List.map p23 + if not (isNil modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head modrefs)), m)) let modrefs = modrefs |> List.filter (fun mvv -> not mvv.IsNamespace) + if isNil modrefs then env else modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult) - let env = (if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env else env) + let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env env - /// Update the contents accessible via the recursive namespace declaration, if any let TcMutRecDefns_UpdateNSContents mutRecNSInfo = match mutRecNSInfo with @@ -14321,7 +14377,7 @@ module TcExceptionDeclarations = | None -> TExnFresh (MakeRecdFieldsTable args') - exnc.entity_exn_info <- repr + exnc.SetExceptionInfo repr let item = Item.ExnCase(mkLocalTyconRef exnc) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) @@ -14628,10 +14684,10 @@ module EstablishTypeDefinitionCores = tycon.SetIsStructRecordOrUnion isStructRecordOrUnionType // Set the compiled name, if any - tycon.entity_compiled_name <- TryFindFSharpStringAttribute cenv.g cenv.g.attrib_CompiledNameAttribute attrs + tycon.SetCompiledName (TryFindFSharpStringAttribute cenv.g cenv.g.attrib_CompiledNameAttribute attrs) if hasMeasureAttr then - tycon.entity_kind <- TyparKind.Measure + tycon.SetTypeOrMeasureKind TyparKind.Measure if not (isNil typars) then error(Error(FSComp.SR.tcMeasureDefinitionsCannotHaveTypeParameters(), m)) let repr = @@ -14953,7 +15009,7 @@ module EstablishTypeDefinitionCores = errorR(Deprecated(FSComp.SR.tcTypeAbbreviationHasTypeParametersMissingOnType(), tycon.Range)) if firstPass then - tycon.entity_tycon_abbrev <- Some ty + tycon.SetTypeAbbrev (Some ty) | _ -> () @@ -15111,10 +15167,10 @@ module EstablishTypeDefinitionCores = if allowed then if kind = explicitKind then warning(PossibleUnverifiableCode(m)) - elif thisTyconRef.Typars(m).Length > 0 then - errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m)) - else + elif List.isEmpty (thisTyconRef.Typars m) then errorR (Error(FSComp.SR.tcOnlyStructsCanHaveStructLayout(), m)) + else + errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m)) | None -> () let hiddenReprChecks(hasRepr) = @@ -15272,7 +15328,7 @@ module EstablishTypeDefinitionCores = let ty = names.[arg].Type let id = names.[arg].Ident let taccess = TAccess [envinner.eAccessPath] - yield NewRecdField false None id ty false false [(*no property attributes*)] [(*no field attributes *)] XmlDoc.Empty taccess (*compiler generated:*)true ] + yield NewRecdField false None id false ty false false [(*no property attributes*)] [(*no field attributes *)] XmlDoc.Empty taccess (*compiler generated:*)true ] (userFields @ implicitStructFields) |> CheckDuplicates (fun f -> f.Id) "field" |> ignore writeFakeRecordFieldsToSink userFields @@ -15387,7 +15443,7 @@ module EstablishTypeDefinitionCores = noCLIMutableAttributeCheck() noSealedAttributeCheck FSComp.SR.tcTypesAreAlwaysSealedEnum noAllowNullLiteralAttributeCheck() - let vfld = NewRecdField false None (ident("value__", m)) fieldTy false false [] [] XmlDoc.Empty taccessPublic true + let vfld = NewRecdField false None (ident("value__", m)) false fieldTy false false [] [] XmlDoc.Empty taccessPublic true if not (ListSet.contains (typeEquiv cenv.g) fieldTy [ cenv.g.int32_ty; cenv.g.int16_ty; cenv.g.sbyte_ty; cenv.g.int64_ty; cenv.g.char_ty; cenv.g.bool_ty; cenv.g.uint32_ty; cenv.g.uint16_ty; cenv.g.byte_ty; cenv.g.uint64_ty ]) then errorR(Error(FSComp.SR.tcInvalidTypeForLiteralEnumeration(), m)) @@ -15470,7 +15526,7 @@ module EstablishTypeDefinitionCores = graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes - tycon.entity_tycon_abbrev <- None + tycon.SetTypeAbbrev None tycon.entity_tycon_repr <- TNoRepr errorR(Error(FSComp.SR.tcTypeDefinitionIsCyclic(), tycon.Range))) @@ -15605,7 +15661,7 @@ module EstablishTypeDefinitionCores = graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes - tycon.entity_tycon_abbrev <- None + tycon.SetTypeAbbrev None tycon.entity_tycon_repr <- TNoRepr errorR(Error(FSComp.SR.tcTypeDefinitionIsCyclicThroughInheritance(), tycon.Range))) @@ -16338,20 +16394,23 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS | SynModuleSigDecl.ModuleAbbrev (id, p, m) -> let ad = env.eAccessRights - let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false) + let resolved = + match p with + | [] -> Result [] + | id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false + let mvvs = ForceRaise resolved let scopem = unionRanges m endm let unfilteredModrefs = mvvs |> List.map p23 let modrefs = unfilteredModrefs |> List.filter (fun modref -> not modref.IsNamespace) - if unfilteredModrefs.Length > 0 && List.isEmpty modrefs then + if not (List.isEmpty unfilteredModrefs) && List.isEmpty modrefs then errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head unfilteredModrefs)), m)) + if List.isEmpty modrefs then return env else modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult) - let env = - if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env - else env + let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env return env | SynModuleSigDecl.HashDirective _ -> diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 2444a699a81..1963b00ed34 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -100,7 +100,7 @@ type XmlDoc = | (lineA::rest) as lines -> let lineAT = lineA.TrimStart([|' '|]) if lineAT = "" then processLines rest - else if String.hasPrefix lineAT "<" then lines + else if lineAT.StartsWith "<" then lines else [""] @ (lines |> List.map (fun line -> Microsoft.FSharp.Core.XmlAdapters.escape(line))) @ [""] diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index f6d7b4c6b8f..699b6c52ec8 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -751,14 +751,8 @@ module MainModuleBuilder = // We want to write forwarders out for all injected types except for System.ITuple, which is internal // Forwarding System.ITuple will cause FxCop failures on 4.0 Set.union (Set.filter (fun t -> t <> "System.ITuple") injectedCompatTypes) typesForwardedToMscorlib |> - Seq.map (fun t -> - { ScopeRef = tcGlobals.ilg.primaryAssemblyScopeRef - Name = t - IsForwarder = true - Access = ILTypeDefAccess.Public - Nested = mkILNestedExportedTypes List.empty - CustomAttrs = mkILCustomAttrs List.empty }) |> - Seq.toList + Seq.map (fun t -> mkTypeForwarder (tcGlobals.ilg.primaryAssemblyScopeRef) t (mkILNestedExportedTypes List.empty) (mkILCustomAttrs List.empty) ILTypeDefAccess.Public ) + |> Seq.toList let createSystemNumericsExportList (tcConfig: TcConfig) (tcImports:TcImports) = let refNumericsDllName = @@ -778,8 +772,7 @@ module MainModuleBuilder = Seq.map (fun t -> { ScopeRef = ILScopeRef.Assembly(systemNumericsAssemblyRef) Name = t - IsForwarder = true - Access = ILTypeDefAccess.Public + Attributes = enum(0x00200000) ||| TypeAttributes.Public Nested = mkILNestedExportedTypes List.empty CustomAttrs = mkILCustomAttrs List.empty }) |> Seq.toList @@ -1415,12 +1408,16 @@ module StaticLinker = if allTypeDefsInProviderGeneratedAssemblies.ContainsKey ilOrigTyRef then let ilOrigTypeDef = allTypeDefsInProviderGeneratedAssemblies.[ilOrigTyRef] if debugStaticLinking then printfn "Relocating %s to %s " ilOrigTyRef.QualifiedName ilTgtTyRef.QualifiedName + let ilOrigTypeDef = + if isNested then + ilOrigTypeDef + .WithAccess(match ilOrigTypeDef.Access with + | ILTypeDefAccess.Public -> ILTypeDefAccess.Nested ILMemberAccess.Public + | ILTypeDefAccess.Private -> ILTypeDefAccess.Nested ILMemberAccess.Private + | _ -> ilOrigTypeDef.Access) + else ilOrigTypeDef { ilOrigTypeDef with Name = ilTgtTyRef.Name - Access = (match ilOrigTypeDef.Access with - | ILTypeDefAccess.Public when isNested -> ILTypeDefAccess.Nested ILMemberAccess.Public - | ILTypeDefAccess.Private when isNested -> ILTypeDefAccess.Nested ILMemberAccess.Assembly - | x -> x) NestedTypes = mkILTypeDefs (List.map buildRelocatedGeneratedType ch) } else // If there is no matching IL type definition, then make a simple container class @@ -1635,7 +1632,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie let directoryBuildingFrom = Directory.GetCurrentDirectory() let setProcessThreadLocals tcConfigB = tcConfigB.openBinariesInMemory <- openBinariesInMemory -#if PREFERRED_UI_LANG match tcConfigB.preferredUiLang with #if FX_RESHAPED_GLOBALIZATION | Some s -> System.Globalization.CultureInfo.CurrentUICulture <- new System.Globalization.CultureInfo(s) @@ -1643,11 +1639,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie | Some s -> Thread.CurrentThread.CurrentUICulture <- new System.Globalization.CultureInfo(s) #endif | None -> () -#else - match tcConfigB.lcid with - | Some n -> Thread.CurrentThread.CurrentUICulture <- new CultureInfo(n) - | None -> () -#endif if tcConfigB.utf8output then Console.OutputEncoding <- Encoding.UTF8 @@ -1975,7 +1966,7 @@ let main2b (tcImportsCapture,dynamicAssemblyCreator) (Args (ctok, tcConfig: TcCo // remove any security attributes from the top-level assembly attribute list let topAttrs = {topAttrs with assemblyAttrs=topAssemblyAttrs} let permissionSets = ilxGenerator.CreatePermissionSets securityAttrs - let secDecls = if securityAttrs.Length > 0 then mkILSecurityDecls permissionSets else emptyILSecurityDecls + let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets let ilxMainModule = MainModuleBuilder.CreateMainModule (ctok, tcConfig, tcGlobals, tcImports, pdbfile, assemblyName, outfile, topAttrs, idata, optDataResources, codegenResults, assemVerFromAttrib, metadataVersion, secDecls) diff --git a/src/fsharp/fscmain.fs b/src/fsharp/fscmain.fs index 9405af123bb..344656d6b52 100644 --- a/src/fsharp/fscmain.fs +++ b/src/fsharp/fscmain.fs @@ -48,7 +48,14 @@ module Driver = failwithf "%s" <| FSComp.SR.elSysEnvExitDidntExit() } - mainCompile (ctok, argv, MSBuildReferenceResolver.Resolver, (*bannerAlreadyPrinted*)false, (*openBinariesInMemory*)false, (*defaultCopyFSharpCore*)true, quitProcessExiter, ConsoleLoggerProvider(), None, None) + let legacyReferenceResolver = +#if CROSS_PLATFORM_COMPILER + SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver +#else + MSBuildReferenceResolver.Resolver +#endif + + mainCompile (ctok, argv, legacyReferenceResolver, (*bannerAlreadyPrinted*)false, (*openBinariesInMemory*)false, (*defaultCopyFSharpCore*)true, quitProcessExiter, ConsoleLoggerProvider(), None, None) 0 [] diff --git a/src/fsharp/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj index e5a435cf6dc..91fa598e7cc 100644 --- a/src/fsharp/fsi/Fsi.fsproj +++ b/src/fsharp/fsi/Fsi.fsproj @@ -20,7 +20,6 @@ $(NoWarn);62 fsi 0x0A000000 - COMPILER;$(DefineConstants) FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) FSI_SERVER;$(DefineConstants) true diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/app.config index 7e6dfe30097..6409add7b66 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/app.config @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 1fb69f2fc4b..b0d55326c4a 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -1593,7 +1593,7 @@ module internal MagicAssemblyResolution = // It is an explicit user trust decision to load an assembly with #r. Scripts are not run automatically (for example, by double-clicking in explorer). // We considered setting loadFromRemoteSources in fsi.exe.config but this would transitively confer unsafe loading to the code in the referenced // assemblies. Better to let those assemblies decide for themselves which is safer. -#if FSI_TODO_NETCORE +#if NETSTANDARD1_6 || NETSTANDARD2_0 Assembly.LoadFrom(path) #else Assembly.UnsafeLoadFrom(path) @@ -1601,7 +1601,7 @@ module internal MagicAssemblyResolution = let Install(tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput) = -#if FSI_TODO_NETCORE +#if NETSTANDARD1_6 || NETSTANDARD2_0 ignore tcConfigB ignore tcImports ignore fsiDynamicCompiler @@ -2029,7 +2029,7 @@ type internal FsiInteractionProcessor // When the last declaration has a shape of DoExp (i.e., non-binding), // transform it to a shape of "let it = ", so we can refer it. - let defsA = if defsA.Length <= 1 || defsB.Length > 0 then defsA else + let defsA = if defsA.Length <= 1 || not (List.isEmpty defsB) then defsA else match List.headAndTail (List.rev defsA) with | SynModuleDecl.DoExpr(_,exp,_), rest -> (rest |> List.rev) @ (fsiDynamicCompiler.BuildItBinding exp) | _ -> defsA @@ -2419,22 +2419,9 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i // We later switch to doing interaction-by-interaction processing on the "event loop" thread. let ctokStartup = AssumeCompilationThreadWithoutEvidence () -#if FX_LCIDFROMCODEPAGE - - // See Bug 735819 - let lcidFromCodePage = - if (Console.OutputEncoding.CodePage <> 65001) && - (Console.OutputEncoding.CodePage <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) && - (Console.OutputEncoding.CodePage <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) then - Thread.CurrentThread.CurrentUICulture <- new CultureInfo("en-US") - Some 1033 - else - None -#endif - let timeReporter = FsiTimeReporter(outWriter) -#if !FX_RESHAPED_CONSOLE +#if !FX_REDUCED_CONSOLE //---------------------------------------------------------------------------- // Console coloring //---------------------------------------------------------------------------- @@ -2463,7 +2450,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i do tcConfigB.resolutionEnvironment <- ResolutionEnvironment.CompilationAndEvaluation // See Bug 3608 do tcConfigB.useFsiAuxLib <- fsi.UseFsiAuxLib -#if FSI_TODO_NETCORE +#if NETSTANDARD1_6 || NETSTANDARD2_0 do tcConfigB.useSimpleResolution <- true do SetTargetProfile tcConfigB "netcore" // always assume System.Runtime codegen #endif @@ -2473,7 +2460,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i do SetDebugSwitch tcConfigB (Some "pdbonly") OptionSwitch.On do SetTailcallSwitch tcConfigB OptionSwitch.On -#if !FSI_TODO_NETCORE +#if NETSTANDARD1_6 || NETSTANDARD2_0 // set platform depending on whether the current process is a 64-bit process. // BUG 429882 : FsiAnyCPU.exe issues warnings (x64 v MSIL) when referencing 64-bit assemblies do tcConfigB.platform <- if IntPtr.Size = 8 then Some AMD64 else Some X86 @@ -2494,19 +2481,14 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let fsiOptions = FsiCommandLineOptions(fsi, argv, tcConfigB, fsiConsoleOutput) let fsiConsolePrompt = FsiConsolePrompt(fsiOptions, fsiConsoleOutput) - // Check if we have a codepage from the console -#if FX_LCIDFROMCODEPAGE do - match fsiOptions.FsiLCID with - | Some _ -> () - | None -> tcConfigB.lcid <- lcidFromCodePage - - // Set the ui culture - do - match fsiOptions.FsiLCID with - | Some(n) -> Thread.CurrentThread.CurrentUICulture <- new CultureInfo(n) - | None -> () + match tcConfigB.preferredUiLang with +#if FX_RESHAPED_GLOBALIZATION + | Some s -> System.Globalization.CultureInfo.CurrentUICulture <- new System.Globalization.CultureInfo(s) +#else + | Some s -> Thread.CurrentThread.CurrentUICulture <- new System.Globalization.CultureInfo(s) #endif + | None -> () #if !FX_NO_SERVERCODEPAGES do diff --git a/src/fsharp/fsi/fsimain.fs b/src/fsharp/fsi/fsimain.fs index b87c795a605..002cfa54a4f 100644 --- a/src/fsharp/fsi/fsimain.fs +++ b/src/fsharp/fsi/fsimain.fs @@ -235,6 +235,12 @@ let evaluateSession(argv: string[]) = None #endif + let legacyReferenceResolver = +#if CROSS_PLATFORM_COMPILER + SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver +#else + MSBuildReferenceResolver.Resolver +#endif // Update the configuration to include 'StartServer', WinFormsEventLoop and 'GetOptionalConsoleReadLine()' let rec fsiConfig = { new FsiEvaluationSessionHostConfig () with @@ -251,21 +257,21 @@ let evaluateSession(argv: string[]) = member __.ReportUserCommandLineArgs args = fsiConfig0.ReportUserCommandLineArgs args member __.EventLoopRun() = #if !FX_NO_WINFORMS - match fsiWinFormsLoop.Value with + match (if fsiSession.IsGui then fsiWinFormsLoop.Value else None) with | Some l -> (l :> IEventLoop).Run() | _ -> #endif fsiConfig0.EventLoopRun() member __.EventLoopInvoke(f) = #if !FX_NO_WINFORMS - match fsiWinFormsLoop.Value with + match (if fsiSession.IsGui then fsiWinFormsLoop.Value else None) with | Some l -> (l :> IEventLoop).Invoke(f) | _ -> #endif fsiConfig0.EventLoopInvoke(f) member __.EventLoopScheduleRestart() = #if !FX_NO_WINFORMS - match fsiWinFormsLoop.Value with + match (if fsiSession.IsGui then fsiWinFormsLoop.Value else None) with | Some l -> (l :> IEventLoop).ScheduleRestart() | _ -> #endif @@ -279,7 +285,7 @@ let evaluateSession(argv: string[]) = member __.GetOptionalConsoleReadLine(probe) = getConsoleReadLine(probe) } // Create the console - and fsiSession = FsiEvaluationSession.Create (fsiConfig, argv, Console.In, Console.Out, Console.Error, collectible=false, legacyReferenceResolver=MSBuildReferenceResolver.Resolver) + and fsiSession : FsiEvaluationSession = FsiEvaluationSession.Create (fsiConfig, argv, Console.In, Console.Out, Console.Error, collectible=false, legacyReferenceResolver=legacyReferenceResolver) #if !FX_NO_WINFORMS diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj index dfd78843ceb..c4d3bd1f4f5 100644 --- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj +++ b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj @@ -15,7 +15,6 @@ $(NoWarn);62 fsiAnyCpu 0x0A000000 - COMPILER;$(DefineConstants) FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) FSI_SERVER;$(DefineConstants) true diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/app.config index 26007af4c54..75abd583188 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/app.config @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 1a636574fe1..ca5cb778136 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -790,10 +790,7 @@ type ILMethInfo = member x.IsFinal = x.RawMetadata.IsFinal /// Indicates if the IL method is marked abstract. - member x.IsAbstract = - match x.RawMetadata.mdKind with - | MethodKind.Virtual vinfo -> vinfo.IsAbstract - | _ -> false + member x.IsAbstract = x.RawMetadata.IsAbstract /// Does it appear to the user as a static method? member x.IsStatic = @@ -801,10 +798,7 @@ type ILMethInfo = x.RawMetadata.CallingConv.IsStatic /// Does it have the .NET IL 'newslot' flag set, and is also a virtual? - member x.IsNewSlot = - match x.RawMetadata.mdKind with - | MethodKind.Virtual vinfo -> vinfo.IsNewSlot - | _ -> false + member x.IsNewSlot = x.RawMetadata.IsNewSlot /// Does it appear to the user as an instance method? member x.IsInstance = not x.IsConstructor && not x.IsStatic @@ -1183,7 +1177,11 @@ type MethInfo = | _ -> failwith "not supported" /// Indicates if this is an extension member. - member x.IsExtensionMember = x.IsCSharpStyleExtensionMember || x.IsFSharpStyleExtensionMember + member x.IsExtensionMember = + match x with + | FSMeth (_,_,vref,pri) -> pri.IsSome || vref.IsExtensionMember + | ILMeth (_,_,Some _) -> true + | _ -> false /// Indicates if this is an F# extension member. member x.IsFSharpStyleExtensionMember = @@ -1191,8 +1189,10 @@ type MethInfo = /// Indicates if this is an C#-style extension member. member x.IsCSharpStyleExtensionMember = - x.ExtensionMemberPriorityOption.IsSome && - (match x with ILMeth _ -> true | FSMeth (_,_,vref,_) -> not vref.IsExtensionMember | _ -> false) + match x with + | FSMeth (_,_,vref,Some _) -> not vref.IsExtensionMember + | ILMeth (_,_,Some _) -> true + | _ -> false /// Add the actual type instantiation of the apparent type of an F# extension method. // @@ -1240,6 +1240,7 @@ type MethInfo = /// Tests whether two method infos have the same underlying definition. /// Used to merge operator overloads collected from left and right of an operator constraint. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member MethInfosUseIdenticalDefinitions x1 x2 = match x1,x2 with | ILMeth(_,x1,_), ILMeth(_,x2,_) -> (x1.RawMetadata === x2.RawMetadata) @@ -1250,8 +1251,7 @@ type MethInfo = #endif | _ -> false - /// Calculates a hash code of method info. Note: this is a very imperfect implementation, - /// but it works decently for comparing methods in the language service... + /// Calculates a hash code of method info. Must be compatible with ItemsAreEffectivelyEqual relation. member x.ComputeHashCode() = match x with | ILMeth(_,x1,_) -> hash x1.RawMetadata.Name @@ -1689,6 +1689,8 @@ type ILFieldInfo = | ProvidedField(amap,fi,m) -> Import.ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType),m)) #endif + /// Tests whether two infos have the same underlying definition. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member ILFieldInfosUseIdenticalDefinitions x1 x2 = match x1,x2 with | ILFieldInfo(_, x1), ILFieldInfo(_, x2) -> (x1 === x2) @@ -1698,6 +1700,10 @@ type ILFieldInfo = #endif /// Get an (uninstantiated) reference to the field as an Abstract IL ILFieldRef member x.ILFieldRef = rescopeILFieldRef x.ScopeRef (mkILFieldRef(x.ILTypeRef,x.FieldName,x.ILFieldType)) + + /// Calculates a hash code of field info. Must be compatible with ItemsAreEffectivelyEqual relation. + member x.ComputeHashCode() = hash x.FieldName + override x.ToString() = x.FieldName @@ -2156,8 +2162,8 @@ type PropInfo = | FSProp _ -> failwith "no setter method" /// Test whether two property infos have the same underlying definition. - /// /// Uses the same techniques as 'MethInfosUseIdenticalDefinitions'. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member PropInfosUseIdenticalDefinitions x1 x2 = let optVrefEq g = function | Some(v1), Some(v2) -> valRefEq g v1 v2 @@ -2172,7 +2178,7 @@ type PropInfo = #endif | _ -> false - /// Calculates a hash code of property info (similar as previous) + /// Calculates a hash code of property info. Must be compatible with ItemsAreEffectivelyEqual relation. member pi.ComputeHashCode() = match pi with | ILProp ilpinfo -> hash ilpinfo.RawMetadata.Name @@ -2411,6 +2417,7 @@ type EventInfo = /// Test whether two event infos have the same underlying definition. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member EventInfosUseIdenticalDefintions x1 x2 = match x1, x2 with | FSEvent(g, pi1, vrefa1, vrefb1), FSEvent(_, pi2, vrefa2, vrefb2) -> @@ -2422,6 +2429,7 @@ type EventInfo = | _ -> false /// Calculates a hash code of event info (similar as previous) + /// Must be compatible with ItemsAreEffectivelyEqual relation. member ei.ComputeHashCode() = match ei with | ILEvent ileinfo -> hash ileinfo.RawMetadata.Name diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index c36b1886418..267b5d566fa 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -3631,6 +3631,13 @@ atomicExprQualification: | identOrOp { let idm = rhs parseState 1 (fun e lhsm dotm -> mkSynDot dotm lhsm e $1) } + + | GLOBAL + { (fun e lhsm dotm -> + reportParseErrorAt (rhs parseState 3) (FSComp.SR.nrGlobalUsedOnlyAsFirstName()) + let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' + mkSynDotMissing dotm fixedLhsm e) } + | /* empty */ { (fun e lhsm dotm -> reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) diff --git a/src/fsharp/range.fs b/src/fsharp/range.fs index aed660be56c..d1da4643be9 100755 --- a/src/fsharp/range.fs +++ b/src/fsharp/range.fs @@ -140,7 +140,11 @@ let fileOfFileIndex n = fileIndexTable.IndexToFile(n) let mkPos l c = pos (l, c) [] +#if DEBUG +[ {DebugCode}")>] +#else [] +#endif type range(code:int64) = static member Zero = range(0L) new (fidx, bl, bc, el, ec) = @@ -163,6 +167,19 @@ type range(code:int64) = 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 +#if DEBUG + member r.DebugCode = + try + let endCol = r.EndColumn - 1 + let startCol = r.StartColumn - 1 + File.ReadAllLines(r.FileName) + |> Seq.skip (r.StartLine - 1) + |> Seq.take (r.EndLine - r.StartLine + 1) + |> String.concat "\n" + |> fun s -> s.Substring(startCol + 1, s.LastIndexOf("\n") + 1 - startCol + endCol) + 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 diff --git a/src/fsharp/service/ServiceAnalysis.fs b/src/fsharp/service/ServiceAnalysis.fs index d8b05a2d063..b34fce79973 100644 --- a/src/fsharp/service/ServiceAnalysis.fs +++ b/src/fsharp/service/ServiceAnalysis.fs @@ -5,26 +5,31 @@ namespace Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.Range +open Microsoft.FSharp.Compiler.PrettyNaming +open System.Collections.Generic +open System.Runtime.CompilerServices module UnusedOpens = - open Microsoft.FSharp.Compiler.PrettyNaming - open System.Runtime.CompilerServices - type Module = - { Entity: FSharpEntity - IsNestedAutoOpen: bool } + let symbolHash = HashIdentity.FromFunctions (fun (x: FSharpSymbol) -> x.GetEffectivelySameAsHash()) (fun x y -> x.IsEffectivelySameAs(y)) - member this.ChildSymbols = - seq { for ent in this.Entity.NestedEntities do + /// Represents one namespace or module opened by an 'open' statement + type OpenedModule(entity: FSharpEntity, isNestedAutoOpen: bool) = + + /// Compute an indexed table of the set of symbols revealed by 'open', on-demand + let revealedSymbols : Lazy> = + lazy + let symbols = + [| for ent in entity.NestedEntities do yield ent :> FSharpSymbol if ent.IsFSharpRecord then for rf in ent.FSharpFields do - yield upcast rf + yield rf :> FSharpSymbol if ent.IsFSharpUnion && not (Symbol.hasAttribute ent.Attributes) then for unionCase in ent.UnionCases do - yield upcast unionCase + yield unionCase :> FSharpSymbol if Symbol.hasAttribute ent.Attributes then for fv in ent.MembersFunctionsAndValues do @@ -32,35 +37,45 @@ module UnusedOpens = // so we have to check Extension attribute instead. // (note: fv.IsExtensionMember has proper value for symbols returning by GetAllUsesOfAllSymbolsInFile though) if Symbol.hasAttribute fv.Attributes then - yield upcast fv + yield fv :> FSharpSymbol - for apCase in this.Entity.ActivePatternCases do - yield upcast apCase + for apCase in entity.ActivePatternCases do + yield apCase :> FSharpSymbol + + // The IsNamespace and IsFSharpModule cases are handled by looking at DeclaringEntity below + if not entity.IsNamespace && not entity.IsFSharpModule then + for fv in entity.MembersFunctionsAndValues do + yield fv :> FSharpSymbol |] + + HashSet<_>(symbols, symbolHash) - for fv in this.Entity.MembersFunctionsAndValues do - yield upcast fv - } |> Seq.cache + member __.Entity = entity + member __.IsNestedAutoOpen = isNestedAutoOpen + member __.RevealedSymbolsContains(symbol) = revealedSymbols.Force().Contains symbol - type ModuleGroup = - { Modules: Module list } + type OpenedModuleGroup = + { OpenedModules: OpenedModule list } static member Create (modul: FSharpEntity) = let rec getModuleAndItsAutoOpens (isNestedAutoOpen: bool) (modul: FSharpEntity) = - [ yield { Entity = modul; IsNestedAutoOpen = isNestedAutoOpen } + [ yield OpenedModule (modul, isNestedAutoOpen) for ent in modul.NestedEntities do if ent.IsFSharpModule && Symbol.hasAttribute ent.Attributes then yield! getModuleAndItsAutoOpens true ent ] - { Modules = getModuleAndItsAutoOpens false modul } + { OpenedModules = getModuleAndItsAutoOpens false modul } /// Represents single open statement. type OpenStatement = - { /// All modules which this open declaration effectively opens, _not_ including auto open ones. - Modules: ModuleGroup list - /// Range of open statement itself. + { /// All namespaces and modules which this open declaration effectively opens, including the AutoOpen ones + OpenedGroups: OpenedModuleGroup list + + /// The range of open statement itself Range: range - /// Scope on which this open declaration is applied. + + /// The scope on which this open declaration is applied AppliedScope: range } + /// Gets the open statements, their scopes and their resolutions let getOpenStatements (openDeclarations: FSharpOpenDeclaration list) : OpenStatement list = openDeclarations |> List.filter (fun x -> not x.IsOwnNamespace) @@ -70,90 +85,123 @@ module UnusedOpens = if firstId.idText = MangledGlobalName then None else - Some { Modules = openDecl.Modules |> List.map ModuleGroup.Create + Some { OpenedGroups = openDecl.Modules |> List.map OpenedModuleGroup.Create Range = range AppliedScope = openDecl.AppliedScope } | _ -> None) + /// Only consider symbol uses which are the first part of a long ident, i.e. with no qualifying identifiers let filterSymbolUses (getSourceLineStr: int -> string) (symbolUses: FSharpSymbolUse[]) : FSharpSymbolUse[] = symbolUses |> Array.filter (fun su -> match su.Symbol with | :? FSharpMemberOrFunctionOrValue as fv when fv.IsExtensionMember -> - // extension members should be taken into account even though they have a prefix (as they do most of the time) + // Extension members should be taken into account even though they have a prefix (as they do most of the time) true + | :? FSharpMemberOrFunctionOrValue as fv when not fv.IsModuleValueOrMember -> + // Local values can be ignored + false + | :? FSharpGenericParameter -> + // Generic parameters can be ignored, they never come into scope via 'open' + false | _ -> - let partialName = QuickParse.GetPartialLongNameEx (getSourceLineStr su.RangeAlternate.StartLine, su.RangeAlternate.EndColumn - 1) - // for the rest of symbols we pick only those which are the first part of a long idend, because it's they which are - // conteined in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because + // For the rest of symbols we pick only those which are the first part of a long ident, because it's they which are + // contained in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because // it's `open System` which really brings it into scope. - partialName.QualifyingIdents = []) + let partialName = QuickParse.GetPartialLongNameEx (getSourceLineStr su.RangeAlternate.StartLine, su.RangeAlternate.EndColumn - 1) + List.isEmpty partialName.QualifyingIdents) + /// Split symbol uses into cases that are easy to handle (via DeclaringEntity) and those that don't have a good DeclaringEntity + let splitSymbolUses (symbolUses: FSharpSymbolUse[]) : FSharpSymbolUse[] * FSharpSymbolUse[] = + symbolUses |> Array.partition (fun symbolUse -> + let symbol = symbolUse.Symbol + match symbol with + | :? FSharpMemberOrFunctionOrValue as f -> + match f.DeclaringEntity with + | Some ent when ent.IsNamespace || ent.IsFSharpModule -> true + | _ -> false + | _ -> false) + + /// Represents intermediate tracking data used to track the modules which are known to have been used so far type UsedModule = { Module: FSharpEntity AppliedScope: range } - let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async = - - let filterOpenStatements (openStatements: OpenStatement list) (symbolUses: FSharpSymbolUse[]) : OpenStatement list = - - let rec filterInner acc (openStatements: OpenStatement list) (usedModules: UsedModule list) = - - let getUsedModules (openStatement: OpenStatement) = - let notAlreadyUsedModuleGroups = - openStatement.Modules - |> List.choose (fun x -> - let notUsedModules = - x.Modules - |> List.filter (fun x -> - not (usedModules - |> List.exists (fun used -> - rangeContainsRange used.AppliedScope openStatement.AppliedScope && - used.Module.IsEffectivelySameAs x.Entity))) + /// Given an 'open' statement, find fresh modules/namespaces referred to by that statement where there is some use of a revealed symbol + /// in the scope of the 'open' is from that module. + /// + /// Performance will be roughly NumberOfOpenStatements x NumberOfSymbolUses + let getUsedModules (symbolUses1: FSharpSymbolUse[], symbolUses2: FSharpSymbolUse[]) (usedModules: UsedModule list) (openStatement: OpenStatement) = + + // Don't re-check modules whose symbols are already known to have been used + let openedGroupsToExamine = + openStatement.OpenedGroups |> List.choose (fun openedGroup -> + let openedEntitiesToExamine = + openedGroup.OpenedModules + |> List.filter (fun openedEntity -> + not (usedModules + |> List.exists (fun used -> + rangeContainsRange used.AppliedScope openStatement.AppliedScope && + used.Module.IsEffectivelySameAs openedEntity.Entity))) - match notUsedModules with - | [] -> None - | _ when notUsedModules |> List.exists (fun x -> not x.IsNestedAutoOpen) -> - Some { Modules = notUsedModules } - | _ -> None) - - match notAlreadyUsedModuleGroups with - | [] -> [] - | _ -> - let symbolUsesInScope = symbolUses |> Array.filter (fun symbolUse -> rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate) - notAlreadyUsedModuleGroups - |> List.filter (fun modulGroup -> - modulGroup.Modules - |> List.exists (fun modul -> - symbolUsesInScope - |> Array.exists (fun symbolUse -> - let usedByEnclosingEntity = - match symbolUse.Symbol with - | :? FSharpMemberOrFunctionOrValue as f -> - match f.DeclaringEntity with - | Some ent when ent.IsNamespace || ent.IsFSharpModule -> - Some (ent.IsEffectivelySameAs modul.Entity) - | _ -> None - | _ -> None - match usedByEnclosingEntity with - | Some x -> x - | None -> modul.ChildSymbols |> Seq.exists (fun x -> x.IsEffectivelySameAs symbolUse.Symbol) - ))) - |> List.collect (fun mg -> - mg.Modules |> List.map (fun x -> { Module = x.Entity; AppliedScope = openStatement.AppliedScope })) + match openedEntitiesToExamine with + | [] -> None + | _ when openedEntitiesToExamine |> List.exists (fun x -> not x.IsNestedAutoOpen) -> Some { OpenedModules = openedEntitiesToExamine } + | _ -> None) + + // Find the opened groups that are used by some symbol use + let newlyUsedOpenedGroups = + openedGroupsToExamine |> List.filter (fun openedGroup -> + openedGroup.OpenedModules |> List.exists (fun openedEntity -> + + symbolUses1 |> Array.exists (fun symbolUse -> + rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate && + match symbolUse.Symbol with + | :? FSharpMemberOrFunctionOrValue as f -> + match f.DeclaringEntity with + | Some ent when ent.IsNamespace || ent.IsFSharpModule -> ent.IsEffectivelySameAs openedEntity.Entity + | _ -> false + | _ -> false) || + + symbolUses2 |> Array.exists (fun symbolUse -> + rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate && + openedEntity.RevealedSymbolsContains symbolUse.Symbol))) + + // Return them as interim used entities + newlyUsedOpenedGroups |> List.collect (fun openedGroup -> + openedGroup.OpenedModules |> List.map (fun x -> { Module = x.Entity; AppliedScope = openStatement.AppliedScope })) - match openStatements with - | os :: xs -> - match getUsedModules os with - | [] -> filterInner (os :: acc) xs usedModules - | um -> filterInner acc xs (um @ usedModules) - | [] -> List.rev acc - - filterInner [] openStatements [] + /// Incrementally filter out the open statements one by one. Filter those whose contents are referred to somewhere in the symbol uses. + /// Async to allow cancellation. + let rec filterOpenStatementsIncremental symbolUses (openStatements: OpenStatement list) (usedModules: UsedModule list) acc = + async { + match openStatements with + | openStatement :: rest -> + match getUsedModules symbolUses usedModules openStatement with + | [] -> + // The open statement has not been used, include it in the results + return! filterOpenStatementsIncremental symbolUses rest usedModules (openStatement :: acc) + | moreUsedModules -> + // The open statement has been used, add the modules which are already known to be used to the list of things we don't need to re-check + return! filterOpenStatementsIncremental symbolUses rest (moreUsedModules @ usedModules) acc + | [] -> return List.rev acc + } + + /// Filter out the open statements whose contents are referred to somewhere in the symbol uses. + /// Async to allow cancellation. + let filterOpenStatements symbolUses openStatements = + async { + let! results = filterOpenStatementsIncremental symbolUses openStatements [] [] + return results |> List.map (fun os -> os.Range) + } + /// Get the open statements whose contents are not referred to anywhere in the symbol uses. + /// Async to allow cancellation. + let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async = async { let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() let symbolUses = filterSymbolUses getSourceLineStr symbolUses + let symbolUses = splitSymbolUses symbolUses let openStatements = getOpenStatements checkFileResults.OpenDeclarations - return filterOpenStatements openStatements symbolUses |> List.map (fun os -> os.Range) + return! filterOpenStatements symbolUses openStatements } \ No newline at end of file diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index ce7291f55ed..5acc998cf46 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -367,12 +367,11 @@ module internal DescriptionListsImpl = | TRecdRepr _ -> FSharpGlyph.Type | TUnionRepr _ -> FSharpGlyph.Union | TILObjectRepr (TILObjectReprData (_,_,td)) -> - match td.tdKind with - | ILTypeDefKind.Class -> FSharpGlyph.Class - | ILTypeDefKind.ValueType -> FSharpGlyph.Struct - | ILTypeDefKind.Interface -> FSharpGlyph.Interface - | ILTypeDefKind.Enum -> FSharpGlyph.Enum - | ILTypeDefKind.Delegate -> FSharpGlyph.Delegate + if td.IsClass then FSharpGlyph.Class + elif td.IsStruct then FSharpGlyph.Struct + elif td.IsInterface then FSharpGlyph.Interface + elif td.IsEnum then FSharpGlyph.Enum + else FSharpGlyph.Delegate | TAsmRepr _ -> FSharpGlyph.Typedef | TMeasureableRepr _-> FSharpGlyph.Typedef #if !NO_EXTENSIONTYPING @@ -431,7 +430,7 @@ module internal DescriptionListsImpl = if tydef.IsInterface then FSharpGlyph.Interface elif tydef.IsDelegate then FSharpGlyph.Delegate elif tydef.IsEnum then FSharpGlyph.Enum - elif tydef.IsStructOrEnum then FSharpGlyph.Struct + elif tydef.IsStruct then FSharpGlyph.Struct else FSharpGlyph.Class else FSharpGlyph.Class | Item.ModuleOrNamespaces(modref::_) -> diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index 04b09ec157b..7532449dc9c 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -213,7 +213,7 @@ module internal InterfaceStubGenerator = let nm = match arg.Name with | None -> - if arg.Type.HasTypeDefinition && arg.Type.TypeDefinition.XmlDocSig = "T:Microsoft.FSharp.Core.unit" then "()" + if arg.Type.HasTypeDefinition && arg.Type.TypeDefinition.CompiledName = "unit" && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" then "()" else sprintf "arg%d" (namesWithIndices |> Map.toSeq |> Seq.map snd |> Seq.sumBy Set.count |> max 1) | Some x -> x @@ -302,7 +302,8 @@ module internal InterfaceStubGenerator = let args, namesWithIndices = match argInfos with | [[x]] when v.IsPropertyGetterMethod && x.Name.IsNone - && x.Type.TypeDefinition.XmlDocSig = "T:Microsoft.FSharp.Core.unit" -> + && x.Type.TypeDefinition.CompiledName = "unit" + && x.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" -> "", Map.ofList [ctx.ObjectIdent, Set.empty] | _ -> formatArgsUsage ctx verboseMode v argInfos diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index a2561d73fb6..38e95e816d1 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -930,11 +930,11 @@ type TypeCheckInfo scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item) /// Get the auto-complete items at a location - member __.GetDeclarations (ctok, parseResultsOpt, line, lineStr, partialName, getAllSymbols, hasTextChangedSinceLastTypecheck) = + member __.GetDeclarations (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName ErrorScope.Protect Range.range0 (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllSymbols, hasTextChangedSinceLastTypecheck) with + match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with | None -> FSharpDeclarationListInfo.Empty | Some (items, denv, ctx, m) -> let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items @@ -950,11 +950,11 @@ type TypeCheckInfo FSharpDeclarationListInfo.Error msg) /// Get the symbols for auto-complete items at a location - member __.GetDeclarationListSymbols (ctok, parseResultsOpt, line, lineStr, partialName, hasTextChangedSinceLastTypecheck) = + member __.GetDeclarationListSymbols (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName ErrorScope.Protect Range.range0 (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, (fun () -> []), hasTextChangedSinceLastTypecheck) with + match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with | None -> List.Empty | Some (items, denv, _, m) -> let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items @@ -966,7 +966,7 @@ type TypeCheckInfo // - show types with fewer generic parameters first // - show types before over other related items - they usually have very useful XmlDocs let items = - items |> List.sortBy (fun d -> + items |> List.sortBy (fun d -> let n = match d.Item with | Item.Types (_,(TType_app(tcref,_) :: _)) -> 1 + tcref.TyparsNoRange.Length @@ -981,8 +981,19 @@ type TypeCheckInfo // Remove all duplicates. We've put the types first, so this removes the DelegateCtor and DefaultStructCtor's. let items = items |> RemoveDuplicateCompletionItems g - // Group by display name - let items = items |> List.groupBy (fun d -> d.Item.DisplayName) + // Group by compiled name for types, display name for functions + // (We don't want types with the same display name to be grouped as overloads) + let items = + items |> List.groupBy (fun d -> + match d.Item with + | Item.Types (_,(TType_app(tcref,_) :: _)) + | Item.ExnCase tcref -> tcref.LogicalName + | Item.UnqualifiedType(tcref :: _) + | Item.FakeInterfaceCtor (TType_app(tcref,_)) + | Item.DelegateCtor (TType_app(tcref,_)) -> tcref.CompiledName + | Item.CtorGroup (_, (cinfo :: _)) -> + (tcrefOfAppTy g cinfo.ApparentEnclosingType).CompiledName + | _ -> d.Item.DisplayName) // Filter out operators (and list) let items = @@ -1203,32 +1214,28 @@ type TypeCheckInfo Some (FSharpFindDeclResult.ExternalDecl (assref.Name, ExternalSymbol.Type fullName)) | _ -> None | _ -> None - match result with | Some x -> x - | None -> - let fail defaultReason = - match item.Item with + | None -> + match rangeOfItem g preferFlag item.Item with + | Some itemRange -> + let projectDir = Filename.directoryName (if projectFileName = "" then mainInputFileName else projectFileName) + let range = fileNameOfItem g (Some projectDir) itemRange item.Item + mkRange range itemRange.Start itemRange.End + |> FSharpFindDeclResult.DeclFound + | None -> + match item.Item with #if !NO_EXTENSIONTYPING - | SymbolHelpers.ItemIsProvidedType g (tcref) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.ProvidedType(tcref.DisplayName)) - | Item.CtorGroup(name, ProvidedMeth(_)::_) - | Item.MethodGroup(name, ProvidedMeth(_)::_, _) - | Item.Property(name, ProvidedProp(_)::_) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.ProvidedMember(name)) - | Item.Event(ProvidedEvent(_) as e) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.ProvidedMember(e.EventName)) - | Item.ILField(ProvidedField(_) as f) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.ProvidedMember(f.FieldName)) +// provided items may have TypeProviderDefinitionLocationAttribute that binds them to some location + | Item.CtorGroup (name, ProvidedMeth (_)::_ ) + | Item.MethodGroup(name, ProvidedMeth (_)::_, _) + | Item.Property (name, ProvidedProp (_)::_ ) -> FSharpFindDeclFailureReason.ProvidedMember name + | Item.Event ( ProvidedEvent(_) as e ) -> FSharpFindDeclFailureReason.ProvidedMember e.EventName + | Item.ILField ( ProvidedField(_) as f ) -> FSharpFindDeclFailureReason.ProvidedMember f.FieldName + | SymbolHelpers.ItemIsProvidedType g (tcref) -> FSharpFindDeclFailureReason.ProvidedType tcref.DisplayName #endif - | _ -> FSharpFindDeclResult.DeclNotFound defaultReason - - match rangeOfItem g preferFlag item.Item with - | None -> fail (FSharpFindDeclFailureReason.Unknown "") - | Some itemRange -> - - let projectDir = Filename.directoryName (if projectFileName = "" then mainInputFileName else projectFileName) - let filename = fileNameOfItem g (Some projectDir) itemRange item.Item - if FileSystem.SafeExists filename then - FSharpFindDeclResult.DeclFound (mkRange filename itemRange.Start itemRange.End) - else - fail FSharpFindDeclFailureReason.NoSourceCode // provided items may have TypeProviderDefinitionLocationAttribute that binds them to some location + | _ -> FSharpFindDeclFailureReason.Unknown "" + |> FSharpFindDeclResult.DeclNotFound ) (fun msg -> Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarationLocation: '%s'" msg) @@ -1519,6 +1526,10 @@ module internal Parser = if source.Length = 0 || not (source.[source.Length - 1] = '\n') then source + "\n" else source let matchBraces(source, fileName, options: FSharpParsingOptions, userOpName: string) = + let delayedLogger = CapturingErrorLogger("matchBraces") + use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) + use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "matchBraces", fileName) // Make sure there is an ErrorLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors @@ -1795,11 +1806,16 @@ type FSharpProjectContext(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad [] // 'details' is an option because the creation of the tcGlobals etc. for the project may have failed. -type FSharpCheckProjectResults(projectFileName:string, keepAssemblyContents, errors: FSharpErrorInfo[], details:(TcGlobals*TcImports*CcuThunk*ModuleOrNamespaceType*TcSymbolUses list*TopAttribs option*CompileOps.IRawFSharpAssemblyData option * ILAssemblyRef * AccessorDomain * TypedImplFile list option * string[]) option, _reactorOps: IReactorOperations) = +type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssemblyContents, errors: FSharpErrorInfo[], details:(TcGlobals*TcImports*CcuThunk*ModuleOrNamespaceType*TcSymbolUses list*TopAttribs option*CompileOps.IRawFSharpAssemblyData option * ILAssemblyRef * AccessorDomain * TypedImplFile list option * string[]) option, _reactorOps: IReactorOperations) = let getDetails() = match details with - | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detaild results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) + | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) + | Some d -> d + + let getTcConfig() = + match tcConfigOption with + | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) | Some d -> d member info.Errors = errors @@ -1810,23 +1826,40 @@ type FSharpCheckProjectResults(projectFileName:string, keepAssemblyContents, err let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() FSharpAssemblySignature(tcGlobals, thisCcu, tcImports, topAttribs, ccuSig) - member info.AssemblyContents = + member info.TypedImplementionFiles = if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies" let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() let mimpls = match tcAssemblyExpr with | None -> [] | Some mimpls -> mimpls + tcGlobals, thisCcu, tcImports, mimpls + + member info.AssemblyContents = FSharpAssemblyContents(info.TypedImplementionFiles) + + member info.GetOptimizedAssemblyContents() = + let tcGlobals, thisCcu, tcImports, mimpls = info.TypedImplementionFiles + let outfile = "" // only used if tcConfig.writeTermsToFiles is true + let importMap = tcImports.GetImportMap() + let optEnv0 = GetInitialOptimizationEnv (tcImports, tcGlobals) + let tcConfig = getTcConfig() + let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, false, optEnv0, thisCcu, mimpls) + let mimpls = + match optimizedImpls with + | TypedAssemblyAfterOptimization files -> + files |> List.map fst + FSharpAssemblyContents(tcGlobals, thisCcu, tcImports, mimpls) // Not, this does not have to be a SyncOp, it can be called from any thread member info.GetUsesOfSymbol(symbol:FSharpSymbol) = let (tcGlobals, _tcImports, _thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - [| for r in tcSymbolUses do yield! r.GetUsesOfSymbol(symbol.Item) |] - |> Seq.distinctBy (fun (itemOcc,_denv,m) -> itemOcc, m) - |> Seq.filter (fun (itemOcc,_,_) -> itemOcc <> ItemOccurence.RelatedText) - |> Seq.map (fun (itemOcc,denv,m) -> FSharpSymbolUse(tcGlobals, denv, symbol, itemOcc, m)) + tcSymbolUses + |> Seq.collect (fun r -> r.GetUsesOfSymbol symbol.Item) + |> Seq.distinctBy (fun symbolUse -> symbolUse.ItemOccurence, symbolUse.Range) + |> Seq.filter (fun symbolUse -> symbolUse.ItemOccurence <> ItemOccurence.RelatedText) + |> Seq.map (fun symbolUse -> FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range)) |> Seq.toArray |> async.Return @@ -1834,11 +1867,11 @@ type FSharpCheckProjectResults(projectFileName:string, keepAssemblyContents, err member info.GetAllUsesOfAllSymbols() = let (tcGlobals, tcImports, thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - [| for r in tcSymbolUses do - for (item,itemOcc,denv,m) in r.GetAllUsesOfSymbols() do - if itemOcc <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(tcGlobals, thisCcu, tcImports, item) - yield FSharpSymbolUse(tcGlobals, denv, symbol, itemOcc, m) |] + [| for r in tcSymbolUses do + for symbolUse in r.AllUsesOfSymbols do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(tcGlobals, thisCcu, tcImports, symbolUse.Item) + yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |] |> async.Return member info.ProjectContext = @@ -1924,16 +1957,18 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp member info.HasFullTypeCheckInfo = details.IsSome /// Intellisense autocompletions - member info.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = + member info.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" + let getAllEntities = defaultArg getAllEntities (fun() -> []) let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) reactorOp userOpName "GetDeclarations" FSharpDeclarationListInfo.Empty (fun ctok scope -> scope.GetDeclarations(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) - member info.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = + member info.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) - reactorOp userOpName "GetDeclarationListSymbols" List.empty (fun ctok scope -> scope.GetDeclarationListSymbols(ctok, parseResultsOpt, line, lineStr, partialName, hasTextChangedSinceLastTypecheck)) + let getAllEntities = defaultArg getAllEntities (fun() -> []) + reactorOp userOpName "GetDeclarationListSymbols" List.empty (fun ctok scope -> scope.GetDeclarationListSymbols(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) /// Resolve the names at the given location to give a data tip member info.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName: string) = @@ -2016,7 +2051,7 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp threadSafeOp (fun () -> failwith "not available") (fun scope -> - // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread + // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread FSharpProjectContext(scope.ThisCcu, scope.GetReferencedAssemblies(), scope.AccessRights)) member info.DependencyFiles = dependencyFiles @@ -2025,19 +2060,19 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp threadSafeOp (fun () -> [| |]) (fun scope -> - [| for (item,itemOcc,denv,m) in scope.ScopeSymbolUses.GetAllUsesOfSymbols() do - if itemOcc <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(scope.TcGlobals, scope.ThisCcu, scope.TcImports, item) - yield FSharpSymbolUse(scope.TcGlobals, denv, symbol, itemOcc, m) |]) + [| for symbolUse in scope.ScopeSymbolUses.AllUsesOfSymbols do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(scope.TcGlobals, scope.ThisCcu, scope.TcImports, symbolUse.Item) + yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) |> async.Return member info.GetUsesOfSymbolInFile(symbol:FSharpSymbol) = threadSafeOp (fun () -> [| |]) (fun scope -> - [| for (itemOcc,denv,m) in scope.ScopeSymbolUses.GetUsesOfSymbol(symbol.Item) |> Seq.distinctBy (fun (itemOcc,_denv,m) -> itemOcc, m) do - if itemOcc <> ItemOccurence.RelatedText then - yield FSharpSymbolUse(scope.TcGlobals, denv, symbol, itemOcc, m) |]) + [| for symbolUse in scope.ScopeSymbolUses.GetUsesOfSymbol(symbol.Item) |> Seq.distinctBy (fun symbolUse -> symbolUse.ItemOccurence, symbolUse.Range) do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) |> async.Return member info.GetVisibleNamespacesAndModulesAtPoint(pos: pos) = @@ -2693,13 +2728,13 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC use _unwind = decrement match builderOpt with | None -> - return FSharpCheckProjectResults (options.ProjectFileName, keepAssemblyContents, Array.ofList creationErrors, None, reactorOps) + return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, Array.ofList creationErrors, None, reactorOps) | Some builder -> let! (tcProj, ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt) = builder.GetCheckResultsAndImplementationsForProject(ctok) let errorOptions = tcProj.TcConfig.errorSeverityOptions let fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation let errors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, true, fileName, tcProj.Errors) |] - return FSharpCheckProjectResults (options.ProjectFileName, keepAssemblyContents, errors, Some(tcProj.TcGlobals, tcProj.TcImports, tcProj.TcState.Ccu, tcProj.TcState.PartialAssemblySignature, tcProj.TcSymbolUses, tcProj.TopAttribs, tcAssemblyDataOpt, ilAssemRef, tcProj.TcEnvAtEnd.AccessRights, tcAssemblyExprOpt, Array.ofList tcProj.TcDependencyFiles), reactorOps) + return FSharpCheckProjectResults (options.ProjectFileName, Some tcProj.TcConfig, keepAssemblyContents, errors, Some(tcProj.TcGlobals, tcProj.TcImports, tcProj.TcState.Ccu, tcProj.TcState.PartialAssemblySignature, tcProj.TcSymbolUses, tcProj.TopAttribs, tcAssemblyDataOpt, ilAssemRef, tcProj.TcEnvAtEnd.AccessRights, tcAssemblyExprOpt, Array.ofList tcProj.TcDependencyFiles), reactorOps) } /// Get the timestamp that would be on the output if fully built immediately @@ -3218,7 +3253,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio | Parser.TypeCheckAborted.No scope -> let errors = [| yield! parseErrors; yield! tcErrors |] let typeCheckResults = FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, None, reactorOps, false) - let projectResults = FSharpCheckProjectResults (filename, keepAssemblyContents, errors, Some(tcGlobals, tcImports, scope.ThisCcu, scope.CcuSig, [scope.ScopeSymbolUses], None, None, mkSimpleAssRef "stdin", tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles), reactorOps) + let projectResults = FSharpCheckProjectResults (filename, Some tcConfig, keepAssemblyContents, errors, Some(tcGlobals, tcImports, scope.ThisCcu, scope.CcuSig, [scope.ScopeSymbolUses], None, None, mkSimpleAssRef "stdin", tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles), reactorOps) parseResults, typeCheckResults, projectResults | _ -> failwith "unexpected aborted" diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 2602d82e4ff..82a1a563ea8 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -119,8 +119,8 @@ type public FSharpCheckFileResults = /// The text of the line where the completion is happening. This is only used to make a couple /// of adhoc corrections to completion accuracy (e.g. checking for "..") /// - /// - /// Function that returns all symbols from current and referenced assemblies. + /// + /// Function that returns all entities from current and referenced assemblies. /// /// /// If text has been used from a captured name resolution from the typecheck, then @@ -128,7 +128,7 @@ type public FSharpCheckFileResults = /// and assume that we're going to repeat the operation later on. /// /// An optional string used for tracing compiler operations associated with this request. - member GetDeclarationListInfo : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * getAllSymbols: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async + member GetDeclarationListInfo : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async /// Get the items for a declaration list in FSharpSymbol format /// @@ -145,8 +145,8 @@ type public FSharpCheckFileResults = /// The text of the line where the completion is happening. This is only used to make a couple /// of adhoc corrections to completion accuracy (e.g. checking for "..") /// - /// - /// Function that returns all symbols from current and referenced assemblies. + /// + /// Function that returns all entities from current and referenced assemblies. /// /// /// If text has been used from a captured name resolution from the typecheck, then @@ -154,7 +154,7 @@ type public FSharpCheckFileResults = /// and assume that we're going to repeat the operation later on. /// /// An optional string used for tracing compiler operations associated with this request. - member GetDeclarationListSymbols : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async + member GetDeclarationListSymbols : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async /// Compute a formatted tooltip for the given location @@ -269,6 +269,9 @@ type public FSharpCheckProjectResults = /// Get a view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. member AssemblyContents: FSharpAssemblyContents + /// Get an optimized view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. + member GetOptimizedAssemblyContents: unit -> FSharpAssemblyContents + /// Get the resolution of the ProjectOptions member ProjectContext: FSharpProjectContext diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index 405ae4e7e96..d818cf956a1 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -197,6 +197,98 @@ module FSharpExprConvert = | Expr.Op(TOp.ValFieldSet rfref, _, _, _) when IsStaticInitializationField rfref -> Some () | _ -> None + let (|ILUnaryOp|_|) e = + match e with + | AI_neg -> Some mkCallUnaryNegOperator + | AI_not -> Some mkCallUnaryNotOperator + | _ -> None + + let (|ILBinaryOp|_|) e = + match e with + | AI_add -> Some mkCallAdditionOperator + | AI_add_ovf + | AI_add_ovf_un -> Some mkCallAdditionChecked + | AI_sub -> Some mkCallSubtractionOperator + | AI_sub_ovf + | AI_sub_ovf_un -> Some mkCallSubtractionChecked + | AI_mul -> Some mkCallMultiplyOperator + | AI_mul_ovf + | AI_mul_ovf_un -> Some mkCallMultiplyChecked + | AI_div + | AI_div_un -> Some mkCallDivisionOperator + | AI_rem + | AI_rem_un -> Some mkCallModulusOperator + | AI_ceq -> Some mkCallEqualsOperator + | AI_clt + | AI_clt_un -> Some mkCallLessThanOperator + | AI_cgt + | AI_cgt_un -> Some mkCallGreaterThanOperator + | AI_and -> Some mkCallBitwiseAndOperator + | AI_or -> Some mkCallBitwiseOrOperator + | AI_xor -> Some mkCallBitwiseXorOperator + | AI_shl -> Some mkCallShiftLeftOperator + | AI_shr + | AI_shr_un -> Some mkCallShiftRightOperator + | _ -> None + + let (|ILConvertOp|_|) e = + match e with + | AI_conv basicTy -> + match basicTy with + | DT_R -> Some mkCallToDoubleOperator + | DT_I1 -> Some mkCallToSByteOperator + | DT_U1 -> Some mkCallToByteOperator + | DT_I2 -> Some mkCallToInt16Operator + | DT_U2 -> Some mkCallToUInt16Operator + | DT_I4 -> Some mkCallToInt32Operator + | DT_U4 -> Some mkCallToUInt32Operator + | DT_I8 -> Some mkCallToInt64Operator + | DT_U8 -> Some mkCallToUInt64Operator + | DT_R4 -> Some mkCallToSingleOperator + | DT_R8 -> Some mkCallToDoubleOperator + | DT_I -> Some mkCallToIntPtrOperator + | DT_U -> Some mkCallToUIntPtrOperator + | DT_REF -> None + | AI_conv_ovf basicTy + | AI_conv_ovf_un basicTy -> + match basicTy with + | DT_R -> Some mkCallToDoubleOperator + | DT_I1 -> Some mkCallToSByteChecked + | DT_U1 -> Some mkCallToByteChecked + | DT_I2 -> Some mkCallToInt16Checked + | DT_U2 -> Some mkCallToUInt16Checked + | DT_I4 -> Some mkCallToInt32Checked + | DT_U4 -> Some mkCallToUInt32Checked + | DT_I8 -> Some mkCallToInt64Checked + | DT_U8 -> Some mkCallToUInt64Checked + | DT_R4 -> Some mkCallToSingleOperator + | DT_R8 -> Some mkCallToDoubleOperator + | DT_I -> Some mkCallToIntPtrChecked + | DT_U -> Some mkCallToUIntPtrChecked + | DT_REF -> None + | _ -> None + + let (|TTypeConvOp|_|) (cenv:Impl.cenv) ty = + let g = cenv.g + match ty with + | TType_app (tcref,_) -> + match tcref with + | _ when tyconRefEq g tcref g.sbyte_tcr -> Some mkCallToSByteOperator + | _ when tyconRefEq g tcref g.byte_tcr -> Some mkCallToByteOperator + | _ when tyconRefEq g tcref g.int16_tcr -> Some mkCallToInt16Operator + | _ when tyconRefEq g tcref g.uint16_tcr -> Some mkCallToUInt16Operator + | _ when tyconRefEq g tcref g.int_tcr -> Some mkCallToIntOperator + | _ when tyconRefEq g tcref g.int32_tcr -> Some mkCallToInt32Operator + | _ when tyconRefEq g tcref g.uint32_tcr -> Some mkCallToUInt32Operator + | _ when tyconRefEq g tcref g.int64_tcr -> Some mkCallToInt64Operator + | _ when tyconRefEq g tcref g.uint64_tcr -> Some mkCallToUInt64Operator + | _ when tyconRefEq g tcref g.float32_tcr -> Some mkCallToSingleOperator + | _ when tyconRefEq g tcref g.float_tcr -> Some mkCallToDoubleOperator + | _ when tyconRefEq g tcref g.nativeint_tcr -> Some mkCallToIntPtrOperator + | _ when tyconRefEq g tcref g.unativeint_tcr -> Some mkCallToUIntPtrOperator + | _ -> None + | _ -> None + let ConvType cenv typ = FSharpType(cenv, typ) let ConvTypes cenv typs = List.map (ConvType cenv) typs let ConvILTypeRefApp (cenv:Impl.cenv) m tref tyargs = @@ -530,11 +622,89 @@ module FSharpExprConvert = let argR = ConvExpr cenv env arg E.ILFieldSet(None, typR, fspec.Name, argR) - - | TOp.ILAsm([ AI_ceq ], _), _, [arg1;arg2] -> + | TOp.ILAsm([ ], [tty]), _, [arg] -> + match tty with + | TTypeConvOp cenv convOp -> + let ty = tyOfExpr cenv.g arg + let op = convOp cenv.g m ty arg + ConvExprPrim cenv env op + | _ -> + ConvExprPrim cenv env arg + + | TOp.ILAsm([ I_box _ ], _), [ty], [arg] -> + let op = mkCallBox cenv.g m ty arg + ConvExprPrim cenv env op + + | TOp.ILAsm([ I_unbox_any _ ], _), [ty], [arg] -> + let op = mkCallUnbox cenv.g m ty arg + ConvExprPrim cenv env op + + | TOp.ILAsm([ I_isinst _ ], _), [ty], [arg] -> + let op = mkCallTypeTest cenv.g m ty arg + ConvExprPrim cenv env op + + | TOp.ILAsm ([ I_call (Normalcall, mspec, None) ], _), _, [arg] + when mspec.MethodRef.DeclaringTypeRef.Name = "System.String" && mspec.Name = "GetHashCode" -> + let ty = tyOfExpr cenv.g arg + let op = mkCallHash cenv.g m ty arg + ConvExprPrim cenv env op + + | TOp.ILCall(_, _, _, _, _, _, _, mref, _, _, _), [], + [Expr.Op(TOp.ILAsm([ I_ldtoken (ILToken.ILType _) ], _), [ty], _, _)] + when mref.DeclaringTypeRef.Name = "System.Type" && mref.Name = "GetTypeFromHandle" -> + let op = mkCallTypeOf cenv.g m ty + ConvExprPrim cenv env op + + | TOp.ILAsm([ EI_ilzero _ ], _), [ty], _ -> + E.DefaultValue (ConvType cenv ty) + + | TOp.ILAsm([ AI_ldnull; AI_cgt_un ], _), _, [arg] -> + let elemTy = tyOfExpr cenv.g arg + let nullVal = mkNull m elemTy + let op = mkCallNotEqualsOperator cenv.g m elemTy arg nullVal + ConvExprPrim cenv env op + + | TOp.ILAsm([ I_ldlen; AI_conv DT_I4 ], _), _, [arr] -> + let arrayTy = tyOfExpr cenv.g arr + let elemTy = destArrayTy cenv.g arrayTy + let op = mkCallArrayLength cenv.g m elemTy arr + ConvExprPrim cenv env op + + | TOp.ILAsm([ I_newarr (ILArrayShape [(Some 0, None)], _)], _), [elemTy], xa -> + E.NewArray(ConvType cenv elemTy, ConvExprs cenv env xa) + + | TOp.ILAsm([ I_ldelem_any (ILArrayShape [(Some 0, None)], _)], _), [elemTy], [arr; idx1] -> + let op = mkCallArrayGet cenv.g m elemTy arr idx1 + ConvExprPrim cenv env op + + | TOp.ILAsm([ I_stelem_any (ILArrayShape [(Some 0, None)], _)], _), [elemTy], [arr; idx1; v] -> + let op = mkCallArraySet cenv.g m elemTy arr idx1 v + ConvExprPrim cenv env op + + | TOp.ILAsm([ ILUnaryOp unaryOp ], _), _, [arg] -> + let ty = tyOfExpr cenv.g arg + let op = unaryOp cenv.g m ty arg + ConvExprPrim cenv env op + + | TOp.ILAsm([ ILBinaryOp binaryOp ], _), _, [arg1;arg2] -> let ty = tyOfExpr cenv.g arg1 - let eq = mkCallEqualsOperator cenv.g m ty arg1 arg2 - ConvExprPrim cenv env eq + let op = binaryOp cenv.g m ty arg1 arg2 + ConvExprPrim cenv env op + + | TOp.ILAsm([ ILConvertOp convertOp1; ILConvertOp convertOp2 ], _), _, [arg] -> + let ty1 = tyOfExpr cenv.g arg + let op1 = convertOp1 cenv.g m ty1 arg + let ty2 = tyOfExpr cenv.g op1 + let op2 = convertOp2 cenv.g m ty2 op1 + ConvExprPrim cenv env op2 + + | TOp.ILAsm([ ILConvertOp convertOp ], [TType_app (tcref,_)]), _, [arg] -> + let ty = tyOfExpr cenv.g arg + let op = + if tyconRefEq cenv.g tcref cenv.g.char_tcr + then mkCallToCharOperator cenv.g m ty arg + else convertOp cenv.g m ty arg + ConvExprPrim cenv env op | TOp.ILAsm([ I_throw ], _), _, [arg1] -> let raiseExpr = mkCallRaise cenv.g m (tyOfExpr cenv.g expr) arg1 @@ -603,17 +773,18 @@ module FSharpExprConvert = | TOp.While _, [], [Expr.Lambda(_, _, _, [_], test, _, _);Expr.Lambda(_, _, _, [_], body, _, _)] -> E.WhileLoop(ConvExpr cenv env test, ConvExpr cenv env body) - | TOp.For(_, (FSharpForLoopUp |FSharpForLoopDown as dir) ), [], [Expr.Lambda(_, _, _, [_], lim0, _, _); Expr.Lambda(_, _, _, [_], SimpleArrayLoopUpperBound, lm, _); SimpleArrayLoopBody cenv.g (arr, elemTy, body)] -> + | TOp.For(_, dir), [], [Expr.Lambda(_, _, _, [_], lim0, _, _); Expr.Lambda(_, _, _, [_], SimpleArrayLoopUpperBound, lm, _); SimpleArrayLoopBody cenv.g (arr, elemTy, body)] -> let lim1 = let len = mkCallArrayLength cenv.g lm elemTy arr // Array.length arr - mkCallSubtractionOperator cenv.g lm cenv.g.int32_ty len (Expr.Const(Const.Int32 1, m, cenv.g.int32_ty)) // len - 1 - E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, (dir = FSharpForLoopUp)) - - | TOp.For(_, dir), [], [Expr.Lambda(_, _, _, [_], lim0, _, _);Expr.Lambda(_, _, _, [_], lim1, _, _);body] -> - match dir with - | FSharpForLoopUp -> E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, true) - | FSharpForLoopDown -> E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, false) - | _ -> failwith "unexpected for-loop form" + mkCallSubtractionOperator cenv.g lm cenv.g.int32_ty len (mkOne cenv.g lm) // len - 1 + E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, dir <> FSharpForLoopDown) + + | TOp.For(_, dir), [], [Expr.Lambda(_, _, _, [_], lim0, _, _); Expr.Lambda(_, _, _, [_], lim1, lm, _); body] -> + let lim1 = + if dir = CSharpForLoopUp then + mkCallSubtractionOperator cenv.g lm cenv.g.int32_ty lim1 (mkOne cenv.g lm) // len - 1 + else lim1 + E.FastIntegerForLoop(ConvExpr cenv env lim0, ConvExpr cenv env lim1, ConvExpr cenv env body, dir <> FSharpForLoopDown) | TOp.ILCall(_, _, _, isNewObj, valUseFlags, _isProp, _, ilMethRef, enclTypeArgs, methTypeArgs, _tys), [], callArgs -> ConvILCall cenv env (isNewObj, valUseFlags, ilMethRef, enclTypeArgs, methTypeArgs, callArgs, m) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 4f8f461bebe..e48f116b92f 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -113,7 +113,6 @@ module Impl = | ILMemberAccess.Assembly -> taccessPrivate (CompPath(declaringEntity.CompilationPath.ILScopeRef, [])) - | ILMemberAccess.CompilerControlled | ILMemberAccess.Private -> taccessPrivate declaringEntity.CompilationPath @@ -222,6 +221,8 @@ type FSharpSymbol(cenv:cenv, item: (unit -> Item), access: (FSharpSymbol -> CcuT override x.GetHashCode() = hash x.ImplementationLocation + member x.GetEffectivelySameAsHash() = ItemsAreEffectivelyEqualHash cenv.g x.Item + override x.ToString() = "symbol " + (try item().DisplayName with _ -> "?") @@ -368,7 +369,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsClass #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Class) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsClass | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> entity.Deref.IsFSharpClassTycon member __.IsByRef = @@ -389,7 +390,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsDelegate () #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.tdKind = ILTypeDefKind.Delegate) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsDelegate | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> entity.IsFSharpDelegateTycon member __.IsEnum = @@ -429,7 +430,6 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = member __.Accessibility = if isUnresolved() then FSharpAccessibility(taccessPublic) else - FSharpAccessibility(getApproxFSharpAccessibilityOfEntity entity) member __.RepresentationAccessibility = @@ -472,7 +472,9 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = not (isResolvedAndFSharp()) || entity.Deref.IsPrefixDisplay member x.IsNamespace = entity.IsNamespace + member x.MembersOrValues = x.MembersFunctionsAndValues + member x.MembersFunctionsAndValues = if isUnresolved() then makeReadOnlyCollection[] else protect <| fun () -> @@ -554,6 +556,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = |> makeReadOnlyCollection member x.RecordFields = x.FSharpFields + member x.FSharpFields = if isUnresolved() then makeReadOnlyCollection[] else @@ -600,7 +603,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = | [] -> [[path]] | _ -> paths |> List.map (fun x -> path :: x) - let walkParts (parts: (string * ModuleOrNamespaceKind) list) = //: string list list = + let walkParts (parts: (string * ModuleOrNamespaceKind) list) = let rec loop (currentPaths: string list list) parts = match parts with | [] -> currentPaths @@ -853,6 +856,12 @@ and FSharpField(cenv: cenv, d: FSharpFieldData) = | Choice1Of2 r -> r.IsCompilerGenerated | Choice2Of2 _ -> false + member __.IsNameGenerated = + if isUnresolved() then false else + match d.TryRecdField with + | Choice1Of2 r -> r.rfield_name_generated + | _ -> false + member __.DeclarationLocation = checkIsResolved() match d.TryRecdField with diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 462544bd208..730c60e79ee 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -86,7 +86,12 @@ type [] public FSharpSymbol = /// /// This is the relation used by GetUsesOfSymbol and GetUsesOfSymbolInFile. member IsEffectivelySameAs : other: FSharpSymbol -> bool + + /// A hash compatible with the IsEffectivelySameAs relation + member GetEffectivelySameAsHash : unit -> int + member IsExplicitlySuppressed : bool + static member GetAccessibility : FSharpSymbol -> FSharpAccessibility option /// Represents an assembly as seen by the F# language @@ -293,7 +298,6 @@ and [] public FSharpEntity = /// Get the cases of a union type member UnionCases : IList - /// Indicates if the type is a delegate with the given Invoke signature member FSharpDelegateSignature : FSharpDelegateSignature @@ -425,6 +429,10 @@ and [] public FSharpField = /// Indicates a compiler generated field, not visible to Intellisense or name resolution member IsCompilerGenerated: bool + /// Indicates if the field name was generated by compiler (e.g. ItemN names in union cases and DataN in exceptions). + /// This API returns true for source defined symbols only. + member IsNameGenerated: bool + /// Get the in-memory XML documentation for the field, used when code is checked in-memory member XmlDoc: IList diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 5912bb1ea3d..5a5bd6d51c8 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -485,15 +485,51 @@ let ComputeDefinitionLocationOfProvidedItem (p : Tainted<#IProvidedCustomAttribu #endif -/// Represents a type definition, exception definition, module definition or namespace definition. -[] -type Entity = - { /// The declared type parameters of the type - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_typars: LazyWithContext +type EntityOptionalData = + { + /// The name of the type, possibly with `n mangling + // MUTABILITY; used only when establishing tycons. + mutable entity_compiled_name: string option + + // MUTABILITY: the signature is adjusted when it is checked + /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is + /// the signature range for an item in an implementation + mutable entity_other_range: (range * bool) option // MUTABILITY; used only when establishing tycons. mutable entity_kind : TyparKind + + /// The declared documentation for the type or module + // MUTABILITY: only for unpickle linkage + mutable entity_xmldoc : XmlDoc + + /// The XML document signature for this entity + mutable entity_xmldocsig : string + + /// If non-None, indicates the type is an abbreviation for another type. + // + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_tycon_abbrev: TType option + + /// The declared accessibility of the representation, not taking signatures into account + mutable entity_tycon_repr_accessibility: Accessibility + + /// Indicates how visible is the entity is. + // MUTABILITY: only for unpickle linkage + mutable entity_accessiblity: Accessibility + + /// Field used when the 'tycon' is really an exception definition + // + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_exn_info: ExceptionInfo + } + +and /// Represents a type definition, exception definition, module definition or namespace definition. + [] + Entity = + { /// The declared type parameters of the type + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_typars: LazyWithContext mutable entity_flags : EntityFlags @@ -505,21 +541,9 @@ type Entity = // MUTABILITY: only for unpickle linkage mutable entity_logical_name: string - /// The name of the type, possibly with `n mangling - // MUTABILITY; used only when establishing tycons. - mutable entity_compiled_name: string option - /// The declaration location for the type constructor mutable entity_range: range - // MUTABILITY: the signature is adjusted when it is checked - /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is - /// the signature range for an item in an implementation - mutable entity_other_range: (range * bool) option - - /// The declared accessibility of the representation, not taking signatures into account - mutable entity_tycon_repr_accessibility: Accessibility - /// The declared attributes for the type // MUTABILITY; used during creation and remapping of tycons // MUTABILITY; used when propagating signature attributes into the implementation. @@ -529,43 +553,22 @@ type Entity = // // MUTABILITY; used only during creation and remapping of tycons mutable entity_tycon_repr: TyconRepresentation - - /// If non-None, indicates the type is an abbreviation for another type. - // - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_tycon_abbrev: TType option /// The methods and properties of the type // // MUTABILITY; used only during creation and remapping of tycons mutable entity_tycon_tcaug: TyconAugmentation - /// Field used when the 'tycon' is really an exception definition - // - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_exn_info: ExceptionInfo - /// This field is used when the 'tycon' is really a module definition. It holds statically nested type definitions and nested modules // // MUTABILITY: only used during creation and remapping of tycons and // when compiling fslib to fixup compiler forward references to internal items mutable entity_modul_contents: MaybeLazy - /// The declared documentation for the type or module - // MUTABILITY: only for unpickle linkage - mutable entity_xmldoc : XmlDoc - - /// The XML document signature for this entity - mutable entity_xmldocsig : string - /// The stable path to the type, e.g. Microsoft.FSharp.Core.FSharpFunc`2 // REVIEW: it looks like entity_cpath subsumes this // MUTABILITY: only for unpickle linkage mutable entity_pubpath : PublicPath option - - /// Indicates how visible is the entity is. - // MUTABILITY: only for unpickle linkage - mutable entity_accessiblity: Accessibility /// The stable path to the type, e.g. Microsoft.FSharp.Core.FSharpFunc`2 // MUTABILITY: only for unpickle linkage @@ -574,12 +577,30 @@ type Entity = /// Used during codegen to hold the ILX representation indicating how to access the type // MUTABILITY: only for unpickle linkage and caching mutable entity_il_repr_cache : CompiledTypeRepr cache + + mutable entity_opt_data : EntityOptionalData option } + + static member EmptyEntityOptData = { entity_compiled_name = None; entity_other_range = None; entity_kind = TyparKind.Type; entity_xmldoc = XmlDoc.Empty; entity_xmldocsig = ""; entity_tycon_abbrev = None; entity_tycon_repr_accessibility = TAccess []; entity_accessiblity = TAccess []; entity_exn_info = TExnNone } + /// The name of the namespace, module or type, possibly with mangling, e.g. List`1, List or FailureException member x.LogicalName = x.entity_logical_name /// The compiled name of the namespace, module or type, e.g. FSharpList`1, ListModule or FailureException - member x.CompiledName = match x.entity_compiled_name with None -> x.LogicalName | Some s -> s + member x.CompiledName = + match x.entity_opt_data with + | Some { entity_compiled_name = Some s } -> s + | _ -> x.LogicalName + + member x.EntityCompiledName = + match x.entity_opt_data with + | Some optData -> optData.entity_compiled_name + | _ -> None + + member x.SetCompiledName(name) = + match x.entity_opt_data with + | Some optData -> optData.entity_compiled_name <- name + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_compiled_name = name } /// The display name of the namespace, module or type, e.g. List instead of List`1, and no static parameters member x.DisplayName = x.GetDisplayName(false, false) @@ -604,7 +625,7 @@ type Entity = | [] -> nm | tps -> let nm = DemangleGenericTypeName nm - if withUnderscoreTypars && tps.Length > 0 then + if withUnderscoreTypars && not (List.isEmpty tps) then nm + "<" + String.concat "," (Array.create tps.Length "_") + ">" else nm @@ -638,16 +659,19 @@ type Entity = /// The range in the implementation, adjusted for an item in a signature member x.DefinitionRange = - match x.entity_other_range with - | Some (r, true) -> r + match x.entity_opt_data with + | Some { entity_other_range = Some (r, true) } -> r | _ -> x.Range member x.SigRange = - match x.entity_other_range with - | Some (r, false) -> r + match x.entity_opt_data with + | Some { entity_other_range = Some (r, false) } -> r | _ -> x.Range - member x.SetOtherRange m = x.entity_other_range <- Some m + member x.SetOtherRange m = + match x.entity_opt_data with + | Some optData -> optData.entity_other_range <- Some m + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_other_range = Some m } /// A unique stamp for this module, namespace or type definition within the context of this compilation. /// Note that because of signatures, there are situations where in a single compilation the "same" @@ -668,13 +692,21 @@ type Entity = | TProvidedTypeExtensionPoint info -> XmlDoc (info.ProvidedType.PUntaintNoFailure(fun st -> (st :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(info.ProvidedType.TypeProvider.PUntaintNoFailure(id)))) | _ -> #endif - x.entity_xmldoc + match x.entity_opt_data with + | Some optData -> optData.entity_xmldoc + | _ -> XmlDoc.Empty /// The XML documentation sig-string of the entity, if any, to use to lookup an .xml doc file. This also acts /// as a cache for this sig-string computation. member x.XmlDocSig - with get() = x.entity_xmldocsig - and set v = x.entity_xmldocsig <- v + with get() = + match x.entity_opt_data with + | Some optData -> optData.entity_xmldocsig + | _ -> "" + and set v = + match x.entity_opt_data with + | Some optData -> optData.entity_xmldocsig <- v + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_xmldocsig = v } /// The logical contents of the entity when it is a module or namespace fragment. member x.ModuleOrNamespaceType = x.entity_modul_contents.Force() @@ -683,7 +715,15 @@ type Entity = member x.TypeContents = x.entity_tycon_tcaug /// The kind of the type definition - is it a measure definition or a type definition? - member x.TypeOrMeasureKind = x.entity_kind + member x.TypeOrMeasureKind = + match x.entity_opt_data with + | Some optData -> optData.entity_kind + | _ -> TyparKind.Type + + member x.SetTypeOrMeasureKind kind = + match x.entity_opt_data with + | Some optData -> optData.entity_kind <- kind + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_kind = kind } /// The identifier at the point of declaration of the type definition. member x.Id = ident(x.LogicalName, x.Range) @@ -692,7 +732,15 @@ type Entity = member x.TypeReprInfo = x.entity_tycon_repr /// The information about the r.h.s. of an F# exception definition, if any. - member x.ExceptionInfo = x.entity_exn_info + member x.ExceptionInfo = + match x.entity_opt_data with + | Some optData -> optData.entity_exn_info + | _ -> TExnNone + + member x.SetExceptionInfo exn_info = + match x.entity_opt_data with + | Some optData -> optData.entity_exn_info <- exn_info + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_exn_info = exn_info } /// Indicates if the entity represents an F# exception declaration. member x.IsExceptionDecl = match x.ExceptionInfo with TExnNone -> false | _ -> true @@ -710,13 +758,24 @@ type Entity = member x.TyparsNoRange = x.Typars x.Range /// Get the type abbreviated by this type definition, if it is an F# type abbreviation definition - member x.TypeAbbrev = x.entity_tycon_abbrev + member x.TypeAbbrev = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_abbrev + | _ -> None + + member x.SetTypeAbbrev tycon_abbrev = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_abbrev <- tycon_abbrev + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_tycon_abbrev = tycon_abbrev } /// Indicates if this entity is an F# type abbreviation definition member x.IsTypeAbbrev = x.TypeAbbrev.IsSome /// Get the value representing the accessibility of the r.h.s. of an F# type definition. - member x.TypeReprAccessibility = x.entity_tycon_repr_accessibility + member x.TypeReprAccessibility = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_repr_accessibility + | _ -> TAccess [] /// Get the cache of the compiled ILTypeRef representation of this module or type. member x.CompiledReprCache = x.entity_il_repr_cache @@ -725,7 +784,10 @@ type Entity = member x.PublicPath = x.entity_pubpath /// Get the value representing the accessibility of an F# type definition or module. - member x.Accessibility = x.entity_accessiblity + member x.Accessibility = + match x.entity_opt_data with + | Some optData -> optData.entity_accessiblity + | _ -> TAccess [] /// Indicates the type prefers the "tycon" syntax for display etc. member x.IsPrefixDisplay = x.entity_flags.IsPrefixDisplay @@ -849,26 +911,18 @@ type Entity = /// Create a new entity with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Entity = { entity_typars = Unchecked.defaultof<_> - entity_kind = Unchecked.defaultof<_> entity_flags = Unchecked.defaultof<_> entity_stamp = Unchecked.defaultof<_> entity_logical_name = Unchecked.defaultof<_> - entity_compiled_name = Unchecked.defaultof<_> entity_range = Unchecked.defaultof<_> - entity_other_range = Unchecked.defaultof<_> - entity_tycon_repr_accessibility = Unchecked.defaultof<_> entity_attribs = Unchecked.defaultof<_> entity_tycon_repr= Unchecked.defaultof<_> - entity_tycon_abbrev= Unchecked.defaultof<_> entity_tycon_tcaug= Unchecked.defaultof<_> - entity_exn_info= Unchecked.defaultof<_> entity_modul_contents= Unchecked.defaultof<_> - entity_xmldoc = Unchecked.defaultof<_> - entity_xmldocsig = Unchecked.defaultof<_> entity_pubpath = Unchecked.defaultof<_> - entity_accessiblity= Unchecked.defaultof<_> entity_cpath = Unchecked.defaultof<_> - entity_il_repr_cache = Unchecked.defaultof<_> } + entity_il_repr_cache = Unchecked.defaultof<_> + entity_opt_data = Unchecked.defaultof<_>} /// Create a new entity with the given backing data. Only used during unpickling of F# metadata. static member New _reason (data: Entity) : Entity = data @@ -876,26 +930,21 @@ type Entity = /// Link an entity based on empty, unlinked data to the given data. Only used during unpickling of F# metadata. member x.Link (tg: EntityData) = x.entity_typars <- tg.entity_typars - x.entity_kind <- tg.entity_kind x.entity_flags <- tg.entity_flags x.entity_stamp <- tg.entity_stamp x.entity_logical_name <- tg.entity_logical_name - x.entity_compiled_name <- tg.entity_compiled_name x.entity_range <- tg.entity_range - x.entity_other_range <- tg.entity_other_range - x.entity_tycon_repr_accessibility <- tg.entity_tycon_repr_accessibility x.entity_attribs <- tg.entity_attribs x.entity_tycon_repr <- tg.entity_tycon_repr - x.entity_tycon_abbrev <- tg.entity_tycon_abbrev x.entity_tycon_tcaug <- tg.entity_tycon_tcaug - x.entity_exn_info <- tg.entity_exn_info x.entity_modul_contents <- tg.entity_modul_contents - x.entity_xmldoc <- tg.entity_xmldoc - x.entity_xmldocsig <- tg.entity_xmldocsig x.entity_pubpath <- tg.entity_pubpath - x.entity_accessiblity <- tg.entity_accessiblity x.entity_cpath <- tg.entity_cpath x.entity_il_repr_cache <- tg.entity_il_repr_cache + match tg.entity_opt_data with + | Some tg -> + x.entity_opt_data <- Some { entity_compiled_name = tg.entity_compiled_name; entity_other_range = tg.entity_other_range; entity_kind = tg.entity_kind; entity_xmldoc = tg.entity_xmldoc; entity_xmldocsig = tg.entity_xmldocsig; entity_tycon_abbrev = tg.entity_tycon_abbrev; entity_tycon_repr_accessibility = tg.entity_tycon_repr_accessibility; entity_accessiblity = tg.entity_accessiblity; entity_exn_info = tg.entity_exn_info } + | None -> () /// Indicates if the entity is linked to backing data. Only used during unpickling of F# metadata. @@ -979,9 +1028,14 @@ type Entity = /// Indicates if this is a .NET-defined struct or enum type definition , i.e. a value type definition member x.IsILStructOrEnumTycon = + x.IsILTycon && + x.ILTyconRawMetadata.IsStructOrEnum + + /// Indicates if this is a .NET-defined struct type definition , i.e. a value type definition + member x.IsILStructTycon = x.IsILTycon && match x.ILTyconRawMetadata.tdKind with - | ILTypeDefKind.ValueType | ILTypeDefKind.Enum -> true + | ILTypeDefKind.ValueType -> true | _ -> false /// Indicates if this is a struct or enum type definition , i.e. a value type definition @@ -1469,7 +1523,9 @@ and mutable rfield_fattribs: Attribs /// Name/declaration-location of the field - rfield_id: Ident + rfield_id: Ident + + rfield_name_generated: bool /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is /// the signature range for an item in an implementation @@ -1809,26 +1865,21 @@ and Construct = Tycon.New "tycon" { entity_stamp=stamp entity_logical_name=name - entity_compiled_name=None - entity_kind=kind entity_range=m - entity_other_range=None entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=false,preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false, isStructRecordOrUnionType=false) entity_attribs=[] // fetched on demand via est.fs API entity_typars= LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = repr - entity_tycon_repr_accessibility = TAccess([]) - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_modul_contents = MaybeLazy.Lazy (lazy new ModuleOrNamespaceType(Namespace, QueueList.ofList [], QueueList.ofList [])) // Generated types get internal accessibility - entity_accessiblity= access - entity_xmldoc = XmlDoc [||] // fetched on demand via est.fs API - entity_xmldocsig="" entity_pubpath = Some pubpath entity_cpath = Some cpath - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match kind, access with + | TyparKind.Type, TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_kind = kind; entity_accessiblity = access } } #endif static member NewModuleOrNamespace cpath access (id:Ident) xml attribs mtype = @@ -1836,26 +1887,21 @@ and Construct = // Put the module suffix on if needed Tycon.New "mspec" { entity_logical_name=id.idText - entity_compiled_name=None entity_range = id.idRange - entity_other_range = None entity_stamp=stamp - entity_kind=TyparKind.Type entity_modul_contents = mtype entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=true, preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false,isStructRecordOrUnionType=false) entity_typars=LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr - entity_tycon_repr_accessibility = access - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath id) entity_cpath=cpath - entity_accessiblity=access entity_attribs=attribs - entity_xmldoc=xml - entity_xmldocsig="" - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match xml, access with + | XmlDoc [||], TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = xml; entity_tycon_repr_accessibility = access; entity_accessiblity = access } } and Accessibility = /// Indicates the construct can only be accessed from any code in the given type constructor, module or assembly. [] indicates global scope. @@ -2156,57 +2202,21 @@ and ValLinkageFullKey(partialKey: ValLinkagePartialKey, typeForLinkage:TType op /// The full type of the value for the purposes of linking. May be None for non-members, since they can't be overloaded. member x.TypeForLinkage = typeForLinkage - -and ValData = Val -and [] - Val = - // ValData is 19 words!! CONSIDER THIS TINY FORMAT, for all local, immutable, attribute-free values - // val_logical_name: string - // val_range: range - // mutable val_type: TType - // val_stamp: Stamp - - { - /// MUTABILITY: for unpickle linkage - mutable val_logical_name: string - +and ValOptionalData = + { /// MUTABILITY: for unpickle linkage mutable val_compiled_name: string option - /// MUTABILITY: for unpickle linkage - mutable val_range: range - /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is /// the signature range for an item in an implementation mutable val_other_range: (range * bool) option - mutable val_type: TType - - /// MUTABILITY: for unpickle linkage - mutable val_stamp: Stamp - - /// See vflags section further below for encoding/decodings here - mutable val_flags: ValFlags - mutable val_const: Const option /// What is the original, unoptimized, closed-term definition, if any? /// Used to implement [] mutable val_defn: Expr option - /// How visible is this? - /// MUTABILITY: for unpickle linkage - mutable val_access: Accessibility - - /// Is the value actually an instance method/property/event that augments - /// a type, and if so what name does it take in the IL? - /// MUTABILITY: for unpickle linkage - mutable val_member_info: ValMemberInfo option - - /// Custom attributes attached to the value. These contain references to other values (i.e. constructors in types). Mutable to fixup - /// these value references after copying a collection of values. - mutable val_attribs: Attribs - // MUTABILITY CLEANUP: mutability of this field is used by // -- adjustAllUsesOfRecValue // -- TLR optimizations @@ -2216,29 +2226,65 @@ and [] // type-checked expression. mutable val_repr_info: ValReprInfo option + /// How visible is this? + /// MUTABILITY: for unpickle linkage + mutable val_access: Accessibility + + /// XML documentation attached to a value. + /// MUTABILITY: for unpickle linkage + mutable val_xmldoc : XmlDoc + + /// Is the value actually an instance method/property/event that augments + /// a type, and if so what name does it take in the IL? + /// MUTABILITY: for unpickle linkage + mutable val_member_info: ValMemberInfo option + // MUTABILITY CLEANUP: mutability of this field is used by // -- LinearizeTopMatch // // The fresh temporary should just be created with the right parent mutable val_declaring_entity: ParentRef - /// XML documentation attached to a value. + /// XML documentation signature for the value + mutable val_xmldocsig : string + + /// Custom attributes attached to the value. These contain references to other values (i.e. constructors in types). Mutable to fixup + /// these value references after copying a collection of values. + mutable val_attribs: Attribs + } + +and ValData = Val +and [] + Val = + { /// MUTABILITY: for unpickle linkage - mutable val_xmldoc : XmlDoc + mutable val_logical_name: string + + /// MUTABILITY: for unpickle linkage + mutable val_range: range + + mutable val_type: TType + + /// MUTABILITY: for unpickle linkage + mutable val_stamp: Stamp + + /// See vflags section further below for encoding/decodings here + mutable val_flags: ValFlags - /// XML documentation signature for the value - mutable val_xmldocsig : string } + mutable val_opt_data : ValOptionalData option } + + static member EmptyValOptData = { val_compiled_name = None; val_other_range = None; val_const = None; val_defn = None; val_repr_info = None; val_access = TAccess []; val_xmldoc = XmlDoc.Empty; val_member_info = None; val_declaring_entity = ParentNone; val_xmldocsig = String.Empty; val_attribs = [] } /// Range of the definition (implementation) of the value, used by Visual Studio member x.DefinitionRange = - match x.val_other_range with - | Some (m,true) -> m + match x.val_opt_data with + | Some { val_other_range = Some(m,true) } -> m | _ -> x.val_range /// Range of the definition (signature) of the value, used by Visual Studio member x.SigRange = - match x.val_other_range with - | Some (m,false) -> m + match x.val_opt_data with + | Some { val_other_range = Some(m,false) } -> m | _ -> x.val_range /// The place where the value was defined. @@ -2255,10 +2301,16 @@ and [] member x.Type = x.val_type /// How visible is this value, function or member? - member x.Accessibility = x.val_access + member x.Accessibility = + match x.val_opt_data with + | Some optData -> optData.val_access + | _ -> TAccess [] /// The value of a value or member marked with [] - member x.LiteralValue = x.val_const + member x.LiteralValue = + match x.val_opt_data with + | Some optData -> optData.val_const + | _ -> None /// Records the "extra information" for a value compiled as a method. /// @@ -2275,7 +2327,10 @@ and [] /// /// TLR also sets this for inner bindings that it wants to /// represent as "top level" bindings. - member x.ValReprInfo : ValReprInfo option = x.val_repr_info + member x.ValReprInfo : ValReprInfo option = + match x.val_opt_data with + | Some optData -> optData.val_repr_info + | _ -> None member x.Id = ident(x.LogicalName,x.Range) @@ -2311,13 +2366,19 @@ and [] member x.IsExtensionMember = x.val_flags.IsExtensionMember /// The quotation expression associated with a value given the [] tag - member x.ReflectedDefinition = x.val_defn + member x.ReflectedDefinition = + match x.val_opt_data with + | Some optData -> optData.val_defn + | _ -> None /// Is this a member, if so some more data about the member. /// /// Note, the value may still be (a) an extension member or (b) and abstract slot without /// a true body. These cases are often causes of bugs in the compiler. - member x.MemberInfo = x.val_member_info + member x.MemberInfo = + match x.val_opt_data with + | Some optData -> optData.val_member_info + | _ -> None /// Indicates if this is a member member x.IsMember = x.MemberInfo.IsSome @@ -2401,18 +2462,33 @@ and [] member x.IsCompilerGenerated = x.val_flags.IsCompilerGenerated /// Get the declared attributes for the value - member x.Attribs = x.val_attribs + member x.Attribs = + match x.val_opt_data with + | Some optData -> optData.val_attribs + | _ -> [] /// Get the declared documentation for the value - member x.XmlDoc = x.val_xmldoc + member x.XmlDoc = + match x.val_opt_data with + | Some optData -> optData.val_xmldoc + | _ -> XmlDoc.Empty ///Get the signature for the value's XML documentation member x.XmlDocSig - with get() = x.val_xmldocsig - and set(v) = x.val_xmldocsig <- v + with get() = + match x.val_opt_data with + | Some optData -> optData.val_xmldocsig + | _ -> String.Empty + and set(v) = + match x.val_opt_data with + | Some optData -> optData.val_xmldocsig <- v + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_xmldocsig = v } /// The parent type or module, if any (None for expression bindings and parameters) - member x.DeclaringEntity = x.val_declaring_entity + member x.DeclaringEntity = + match x.val_opt_data with + | Some optData -> optData.val_declaring_entity + | _ -> ParentNone /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member @@ -2503,6 +2579,11 @@ and [] | slotsig :: _ -> slotsig.Name | _ -> x.val_logical_name + member x.ValCompiledName = + match x.val_opt_data with + | Some optData -> optData.val_compiled_name + | _ -> None + /// The name of the method in compiled code (with some exceptions where ilxgen.fs decides not to use a method impl) /// - If this is a property then this is 'get_Foo' or 'set_Foo' /// - If this is an implementation of an abstract slot then this may be a mangled name @@ -2510,9 +2591,9 @@ and [] /// - If this is an operator then this is 'op_Addition' member x.CompiledName = let givenName = - match x.val_compiled_name with - | Some n -> n - | None -> x.LogicalName + match x.val_opt_data with + | Some { val_compiled_name = Some n } -> n + | _ -> x.LogicalName // These cases must get stable unique names for their static field & static property. This name // must be stable across quotation generation and IL code generation (quotations can refer to the // properties implicit in these) @@ -2568,28 +2649,40 @@ and [] member x.SetHasBeenReferenced() = x.val_flags <- x.val_flags.SetHasBeenReferenced member x.SetIsCompiledAsStaticPropertyWithoutField() = x.val_flags <- x.val_flags.SetIsCompiledAsStaticPropertyWithoutField member x.SetIsFixed() = x.val_flags <- x.val_flags.SetIsFixed - member x.SetValReprInfo info = x.val_repr_info <- info + member x.SetValReprInfo info = + match x.val_opt_data with + | Some optData -> optData.val_repr_info <- info + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_repr_info = info } member x.SetType ty = x.val_type <- ty - member x.SetOtherRange m = x.val_other_range <- Some m + member x.SetOtherRange m = + match x.val_opt_data with + | Some optData -> optData.val_other_range <- Some m + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_other_range = Some m } + member x.SetDeclaringEntity parent = + match x.val_opt_data with + | Some optData -> optData.val_declaring_entity <- parent + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_declaring_entity = parent } + member x.SetAttribs attribs = + match x.val_opt_data with + | Some optData -> optData.val_attribs <- attribs + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_attribs = attribs } + member x.SetMemberInfo member_info = + match x.val_opt_data with + | Some optData -> optData.val_member_info <- Some member_info + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_member_info = Some member_info } + member x.SetValDefn val_defn = + match x.val_opt_data with + | Some optData -> optData.val_defn <- Some val_defn + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_defn = Some val_defn } /// Create a new value with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Val = { val_logical_name = Unchecked.defaultof<_> - val_compiled_name = Unchecked.defaultof<_> val_range = Unchecked.defaultof<_> - val_other_range = Unchecked.defaultof<_> val_type = Unchecked.defaultof<_> val_stamp = Unchecked.defaultof<_> val_flags = Unchecked.defaultof<_> - val_const = Unchecked.defaultof<_> - val_defn = Unchecked.defaultof<_> - val_access = Unchecked.defaultof<_> - val_member_info = Unchecked.defaultof<_> - val_attribs = Unchecked.defaultof<_> - val_repr_info = Unchecked.defaultof<_> - val_declaring_entity = Unchecked.defaultof<_> - val_xmldoc = Unchecked.defaultof<_> - val_xmldocsig = Unchecked.defaultof<_> } + val_opt_data = Unchecked.defaultof<_> } /// Create a new value with the given backing data. Only used during unpickling of F# metadata. @@ -2601,24 +2694,16 @@ and [] /// Set all the data on a value member x.SetData (tg: ValData) = x.val_logical_name <- tg.val_logical_name - x.val_compiled_name <- tg.val_compiled_name x.val_range <- tg.val_range - x.val_other_range <- tg.val_other_range x.val_type <- tg.val_type x.val_stamp <- tg.val_stamp x.val_flags <- tg.val_flags - x.val_const <- tg.val_const - x.val_defn <- tg.val_defn - x.val_access <- tg.val_access - x.val_member_info <- tg.val_member_info - x.val_attribs <- tg.val_attribs - x.val_repr_info <- tg.val_repr_info - x.val_declaring_entity <- tg.val_declaring_entity - x.val_xmldoc <- tg.val_xmldoc - x.val_xmldocsig <- tg.val_xmldocsig + match tg.val_opt_data with + | Some tg -> x.val_opt_data <- Some { val_compiled_name = tg.val_compiled_name; val_other_range = tg.val_other_range; val_const = tg.val_const; val_defn = tg.val_defn; val_repr_info = tg.val_repr_info; val_access = tg.val_access; val_xmldoc = tg.val_xmldoc; val_member_info = tg.val_member_info; val_declaring_entity = tg.val_declaring_entity; val_xmldocsig = tg.val_xmldocsig; val_attribs = tg.val_attribs } + | None -> () /// Indicates if a value is linked to backing data yet. Only used during unpickling of F# metadata. - member x.IsLinked = match box x.val_attribs with null -> false | _ -> true + member x.IsLinked = match box x.val_logical_name with null -> false | _ -> true override x.ToString() = x.LogicalName @@ -3145,9 +3230,6 @@ and /// Indicates if this is an F#-defined struct or enum type definition , i.e. a value type definition member x.IsFSharpStructOrEnumTycon = x.Deref.IsFSharpStructOrEnumTycon - /// Indicates if this is a .NET-defined struct or enum type definition , i.e. a value type definition - member x.IsILStructOrEnumTycon = x.Deref.IsILStructOrEnumTycon - /// Indicates if we have pre-determined that a type definition has a default constructor. member x.PreEstablishedHasDefaultConstructor = x.Deref.PreEstablishedHasDefaultConstructor @@ -4899,28 +4981,23 @@ let NewExn cpath (id:Ident) access repr attribs doc = Tycon.New "exnc" { entity_stamp=newStamp() entity_attribs=attribs - entity_kind=TyparKind.Type entity_logical_name=id.idText - entity_compiled_name=None entity_range=id.idRange - entity_other_range=None - entity_exn_info= repr entity_tycon_tcaug=TyconAugmentation.Create() - entity_xmldoc=doc - entity_xmldocsig="" entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath id) - entity_accessiblity=access - entity_tycon_repr_accessibility=access entity_modul_contents = MaybeLazy.Strict (NewEmptyModuleOrNamespaceType ModuleOrType) entity_cpath= cpath entity_typars=LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=false, preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false, isStructRecordOrUnionType=false) - entity_il_repr_cache= newCache() } + entity_il_repr_cache= newCache() + entity_opt_data = + match doc, access, repr with + | XmlDoc [||], TAccess [], TExnNone -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = doc; entity_accessiblity = access; entity_tycon_repr_accessibility = access; entity_exn_info = repr } } /// Create a new TAST RecdField node for an F# class, struct or record field -let NewRecdField stat konst id ty isMutable isVolatile pattribs fattribs docOption access secret = +let NewRecdField stat konst id nameGenerated ty isMutable isVolatile pattribs fattribs docOption access secret = { rfield_mutable=isMutable rfield_pattribs=pattribs rfield_fattribs=fattribs @@ -4932,7 +5009,8 @@ let NewRecdField stat konst id ty isMutable isVolatile pattribs fattribs docOpt rfield_secret = secret rfield_xmldoc = docOption rfield_xmldocsig = "" - rfield_id=id + rfield_id=id + rfield_name_generated = nameGenerated rfield_other_range = None } @@ -4941,25 +5019,20 @@ let NewTycon (cpath, nm, m, access, reprAccess, kind, typars, docOption, usesPre Tycon.New "tycon" { entity_stamp=stamp entity_logical_name=nm - entity_compiled_name=None - entity_kind=kind entity_range=m - entity_other_range=None entity_flags=EntityFlags(usesPrefixDisplay=usesPrefixDisplay, isModuleOrNamespace=false,preEstablishedHasDefaultCtor=preEstablishedHasDefaultCtor, hasSelfReferentialCtor=hasSelfReferentialCtor, isStructRecordOrUnionType=false) entity_attribs=[] // fixed up after entity_typars=typars - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr - entity_tycon_repr_accessibility = reprAccess - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_modul_contents = mtyp - entity_accessiblity=access - entity_xmldoc = docOption - entity_xmldocsig="" entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath (mkSynId m nm)) entity_cpath = cpath - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match kind, docOption, reprAccess, access with + | TyparKind.Type, XmlDoc [||], TAccess [], TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_kind = kind; entity_xmldoc = docOption; entity_tycon_repr_accessibility = reprAccess; entity_accessiblity=access } } let NewILTycon nlpath (nm,m) tps (scoref:ILScopeRef, enc, tdef:ILTypeDef) mtyp = @@ -4979,24 +5052,27 @@ exception FullAbstraction of string * range let NewModuleOrNamespace cpath access (id:Ident) xml attribs mtype = Construct.NewModuleOrNamespace cpath access id xml attribs mtype let NewVal (logicalName:string,m:range,compiledName,ty,isMutable,isCompGen,arity,access,recValInfo,specialRepr,baseOrThis,attribs,inlineInfo,doc,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal,konst,actualParent) : Val = - let stamp = newStamp() + let stamp = newStamp() Val.New - { val_stamp = stamp - val_logical_name=logicalName - val_compiled_name= (match compiledName with Some v when v <> logicalName -> compiledName | _ -> None) - val_range=m - val_other_range=None - val_defn=None - val_repr_info= arity - val_declaring_entity= actualParent - val_flags = ValFlags(recValInfo,baseOrThis,isCompGen,inlineInfo,isMutable,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal) - val_const= konst - val_access=access - val_member_info=specialRepr - val_attribs=attribs - val_type = ty - val_xmldoc = doc - val_xmldocsig = ""} + { val_stamp = stamp + val_logical_name = logicalName + val_range = m + val_flags = ValFlags(recValInfo,baseOrThis,isCompGen,inlineInfo,isMutable,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal) + val_type = ty + val_opt_data = + match compiledName, arity, konst, access, doc, specialRepr, actualParent, attribs with + | None, None, None, TAccess [], XmlDoc [||], None, ParentNone, [] -> None + | _ -> + Some { Val.EmptyValOptData with + val_compiled_name = (match compiledName with Some v when v <> logicalName -> compiledName | _ -> None) + val_repr_info = arity + val_const = konst + val_access = access + val_xmldoc = doc + val_member_info = specialRepr + val_declaring_entity = actualParent + val_attribs = attribs } + } let NewCcuContents sref m nm mty = @@ -5072,10 +5148,14 @@ let CombineCcuContentFragments m l = match entity1.IsModuleOrNamespace, entity2.IsModuleOrNamespace with | true,true -> entity1 |> NewModifiedTycon (fun data1 -> + let xml = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc { data1 with - entity_xmldoc = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc entity_attribs = entity1.Attribs @ entity2.Attribs - entity_modul_contents = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes (path@[entity2.DemangledModuleOrNamespaceName]) entity2.Range entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) }) + entity_modul_contents = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes (path@[entity2.DemangledModuleOrNamespaceName]) entity2.Range entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) + entity_opt_data = + match data1.entity_opt_data with + | Some optData -> Some { optData with entity_xmldoc = xml } + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = xml } }) | false,false -> error(Error(FSComp.SR.tastDuplicateTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path),entity2.Range)) | _,_ -> diff --git a/src/fsharp/test.snk b/src/fsharp/test.snk new file mode 100644 index 00000000000..c16543bdc48 Binary files /dev/null and b/src/fsharp/test.snk differ diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index c79be706d15..ad7572ef053 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6972,6 +6972,16 @@ Tato metoda nebo vlastnost se obvykle z kódu F# nepoužívá, použijte místo toho pro dekonstrukci explicitní vzor řazené kolekce členů. + + This expression returns a value of type '{0}' 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'. + Tento výraz vrátí hodnotu typu {0}, ale implicitně se zahodí. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli výraz použít jako hodnotu v sekvenci, použijte explicitní klíčové slovo yield. + + + + This expression returns a value of type '{0}' 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!'. + Tento výraz vrátí hodnotu typu {0}, ale implicitně se zahodí. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli výraz použít jako hodnotu v sekvenci, použijte explicitní klíčové slovo yield!. + + \ 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 8ff290372d1..1754e4d729a 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6969,7 +6969,17 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - Diese Methode oder Eigenschaft wird normalerweise nicht aus dem F#-Code verwendet. Nutzen Sie stattdessen zur Dekonstruktion ein explizites Tupelmuster. + Diese Methode oder Eigenschaft wird normalerweise nicht im F#-Code verwendet. Nutzen Sie stattdessen zur Dekonstruktion ein explizites Tupelmuster. + + + + This expression returns a value of type '{0}' 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'. + Dieser Ausdruck gibt einen Wert des Typs "{0}" zurück, wird aber implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie den Ausdruck als Wert in der Sequenz einsetzen möchten, verwenden Sie explizit "yield". + + + + This expression returns a value of type '{0}' 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!'. + Dieser Ausdruck gibt einen Wert des Typs "{0}" zurück, wird aber implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie den Ausdruck als Wert in der Sequenz einsetzen möchten, verwenden Sie explizit "yield!". diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 9407743447a..a1dece2d6f9 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -6972,6 +6972,16 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + + This expression returns a value of type '{0}' 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'. + This expression returns a value of type '{0}' 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'. + + + + This expression returns a value of type '{0}' 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!'. + This expression returns a value of type '{0}' 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!'. + + \ 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 fac5764866d..0ea4958ff74 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6972,6 +6972,16 @@ Este método o propiedad no se utiliza normalmente desde código F#, use un modelo de tupla explícito para la deconstrucción en su lugar. + + This expression returns a value of type '{0}' 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'. + Esta expresión devuelve un valor de tipo “{0}”, pero se descarta de forma implícita. Considere el uso de “let” para enlazar el resultado a un nombre; por ejemplo, “let result = expression”. Si su intención es utilizar la expresión como un valor en la secuencia, utilice “yield” de forma explícita. + + + + This expression returns a value of type '{0}' 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!'. + Esta expresión devuelve un valor de tipo “{0}”, pero se descarta de forma implícita. Considere el uso de “let” para enlazar el resultado a un nombre; por ejemplo, “let result = expression”. Si su intención es utilizar la expresión como un valor en la secuencia, utilice “yield” de forma explícita. + + \ 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 10f4b9f2fc0..c74eb738e59 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6972,6 +6972,16 @@ Normalement, cette méthode ou propriété n'est pas utilisée dans le code F#. Utilisez plutôt un modèle de tuple explicite pour la déconstruction. + + This expression returns a value of type '{0}' 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'. + Cette expression retourne une valeur de type '{0}', mais est implicitement ignorée. Utilisez 'let' pour lier le résultat à un nom, par ex. 'let result = expression'. Si vous voulez utiliser l'expression comme valeur dans la séquence, utilisez un 'yield' explicite. + + + + This expression returns a value of type '{0}' 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!'. + Cette expression retourne une valeur de type '{0}', mais est implicitement ignorée. Utilisez 'let' pour lier le résultat à un nom, par ex. 'let result = expression'. Si vous voulez utiliser l'expression comme valeur dans la séquence, utilisez un 'yield!' explicite. + + \ 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 e53aa55a454..d063e9e49ce 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -1454,7 +1454,7 @@ Quotations cannot contain array pattern matching - Le quotation non possono contenere caratteri jolly per identificare matrici + Le quotation non possono contenere criteri di ricerca per identificare matrici @@ -2619,7 +2619,7 @@ 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. - Espressione di costruzione di oggetto non valida. I costruttori di oggetto espliciti devono chiamare un costruttore alternativo o inizializzare tutti i campi dell'oggetto e specificare una chiamata al costruttore di super classe. + Espressione di costruzione di oggetti non valida. I costruttori di oggetto espliciti devono chiamare un costruttore alternativo o inizializzare tutti i campi dell'oggetto e specificare una chiamata al costruttore di super classe. @@ -3034,7 +3034,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 oggetto 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 oggetti ereditato e assegna un valore a ogni campo @@ -5339,7 +5339,7 @@ Unmatched '<'. Expected closing '>' - '<' non corrispondente. Previsto '>' di chiusura + '<' senza corrispondenza. Previsto '>' di chiusura @@ -5964,7 +5964,7 @@ Unmatched '[<'. Expected closing '>]' - '[<' non corrispondente. Previsto '>]' di chiusura + '[<' senza corrispondenza. Previsto '>]' di chiusura @@ -6972,6 +6972,16 @@ Questo metodo o questa proprietà non è in genere usato dal codice F#. Per la decostruzione usare invece un criterio di tupla esplicito. + + This expression returns a value of type '{0}' 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'. + Questa espressione restituisce un valore di tipo '{0}' ma viene rimossa in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let risultato = espressione'. Se si intende usare l'espressione come valore nella sequenza, usare l'operando 'yield' esplicito. + + + + This expression returns a value of type '{0}' 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!'. + Questa espressione restituisce un valore di tipo '{0}' ma viene rimossa in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let risultato = espressione'. Se si intende usare l'espressione come valore nella sequenza, usare l'operando 'yield!' esplicito. + + \ 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 e1f5ceff5fe..f515115c15d 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6972,6 +6972,16 @@ このメソッドまたはプロパティは通常、F# コードから使用されません。代わりに、明示的なタプル パターンを分解に使用してください。 + + This expression returns a value of type '{0}' 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'. + この式は型 '{0}' の値を返しますが、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。式をシーケンス内で値として使用する場合は、明示的に 'yield' を使用してください。 + + + + This expression returns a value of type '{0}' 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!'. + この式は型 '{0}' の値を返しますが、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。式をシーケンス内で値として使用する場合は、明示的に 'yield!' を使用してください。 + + \ 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 5b559a63ca8..ca9ffe834f4 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6972,6 +6972,16 @@ 이 메서드 또는 속성은 일반적으로 F# 코드에서 사용되지 않습니다. 대신 분해에 대해 명시적 튜플 패턴을 사용하세요. + + This expression returns a value of type '{0}' 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'. + 이 식은 '{0}' 형식의 값을 반환하지만 암시적으로 삭제됩니다. 'let'을 사용하여 결과를 이름에 바인딩하세요(예: 'let result = expression'). 식을 시퀀스의 값으로 사용하려면 명시적 'yield'를 사용하세요. + + + + This expression returns a value of type '{0}' 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!'. + 이 식은 '{0}' 형식의 값을 반환하지만 암시적으로 삭제됩니다. 'let'을 사용하여 결과를 이름에 바인딩하세요(예: 'let result = expression'). 식을 시퀀스의 값으로 사용하려면 명시적 'yield!'를 사용하세요. + + \ 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 ad7667fb07f..4cad63a4afa 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6972,6 +6972,16 @@ Ta metoda lub właściwość nie jest zwykle używana z kodu języka F#. Zamiast tego do dekonstrukcji użyj jawnego wzorca krotki. + + This expression returns a value of type '{0}' 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'. + To wyrażenie zwraca wartość typu „{0}”, ale jest niejawnie odrzucane. Rozważ użycie instrukcji „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz użyć tego wyrażenia jako wartości w sekwencji, użyj jawnej instrukcji „yield”. + + + + This expression returns a value of type '{0}' 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!'. + To wyrażenie zwraca wartość typu „{0}”, ale jest niejawnie odrzucane. Rozważ użycie instrukcji „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz użyć tego wyrażenia jako wartości w sekwencji, użyj jawnej instrukcji „yield!”. + + \ 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 cdaeee1cdc6..98205cd7a14 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6972,6 +6972,16 @@ Essa propriedade ou esse método normalmente não é usado no código F#. Use um padrão de tupla explícito para a desconstrução. + + This expression returns a value of type '{0}' 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'. + Essa expressão retorna um valor de tipo '{0}', mas é descartada de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende usar a expressão como um valor na sequência, use um “yield” explícito. + + + + This expression returns a value of type '{0}' 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!'. + Essa expressão retorna um valor de tipo '{0}', mas é descartada de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende usar a expressão como um valor na sequência, use um “yield!” explícito. + + \ 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 98dbe821669..4e32cbed5d1 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6972,6 +6972,16 @@ Этот метод или свойство обычно не используется в коде F#. Вместо этого используйте явный шаблон кортежа для деконструкции. + + This expression returns a value of type '{0}' 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'. + Это выражение возвращает значение типа "{0}", но оно неявно отбрасывается. Чтобы привязать результат к какому-то имени, используйте "let", например: "let <результат> = <выражение>". Если вы собирались использовать выражение как значение в последовательности, используйте в явном виде "yield". + + + + This expression returns a value of type '{0}' 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!'. + Это выражение возвращает значение типа "{0}", но оно неявно отбрасывается. Чтобы привязать результат к какому-то имени, используйте "let", например: "let <результат> = <выражение>". Если вы собирались использовать выражение как значение в последовательности, используйте в явном виде "yield!". + + \ 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 8e3f343c173..93cfa3de92d 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6972,6 +6972,16 @@ Bu metot veya özellik normalde F# kodundan kullanılmaz, bunun yerine ayrıştırma için açıkça bir demet deseni kullanın. + + This expression returns a value of type '{0}' 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'. + Bu ifade '{0}' türünde bir değer döndürür ancak örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanabilirsiniz, örn. 'let sonuc = ifade'. İfadeyi dizide bir değer olarak kullanmayı amaçladıysanız açık bir 'yield' kullanın. + + + + This expression returns a value of type '{0}' 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!'. + Bu ifade '{0}' türünde bir değer döndürür ancak örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanabilirsiniz, örn. 'let sonuc = ifade'. İfadeyi dizide bir değer olarak kullanmayı amaçladıysanız açık bir 'yield!' kullanın. + + \ 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 874613201b7..f9af6c23c8b 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6972,6 +6972,16 @@ 通常不通过 F# 代码使用此方法或属性,而是改用显式元组模式进行析构。 + + This expression returns a value of type '{0}' 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'. + 此表达式返回类型为“{0}”的值,但被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要使用该表达式作为序列中的值,则使用显式 "yield"。 + + + + This expression returns a value of type '{0}' 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!'. + 此表达式返回类型为“{0}”的值,但被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要使用该表达式作为序列中的值,则使用显式 "yield!"。 + + \ 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 08102beb66e..63e673fe136 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6972,6 +6972,16 @@ F# 程式碼不常使用這個方法或屬性,請改用明確的元組模式進行解構。 + + This expression returns a value of type '{0}' 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'. + 此運算式會傳回類型為 '{0}' 的值,但會被間接捨棄。請考慮使用 'let' 將結果繫結到名稱。例如 'let result = expression'。若您想要在序列中,以值的形式使用運算式,請直接使用 'yield'。 + + + + This expression returns a value of type '{0}' 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!'. + 此運算式會傳回類型為 '{0}' 的值,但會被間接捨棄。請考慮使用 'let' 將結果繫結到名稱。例如 'let result = expression'。若您想要在序列中,以值的形式使用運算式,請直接使用 'yield!'。 + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.cs.xlf b/src/fsharp/xlf/FSStrings.cs.xlf index 595a0422f5a..90e272e863b 100644 --- a/src/fsharp/xlf/FSStrings.cs.xlf +++ b/src/fsharp/xlf/FSStrings.cs.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Výsledek tohoto výrazu se implicitně ignoruje. Zvažte možnost použít ignore, aby se tato hodnota explicitně zahodila, třeba expr |> ignore, nebo let, aby se výsledek svázal s názvem, třeba let result = expr. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Výsledek tohoto výrazu má typ {0} a implicitně se ignoruje. Zvažte možnost použít klíčové slovo ignore, aby se tato hodnota explicitně zahodila, třeba expr |> ignore, nebo klíčové slovo let, aby se výsledek svázal s názvem, třeba let výsledek = expr. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Výsledek tohoto výrazu rovnosti se implicitně zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Výsledek tohoto výrazu rovnosti má typ {0} a implicitně se zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Výsledek tohoto výrazu rovnosti se implicitně zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli nastavit hodnotu na vlastnost, použijte operátor <-, např. {0}.{1} <- výraz. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Výsledek tohoto výrazu rovnosti má typ {0} a implicitně se zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli nastavit hodnotu na vlastnost, použijte operátor <-, např. {1}.{2} <- výraz. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Výsledek tohoto výrazu rovnosti se implicitně zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli mutovat hodnotu, označte hodnotu jako mutable a použijte operátor <-, např. {0} <- výraz. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Výsledek tohoto výrazu rovnosti má typ {0} a implicitně se zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli mutovat hodnotu, označte hodnotu jako mutable a použijte operátor <-, např. {1} <- výraz. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Výsledek tohoto výrazu rovnosti se implicitně zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli mutovat hodnotu, použijte operátor <-, např. {0} <- výraz. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Výsledek tohoto výrazu rovnosti má typ {0} a implicitně se zruší. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli mutovat hodnotu, použijte operátor <-, např. {1} <- výraz. diff --git a/src/fsharp/xlf/FSStrings.de.xlf b/src/fsharp/xlf/FSStrings.de.xlf index 7a94ebe9e1d..1c98a1cdb01 100644 --- a/src/fsharp/xlf/FSStrings.de.xlf +++ b/src/fsharp/xlf/FSStrings.de.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Das Ergebnis dieses Ausdrucks wird implizit ignoriert. Verwenden Sie ggf. "ignore", um diesen Wert explizit zu verwerfen, z. B. "expr |> ignore" oder "let" zum Binden des Ergebnisses an einen Namen, z. B. "let result = expr". + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Das Ergebnis dieses Ausdrucks weist den Typ "{0}" auf und wird implizit ignoriert. Verwenden Sie ggf. "ignore", um diesen Wert explizit zu verwerfen, z. B. "expr |> ignore" oder "let" zum Binden des Ergebnisses an einen Namen, z. B. "let result = expr". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Das Ergebnis dieses Gleichheitsausdrucks wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Das Ergebnis dieses Gleichheitsausdrucks weist den Typ "{0}" auf und wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Das Ergebnis dieses Gleichheitsausdrucks wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert auf eine Eigenschaft festlegen möchten, verwenden Sie den Operator "<-". Beispiel: "{0}.{1} <- Ausdruck". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Das Ergebnis dieses Gleichheitsausdrucks weist den Typ "{0}" auf und wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert auf eine Eigenschaft festlegen möchten, verwenden Sie den Operator "<-". Beispiel: "{1}.{2} <-Ausdruck". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Das Ergebnis dieses Gleichheitsausdrucks wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert mutieren möchten, markieren Sie ihn als "mutable", und verwenden Sie den Operator "<-". Beispiel: "{0} <- Ausdruck". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Das Ergebnis dieses Gleichheitsausdrucks weist den Typ "{0}" auf und wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert mutieren möchten, markieren Sie ihn als "mutable", und verwenden Sie den Operator "<-". Beispiel: "{1} <- Ausdruck". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Das Ergebnis dieses Gleichheitsausdrucks wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert mutieren möchten, verwenden Sie den Operator "<-". Beispiel: "{0} <- Ausdruck". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Das Ergebnis dieses Gleichheitsausdrucks weist den Typ "{0}" auf und wird implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie einen Wert mutieren möchten, verwenden Sie den Operator "<-". Beispiel: "{1} <- Ausdruck". diff --git a/src/fsharp/xlf/FSStrings.en.xlf b/src/fsharp/xlf/FSStrings.en.xlf index 45e76d2e303..03bc0887740 100644 --- a/src/fsharp/xlf/FSStrings.en.xlf +++ b/src/fsharp/xlf/FSStrings.en.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. diff --git a/src/fsharp/xlf/FSStrings.es.xlf b/src/fsharp/xlf/FSStrings.es.xlf index 9bb6ba04bf8..986deafbc5c 100644 --- a/src/fsharp/xlf/FSStrings.es.xlf +++ b/src/fsharp/xlf/FSStrings.es.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Implícitamente se omite el resultado de esta expresión. Considere el uso de 'ignore' para descartar este valor explícitamente, por ejemplo, 'expr |> ignore' o 'let' para vincular el resultado a un nombre, por ejemplo, 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Implícitamente se omite el resultado de esta expresión, que tiene el tipo "{0}". Considere el uso de "ignore" para descartar este valor explícitamente, por ejemplo, "expr |> ignore" o "let" para vincular el resultado a un nombre, por ejemplo, "let result = expr". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - El resultado de esta expresión de igualdad se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + El resultado de esta expresión de igualdad, de tipo "{0}", se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - El resultado de esta expresión de igualdad se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea establecer un valor en una propiedad, use el operador "<-". Por ejemplo: "{0}.{1} <- expresión". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + El resultado de esta expresión de igualdad, de tipo "{0}", se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea establecer un valor en una propiedad, use el operador "<-". Por ejemplo: "{1}.{2} <- expresión". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - El resultado de esta expresión de igualdad se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea mutar un valor, marque el valor como "mutable" y use el operador "<-". Por ejemplo: "{0} <- expresión". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + El resultado de esta expresión de igualdad, de tipo "{0}", se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea mutar un valor, marque el valor como "mutable" y use el operador "<-". Por ejemplo: "{1} <- expresión". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - El resultado de esta expresión de igualdad se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea mutar un valor, use el operador "<-". Por ejemplo: "{0} <- expresión". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + El resultado de esta expresión de igualdad, de tipo "{0}", se descarta de forma implícita. Considere la posibilidad de usar "let" para enlazar el resultado a un nombre, por ejemplo "let resultado = expresión". Si desea mutar un valor, use el operador "<-". Por ejemplo: "{1} <- expresión". diff --git a/src/fsharp/xlf/FSStrings.fr.xlf b/src/fsharp/xlf/FSStrings.fr.xlf index b3046795b11..4d4cccb39fe 100644 --- a/src/fsharp/xlf/FSStrings.fr.xlf +++ b/src/fsharp/xlf/FSStrings.fr.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Le résultat de cette expression est ignoré implicitement. Songez à utiliser 'ignore' pour abandonner explicitement cette valeur (par exemple, 'expr |> ignore') ou 'let' pour lier le résultat à un nom (par exemple, 'let result = expr'). + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Le résultat de cette expression a le type '{0}' et est implicitement ignoré. Utilisez 'ignore' pour abandonner cette valeur de manière explicite, par exemple 'expr |> ignore', ou 'let' pour lier le résultat à un nom, par exemple 'let result = expr'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Le résultat de cette expression d'égalité est implicitement ignoré. Utilisez 'let' pour lier le résultat à un nom, par ex., 'let result = expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Le résultat de cette expression d'égalité a le type '{0}' et est implicitement abandonné. Utilisez 'let' pour lier le résultat à un nom, par exemple 'let result = expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Le résultat de cette expression d'égalité est implicitement ignoré. Utilisez 'let' pour lier le résultat à un nom, par ex., 'let result = expression'. Si vous voulez définir une valeur sur une propriété, utilisez l'opérateur '<-', par ex., '{0}.{1} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Le résultat de cette expression d'égalité a le type '{0}' et est implicitement abandonné. Utilisez 'let' pour lier le résultat à un nom, par exemple 'let result = expression'. Si vous avez l'intention de définir une valeur pour une propriété, utilisez l'opérateur '<-'. Exemple : '{1}.{2} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Le résultat de cette expression d'égalité est implicitement ignoré. Utilisez 'let' pour lier le résultat à un nom, par ex., 'let result = expression'. Si vous voulez muter une valeur, marquez la valeur avec 'mutable' et utilisez l'opérateur '<-', par ex., '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Le résultat de cette expression d'égalité a le type '{0}' et est implicitement abandonné. Utilisez 'let' pour lier le résultat à un nom, par exemple 'let result = expression'. Si vous avez l'intention de muter une valeur, marquez cette valeur à l'aide de 'mutable' et utilisez l'opérateur '<-'. Exemple : '{1} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Le résultat de cette expression d'égalité est implicitement ignoré. Utilisez 'let' pour lier le résultat à un nom, par ex., 'let result = expression'. Si vous voulez muter une valeur, utilisez l'opérateur '<-', par ex., '{0} <- expression'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Le résultat de cette expression d'égalité a le type '{0}' et est implicitement abandonné. Utilisez 'let' pour lier le résultat à un nom, par exemple 'let result = expression'. Si vous avez l'intention de muter une valeur, utilisez l'opérateur '<-'. Exemple : '{1} <- expression'. diff --git a/src/fsharp/xlf/FSStrings.it.xlf b/src/fsharp/xlf/FSStrings.it.xlf index 2918a10093f..e26f38b3270 100644 --- a/src/fsharp/xlf/FSStrings.it.xlf +++ b/src/fsharp/xlf/FSStrings.it.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Il risultato di questa espressione viene ignorato in modo implicito. Provare a usare 'ignore' per rimuovere esplicitamente questo valore, ad esempio 'expr |> ignore', oppure 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Il risultato di questa espressione è di tipo '{0}' e viene ignorato in modo implicito. Provare a usare 'ignore' per rimuovere esplicitamente questo valore, ad esempio 'expr |> ignore', oppure 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = expr'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Il risultato di questa espressione di uguaglianza viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Il risultato di questa espressione di uguaglianza è di tipo '{0}' e viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Il risultato di questa espressione di uguaglianza viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende impostare un valore su una proprietà, usare l'operatore '<-', ad esempio '{0}.{1} <- espressione'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Il risultato di questa espressione di uguaglianza è di tipo '{0}' e viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende impostare un valore su una proprietà, usare l'operatore '<-', ad esempio '{1}.{2} <- espressione'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Il risultato di questa espressione di uguaglianza viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende modificare un valore, contrassegnare il valore 'mutable' e usare l'operatore '<-', ad esempio '{0} <- espressione'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Il risultato di questa espressione di uguaglianza è di tipo '{0}' e viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende modificare un valore, contrassegnare il valore 'mutable' e usare l'operatore '<-', ad esempio '{1} <- espressione'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Il risultato di questa espressione di uguaglianza viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende modificare un valore, usare l'operatore '<-', ad esempio '{0} <- espressione'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Il risultato di questa espressione di uguaglianza è di tipo '{0}' e viene rimosso in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let result = espressione'. Se si intende modificare un valore, usare l'operatore '<-', ad esempio '{1} <- espressione'. diff --git a/src/fsharp/xlf/FSStrings.ja.xlf b/src/fsharp/xlf/FSStrings.ja.xlf index ed6e8e4662f..7256d1b1a49 100644 --- a/src/fsharp/xlf/FSStrings.ja.xlf +++ b/src/fsharp/xlf/FSStrings.ja.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - この式の結果は暗黙に無視されます。'expr |> ignore' のように 'ignore' を使用してこの値を明示的に破棄するか、'let result = expr' のように 'let' を使用して結果を名前にバインドすることをご考慮ください。 + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + この式の結果は型 '{0}' を持ち、暗黙的に無視されます。'expr |> ignore' のように 'ignore' を使用してこの値を明示的に破棄するか、'let result = expr' のように 'let' を使用して結果を名前にバインドすることをご考慮ください。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - この等式の結果は暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + この等式の結果は型 '{0}' を持ち、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - この等式の結果は暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値をプロパティに設定する場合は、'<-' 演算子を使用します。例: '{0}.{1} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + この等式の結果は型 '{0}' を持ち、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値をプロパティに設定する場合は、'<-' 演算子を使用します。例: '{1}.{2} <- expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - この等式の結果は暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値を変換する場合は、値 'mutable' をマークして、'<-' 演算子を使用します。例: '{0} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + この等式の結果は型 '{0}' を持ち、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値を変換する場合は、値 'mutable' をマークして、'<-' 演算子を使用します。例: '{1} <- expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - この等式の結果は暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値を変換する場合は、'<-' 演算子を使用します。例: '{0} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + この等式の結果は型 '{0}' を持ち、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。値を変換する場合は、'<-' 演算子を使用します。例: '{1} <- expression'。 diff --git a/src/fsharp/xlf/FSStrings.ko.xlf b/src/fsharp/xlf/FSStrings.ko.xlf index b7114046056..2ba29ac4307 100644 --- a/src/fsharp/xlf/FSStrings.ko.xlf +++ b/src/fsharp/xlf/FSStrings.ko.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - 이 식의 결과는 암시적으로 무시됩니다. 'ignore'를 사용하여 이 값을 명시적으로 버리거나(예: 'expr |> ignore'), 'let'을 사용하여 결과를 이름에 바인딩하세요(예: 'let result = expr'). + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + 이 식의 결과는 ‘{0}’ 형식이며 암시적으로 무시됩니다. 'ignore'를 사용하여 이 값을 명시적으로 버리거나(예: 'expr |> ignore'), 'let'을 사용하여 결과를 이름에 바인딩하세요(예: 'let result = expr'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - 이 같음 식의 결과가 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + 이 같음 식의 결과는 ‘{0}’ 형식이며 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - 이 같음 식의 결과가 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 속성으로 설정하려면 '<-' 연산자를 사용하세요(예: '{0}.{1} <- expression'). + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + 이 같음 식의 결과는 ‘{0}’ 형식이며 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 속성으로 설정하려면 '<-' 연산자를 사용하세요(예: '{1}.{2} <- expression'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - 이 같음 식의 결과가 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 변경하려면 값을 'mutable'로 표시하고 '<-' 연산자를 사용하세요(예: '{0} <- expression'). + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + 이 같음 식의 결과는 ‘{0}’ 형식이며 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 변경하려면 값을 'mutable'로 표시하고 '<-' 연산자를 사용하세요(예: '{1} <- expression'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - 이 같음 식의 결과가 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 변경하려면 '<-' 연산자를 사용하세요(예: '{0} <- expression'). + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + 이 같음 식의 결과는 ‘{0}’ 형식이며 암시적으로 삭제됩니다. 결과를 이름에 바인딩하려면 'let'을 사용하세요(예: 'let result = expression'). 값을 변경하려면 '<-' 연산자를 사용하세요(예: '{1} <- expression'). diff --git a/src/fsharp/xlf/FSStrings.pl.xlf b/src/fsharp/xlf/FSStrings.pl.xlf index 567512b1a97..d544bdcc32e 100644 --- a/src/fsharp/xlf/FSStrings.pl.xlf +++ b/src/fsharp/xlf/FSStrings.pl.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Wynik tego wyrażenia jest niejawnie ignorowany. Rozważ użycie elementu „ignore”, aby niejawnie odrzucić tę wartość (np. „expr |> ignore”), lub elementu „let”, aby powiązać wynik z nazwą (np. „let result = expr”). + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Wynik tego wyrażenia ma typ „{0}” i jest niejawnie ignorowany. Rozważ użycie elementu „ignore”, aby jawnie odrzucić tę wartość (np. „expr |> ignore”), lub elementu „let”, aby powiązać wynik z nazwą (np. „let result = expr”). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Wynik tego wyrażenia równości jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Wynik tego wyrażenia równości ma typ „{0}” i jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Wynik tego wyrażenia równości jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz ustawić wartość właściwości, użyj operatora „<-”, np. „{0}.{1} <- wyrażenie”. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Wynik tego wyrażenia równości ma typ „{0}” i jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz ustawić wartość właściwości, użyj operatora „<-”, np. „{1}.{2} <- wyrażenie”. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Wynik tego wyrażenia równości jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz zmutować wartość, oznacz ją za pomocą deklaratora „mutable” i użyj operatora „<-”, np. „{0} <- wyrażenie”. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Wynik tego wyrażenia równości ma typ „{0}” i jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz zmutować wartość, oznacz ją za pomocą deklaratora „mutable” i użyj operatora „<-”, np. „{1} <- wyrażenie”. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Wynik tego wyrażenia równości jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz zmutować wartość, użyj operatora „<-”, np. „{0} <- wyrażenie”. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Wynik tego wyrażenia równości ma typ „{0}” i jest niejawnie odrzucany. Rozważ użycie słowa kluczowego „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz zmutować wartość, użyj operatora „<-”, np. „{1} <- wyrażenie”. diff --git a/src/fsharp/xlf/FSStrings.pt-BR.xlf b/src/fsharp/xlf/FSStrings.pt-BR.xlf index 1e53365bf7b..b1dccf3db10 100644 --- a/src/fsharp/xlf/FSStrings.pt-BR.xlf +++ b/src/fsharp/xlf/FSStrings.pt-BR.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - O resultado dessa expressão é ignorado implicitamente. Considere usar 'ignore' para descartar esse valor explicitamente, por exemplo, 'expr |> ignore' ou 'let' para associar o resultado a um nome, por exemplo, 'let result = expr'. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + O resultado dessa expressão contém o tipo '{0}' e é ignorado de forma implícita. Considere o uso de 'ignore' para descartar esse valor de forma explícita, por exemplo, 'expr |> ignore' ou 'let' para associar o resultado a um nome, por exemplo, 'let result = expr'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - O resultado dessa expressão de igualdade é implicitamente descartado. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let resultado = expressão'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + O resultado dessa expressão de igualdade contém o tipo '{0}' e é descartado de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - O resultado dessa expressão de igualdade é implicitamente descartado. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let resultado = expressão'. Se você pretende definir um valor de uma propriedade, use o operador '<-', por exemplo, '{0}.{1} <- expressão'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + O resultado dessa expressão de igualdade contém o tipo '{0}' e é descartado de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende definir um valor com uma propriedade, use o operador '<-', por exemplo, '{1}.{2} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - O resultado dessa expressão de igualdade é implicitamente descartado. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let resultado = expressão'. Se você pretende alterar um valor, marque-o como 'mutable' e use o operador '<-', por exemplo, '{0} <-expressão'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + O resultado dessa expressão de igualdade contém o tipo '{0}' e é descartado de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende alterar um valor, marque-o como 'mutable' e use o operador '<-', por exemplo, '{1} <- expression'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - O resultado dessa expressão de igualdade é implicitamente descartado. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let resultado = expressão'. Se você pretende alterar um valor, use o operador '<-', por exemplo, '{0} <- expressão'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + O resultado dessa expressão de igualdade contém o tipo '{0}' e é descartado de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende alterar um valor, use o operador '<-', por exemplo, '{1} <- expression'. diff --git a/src/fsharp/xlf/FSStrings.ru.xlf b/src/fsharp/xlf/FSStrings.ru.xlf index d9d8539a80c..bd45c8d8eee 100644 --- a/src/fsharp/xlf/FSStrings.ru.xlf +++ b/src/fsharp/xlf/FSStrings.ru.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Результат этого выражения неявно игнорируется. Рассмотрите использование здесь "ignore", чтобы отбросить это значение явным образом, например "expr |> ignore", или же "let", чтобы привязать результат к имени, например "let result = expr". + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Результат этого выражения имеет тип "{0}" и неявно игнорируется. Попробуйте использовать "ignore", чтобы явным образом удалить это значение (например: "expr |> ignore"), или используйте "let", чтобы привязать результат к имени (например: "let result = expr"). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Результат этого выражения равенства неявно удаляется. Рекомендуем использовать let, чтобы привязать результат к имени, например "let result = expression". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Результат этого выражения равенства имеет тип "{0}" и неявно отбрасывается. Попробуйте использовать "let", чтобы привязать результат к имени, например: "let result = expression". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Результат этого выражения равенства неявно удаляется. Рекомендуем использовать let, чтобы привязать результат к имени, например "let result = expression". Если вы собирались присваивать значение свойству, используйте оператор "<-", например "{0}.{1} <- expression". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Результат этого выражения равенства имеет тип "{0}" и неявно отбрасывается. Попробуйте использовать "let", чтобы привязать результат к имени, например "let result = expression". Если вы собирались присвоить значение свойству, используйте оператор "<-", например: "{1}.{2} <- expression". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Результат этого выражения равенства неявно удаляется. Рекомендуем использовать let, чтобы привязать результат к имени, например "let result = expression". Если вы собирались изменять значение, пометьте его как mutable и используйте оператор "<-", например "{0} <- expression". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Результат этого выражения равенства имеет тип "{0}" и неявно отбрасывается. Попробуйте использовать "let", чтобы привязать результат к имени, например "let result = expression". Если вы собирались изменять значение, отметьте его как "mutable" и используйте оператор "<-", например: "{1} <- expression". - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Результат этого выражения равенства неявно удаляется. Рекомендуем использовать let, чтобы привязать результат к имени, например "let result = expression". Если вы собирались изменять значение, используйте оператор "<-", например "{0} <- expression". + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Результат этого выражения равенства имеет тип "{0}" и неявно отбрасывается. Попробуйте использовать "let", чтобы привязать результат к имени, например "let result = expression". Если вы собирались изменять значение, используйте оператор "<-", например: "{1} <- expression". diff --git a/src/fsharp/xlf/FSStrings.tr.xlf b/src/fsharp/xlf/FSStrings.tr.xlf index a91af98c42a..6ce85a3cc4c 100644 --- a/src/fsharp/xlf/FSStrings.tr.xlf +++ b/src/fsharp/xlf/FSStrings.tr.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - Bu ifadenin sonucu örtük olarak yoksayılır. Bu değeri açıkça atmak için 'ignore' kullanmayı (örn. 'expr |> ignore') veya sonucu bir ada bağlamak için 'let' kullanmayı (örn. 'let result = expr') deneyin. + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + Bu ifadenin sonucu '{0}' türüne sahip ve örtük olarak yoksayılır. Bu değeri açıkça atmak için 'ignore' kullanmayı (örn. 'deyim |> ignore') veya sonucu bir ada bağlamak için 'let' kullanmayı (örn. 'let sonuc = deyim') deneyin. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - Bu eşitlik ifadesinin sonucu örtük olarak atılmıştır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün; örneğin, 'let sonuç = deyim'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + Bu eşitlik ifadesinin sonucu '{0}' türüne sahip ve örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün (örneğin, 'let sonuc = deyim'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - Bu eşitlik ifadesinin sonucu örtük olarak atılmıştır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün; örneğin, 'let sonuç = deyim'. Bir özelliğin değerini ayarlamak istiyorsanız, '<-' işlecini kullanın; örneğin, '{0}.{1} <- deyim'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + Bu eşitlik ifadesinin sonucu '{0}' türüne sahip ve örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün (örneğin, 'let sonuc = deyim'). Bir özelliğin değerini ayarlamak istiyorsanız, '<-' işlecini kullanın (örneğin, '{1}.{2} <- deyim'). - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - Bu eşitlik ifadesinin sonucu örtük olarak atılmıştır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün; örneğin, 'let sonuç = deyim'. Bir değeri değiştirmek istiyorsanız, değeri 'mutable' olarak işaretleyin ve '<-' işlecini kullanın; örneğin, '{0} <- deyim'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + Bu eşitlik ifadesinin sonucu '{0}' türüne sahip ve örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün (örneğin, 'let sonuc = deyim'). Bir değeri değiştirmek istiyorsanız, değeri 'mutable' olarak işaretleyin ve '<-' işlecini kullanın; örneğin, '{1} <- deyim'. - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - Bu eşitlik ifadesinin sonucu örtük olarak atılmıştır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün, örneğin 'let sonuç = deyim'. Bir değeri değiştirmek istiyorsanız, '<-' işlecini kullanın; örneğin, '{0} <- deyim'. + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + Bu eşitlik ifadesinin sonucu '{0}' türüne sahip ve örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanmayı düşünün (örneğin 'let sonuc = deyim'). Bir değeri değiştirmek istiyorsanız, '<-' işlecini kullanın; örneğin, '{1} <- deyim'. diff --git a/src/fsharp/xlf/FSStrings.zh-Hans.xlf b/src/fsharp/xlf/FSStrings.zh-Hans.xlf index 9e3ea8eb1ce..235affe46bb 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hans.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hans.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - 此表达式的结果被隐式忽略。请考虑使用 "ignore" 以显式放弃该值,例如 "expr |> ignore" 或 "let" 以将结果绑定到一个名称,例如 "let result = expr"。 + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + 此表达式的结果为类型“{0}”且被隐式忽略。请考虑使用 "ignore" 显式放弃该值,例如使用 "expr |> ignore" 或 "let" 将结果绑定到名称,例如 "let result = expr"。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - 此等式表达式的结果被隐式丢弃。请考虑使用 "let" 将结果绑定到一个名称,例如 "let result = expression"。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + 此等式表达式的结果为类型“{0}”且被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - 此等式表达式的结果被隐式丢弃。请考虑使用 "let" 将结果绑定到一个名称,例如 "let result = expression"。如果要为某属性设置值,请使用 "<-" 运算符,例如 "{0}.{1} <- expression"。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + 此等式表达式的结果为类型“{0}”且被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要为某属性设置值,请使用 "<-" 运算符,例如 "{1}.{2} <- expression"。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - 此等式表达式的结果被隐式丢弃。请考虑使用 "let" 将结果绑定到一个名称,例如 "let result = expression"。如果想要转变某个值,则将此值标记为 "mutable" 并使用 "<-" 运算符,例如 "{0} <- expression"。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + 此等式表达式的结果为类型“{0}”且被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要转变某个值,则将此值标记为 "mutable" 并使用 "<-" 运算符,例如 "{1} <- expression"。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - 此等式表达式的结果被隐式丢弃。请考虑使用 "let" 将结果绑定到一个名称,例如 "let result = expression"。如果想要转变某个值,请使用 "<-" 运算符,例如 "{0} <- expression"。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + 此等式表达式的结果为类型“{0}”且被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要转变某个值,请使用 "<-" 运算符,例如 "{1} <- expression"。 diff --git a/src/fsharp/xlf/FSStrings.zh-Hant.xlf b/src/fsharp/xlf/FSStrings.zh-Hant.xlf index 6cb55c0004e..90c5a5a8066 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hant.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hant.xlf @@ -1283,28 +1283,28 @@ - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. - 已隱含忽略運算式的結果。請考慮使用 'ignore' 以明確捨棄此值,例如 'expr |> ignore',或使用 'let' 將結果繫結至名稱,例如 'let result = expr'。 + The result of this expression has type '{0}' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + 這個運算式的結果類型為 '{0}',已隱含略過。請考慮使用 'ignore' 以明確捨棄此值,例如 'expr |> ignore',或使用 'let' 將結果繫結至名稱,例如 'let result = expr'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. - 將隱含捨棄此等號比較運算式的結果。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. + 這個等號比較運算式的結果類型為 '{0}',已隱含捨棄。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{0}.{1} <- expression'. - 將隱含捨棄此等號比較運算式的結果。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要設定屬性值,則使用 '<-' 運算子,例如 '{0}.{1} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to set a value to a property, then use the '<-' operator e.g. '{1}.{2} <- expression'. + 這個等號比較運算式的結果類型為 '{0}',已隱含捨棄。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要設定屬性值,請使用 '<-' 運算子,例如 '{1}.{2} <- expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{0} <- expression'. - 將隱含捨棄此等號比較運算式的結果。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要變動值,請將值標示為 [可變動]5D; 並使用 '<-' 運算子,例如 '{0} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then mark the value 'mutable' and use the '<-' operator e.g. '{1} <- expression'. + 這個等號比較運算式的結果類型為 '{0}',已隱含捨棄。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要變動值,請將值標示為「可變動」,並使用 '<-' 運算子,例如 '{1} <- expression'。 - The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{0} <- expression'. - 將隱含捨棄此等號比較運算式的結果。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要變動值,則使用 '<-' 運算子,例如 '{0} <- expression'。 + The result of this equality expression has type '{0}' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to mutate a value, then use the '<-' operator e.g. '{1} <- expression'. + 這個等號比較運算式的結果類型為 '{0}',已隱含捨棄。請考慮使用 'let' 將結果繫結至名稱,例如 'let result = expression'。若您要變動值,請使用 '<-' 運算子,例如 '{1} <- expression'。 diff --git a/src/ilx/EraseClosures.fs b/src/ilx/EraseClosures.fs index 80329249c38..c8adbfff69b 100644 --- a/src/ilx/EraseClosures.fs +++ b/src/ilx/EraseClosures.fs @@ -13,6 +13,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.IlxSettings open Microsoft.FSharp.Compiler.AbstractIL.Morphs open Microsoft.FSharp.Compiler.AbstractIL.IL open Microsoft.FSharp.Compiler.PrettyNaming +open System.Reflection // -------------------------------------------------------------------- // Erase closures and function types @@ -359,7 +360,6 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let tagApp = (Lazy.force clo.cloCode).SourceMarker let tyargsl, tmargsl, laterStruct = stripSupportedAbstraction clo.cloStructure - let laterAccess = td.Access // Adjust all the argument and environment accesses let rewriteCodeToAccessArgsFromEnv laterCloSpec (argToFreeVarMap: (int * IlxClosureFreeVar) list) = @@ -429,7 +429,6 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let laterTypeDefs = convIlxClosureDef cenv encl {td with GenericParams=laterGenericParams - Access=laterAccess Name=laterTypeName} {clo with cloStructure=laterStruct cloFreeVars=laterFields @@ -482,17 +481,10 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let cloTypeDef = { Name = td.Name GenericParams= td.GenericParams - Access=td.Access + Attributes = td.Attributes Implements = List.empty - IsAbstract = false NestedTypes = emptyILTypeDefs - IsSealed = true - IsSerializable=td.IsSerializable - IsComInterop=false - IsSpecialName=false Layout=ILTypeDefLayout.Auto - Encoding=ILDefaultPInvokeEncoding.Ansi - InitSemantics=ILTypeInit.BeforeField Extends= Some cenv.mkILTyFuncTy Methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]) Fields= mkILFields (mkILCloFldDefs cenv nowFields) @@ -500,9 +492,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = MethodImpls=emptyILMethodImpls Properties=emptyILProperties Events=emptyILEvents - HasSecurity=false - SecurityDecls=emptyILSecurityDecls - tdKind = ILTypeDefKind.Class} + SecurityDecls=emptyILSecurityDecls }.WithSpecialName(false).WithImport(false).WithHasSecurity(false).WithAbstract(false).WithSealed(true).WithInitSemantics(ILTypeInit.BeforeField).WithEncoding(ILDefaultPInvokeEncoding.Ansi) [ cloTypeDef] // CASE 2 - Term Application @@ -547,7 +537,6 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let laterTypeDefs = convIlxClosureDef cenv encl {td with GenericParams=laterGenericParams - Access=laterAccess Name=laterTypeName} {clo with cloStructure=laterStruct cloFreeVars=laterFields @@ -583,16 +572,9 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = { Name = td.Name GenericParams= td.GenericParams - Access = td.Access + Attributes = td.Attributes Implements = [] - IsAbstract = false - IsSealed = true - IsSerializable=td.IsSerializable - IsComInterop=false - IsSpecialName=false Layout=ILTypeDefLayout.Auto - Encoding=ILDefaultPInvokeEncoding.Ansi - InitSemantics=ILTypeInit.BeforeField NestedTypes = emptyILTypeDefs Extends= Some nowEnvParentClass Methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]) @@ -601,9 +583,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = MethodImpls=emptyILMethodImpls Properties=emptyILProperties Events=emptyILEvents - HasSecurity=false - SecurityDecls=emptyILSecurityDecls - tdKind = ILTypeDefKind.Class } + SecurityDecls=emptyILSecurityDecls }.WithHasSecurity(false).WithSpecialName(false).WithAbstract(false).WithImport(false).WithEncoding(ILDefaultPInvokeEncoding.Ansi).WithSealed(true).WithInitSemantics(ILTypeInit.BeforeField) [cloTypeDef] @@ -639,8 +619,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = Name = td.Name GenericParams= td.GenericParams Methods= mkILMethods (ctorMethodDef :: List.map (convMethodDef (Some nowCloSpec)) td.Methods.AsList) - Fields= mkILFields (mkILCloFldDefs cenv nowFields @ td.Fields.AsList) - tdKind = ILTypeDefKind.Class } + Fields= mkILFields (mkILCloFldDefs cenv nowFields @ td.Fields.AsList) } [cloTypeDef] diff --git a/src/ilx/EraseUnions.fs b/src/ilx/EraseUnions.fs index b7f284dbf84..6eece54f247 100644 --- a/src/ilx/EraseUnions.fs +++ b/src/ilx/EraseUnions.fs @@ -14,6 +14,7 @@ open Microsoft.FSharp.Compiler.AbstractIL.IL open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types +open System.Reflection [] @@ -178,7 +179,7 @@ let cudefRepr = (fun (_td,cud) -> cud.cudNullPermitted), (fun (alt:IlxUnionAlternative) -> alt.IsNullary), (fun (_td,cud) -> cud.cudHasHelpers = IlxUnionHasHelpers.SpecialFSharpListHelpers), - (fun (td,_cud) -> match td.tdKind with ILTypeDefKind.ValueType -> true | _ -> false), + (fun (td:ILTypeDef,_cud) -> td.IsStruct), (fun (alt:IlxUnionAlternative) -> alt.Name), (fun (_td,_cud) -> NoTypesGeneratedViaThisReprDecider), (fun ((_td,_cud),_nm) -> NoTypesGeneratedViaThisReprDecider)) @@ -613,16 +614,15 @@ let mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGenerat let basicProps = fields |> Array.map (fun field -> - { Name=adjustFieldName hasHelpers field.Name - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None + { Name = adjustFieldName hasHelpers field.Name + Attributes = PropertyAttributes.None + SetMethod = None GetMethod = Some (mkILMethRef (typ.TypeRef, ILCallingConv.Instance, "get_" + adjustFieldName hasHelpers field.Name, 0, [], field.Type)) - CallingConv=ILThisConvention.Instance - Type=field.Type - Init=None + CallingConv = ILThisConvention.Instance + Type = field.Type + Init = None Args = [] - CustomAttrs= field.ILField.CustomAttrs } + CustomAttrs = field.ILField.CustomAttrs } |> addPropertyGeneratedAttrs ) |> Array.toList @@ -667,7 +667,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP | _ -> if alt.IsNullary && repr.MaintainPossiblyUniqueConstantFieldForAlternative (info,alt) then let methName = "get_" + altName - let meth = + let meth = mkILNonGenericStaticMethod (methName, cud.cudReprAccess,[],mkILReturn(baseTy), @@ -698,16 +698,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP mkMethodBody(true,[],2,nonBranchingInstrsToCode ([ mkLdarg0 ] @ mkIsData ilg (true, cuspec, num)), attr)) |> addMethodGeneratedAttrs ], - [ { Name=mkTesterName altName - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None + [ { Name = mkTesterName altName + Attributes = PropertyAttributes.None + SetMethod = None GetMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Instance, "get_" + mkTesterName altName, 0, [], ilg.typ_Bool)) - CallingConv=ILThisConvention.Instance - Type=ilg.typ_Bool - Init=None + CallingConv = ILThisConvention.Instance + Type = ilg.typ_Bool + Init = None Args = [] - CustomAttrs=emptyILCustomAttrs } + CustomAttrs = emptyILCustomAttrs } |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs ] @@ -727,16 +726,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP let nullaryProp = - { Name=altName - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None + { Name = altName + Attributes = PropertyAttributes.None + SetMethod = None GetMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Static, "get_" + altName, 0, [], baseTy)) - CallingConv=ILThisConvention.Static - Type=baseTy - Init=None + CallingConv = ILThisConvention.Static + Type = baseTy + Init = None Args = [] - CustomAttrs=emptyILCustomAttrs } + CustomAttrs = emptyILCustomAttrs } |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs @@ -770,12 +768,12 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP else let altNullaryFields = if repr.MaintainPossiblyUniqueConstantFieldForAlternative(info,alt) then - let basic = + let basic : ILFieldDef = mkILStaticField (constFieldName altName, baseTy, None, None, ILMemberAccess.Assembly) |> addFieldNeverAttrs |> addFieldGeneratedAttrs - let uniqObjField = { basic with IsInitOnly=true } + let uniqObjField = basic.WithInitOnly(true) let inRootClass = cuspecRepr.OptimizeAlternativeToRootClass (cuspec,alt) [ (info,alt, altTy,num,uniqObjField,inRootClass) ] else @@ -820,7 +818,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP mkMethodBody(true,[],2, nonBranchingInstrsToCode [ mkLdarg0 - (match td.tdKind with ILTypeDefKind.ValueType -> mkNormalLdflda | _ -> mkNormalLdfld) + (if td.IsStruct then mkNormalLdflda else mkNormalLdfld) (mkILFieldSpecInTy (debugProxyTy,debugProxyFieldName,altTy)) mkNormalLdfld (mkILFieldSpecInTy(altTy,fldName,fldTy))],None)) |> addMethodGeneratedAttrs ) @@ -829,16 +827,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP let debugProxyGetterProps = fields |> Array.map (fun fdef -> - { Name=fdef.Name - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None - GetMethod=Some(mkILMethRef(debugProxyTy.TypeRef,ILCallingConv.Instance,"get_" + fdef.Name,0,[],fdef.Type)) - CallingConv=ILThisConvention.Instance - Type=fdef.Type - Init=None + { Name = fdef.Name + Attributes = PropertyAttributes.None + SetMethod = None + GetMethod = Some(mkILMethRef(debugProxyTy.TypeRef,ILCallingConv.Instance,"get_" + fdef.Name,0,[],fdef.Type)) + CallingConv = ILThisConvention.Instance + Type = fdef.Type + Init = None Args = [] - CustomAttrs= fdef.ILField.CustomAttrs } + CustomAttrs = fdef.ILField.CustomAttrs } |> addPropertyGeneratedAttrs) |> Array.toList @@ -855,7 +852,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP emptyILCustomAttrs, ILTypeInit.BeforeField) - [ { debugProxyTypeDef with IsSpecialName=true } ], + [ debugProxyTypeDef.WithSpecialName(true) ], ( [mkDebuggerTypeProxyAttribute debugProxyTy] @ cud.cudDebugDisplayAttributes) let altTypeDef = @@ -864,11 +861,11 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP |> Array.map (fun field -> let fldName,fldTy = mkUnionCaseFieldId field let fdef = mkILInstanceField (fldName,fldTy, None, ILMemberAccess.Assembly) |> addFieldNeverAttrs |> addFieldGeneratedAttrs - { fdef with IsInitOnly=isTotallyImmutable }) + fdef.WithInitOnly(isTotallyImmutable)) |> Array.toList - let basicProps, basicMethods = mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGeneratedAttrs) cud.cudReprAccess attr cud.cudHasHelpers altTy fields + let basicProps, basicMethods = mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGeneratedAttrs) (cud.cudReprAccess) attr cud.cudHasHelpers altTy fields let basicCtorMeth = mkILStorageCtor @@ -902,7 +899,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP mkILCustomAttrs debugAttrs, ILTypeInit.BeforeField) - { altTypeDef with IsSerializable=td.IsSerializable; IsSpecialName=true } + altTypeDef.WithSpecialName(true).WithSerializable(td.IsSerializable) [ altTypeDef ], altDebugTypeDefs @@ -912,8 +909,8 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP baseMakerMeths, baseMakerProps, altUniqObjMeths, typeDefs, altDebugTypeDefs, altNullaryFields -let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addPropertyNeverAttrs, addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef, addFieldNeverAttrs: ILFieldDef -> ILFieldDef, mkDebuggerTypeProxyAttribute) ilg tref td cud = - let boxity = match td.tdKind with ILTypeDefKind.ValueType -> ILBoxity.AsValue | _ -> ILBoxity.AsObject +let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addPropertyNeverAttrs, addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef, addFieldNeverAttrs: ILFieldDef -> ILFieldDef, mkDebuggerTypeProxyAttribute) ilg tref (td:ILTypeDef) cud = + let boxity = if td.IsStruct then ILBoxity.AsValue else ILBoxity.AsObject let baseTy = mkILFormalNamedTy boxity tref td.GenericParams let cuspec = IlxUnionSpec(IlxUnionRef(boxity,baseTy.TypeRef, cud.cudAlternatives, cud.cudNullPermitted, cud.cudHasHelpers), baseTy.GenericArgs) let info = (td,cud) @@ -937,7 +934,7 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp | SingleCase | RuntimeTypes | TailOrNull -> [] | IntegerTag -> [ mkTagFieldId ilg cuspec ] - let isStruct = match td.tdKind with ILTypeDefKind.ValueType -> true | _ -> false + let isStruct = td.IsStruct let selfFields, selfMeths, selfProps = @@ -969,7 +966,7 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp (if cuspec.HasHelpers = AllHelpers then ILMemberAccess.Assembly else cud.cudReprAccess)) |> addMethodGeneratedAttrs - let props, meths = mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGeneratedAttrs) cud.cudReprAccess cud.cudWhere cud.cudHasHelpers baseTy alt.FieldDefs + let props, meths = mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGeneratedAttrs) (cud.cudReprAccess) cud.cudWhere cud.cudHasHelpers baseTy alt.FieldDefs yield (fields,([ctor] @ meths),props) ] |> List.unzip3 |> (fun (a,b,c) -> List.concat a, List.concat b, List.concat c) @@ -977,7 +974,7 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp let selfAndTagFields = [ for (fldName,fldTy) in (selfFields @ tagFieldsInObject) do let fdef = mkILInstanceField (fldName,fldTy, None, ILMemberAccess.Assembly) |> addFieldNeverAttrs |> addFieldGeneratedAttrs - yield { fdef with IsInitOnly= (not isStruct && isTotallyImmutable) } ] + yield fdef.WithInitOnly(not isStruct && isTotallyImmutable) ] let ctorMeths = if (List.isEmpty selfFields && List.isEmpty tagFieldsInObject && not (List.isEmpty selfMeths)) @@ -1042,16 +1039,15 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp [ mkILNonGenericInstanceMethod("get_" + tagPropertyName,cud.cudHelpersAccess,[],mkILReturn tagFieldType,body) |> addMethodGeneratedAttrs ], - [ { Name=tagPropertyName - IsRTSpecialName=false - IsSpecialName=false - SetMethod=None - GetMethod=Some(mkILMethRef(baseTy.TypeRef,ILCallingConv.Instance,"get_" + tagPropertyName,0,[], tagFieldType)) - CallingConv=ILThisConvention.Instance - Type=tagFieldType - Init=None + [ { Name = tagPropertyName + Attributes = PropertyAttributes.None + SetMethod = None + GetMethod = Some(mkILMethRef(baseTy.TypeRef,ILCallingConv.Instance,"get_" + tagPropertyName,0,[], tagFieldType)) + CallingConv = ILThisConvention.Instance + Type = tagFieldType + Init = None Args = [] - CustomAttrs=emptyILCustomAttrs } + CustomAttrs = emptyILCustomAttrs } |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs ] @@ -1069,46 +1065,32 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp if tagEnumFields.Length <= 1 then None else - Some + Some( { Name = "Tags" NestedTypes = emptyILTypeDefs GenericParams= td.GenericParams - Access = ILTypeDefAccess.Nested cud.cudReprAccess - IsAbstract = true - IsSealed = true - IsSerializable=false - IsComInterop=false + Attributes = enum 0 Layout=ILTypeDefLayout.Auto - IsSpecialName=false - Encoding=ILDefaultPInvokeEncoding.Ansi Implements = [] Extends= Some ilg.typ_Object Methods= emptyILMethods SecurityDecls=emptyILSecurityDecls - HasSecurity=false Fields=mkILFields tagEnumFields MethodImpls=emptyILMethodImpls - InitSemantics=ILTypeInit.OnAny Events=emptyILEvents Properties=emptyILProperties - CustomAttrs= emptyILCustomAttrs - tdKind = ILTypeDefKind.Enum } + CustomAttrs= emptyILCustomAttrs }.WithNestedAccess(cud.cudReprAccess).WithAbstract(true).WithSealed(true).WithImport(false).WithEncoding(ILDefaultPInvokeEncoding.Ansi).WithHasSecurity(false)) let baseTypeDef = - { td with + { td.WithInitSemantics(ILTypeInit.BeforeField) with NestedTypes = mkILTypeDefs (Option.toList enumTypeDef @ altTypeDefs @ altDebugTypeDefs @ td.NestedTypes.AsList) - IsAbstract = isAbstract - IsSealed = altTypeDefs.IsEmpty - IsComInterop=false Extends= (match td.Extends with None -> Some ilg.typ_Object | _ -> td.Extends) Methods= mkILMethods (ctorMeths @ baseMethsFromAlt @ selfMeths @ tagMeths @ altUniqObjMeths @ existingMeths) Fields=mkILFields (selfAndTagFields @ List.map (fun (_,_,_,_,fdef,_) -> fdef) altNullaryFields @ td.Fields.AsList) - InitSemantics=ILTypeInit.BeforeField - Properties=mkILProperties (tagProps @ basePropsFromAlt @ selfProps @ existingProps) - tdKind = ILTypeDefKind.Class } + Properties=mkILProperties (tagProps @ basePropsFromAlt @ selfProps @ existingProps) } // The .cctor goes on the Cases type since that's where the constant fields for nullary constructors live |> addConstFieldInit - baseTypeDef + baseTypeDef.WithAbstract(isAbstract).WithSealed(altTypeDefs.IsEmpty) diff --git a/src/scripts/fssrgen.fsx b/src/scripts/fssrgen.fsx index 0bee9b79e11..32c5b4fa58c 100644 --- a/src/scripts/fssrgen.fsx +++ b/src/scripts/fssrgen.fsx @@ -1,4 +1,7 @@ // 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 @@ -229,14 +232,14 @@ let StringBoilerPlate filename = // BEGIN BOILERPLATE static let getCurrentAssembly () = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly #else System.Reflection.Assembly.GetExecutingAssembly() #endif static let getTypeInfo (t: System.Type) = - #if DNXCORE50 || NETSTANDARD1_5 || NETSTANDARD1_6 || NETCOREAPP1_0 + #if FX_RESHAPED_REFLECTION t.GetTypeInfo() #else t @@ -362,8 +365,8 @@ let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = 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) + + 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 @@ -377,8 +380,8 @@ let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = 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 formalArgs = System.Text.StringBuilder() + let actualArgs = System.Text.StringBuilder() let firstTime = ref true let n = ref 0 formalArgs.Append "(" |> ignore @@ -420,7 +423,14 @@ let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = 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 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) -> @@ -432,8 +442,16 @@ let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = xnc.AppendChild(xd.CreateTextNode netFormatString) |> ignore xd.LastChild.AppendChild xn |> ignore ) - use outXmlStream = System.IO.File.Create outXmlFilenameOpt.Value - xd.Save outXmlStream + 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 -> diff --git a/src/scripts/fssrgen.targets b/src/scripts/fssrgen.targets index 220a971bbdb..3458dd5bff5 100644 --- a/src/scripts/fssrgen.targets +++ b/src/scripts/fssrgen.targets @@ -13,7 +13,7 @@ Copyright (C) Microsoft Corporation. All Rights Reserved. - ProcessFsSrGen;$(PrepareForBuildDependsOn) + ProcessFsSrGen;$(BuildDependsOn) diff --git a/src/scripts/scriptlib.fsx b/src/scripts/scriptlib.fsx index cc797e30599..c2ace216354 100644 --- a/src/scripts/scriptlib.fsx +++ b/src/scripts/scriptlib.fsx @@ -107,7 +107,7 @@ module Scripting = processInfo.UseShellExecute <- false processInfo.WorkingDirectory <- workDir -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 ignore envs // work out what to do about this #else envs diff --git a/src/utils/HashMultiMap.fs b/src/utils/HashMultiMap.fs index 134597efc6a..89f3a4fc2a4 100644 --- a/src/utils/HashMultiMap.fs +++ b/src/utils/HashMultiMap.fs @@ -10,10 +10,13 @@ open Microsoft.FSharp.Collections // one entry. So use two hash tables: one for the main entries and one for the overflow. [] type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) = + let firstEntries = Dictionary<_,_>(n,hasheq) + let rest = Dictionary<_,_>(3,hasheq) new (hasheq : IEqualityComparer<'Key>) = HashMultiMap<'Key,'Value>(11, hasheq) + new (seq : seq<'Key * 'Value>, hasheq : IEqualityComparer<'Key>) as x = new HashMultiMap<'Key,'Value>(11, hasheq) then seq |> Seq.iter (fun (k,v) -> x.Add(k,v)) @@ -35,7 +38,9 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) rest.Clear() member x.FirstEntries = firstEntries + member x.Rest = rest + member x.Copy() = let res = HashMultiMap<'Key,'Value>(firstEntries.Count,firstEntries.Comparer) for kvp in firstEntries do @@ -114,6 +119,7 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) member x.Count = firstEntries.Count interface IEnumerable> with + member s.GetEnumerator() = let elems = List<_>(firstEntries.Count + rest.Count) for kvp in firstEntries do @@ -123,34 +129,48 @@ type internal HashMultiMap<'Key,'Value>(n: int, hasheq: IEqualityComparer<'Key>) (elems.GetEnumerator() :> IEnumerator<_>) interface System.Collections.IEnumerable with + member s.GetEnumerator() = ((s :> seq<_>).GetEnumerator() :> System.Collections.IEnumerator) interface IDictionary<'Key, 'Value> with + member s.Item with get x = s.[x] and set x v = s.[x] <- v member s.Keys = ([| for kvp in s -> kvp.Key |] :> ICollection<'Key>) + member s.Values = ([| for kvp in s -> kvp.Value |] :> ICollection<'Value>) + member s.Add(k,v) = s.[k] <- v + member s.ContainsKey(k) = s.ContainsKey(k) + member s.TryGetValue(k,r) = if s.ContainsKey(k) then (r <- s.[k]; true) else false + member s.Remove(k:'Key) = let res = s.ContainsKey(k) in s.Remove(k); res interface ICollection> with + member s.Add(x) = s.[x.Key] <- x.Value + member s.Clear() = s.Clear() + member s.Remove(x) = let res = s.ContainsKey(x.Key) if res && Unchecked.equals s.[x.Key] x.Value then s.Remove(x.Key); res + member s.Contains(x) = s.ContainsKey(x.Key) && Unchecked.equals s.[x.Key] x.Value + member s.CopyTo(arr,arrIndex) = s |> Seq.iteri (fun j x -> arr.[arrIndex+j] <- x) + member s.IsReadOnly = false + member s.Count = s.Count diff --git a/src/utils/ResizeArray.fs b/src/utils/ResizeArray.fs index b8720222dea..66613044349 100644 --- a/src/utils/ResizeArray.fs +++ b/src/utils/ResizeArray.fs @@ -10,9 +10,13 @@ open Microsoft.FSharp.Core.OptimizedClosures module internal ResizeArray = let length (arr: ResizeArray<'T>) = arr.Count + let get (arr: ResizeArray<'T>) (n: int) = arr.[n] + let set (arr: ResizeArray<'T>) (n: int) (x:'T) = arr.[n] <- x + let create (n: int) x = new ResizeArray<_> (seq { for _ in 1 .. n -> x }) + let init (n: int) (f: int -> 'T) = new ResizeArray<_> (seq { for i in 0 .. n-1 -> f i }) let blit (arr1: ResizeArray<'T>) start1 (arr2: ResizeArray<'T>) start2 len = @@ -25,6 +29,7 @@ module internal ResizeArray = arr2.[start2+i] <- arr1.[start1 + i] let concat (arrs: ResizeArray<'T> list) = new ResizeArray<_> (seq { for arr in arrs do for x in arr do yield x }) + let append (arr1: ResizeArray<'T>) (arr2: ResizeArray<'T>) = concat [arr1; arr2] let sub (arr: ResizeArray<'T>) start len = @@ -176,10 +181,13 @@ module internal ResizeArray = res let toArray (arr: ResizeArray<'T>) = arr.ToArray() + let ofArray (arr: 'T[]) = new ResizeArray<_>(arr) + let toSeq (arr: ResizeArray<'T>) = Seq.readonly arr let sort f (arr: ResizeArray<'T>) = arr.Sort (System.Comparison(f)) + let sortBy f (arr: ResizeArray<'T>) = arr.Sort (System.Comparison(fun x y -> compare (f x) (f y))) diff --git a/src/utils/TaggedCollections.fsi b/src/utils/TaggedCollections.fsi index ba99df33762..c877cbe7eb5 100644 --- a/src/utils/TaggedCollections.fsi +++ b/src/utils/TaggedCollections.fsi @@ -107,10 +107,13 @@ namespace Internal.Utilities.Collections.Tagged member ToArray: unit -> 'T array interface ICollection<'T> + interface IEnumerable<'T> + interface System.Collections.IEnumerable interface System.IComparable + override Equals : obj -> bool type internal Set<'T> = Set<'T, IComparer<'T>> @@ -128,14 +131,13 @@ namespace Internal.Utilities.Collections.Tagged /// Immutable maps. A constraint tag carries information about the class of key-comparers being used. [] type internal Map<'Key,'Value,'ComparerTag> when 'ComparerTag :> IComparer<'Key> = + /// Return a new map with the binding added to the given map. member Add: 'Key * 'Value -> Map<'Key,'Value,'ComparerTag> /// Return True if there are no bindings in the map. member IsEmpty: bool - //member Comparer : 'ComparerTag - /// The empty map, and use the given comparer comparison function for all operations associated /// with any maps built from this map. static member Empty: 'ComparerTag -> Map<'Key,'Value,'ComparerTag> @@ -213,7 +215,9 @@ namespace Internal.Utilities.Collections.Tagged interface IEnumerable> interface System.Collections.IEnumerable + interface System.IComparable + override Equals : obj -> bool type internal Map<'Key,'Value> = Map<'Key, 'Value, IComparer<'Key>> diff --git a/src/utils/reshapedmsbuild.fs b/src/utils/reshapedmsbuild.fs index f52d0a61f3f..925b904e3e2 100644 --- a/src/utils/reshapedmsbuild.fs +++ b/src/utils/reshapedmsbuild.fs @@ -218,8 +218,7 @@ module internal ToolLocationHelper = let dotNetFrameworkFolderPrefix = dotNetFrameworkVersionFolderPrefix let frameworkName = FrameworkName(dotNetFrameworkIdentifier, version) -#if FX_NO_WIN_REGISTRY -#else +#if !FX_NO_WIN_REGISTRY let findRegistryValueUnderKey registryBaseKeyName registryKeyName registryView = try use baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView) diff --git a/src/utils/reshapedreflection.fs b/src/utils/reshapedreflection.fs index 19be659bfd6..b1f0aeca8d4 100644 --- a/src/utils/reshapedreflection.fs +++ b/src/utils/reshapedreflection.fs @@ -24,24 +24,10 @@ module internal XmlAdapters = #if FX_RESHAPED_REFLECTION module internal ReflectionAdapters = open System -#if FX_RESHAPED_REFLECTION_CORECLR - open System.Runtime.Loader -#endif open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Collections open PrimReflectionAdapters -#if FX_NO_SYSTEM_BINDINGFLAGS - [] - type BindingFlags = - | DeclaredOnly = 2 - | Instance = 4 - | Static = 8 - | Public = 16 - | NonPublic = 32 - | InvokeMethod = 0x100 -#endif - let inline hasFlag (flag : BindingFlags) f = (f &&& flag) = flag let isDeclaredFlag f = hasFlag BindingFlags.DeclaredOnly f let isPublicFlag f = hasFlag BindingFlags.Public f @@ -49,23 +35,6 @@ module internal ReflectionAdapters = let isInstanceFlag f = hasFlag BindingFlags.Instance f let isNonPublicFlag f = hasFlag BindingFlags.NonPublic f -#if FX_NO_TYPECODE - [] - type TypeCode = - | Int32 = 0 - | Int64 = 1 - | Byte = 2 - | SByte = 3 - | Int16 = 4 - | UInt16 = 5 - | UInt32 = 6 - | UInt64 = 7 - | Single = 8 - | Double = 9 - | Decimal = 10 - | Object = 11 -#endif - let isAcceptable bindingFlags isStatic isPublic = // 1. check if member kind (static\instance) was specified in flags ((isStaticFlag bindingFlags && isStatic) || (isInstanceFlag bindingFlags && not isStatic)) && @@ -112,11 +81,13 @@ module internal ReflectionAdapters = (if isDeclaredFlag bindingFlags then this.GetTypeInfo().DeclaredMethods else this.GetRuntimeMethods()) |> Seq.filter (fun m -> isAcceptable bindingFlags m.IsStatic m.IsPublic) |> Seq.toArray + // use different sources based on Declared flag member this.GetFields(bindingFlags) = (if isDeclaredFlag bindingFlags then this.GetTypeInfo().DeclaredFields else this.GetRuntimeFields()) |> Seq.filter (fun f -> isAcceptable bindingFlags f.IsStatic f.IsPublic) |> Seq.toArray + // use different sources based on Declared flag member this.GetProperties(?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags @@ -127,7 +98,7 @@ module internal ReflectionAdapters = else isAcceptable bindingFlags mi.IsStatic mi.IsPublic ) |> Seq.toArray -#if FX_RESHAPED_REFLECTION_CORECLR + member this.GetEvents(?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags (if isDeclaredFlag bindingFlags then this.GetTypeInfo().DeclaredEvents else this.GetRuntimeEvents()) @@ -137,26 +108,31 @@ module internal ReflectionAdapters = else isAcceptable bindingFlags m.IsStatic m.IsPublic ) |> Seq.toArray + member this.GetEvent(name, ?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags this.GetEvents(bindingFlags) |> Array.filter (fun ei -> ei.Name = name) |> commit -#endif + member this.GetConstructor(bindingFlags, _binder, argsT:Type[], _parameterModifiers) = this.GetConstructor(bindingFlags,argsT) + member this.GetMethod(name, ?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags this.GetMethods(bindingFlags) |> Array.filter(fun m -> m.Name = name) |> commit + member this.GetMethod(name, _bindingFlags, _binder, argsT:Type[], _parameterModifiers) = this.GetMethod(name, argsT) + // use different sources based on Declared flag member this.GetProperty(name, bindingFlags) = this.GetProperties(bindingFlags) |> Array.filter (fun pi -> pi.Name = name) |> commit + member this.GetMethod(methodName, args:Type[], ?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags let compareSequences parms args = @@ -164,6 +140,7 @@ module internal ReflectionAdapters = this.GetMethods(bindingFlags) |> Array.filter(fun m -> m.Name = methodName && (compareSequences (m.GetParameters() |> Seq.map(fun x -> x.ParameterType)) args) = 0) |> commit + member this.GetNestedTypes(?bindingFlags) = let bindingFlags = defaultArg bindingFlags publicFlags this.GetTypeInfo().DeclaredNestedTypes @@ -172,26 +149,35 @@ module internal ReflectionAdapters = (isNonPublicFlag bindingFlags && (nestedTy.IsNestedPrivate || nestedTy.IsNestedFamily || nestedTy.IsNestedAssembly || nestedTy.IsNestedFamORAssem || nestedTy.IsNestedFamANDAssem))) |> Seq.map (fun ti -> ti.AsType()) |> Seq.toArray + member this.GetEnumUnderlyingType() = Enum.GetUnderlyingType(this) -#if FX_RESHAPED_REFLECTION_CORECLR + member this.InvokeMember(memberName, bindingFlags, _binder, target:obj, arguments:obj[], _cultureInfo) = let m = this.GetMethod(memberName, (arguments |> Seq.map(fun x -> x.GetType()) |> Seq.toArray), bindingFlags) match m with | null -> raise <| System.MissingMethodException(String.Format("Method '{0}.{1}' not found.", this.FullName, memberName)) | _ -> m.Invoke(target, arguments) -#endif + member this.IsGenericType = this.GetTypeInfo().IsGenericType + member this.IsGenericTypeDefinition = this.GetTypeInfo().IsGenericTypeDefinition + member this.GetGenericArguments() = if this.IsGenericTypeDefinition then this.GetTypeInfo().GenericTypeParameters elif this.IsGenericType then this.GenericTypeArguments else [||] + member this.IsInterface = this.GetTypeInfo().IsInterface + member this.IsPublic = this.GetTypeInfo().IsPublic + member this.IsNestedPublic = this.GetTypeInfo().IsNestedPublic + member this.IsClass = this.GetTypeInfo().IsClass + member this.IsValueType = this.GetTypeInfo().IsValueType + member this.IsSealed = this.GetTypeInfo().IsSealed member this.BaseType = this.GetTypeInfo().BaseType @@ -221,15 +207,22 @@ module internal ReflectionAdapters = // MSDN: returns an array of Type objects representing all the interfaces implemented or inherited by the current Type. member this.GetInterfaces() = this.GetTypeInfo().ImplementedInterfaces |> Seq.toArray + member this.GetMethods() = this.GetMethods(publicFlags) + member this.Assembly = this.GetTypeInfo().Assembly + member this.IsSubclassOf(otherTy : Type) = this.GetTypeInfo().IsSubclassOf(otherTy) + member this.IsEnum = this.GetTypeInfo().IsEnum; + member this.GetField(name, bindingFlags) = this.GetFields(bindingFlags) |> Array.filter (fun fi -> fi.Name = name) |> commit + member this.GetField(name) = RuntimeReflectionExtensions.GetRuntimeField(this, name) + member this.GetProperty(name, propertyType, parameterTypes : Type[]) = this.GetProperties() |> Array.filter (fun pi -> @@ -266,10 +259,13 @@ module internal ReflectionAdapters = s.GetHashCode() type System.Reflection.EventInfo with + member this.GetAddMethod() = this.AddMethod + member this.GetRemoveMethod() = this.RemoveMethod + member this.MetadataToken = // TODO: is this an adequate replacement for MetadataToken let s = String.Format("{0},{0}", this.DeclaringType.ToString(), this.ToString()) @@ -278,6 +274,7 @@ module internal ReflectionAdapters = type System.Reflection.FieldInfo with member this.GetRawConstantValue() = this.GetValue(null) + member this.MetadataToken = // TODO: is this an adequate replacement for MetadataToken let s = String.Format("{0},{0}", this.DeclaringType.ToString(), this.ToString()) @@ -285,6 +282,7 @@ module internal ReflectionAdapters = type System.Reflection.MemberInfo with member this.GetCustomAttributes(attrTy, inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy, inherits) |> Seq.toArray) + // TODO: is this an adequate replacement for MetadataToken member this.MetadataToken = // TODO: is this an adequate replacement for MetadataToken @@ -292,16 +290,21 @@ module internal ReflectionAdapters = s.GetHashCode() type System.Reflection.MethodInfo with + member this.GetCustomAttributes(inherits : bool) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, inherits) |> Seq.toArray) + member this.Invoke(obj, _bindingFlags, _binder, args, _ci) = this.Invoke(obj, args) + member this.MetadataToken = // TODO: is this an adequate replacement for MetadataToken let s = String.Format("{0},{0}", this.DeclaringType.ToString(), this.ToString()) s.GetHashCode() type System.Reflection.ParameterInfo with + member this.RawDefaultValue = this.DefaultValue + member this.MetadataToken = // TODO: is this an adequate replacement for MetadataToken // I really do not understand why: sprintf "%s,%s" (this.ReflectedType.ToString()) (this.ToString()) did not work @@ -309,69 +312,50 @@ module internal ReflectionAdapters = s.GetHashCode() type System.Reflection.PropertyInfo with + member this.GetGetMethod(nonPublic) = let mi = this.GetMethod if canUseAccessor mi nonPublic then mi else null + member this.GetSetMethod(nonPublic) = let mi = this.SetMethod if canUseAccessor mi nonPublic then mi else null - member this.GetGetMethod() = this.GetMethod - member this.GetSetMethod() = this.SetMethod - -#if FX_RESHAPED_REFLECTION_CORECLR - type CustomAssemblyResolver() = - inherit AssemblyLoadContext() - override this.Load (assemblyName:AssemblyName):Assembly = - this.LoadFromAssemblyName(assemblyName) + member this.GetGetMethod() = this.GetMethod - let globalLoadContext = - // This is an unfortunate temporary fix!!!! - // ======================================== - // We need to run fsi tests on a very old version of the corclr because of an unfortunate test framework - // This hack detects that, and uses the old code. - // On slightly newer code AssemblyLoadContext.Default is the way to go. - match Seq.tryHead (typeof.GetTypeInfo().Assembly.GetCustomAttributes()) with - | Some a when a.Version = "4.6.24410.01" -> new CustomAssemblyResolver() :> AssemblyLoadContext - | _ -> AssemblyLoadContext.Default + member this.GetSetMethod() = this.SetMethod -#endif type System.Reflection.Assembly with + member this.GetTypes() = this.DefinedTypes |> Seq.map (fun ti -> ti.AsType()) |> Seq.toArray + member this.GetExportedTypes() = this.DefinedTypes |> Seq.filter(fun ti -> ti.IsPublic) |> Seq.map (fun ti -> ti.AsType()) |> Seq.toArray + member this.Location = this.ManifestModule.FullyQualifiedName -#if FX_RESHAPED_REFLECTION_CORECLR - static member LoadFrom(filename:string) = - globalLoadContext.LoadFromAssemblyPath(filename) - - static member UnsafeLoadFrom(filename:string) = - globalLoadContext.LoadFromAssemblyPath(filename) - - type System.Reflection.AssemblyName with - static member GetAssemblyName(path) = - System.Runtime.Loader.AssemblyLoadContext.GetAssemblyName(path) -#endif - type System.Delegate with + static member CreateDelegate(delegateType, methodInfo : MethodInfo) = methodInfo.CreateDelegate(delegateType) + static member CreateDelegate(delegateType, obj : obj, methodInfo : MethodInfo) = methodInfo.CreateDelegate(delegateType, obj) type System.Object with member this.GetPropertyValue(propName) = this.GetType().GetProperty(propName, BindingFlags.Public).GetValue(this, null) + member this.SetPropertyValue(propName, propValue) = this.GetType().GetProperty(propName, BindingFlags.Public).SetValue(this, propValue, null) + member this.GetMethod(methodName, argTypes) = this.GetType().GetMethod(methodName, argTypes, BindingFlags.Public) @@ -384,4 +368,34 @@ module internal ReflectionAdapters = let s = this.FullyQualifiedName s.GetHashCode() +#if COMPILER // This part includes global state in globalLoadContext. Only include this support "once", i.e. when compiling FSharp.Compiler.Private.dll, FSharp.Compiler.Service.dll, fsc-proto.exe + + type CustomAssemblyResolver() = + inherit System.Runtime.Loader.AssemblyLoadContext() + override this.Load (assemblyName:AssemblyName):Assembly = + this.LoadFromAssemblyName(assemblyName) + + let globalLoadContext = + // This is an unfortunate temporary fix!!!! + // ======================================== + // We need to run fsi tests on a very old version of the corclr because of an unfortunate test framework + // This hack detects that, and uses the old code. + // On slightly newer code AssemblyLoadContext.Default is the way to go. + match Seq.tryHead (typeof.GetTypeInfo().Assembly.GetCustomAttributes()) with + | Some a when a.Version = "4.6.24410.01" -> new CustomAssemblyResolver() :> System.Runtime.Loader.AssemblyLoadContext + | _ -> System.Runtime.Loader.AssemblyLoadContext.Default + + type System.Reflection.Assembly with + static member LoadFrom(filename:string) = + globalLoadContext.LoadFromAssemblyPath(filename) + + static member UnsafeLoadFrom(filename:string) = + globalLoadContext.LoadFromAssemblyPath(filename) + + type System.Reflection.AssemblyName with + static member GetAssemblyName(path) = + System.Runtime.Loader.AssemblyLoadContext.GetAssemblyName(path) + +#endif + #endif diff --git a/src/utils/sformat.fs b/src/utils/sformat.fs index 849ff5326fe..d3f6bb48eda 100644 --- a/src/utils/sformat.fs +++ b/src/utils/sformat.fs @@ -489,21 +489,14 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl let string_of_int (i:int) = i.ToString() let typeUsesSystemObjectToString (typ:System.Type) = -#if FX_PORTABLE_OR_NETSTANDARD try #if FX_RESHAPED_REFLECTION let methInfo = typ.GetRuntimeMethod("ToString",[| |]) - methInfo.DeclaringType = typeof #else - let methInfo = typ.GetMethod("ToString",[| |]) - methInfo.DeclaringType = typeof + let methInfo = typ.GetMethod("ToString",BindingFlags.Public ||| BindingFlags.Instance,null,[| |],null) #endif - with e -> false -#else - try let methInfo = typ.GetMethod("ToString",BindingFlags.Public ||| BindingFlags.Instance,null,[| |],null) methInfo.DeclaringType = typeof with e -> false -#endif /// If "str" ends with "ending" then remove it from "str", otherwise no change. let trimEnding (ending:string) (str:string) = if str.EndsWith(ending,StringComparison.Ordinal) then @@ -805,20 +798,13 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl // -------------------------------------------------------------------- let getProperty (ty: Type) (obj: obj) name = -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let prop = ty.GetProperty(name, (BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.NonPublic)) if not (isNull prop) then prop.GetValue(obj,[||]) -#if FX_NO_MISSINGMETHODEXCEPTION - // Profile 7, 47, 78 and 259 raise MissingMemberException - else - let msg = System.String.Concat([| "Method '"; ty.FullName; "."; name; "' not found." |]) - raise (System.MissingMemberException(msg)) -#else // Others raise MissingMethodException else let msg = System.String.Concat([| "Method '"; ty.FullName; "."; name; "' not found." |]) raise (System.MissingMethodException(msg)) -#endif #else ty.InvokeMember(name, (BindingFlags.GetProperty ||| BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.NonPublic), null, obj, [| |],CultureInfo.InvariantCulture) #endif @@ -1189,7 +1175,7 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl // If the leafFormatter was directly here, then layout leaves could store strings. match obj with | _ when opts.ShowProperties -> -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION let props = ty.GetProperties(BindingFlags.Instance ||| BindingFlags.Public) #else let props = ty.GetProperties(BindingFlags.GetField ||| BindingFlags.Instance ||| BindingFlags.Public) @@ -1208,7 +1194,7 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl // massively reign in deep printing of properties let nDepth = depthLim/10 -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 || NETSTANDARD2_0 Array.Sort((propsAndFields),{ new IComparer with member this.Compare(p1,p2) = compare (p1.Name) (p2.Name) } ); #else Array.Sort((propsAndFields :> Array),{ new System.Collections.IComparer with member this.Compare(p1,p2) = compare ((p1 :?> MemberInfo).Name) ((p2 :?> MemberInfo).Name) } ); diff --git a/src/utils/sformat.fsi b/src/utils/sformat.fsi index 65f01c17858..fb768703e17 100644 --- a/src/utils/sformat.fsi +++ b/src/utils/sformat.fsi @@ -15,7 +15,7 @@ // all 4 cases the layout types are really different types. #if COMPILER -// fsc-proto.exe: +// fsc.exe: // FSharp.Compiler.Service.dll: namespace Internal.Utilities.StructuredFormat #else @@ -36,7 +36,7 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl type internal TaggedText = abstract Tag: LayoutTag abstract Text: string -#else // FSharp.Compiler.Service.dll, fsc-proto.exe +#else // FSharp.Compiler.Service.dll, fsc.exe /// Data representing joints in structured layouts of terms. The representation /// of this data type is only for the consumption of formatting engines. diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index f0cc28128c1..0522cf51f50 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -41,6 +41,8 @@ True $(NUnitLibDir)\nunit.framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll @@ -54,6 +56,20 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.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} diff --git a/tests/FSharp.Build.UnitTests/NuGet.Config b/tests/FSharp.Build.UnitTests/NuGet.Config new file mode 100644 index 00000000000..0a86752fee0 --- /dev/null +++ b/tests/FSharp.Build.UnitTests/NuGet.Config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/FSharp.Build.UnitTests/project.json b/tests/FSharp.Build.UnitTests/project.json index 557b06140e2..91e95a04872 100644 --- a/tests/FSharp.Build.UnitTests/project.json +++ b/tests/FSharp.Build.UnitTests/project.json @@ -11,6 +11,7 @@ "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": { diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj index 195324d0853..5357d4ffad6 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj @@ -44,7 +44,7 @@ - ..\..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll @@ -60,10 +60,9 @@ FSharp.Compiler.Private {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - + + {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core - {ded3bbd7-53f4-428a-8c9f-27968e768605} - True diff --git a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs index 3b3eab8a3cd..94c87bf0e1a 100644 --- a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs +++ b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs @@ -1,6 +1,7 @@ namespace FSharp.Compiler.UnitTests open System +open System.IO open System.Text open NUnit.Framework @@ -111,18 +112,19 @@ module TypeProviderDesignTimeComponentLoading = [] let ``check tooling paths for type provider design time component loading`` () = - let arch = if sizeof = 8 then "x64" else "x86" let expected = - [ @"typeproviders\fsharp41\net461\" + arch - @"typeproviders\fsharp41\net461" - @"typeproviders\fsharp41\net452\" + arch - @"typeproviders\fsharp41\net452" - @"typeproviders\fsharp41\net451\" + arch - @"typeproviders\fsharp41\net451" - @"typeproviders\fsharp41\net45\" + arch - @"typeproviders\fsharp41\net45" - @"typeproviders\fsharp41\netstandard2.0\" + arch - @"typeproviders\fsharp41\netstandard2.0" + [ Path.Combine("typeproviders", "fsharp41", "net461") + Path.Combine("tools", "fsharp41", "net461") + Path.Combine("typeproviders", "fsharp41", "net452") + Path.Combine("tools", "fsharp41", "net452") + Path.Combine("typeproviders", "fsharp41", "net451") + Path.Combine("tools", "fsharp41", "net451") + Path.Combine("typeproviders", "fsharp41", "net45") + Path.Combine("tools", "fsharp41", "net45") + Path.Combine("typeproviders", "fsharp41", "netstandard2.0") + Path.Combine("tools", "fsharp41", "netstandard2.0") ] let actual = Microsoft.FSharp.Compiler.ExtensionTyping.toolingCompatiblePaths() - Assert.areEqual expected actual + printfn "actual = %A" actual + printfn "expected = %A" expected + Assert.True((expected=actual)) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj index f1e384f1d64..361537fcfde 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj @@ -49,10 +49,10 @@ true True - $(FsCheckLibDir)\net45\FsCheck.dll + $(FsCheckLibDir)\net452\FsCheck.dll - ..\..\..\packages\System.ValueTuple.4.3.1\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll True @@ -118,8 +118,8 @@ - - FSharp.Core.UnitTests.dll.config + + FSharp.Core.Unittests.dll.config FSCoreVersion $(FSCoreVersion) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs index e7bc94a69cd..4333e5316af 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs @@ -1628,7 +1628,7 @@ module ComparersRegression = static member I = inlinable static member N = noninlinable -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 let create<'a,'b when 'b : equality> name operation (f:IOperation<'a>) (items:array<'a>) = printf """ [] member __.``%s %s``() = 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 982760aeafa..725775bf751 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 @@ -416,11 +416,9 @@ type ArrayModule() = member this.Choose() = this.ChooseTester Array.choose Array.choose -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Choose`` () = this.ChooseTester Array.Parallel.choose Array.Parallel.choose -#endif member private this.CollectTester collectInt collectString = @@ -463,11 +461,9 @@ type ArrayModule() = Array.collect f [|1;2;3|] |> ignore Assert.AreEqual(3,!stamp) -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Collect`` () = this.CollectTester Array.Parallel.collect Array.Parallel.collect -#endif [] member this.compareWith() = @@ -1279,11 +1275,9 @@ type ArrayModule() = Array.init 10 f |> ignore Assert.AreEqual (10, !stamp) -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Init``() = this.InitTester Array.Parallel.init Array.Parallel.init -#endif [] member this.IsEmpty() = @@ -1491,11 +1485,9 @@ type ArrayModule() = Array.map f [| 1..100 |] |> ignore Assert.AreEqual(100,!stamp) -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Map`` () = this.MapTester Array.Parallel.map Array.Parallel.map -#endif member private this.MapiTester mapiInt mapiString = // empty array @@ -1533,7 +1525,6 @@ type ArrayModule() = Assert.AreEqual(100,!stamp) () -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Mapi`` () = this.MapiTester Array.Parallel.mapi Array.Parallel.mapi @@ -1603,7 +1594,6 @@ type ArrayModule() = CheckThrowsArgumentNullException (fun () -> Array.Parallel.iteri funStr nullArr |> ignore) () -#endif member private this.PartitionTester partInt partString = // int array @@ -1648,11 +1638,9 @@ type ArrayModule() = Assert.AreEqual([|[]|], Array.singleton []) Assert.IsTrue([|[||]|] = Array.singleton [||]) -#if !FX_NO_TPL_PARALLEL [] member this.``Parallel.Partition`` () = this.PartitionTester Array.Parallel.partition Array.Parallel.partition -#endif [] member this.Contains() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs index 121f796b29b..80c13757f6d 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs @@ -102,7 +102,7 @@ type ListType() = [] member this.IReadOnlyList_T() = - + let c = ['a'; 'b'; 'c'] :> IReadOnlyList Assert.AreEqual(c.[1], 'b') @@ -110,11 +110,11 @@ type ListType() = let c = [1..10] :> IReadOnlyList Assert.AreEqual(c.[5], 6) - + let c = [] :> IReadOnlyList - + CheckThrowsArgumentException(fun () -> c.[0] |> ignore) - + // Base class methods [] member this.ObjectToString() = 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 bd8016b321f..d26b1d5f60f 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 @@ -9,9 +9,7 @@ open System open System.Threading open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework -#if !FSCORE_PORTABLE_NEW open FsCheck -#endif module Utils = let internal memoizeAsync f = @@ -25,7 +23,6 @@ type [] Dummy (x: int) = member this.Dispose () = () -#if !FSCORE_PORTABLE_NEW [] module ChoiceUtils = @@ -139,8 +136,6 @@ module ChoiceUtils = let minTimeoutOps = ops |> Seq.filter (fun op -> op.Timeout <= minTimeout) |> Seq.length Assert.LessOrEqual(!completed, minTimeoutOps) -#endif - module LeakUtils = // when testing for liveness, the things that we want to observe must always be created in // a nested function call to avoid the GC (possibly) treating them as roots past the last use in the block. @@ -446,7 +441,7 @@ type AsyncModule() = member this.``RaceBetweenCancellationAndError.Sleep``() = testErrorAndCancelRace (Async.Sleep (-5)) -#if !(FSCORE_PORTABLE_NEW || coreclr) +#if !coreclr [] // takes 3 minutes! member this.``Async.Choice specification test``() = ThreadPool.SetMinThreads(100,100) |> ignore @@ -498,7 +493,6 @@ type AsyncModule() = } Async.RunSynchronously(test) -#if !FSCORE_PORTABLE_NEW [] member this.``FromContinuationsCanTailCallCurrentThread``() = let cnt = ref 0 @@ -519,7 +513,6 @@ type AsyncModule() = f 5000 |> Async.StartImmediate Assert.AreEqual(origTid, !finalTid) Assert.AreEqual(5000, !cnt) -#endif [] member this.``AwaitWaitHandle With Cancellation``() = @@ -572,7 +565,6 @@ type AsyncModule() = Assert.AreEqual("boom", !r) -#if !FSCORE_PORTABLE_NEW [] member this.``SleepContinuations``() = let okCount = ref 0 @@ -599,7 +591,6 @@ type AsyncModule() = for i = 1 to 3 do test() Assert.AreEqual(0, !okCount) Assert.AreEqual(0, !errCount) -#endif [] member this.``Async caching should work``() = @@ -611,24 +602,30 @@ type AsyncModule() = x := !x + 1 // Side effect! return "" } - let memFunc = Utils.memoizeAsync <| someSlowFunc + let memFunc : string -> Async = Utils.memoizeAsync <| someSlowFunc async { + Console.WriteLine "Do the same memoized thing many ways...." do! memFunc "a" |> Async.Ignore do! memFunc "a" |> Async.Ignore do! memFunc "a" |> Async.Ignore do! [|1 .. 30|] |> Seq.map(fun _ -> (memFunc "a")) |> Async.Parallel |> Async.Ignore + + Console.WriteLine "Still more ways...." for _i = 1 to 30 do Async.Start( memFunc "a" |> Async.Ignore ) Async.Start( memFunc "a" |> Async.Ignore ) do! Async.Sleep 500 do! memFunc "a" |> Async.Ignore do! memFunc "a" |> Async.Ignore + Console.WriteLine "Still more ways again...." for _i = 1 to 30 do Async.Start( memFunc "a" |> Async.Ignore ) + Console.WriteLine "Still more ways again again...." do! [|1 .. 30|] |> Seq.map(fun _ -> (memFunc "a")) |> Async.Parallel |> Async.Ignore } |> Async.RunSynchronously + Console.WriteLine "Checking result...." Assert.AreEqual(1, !x) 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 166844ea22b..d2fe26e0c00 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 @@ -9,10 +9,7 @@ open System open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework open System.Threading - -#if !FX_NO_TPL_PARALLEL open System.Threading.Tasks -#endif type RunWithContinuationsTest_WhatToDo = | Exit @@ -128,8 +125,6 @@ type AsyncType() = Assert.IsTrue(!result = "Cancel" || !result = "Ok") ) -#if !FX_NO_TPL_PARALLEL - member private this.WaitASec (t:Task) = let result = t.Wait(TimeSpan(hours=0,minutes=0,seconds=1)) Assert.IsTrue(result, "Task did not finish after waiting for a second.") @@ -139,7 +134,7 @@ type AsyncType() = member this.CreateTask () = let s = "Hello tasks!" let a = async { return s } -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t : Task = #else use t : Task = @@ -156,7 +151,7 @@ type AsyncType() = let a = async { cts.CancelAfter (100) do! tcs.Task |> Async.AwaitTask } -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t : Task = #else use t : Task = @@ -183,7 +178,7 @@ type AsyncType() = member this.StartTask () = let s = "Hello tasks!" let a = async { return s } -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -213,7 +208,7 @@ type AsyncType() = let a = async { do raise (Exception ()) } -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -232,7 +227,7 @@ type AsyncType() = let a = async { while true do () } -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -257,7 +252,7 @@ type AsyncType() = } let cts = new CancellationTokenSource() let token = cts.Token -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -324,6 +319,7 @@ type AsyncType() = Assert.IsTrue(exceptionThrown) [] + [] member this.CancellationPropagatesToImmediateTask () = let a = async { while true do () @@ -343,6 +339,7 @@ type AsyncType() = Assert.IsTrue(t.IsCanceled) [] + [] member this.CancellationPropagatesToGroupImmediate () = let ewh = new ManualResetEvent(false) let cancelled = ref false @@ -375,7 +372,7 @@ type AsyncType() = [] member this.TaskAsyncValue () = let s = "Test" -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -415,7 +412,7 @@ type AsyncType() = [] member this.TaskAsyncValueException () = -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -434,7 +431,7 @@ type AsyncType() = use ewh = new ManualResetEvent(false) let cts = new CancellationTokenSource() let token = cts.Token -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t : Task= #else use t : Task= @@ -453,7 +450,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValue () = let hasBeenCalled = ref false -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -468,7 +465,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValueException () = -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -487,7 +484,7 @@ type AsyncType() = use ewh = new ManualResetEvent(false) let cts = new CancellationTokenSource() let token = cts.Token -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -503,4 +500,3 @@ type AsyncType() = cts.Cancel() ewh.WaitOne(10000) |> ignore -#endif diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs index 54720b29d7c..47f241f2462 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs @@ -306,3 +306,5 @@ type CancellationType() = Assert.IsFalse((r1a <> r1a')) Assert.IsTrue((r1a <> r1b)) Assert.IsTrue((r1a <> r2)) + + 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 74b0abaf291..de56a4b1455 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,3 +292,43 @@ type MailboxProcessorType() = test() + [] + member this.PostAndAsyncReply_Cancellation() = + + use cancel = new CancellationTokenSource(500) + let mutable gotGood = false + let mutable gotBad = false + + let goodAsync = async { + try + for i in Seq.initInfinite (fun i -> i) do + if i % 10000000 = 0 then + printfn "good async working..." + finally + printfn "good async exited - that's what we want" + gotGood <- true + } + + let badAsync (mbox:MailboxProcessor>) = async { + try + printfn "bad async working..." + let! result = mbox.PostAndAsyncReply id // <- got stuck in here forever + printfn "%d" result + finally + printfn "bad async exited - that's what we want" // <- we never got here + gotBad <- true + } + + let mbox = MailboxProcessor.Start(fun inbox -> async { + let! (reply : AsyncReplyChannel) = inbox.Receive() + do! Async.Sleep 1000000 + reply.Reply (200) + }, cancel.Token) + + [goodAsync; badAsync mbox] + |> Async.Parallel + |> Async.Ignore + |> fun x -> Async.Start(x, cancel.Token) + System.Threading.Thread.Sleep(1000) // cancellation after 500 + if not gotGood || not gotBad then + failwith "Exected both good and bad async's to be cancelled afteMailbox should not fail!" diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs index 4e548f34cb5..c009617c500 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs @@ -183,8 +183,7 @@ type BigIntType() = Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigPositiveA, bigPositiveB), 900000000090I) Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigNegativeA, bigNegativeB), 900000000090I) Assert.AreEqual(BigInteger.GreatestCommonDivisor(0I, bigPositiveA), bigPositiveA) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else +#if !CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 Assert.AreEqual(BigInteger.GreatestCommonDivisor(BigInteger(), bigPositiveA), bigPositiveA) Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigPositiveA, BigInteger()), bigPositiveA) Assert.AreEqual(BigInteger.GreatestCommonDivisor(BigInteger(), bigNegativeA), bigPositiveA) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs index 4c01edb82e1..7e1dec5a2ff 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs @@ -23,6 +23,7 @@ Make sure each method works on: * Exception * Tuple * Fuction +* Struct versions of the above *) #if FX_RESHAPED_REFLECTION @@ -51,19 +52,32 @@ open PrimReflectionAdapters module IsModule = type IsModuleType () = - member this.M = 1 + member __.M = 1 type FSharpDelegate = delegate of int -> string type RecordType = { field1 : string; field2 : RecordType option; field3 : (unit -> RecordType * string) } -type GenericRecordType<'a, 'b> = { field1 : 'a; field2 : 'b; field3 : (unit -> GenericRecordType<'a, 'b>) } +type GenericRecordType<'T, 'U> = { field1 : 'T; field2 : 'U; field3 : (unit -> GenericRecordType<'T, 'U>) } + +[] +type StructRecordType = { field1 : string; field2 : StructRecordType option; field3 : (unit -> StructRecordType * string) } type SingleNullaryCaseDiscUnion = SingleNullaryCaseTag type SingleCaseDiscUnion = SingleCaseTag of float * float * float -type DiscUnionType<'a> = +[] +type SingleNullaryCaseDiscStructUnion = SingleNullaryCaseTagStruct +[] +type SingleCaseDiscStructUnion = SingleCaseTagStruct of float * float * float + +type DiscUnionType<'T> = + | A // No data associated with tag + | B of 'T * DiscUnionType<'T> option + | C of float * string + +type DiscStructUnionType<'T> = | A // No data associated with tag - | B of 'a * DiscUnionType<'a> option + | B of 'T | C of float * string exception ExceptionInt of int @@ -79,36 +93,51 @@ module FSharpModule = type FSharpValueTests() = // global variables - let rec recordtype1 : RecordType = { field1 = "field1"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1,"") )} - let recordtype2 : RecordType = { field1 = "field2"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1,"") )} + let rec record1 : RecordType = { field1 = "field1"; field2 = Some(record1); field3 = ( fun () -> (record1, "") )} + let record2 : RecordType = { field1 = "field2"; field2 = Some(record1); field3 = ( fun () -> (record1, "") )} - let rec genericRecordType1 : GenericRecordType = + // global variables + let rec structRecord1 : StructRecordType = { field1 = "field1"; field2 = None; field3 = ( fun () -> (structRecord1, "") )} + let structRecord2 : StructRecordType = { field1 = "field2"; field2 = Some(structRecord1); field3 = ( fun () -> (structRecord1, "") )} + + let rec genericRecordType1 : GenericRecordType = { field1 = "field1" field2 = 1 field3 = (fun () -> genericRecordType1) } - let genericRecordType2 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} + let genericRecordType2 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} let nullValue = null - let singlecaseunion1 = SingleCaseDiscUnion.SingleCaseTag(1.0,2.0,3.0) - let singlecaseunion2 = SingleCaseDiscUnion.SingleCaseTag(4.0,5.0,6.0) + let singleCaseUnion1 = SingleCaseDiscUnion.SingleCaseTag(1.0, 2.0, 3.0) + let singleCaseUnion2 = SingleCaseDiscUnion.SingleCaseTag(4.0, 5.0, 6.0) - let discUniontypeA = DiscUnionType.A - let discUniontypeB = DiscUnionType.B(1,Some(discUniontypeA)) - let discUniontypeC = DiscUnionType.C(1.0,"stringparam") + let singleCaseStructUnion1 = SingleCaseDiscStructUnion.SingleCaseTagStruct(1.0, 2.0, 3.0) + let singleCaseStructUnion2 = SingleCaseDiscStructUnion.SingleCaseTagStruct(4.0, 5.0, 6.0) - let recDiscUniontypeB = DiscUnionType.B(1,Some(discUniontypeB)) + let discUnionCaseA = DiscUnionType.A + let discUnionCaseB = DiscUnionType.B(1, Some(discUnionCaseA)) + let discUnionCaseC = DiscUnionType.C(1.0, "stringparam") - let fsharpdelegate1 = new FSharpDelegate(fun (x:int) -> "delegate1") - let fsharpdelegate2 = new FSharpDelegate(fun (x:int) -> "delegate2") + let discUnionRecCaseB = DiscUnionType.B(1, Some(discUnionCaseB)) + + let discStructUnionCaseA = DiscStructUnionType.A + let discStructUnionCaseB = DiscStructUnionType.B(1) + let discStructUnionCaseC = DiscStructUnionType.C(1.0, "stringparam") + + + let fsharpDelegate1 = new FSharpDelegate(fun (x:int) -> "delegate1") + let fsharpDelegate2 = new FSharpDelegate(fun (x:int) -> "delegate2") let tuple1 = ( 1, "tuple1") - let tuple2 = ( 2, "tuple2",(fun x -> x + 1)) + let tuple2 = ( 2, "tuple2", (fun x -> x + 1)) let tuple3 = ( 1, ( 2, "tuple")) + let structTuple1 = struct ( 1, "tuple1") + let structTuple2 = struct ( 2, "tuple2", (fun x -> x + 1)) + let structTuple3 = struct ( 1, struct ( 2, "tuple")) let func1 param = param + 1 let func2 param = param + "" @@ -117,51 +146,92 @@ type FSharpValueTests() = let exDataless = DatalessException [] - member this.Equals() = + member __.Equals1() = // Record value - Assert.IsTrue(FSharpValue.Equals(recordtype1, recordtype1)) - Assert.IsFalse(FSharpValue.Equals(recordtype1, recordtype2)) + Assert.IsTrue(FSharpValue.Equals(record1, record1)) + Assert.IsFalse(FSharpValue.Equals(record1, record2)) + [] + member __.Equals2() = + Assert.IsTrue(FSharpValue.Equals(structRecord1, structRecord1)) + Assert.IsFalse(FSharpValue.Equals(structRecord1, structRecord2)) + Assert.IsFalse(FSharpValue.Equals(structRecord1, record2)) + Assert.IsFalse(FSharpValue.Equals(record1, structRecord1)) + Assert.IsFalse(FSharpValue.Equals(record2, structRecord2)) + + [] + member __.Equals3() = // Generic Record value Assert.IsTrue(FSharpValue.Equals(genericRecordType1, genericRecordType1)) Assert.IsFalse(FSharpValue.Equals(genericRecordType1, genericRecordType2)) + [] + member __.Equals4() = // null value - Assert.IsTrue(FSharpValue.Equals(nullValue,nullValue)) - Assert.IsFalse(FSharpValue.Equals(nullValue,1)) + Assert.IsTrue(FSharpValue.Equals(nullValue, nullValue)) + Assert.IsFalse(FSharpValue.Equals(nullValue, 1)) + [] + member __.Equals5() = + // Single Case Union + Assert.IsTrue(FSharpValue.Equals(singleCaseUnion1, singleCaseUnion1)) + Assert.IsFalse(FSharpValue.Equals(singleCaseUnion1, singleCaseUnion2)) + + [] + member __.Equals6() = // Single Case Union - Assert.IsTrue(FSharpValue.Equals(singlecaseunion1,singlecaseunion1)) - Assert.IsFalse(FSharpValue.Equals(singlecaseunion1,singlecaseunion2)) + Assert.IsTrue(FSharpValue.Equals(singleCaseStructUnion1, singleCaseStructUnion1)) + Assert.IsFalse(FSharpValue.Equals(singleCaseStructUnion1, singleCaseStructUnion2)) + [] + member __.Equals7() = + // Discriminated Union + Assert.IsTrue(FSharpValue.Equals(discUnionCaseA, discUnionCaseA)) + Assert.IsFalse(FSharpValue.Equals(discUnionCaseB, discUnionCaseC)) + + [] + member __.Equals8() = // Discriminated Union - Assert.IsTrue(FSharpValue.Equals(discUniontypeA,discUniontypeA)) - Assert.IsFalse(FSharpValue.Equals(discUniontypeB,discUniontypeC)) + Assert.IsTrue(FSharpValue.Equals(discStructUnionCaseA, discStructUnionCaseA)) + Assert.IsFalse(FSharpValue.Equals(discStructUnionCaseB, discStructUnionCaseC)) + [] + member __.Equals9() = // FSharpDelegate - Assert.IsTrue(FSharpValue.Equals(fsharpdelegate1,fsharpdelegate1)) - Assert.IsFalse(FSharpValue.Equals(fsharpdelegate1,fsharpdelegate2)) + Assert.IsTrue(FSharpValue.Equals(fsharpDelegate1, fsharpDelegate1)) + Assert.IsFalse(FSharpValue.Equals(fsharpDelegate1, fsharpDelegate2)) + [] + member __.Equals10() = // Tuple Assert.IsTrue(FSharpValue.Equals(tuple1, tuple1)) Assert.IsFalse(FSharpValue.Equals( (1, 2, 3), (4, 5, 6) )) + [] + member __.Equals10b() = + // Tuple + Assert.IsTrue(FSharpValue.Equals(structTuple1, structTuple1)) + Assert.IsFalse(FSharpValue.Equals( struct (1, 2, 3), struct (4, 5, 6) )) + + [] + member __.Equals11() = // Tuples of differing types Assert.IsFalse(FSharpValue.Equals(tuple1, tuple2)) + [] + member __.Equals12() = // Exception - Assert.IsTrue(FSharpValue.Equals(exInt,exInt)) - Assert.IsFalse(FSharpValue.Equals(exInt,exDataless)) - () + Assert.IsTrue(FSharpValue.Equals(exInt, exInt)) + Assert.IsFalse(FSharpValue.Equals(exInt, exDataless)) [] - member this.GetExceptionFields() = + member __.GetExceptionFields() = // int Assert.AreEqual(FSharpValue.GetExceptionFields(exInt), ([|1|] : obj [])) // dataless - Assert.AreEqual(FSharpValue.GetExceptionFields(exDataless),[||]) + Assert.AreEqual(FSharpValue.GetExceptionFields(exDataless), [||]) // invalid type CheckThrowsArgumentException(fun () -> FSharpValue.GetExceptionFields(1) |> ignore) @@ -172,42 +242,56 @@ type FSharpValueTests() = // null CheckThrowsArgumentException(fun () -> FSharpValue.GetExceptionFields(null) |> ignore) - - () [] - member this.GetRecordField() = + member __.GetRecordField() = // Record let propertyinfo1 = (typeof).GetProperty("field1") - Assert.AreEqual((FSharpValue.GetRecordField(recordtype1,propertyinfo1)),"field1") + Assert.AreEqual((FSharpValue.GetRecordField(record1, propertyinfo1)), "field1") // Generic Record value - let propertyinfo2 = (typeof>).GetProperty("field2") - Assert.AreEqual((FSharpValue.GetRecordField(genericRecordType1,propertyinfo2)),1) + let propertyinfo2 = (typeof>).GetProperty("field2") + Assert.AreEqual((FSharpValue.GetRecordField(genericRecordType1, propertyinfo2)), 1) // null value - CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField(null,propertyinfo1)|> ignore) - CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField( () ,propertyinfo1)|> ignore) + CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField(null, propertyinfo1)|> ignore) + CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField( () , propertyinfo1)|> ignore) // invalid value - CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid",propertyinfo1) |> ignore) + CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid", propertyinfo1) |> ignore) // invalid property info let propertyinfoint = (typeof).GetProperty("fieldstring") - CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid",propertyinfoint) |> ignore) - - () + CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid", propertyinfoint) |> ignore) [] - member this.GetRecordFields() = + member __.GetStructRecordField() = + + // Record + let propertyinfo1 = (typeof).GetProperty("field1") + Assert.AreEqual((FSharpValue.GetRecordField(structRecord1, propertyinfo1)), "field1") + + // null value + CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField(null, propertyinfo1)|> ignore) + CheckThrowsArgumentException(fun () ->FSharpValue.GetRecordField( () , propertyinfo1)|> ignore) + + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid", propertyinfo1) |> ignore) + + // invalid property info + let propertyinfoint = (typeof).GetProperty("fieldstring") + CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordField("invalid", propertyinfoint) |> ignore) + + [] + member __.GetRecordFields() = // Record let propertyinfo1 = (typeof).GetProperty("field1") - Assert.AreEqual((FSharpValue.GetRecordFields(recordtype1)).[0],"field1") + Assert.AreEqual((FSharpValue.GetRecordFields(record1)).[0], "field1") // Generic Record value - let propertyinfo2 = (typeof>).GetProperty("field1") - Assert.AreEqual((FSharpValue.GetRecordFields(genericRecordType1)).[0],"field1") + let propertyinfo2 = (typeof>).GetProperty("field1") + Assert.AreEqual((FSharpValue.GetRecordFields(genericRecordType1)).[0], "field1") // null value CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordFields(null)|> ignore) @@ -215,35 +299,48 @@ type FSharpValueTests() = // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.GetRecordFields("invalid") |> ignore) - () + [] + member __.GetStructRecordFields() = + let propertyinfo1 = (typeof).GetProperty("field1") + Assert.AreEqual((FSharpValue.GetRecordFields(structRecord1)).[0], "field1") [] - member this.GetTupleField() = + member __.GetTupleField() = // Tuple - Assert.AreEqual((FSharpValue.GetTupleField(tuple1,0)),1) + Assert.AreEqual((FSharpValue.GetTupleField(tuple1, 0)), 1) // Tuple with function element - Assert.AreEqual( FSharpValue.GetTupleField(tuple2,1), "tuple2") + Assert.AreEqual( FSharpValue.GetTupleField(tuple2, 1), "tuple2") // null value CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField(null, 3)|> ignore) CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField( () , 3)|> ignore) // invalid value - CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField("Invalid",3)|> ignore) + CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField("Invalid", 3)|> ignore) // index out of range - CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField(tuple2,8)|> ignore) - () + CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField(tuple2, 8)|> ignore) + + [] + member __.GetStructTupleField() = + // Tuple + Assert.AreEqual((FSharpValue.GetTupleField(structTuple1, 0)), 1) + + // Tuple with function element + Assert.AreEqual( FSharpValue.GetTupleField(structTuple2, 1), "tuple2") + + // index out of range + CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleField(structTuple2, 8)|> ignore) [] - member this.GetTupleFields() = + member __.GetTupleFields() = // Tuple - Assert.AreEqual(FSharpValue.GetTupleFields(tuple1).[0],1) + Assert.AreEqual(FSharpValue.GetTupleFields(tuple1).[0], 1) // Tuple with function element - Assert.AreEqual( (FSharpValue.GetTupleFields(tuple2)).[1],"tuple2") + Assert.AreEqual( (FSharpValue.GetTupleFields(tuple2)).[1], "tuple2") // null value CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleFields(null)|> ignore) @@ -251,171 +348,233 @@ type FSharpValueTests() = // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.GetTupleFields("Invalid")|> ignore) - () + + [] + member __.GetStructTupleFields() = + // Tuple + Assert.AreEqual(FSharpValue.GetTupleFields(structTuple1).[0], 1) + + // Tuple with function element + Assert.AreEqual( (FSharpValue.GetTupleFields(structTuple2)).[1], "tuple2") [] - member this.GetUnionFields() = + member __.GetUnionFields() = // single case union - let (singlecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let (singlecaseinfo, singlevaluearray) = FSharpValue.GetUnionFields(singleCaseUnion1, typeof) Assert.AreEqual(singlevaluearray, ([|1.0;2.0;3.0|] : obj [])) // DiscUnionType - let (duCaseinfo, duValueArray) = FSharpValue.GetUnionFields(discUniontypeB,typeof>) - Assert.AreEqual(duValueArray.[0],1) + let (duCaseinfo, duValueArray) = FSharpValue.GetUnionFields(discUnionCaseB, typeof>) + Assert.AreEqual(duValueArray.[0], 1) // null value CheckThrowsArgumentException(fun () -> FSharpValue.GetUnionFields(null, null)|> ignore) CheckThrowsArgumentException(fun () -> FSharpValue.GetUnionFields( () , null)|> ignore) - () + [] + member __.GetStructUnionFields() = + // single case union + let (_singlecaseinfo, singlevaluearray) = FSharpValue.GetUnionFields(singleCaseStructUnion1, typeof) + Assert.AreEqual(singlevaluearray, ([|1.0;2.0;3.0|] : obj [])) + // DiscUnionType + let (_duCaseinfo, duValueArray) = FSharpValue.GetUnionFields(discStructUnionCaseB, typeof>) + Assert.AreEqual(duValueArray.[0], 1) + [] - member this.MakeFunction() = + member __.MakeFunction() = // Int function let implementationInt (x:obj) = box( unbox(x) + 1) let resultFuncIntObj = FSharpValue.MakeFunction(typeof int>, implementationInt ) let resultFuncInt = resultFuncIntObj :?> (int -> int) - Assert.AreEqual(resultFuncInt(5),6) + Assert.AreEqual(resultFuncInt(5), 6) // String funcion let implementationString (x:obj) = box( unbox(x) + " function") let resultFuncStringObj = FSharpValue.MakeFunction(typeof string>, implementationString ) let resultFuncString = resultFuncStringObj :?> (string -> string) - Assert.AreEqual(resultFuncString("parameter"),"parameter function") - - () + Assert.AreEqual(resultFuncString("parameter"), "parameter function") [] - member this.MakeRecord() = + member __.MakeRecord() = // Record - let makeRecord = FSharpValue.MakeRecord(typeof,[|box"field1";box(Some(recordtype1));box( fun () -> (recordtype1,"")) |]) - Assert.AreEqual(FSharpValue.GetRecordFields(makeRecord).[0],"field1") + let makeRecord = FSharpValue.MakeRecord(typeof, [| box"field1"; box(Some(record1)); box( fun () -> (record1, "")) |]) + Assert.AreEqual(FSharpValue.GetRecordFields(makeRecord).[0], "field1") // Generic Record value - let makeRecordGeneric = FSharpValue.MakeRecord(typeof>,[|box"field1";box(1);box( fun () -> genericRecordType1) |]) - Assert.AreEqual(FSharpValue.GetRecordFields(makeRecordGeneric).[0],"field1") + let makeRecordGeneric = FSharpValue.MakeRecord(typeof>, [| box"field1"; box 1; box( fun () -> genericRecordType1) |]) + Assert.AreEqual(FSharpValue.GetRecordFields(makeRecordGeneric).[0], "field1") // null value - CheckThrowsArgumentException(fun () ->FSharpValue.MakeRecord(null,null)|> ignore) + CheckThrowsArgumentException(fun () ->FSharpValue.MakeRecord(null, null)|> ignore) // invalid value - CheckThrowsArgumentException(fun () -> FSharpValue.MakeRecord(typeof>,[|box(1);box("invalid param");box("invalid param") |])|> ignore) - () + CheckThrowsArgumentException(fun () -> FSharpValue.MakeRecord(typeof>, [| box 1; box("invalid param"); box("invalid param") |])|> ignore) [] - member this.MakeTuple() = + member __.MakeStructRecord() = + // Record + let makeRecord = FSharpValue.MakeRecord(typeof, [| box"field1"; box(Some(structRecord1)); box( fun () -> (structRecord1, "")) |]) + Assert.AreEqual(FSharpValue.GetRecordFields(makeRecord).[0], "field1") + + [] + member __.MakeTuple() = // Tuple - let makeTuple = FSharpValue.MakeTuple([|box(1);box("tuple")|], typeof>) - Assert.AreEqual(FSharpValue.GetTupleFields(makeTuple).[0],1) + let makeTuple = FSharpValue.MakeTuple([| box 1; box("tuple") |], typeof>) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuple).[0], 1) // Tuple with function - let makeTuplewithFunc = FSharpValue.MakeTuple([|box(1);box("tuple with func");box(fun x -> x + 1)|], typeof int)>>) - Assert.AreEqual(FSharpValue.GetTupleFields(makeTuplewithFunc).[1],"tuple with func") + let makeTuplewithFunc = FSharpValue.MakeTuple([| box 1; box "tuple with func"; box (fun x -> x + 1) |], typeof int)>>) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuplewithFunc).[1], "tuple with func") // null value - CheckThrowsArgumentNullException(fun () ->FSharpValue.MakeTuple(null,null)|> ignore) + CheckThrowsArgumentNullException(fun () ->FSharpValue.MakeTuple(null, null)|> ignore) // invalid value - CheckThrowsArgumentException(fun () -> FSharpValue.MakeTuple([|box"invalid param";box"invalid param"|],typeof>) |> ignore) - () + CheckThrowsArgumentException(fun () -> FSharpValue.MakeTuple([| box"invalid param"; box"invalid param"|], typeof>) |> ignore) + + [] + member __.MakeStructTuple() = + // Tuple + let makeTuple = FSharpValue.MakeTuple([| box 1; box("tuple") |], typeof) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuple).[0], 1) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuple).[1], "tuple") + + // Tuple with function + let makeTuplewithFunc = FSharpValue.MakeTuple([| box 1; box "tuple with func"; box (fun x -> x + 1) |], typeof int))>) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuplewithFunc).[0], 1) + Assert.AreEqual(FSharpValue.GetTupleFields(makeTuplewithFunc).[1], "tuple with func") + + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.MakeTuple([| box"invalid param"; box"invalid param"|], typeof) |> ignore) [] - member this.MakeUnion() = + member __.MakeUnion() = // single case union - let (singlecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) - let resultSingleCaseUnion=FSharpValue.MakeUnion(singlecaseinfo,[|box(1.0);box(2.0);box(3.0)|]) - Assert.AreEqual(resultSingleCaseUnion,singlecaseunion1) + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseUnion1, typeof) + let resultSingleCaseUnion=FSharpValue.MakeUnion(singlecaseinfo, [| box 1.0; box 2.0; box 3.0|]) + Assert.AreEqual(resultSingleCaseUnion, singleCaseUnion1) // DiscUnionType - let (duCaseinfo, duValueArray) = FSharpValue.GetUnionFields(discUniontypeB,typeof>) - let resultDiscUnion=FSharpValue.MakeUnion(duCaseinfo,[|box(1);box(Some(discUniontypeB))|]) - Assert.AreEqual(resultDiscUnion,recDiscUniontypeB) - - () + let (duCaseinfo, _duValueArray) = FSharpValue.GetUnionFields(discUnionCaseB, typeof>) + let resultDiscUnion=FSharpValue.MakeUnion(duCaseinfo, [| box 1; box (Some discUnionCaseB) |]) + Assert.AreEqual(resultDiscUnion, discUnionRecCaseB) + + [] + member __.MakeStructUnion() = + // single case union + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseStructUnion1, typeof) + let resultSingleCaseUnion=FSharpValue.MakeUnion(singlecaseinfo, [| box 1.0; box 2.0; box 3.0|]) + Assert.AreEqual(resultSingleCaseUnion, singleCaseStructUnion1) + + // DiscUnionType + let (duCaseinfo, duValueArray) = FSharpValue.GetUnionFields(discStructUnionCaseB, typeof>) + FSharpValue.MakeUnion(duCaseinfo, [| box 1|]) |> ignore [] - member this.PreComputeRecordConstructor() = + member __.PreComputeRecordConstructor() = // Record let recCtor = FSharpValue.PreComputeRecordConstructor(typeof) - let resultRecordType = recCtor([| box("field1");box(Some(recordtype1));box(fun () -> (recordtype1,""))|]) - Assert.AreEqual( (unbox(resultRecordType)).field1 ,recordtype1.field1) + let resultRecordType = recCtor([| box("field1"); box(Some(record1)); box(fun () -> (record1, "")) |]) + Assert.AreEqual( (unbox(resultRecordType)).field1 , record1.field1) // Generic Record value - let genericRecCtor = FSharpValue.PreComputeRecordConstructor(typeof>) - let resultGenericRecordType = genericRecCtor([| box("field1");box(2);box( fun () -> genericRecordType1)|]) - Assert.AreEqual( (unbox>(resultGenericRecordType)).field1,genericRecordType1.field1) + let genericRecCtor = FSharpValue.PreComputeRecordConstructor(typeof>) + let resultGenericRecordType = genericRecCtor([| box("field1"); box 2; box( fun () -> genericRecordType1) |]) + Assert.AreEqual( (unbox>(resultGenericRecordType)).field1, genericRecordType1.field1) // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeRecordConstructor(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeRecordConstructor(typeof>) |> ignore) - - () [] - member this.PreComputeRecordConstructorInfo() = + member __.PreComputeStructRecordConstructor() = + // Record + let recCtor = FSharpValue.PreComputeRecordConstructor(typeof) + let resultRecordType = recCtor([| box("field1"); box(Some(structRecord1)); box(fun () -> (structRecord1, "")) |]) + Assert.AreEqual( (unbox(resultRecordType)).field1 , structRecord1.field1) + + + [] + member __.PreComputeRecordConstructorInfo() = // Record let recordCtorInfo = FSharpValue.PreComputeRecordConstructorInfo(typeof) - Assert.AreEqual(recordCtorInfo.ReflectedType,typeof ) + Assert.AreEqual(recordCtorInfo.ReflectedType, typeof ) // Generic Record value - let genericrecordCtorInfo = FSharpValue.PreComputeRecordConstructorInfo(typeof>) - Assert.AreEqual(genericrecordCtorInfo.ReflectedType,typeof>) + let genericrecordCtorInfo = FSharpValue.PreComputeRecordConstructorInfo(typeof>) + Assert.AreEqual(genericrecordCtorInfo.ReflectedType, typeof>) // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeRecordConstructorInfo(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeRecordConstructorInfo(typeof>) |> ignore) - () [] - member this.PreComputeRecordFieldReader() = + member __.PreComputeStructRecordConstructorInfo() = + // Record + let recordCtorInfo = FSharpValue.PreComputeRecordConstructorInfo(typeof) + Assert.AreEqual(recordCtorInfo.ReflectedType, typeof ) + + [] + member __.PreComputeRecordFieldReader() = // Record let recordFieldReader = FSharpValue.PreComputeRecordFieldReader((typeof).GetProperty("field1")) - Assert.AreEqual(recordFieldReader(recordtype1),box("field1")) + Assert.AreEqual(recordFieldReader(record1), box("field1")) // Generic Record value - let recordFieldReader = FSharpValue.PreComputeRecordFieldReader((typeof>).GetProperty("field1")) - Assert.AreEqual(recordFieldReader(genericRecordType1),box("field1")) + let recordFieldReader = FSharpValue.PreComputeRecordFieldReader((typeof>).GetProperty("field1")) + Assert.AreEqual(recordFieldReader(genericRecordType1), box("field1")) // null value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeRecordFieldReader(null)|> ignore) - () [] - member this.PreComputeRecordReader() = + member __.PreComputeStructRecordFieldReader() = + // Record + let recordFieldReader = FSharpValue.PreComputeRecordFieldReader((typeof).GetProperty("field1")) + Assert.AreEqual(recordFieldReader(structRecord1), box("field1")) + + [] + member __.PreComputeRecordReader() = // Record let recordReader = FSharpValue.PreComputeRecordReader(typeof) - Assert.AreEqual( (recordReader(recordtype1)).[0],"field1") + Assert.AreEqual( (recordReader(record1)).[0], "field1") // Generic Record value - let genericrecordReader = FSharpValue.PreComputeRecordReader(typeof>) - Assert.AreEqual( (genericrecordReader(genericRecordType1)).[0],"field1") + let genericrecordReader = FSharpValue.PreComputeRecordReader(typeof>) + Assert.AreEqual( (genericrecordReader(genericRecordType1)).[0], "field1") // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeRecordReader(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeRecordReader(typeof>) |> ignore) - () [] - member this.PreComputeTupleConstructor() = + member __.PreComputeStructRecordReader() = + // Record + let recordReader = FSharpValue.PreComputeRecordReader(typeof) + Assert.AreEqual( (recordReader(structRecord1)).[0], "field1") + + [] + member __.PreComputeTupleConstructor() = // Tuple let tupleCtor = FSharpValue.PreComputeTupleConstructor(tuple1.GetType()) - Assert.AreEqual( tupleCtor([| box(1);box("tuple1") |]) , box(tuple1)) + Assert.AreEqual( tupleCtor([| box 1; box "tuple1" |]) , box(tuple1)) // Tuple with function member let tuplewithFuncCtor = FSharpValue.PreComputeTupleConstructor(tuple2.GetType()) - let resultTuplewithFunc = tuplewithFuncCtor([| box(2); box("tuple2"); box(fun x -> x + 1)|]) + let resultTuplewithFunc = tuplewithFuncCtor([| box 2; box "tuple2"; box (fun x -> x + 1) |]) Assert.AreEqual( FSharpValue.GetTupleFields( box(resultTuplewithFunc)).[1] , "tuple2") // nested tuple let tupleNestedCtor = FSharpValue.PreComputeTupleConstructor(tuple3.GetType()) - Assert.AreEqual( tupleNestedCtor([| box(1);box(2,"tuple")|] ), box(tuple3)) + Assert.AreEqual( tupleNestedCtor([| box 1; box(2, "tuple") |] ), box(tuple3)) // null value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructor(null)|> ignore) @@ -423,112 +582,202 @@ type FSharpValueTests() = // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructor(typeof>) |> ignore) CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructor(typeof) |> ignore) - - () [] - member this.PreComputeTupleConstructorInfo() = + member __.PreComputeStructTupleConstructor() = + // Tuple + let tupleCtor = FSharpValue.PreComputeTupleConstructor(structTuple1.GetType()) + Assert.AreEqual( tupleCtor([| box 1; box "tuple1" |]) , box(structTuple1)) + + // Tuple with function member + let tuplewithFuncCtor = FSharpValue.PreComputeTupleConstructor(structTuple2.GetType()) + let resultTuplewithFunc = tuplewithFuncCtor([| box 2; box "tuple2"; box (fun x -> x + 1) |]) + Assert.AreEqual( FSharpValue.GetTupleFields( box(resultTuplewithFunc)).[1] , "tuple2") + + // nested tuple + let tupleNestedCtor = FSharpValue.PreComputeTupleConstructor(structTuple3.GetType()) + Assert.AreEqual( tupleNestedCtor([| box 1; box (struct (2, "tuple")) |] ), box(structTuple3)) + + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructor(typeof>) |> ignore) + + [] + member __.PreComputeTupleConstructorInfo() = // Tuple - let (tupleCtorInfo, tupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof>) - Assert.AreEqual(tupleCtorInfo.ReflectedType,typeof> ) + let (tupleCtorInfo, _tupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof>) + Assert.AreEqual(tupleCtorInfo.ReflectedType, typeof> ) // Nested - let (nestedTupleCtorInfo, nestedTupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof>>) - Assert.AreEqual(nestedTupleCtorInfo.ReflectedType, typeof>>) + let (nestedTupleCtorInfo, _nestedTupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof>>) + Assert.AreEqual(nestedTupleCtorInfo.ReflectedType, typeof>>) // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeTupleConstructorInfo(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructorInfo(typeof) |> ignore) - () + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleConstructorInfo(typeof) |> ignore) [] - member this.PreComputeTuplePropertyInfo() = + member __.PreComputeStructTupleConstructorInfo() = + // Tuple + let (tupleCtorInfo, _tupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof) + Assert.AreEqual(tupleCtorInfo.ReflectedType, typeof ) + + // Nested + let (nestedTupleCtorInfo, _nestedTupleType) = FSharpValue.PreComputeTupleConstructorInfo(typeof) + Assert.AreEqual(nestedTupleCtorInfo.ReflectedType, typeof) + + [] + member __.PreComputeTuplePropertyInfo() = // Tuple - let (tuplePropInfo, typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof>,0) - Assert.AreEqual(tuplePropInfo.PropertyType,typeof) + let (tuplePropInfo, _typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof>, 0) + Assert.AreEqual(tuplePropInfo.PropertyType, typeof) // Nested - let (tupleNestedPropInfo, typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof>>,1) - Assert.AreEqual(tupleNestedPropInfo.PropertyType,typeof>) + let (tupleNestedPropInfo, _typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof>>, 1) + Assert.AreEqual(tupleNestedPropInfo.PropertyType, typeof>) // null value - CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeTuplePropertyInfo(null,0)|> ignore) + CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeTuplePropertyInfo(null, 0)|> ignore) // invalid value - CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTuplePropertyInfo(typeof,0) |> ignore) - () + CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTuplePropertyInfo(typeof, 0) |> ignore) + + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTuplePropertyInfo(typeof, 0) |> ignore) + + // This fails as no PropertyInfo's actually exist for struct tuple types. + // + //[] + //member __.PreComputeStructTuplePropertyInfo() = + // + // // Tuple + // let (tuplePropInfo, _typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof, 0) + // Assert.AreEqual(tuplePropInfo.PropertyType, typeof) + // + // // Nested + // let (tupleNestedPropInfo, _typeindex) = FSharpValue.PreComputeTuplePropertyInfo(typeof, 1) + // Assert.AreEqual(tupleNestedPropInfo.PropertyType, typeof) [] - member this.PreComputeTupleReader() = + member __.PreComputeTupleReader() = // Tuple - let tuplereader = FSharpValue.PreComputeTupleReader(typeof>) - Assert.AreEqual(tuplereader(tuple1).[0],1) + let tuplereader = FSharpValue.PreComputeTupleReader(typeof>) + Assert.AreEqual(tuplereader(tuple1).[0], 1) // Nested - let nestedtuplereader = FSharpValue.PreComputeTupleReader(typeof>>) - Assert.AreEqual(nestedtuplereader(tuple3).[1],box(2, "tuple")) + let nestedtuplereader = FSharpValue.PreComputeTupleReader(typeof>>) + Assert.AreEqual(nestedtuplereader(tuple3).[1], box(2, "tuple")) // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeTupleReader(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleReader(typeof) |> ignore) - () + + [] + member __.PreComputeStructTupleReader() = + + // Tuple + let tuplereader = FSharpValue.PreComputeTupleReader(typeof) + Assert.AreEqual(tuplereader(structTuple1).[0], 1) + + // Nested + let nestedtuplereader = FSharpValue.PreComputeTupleReader(typeof) + Assert.AreEqual(nestedtuplereader(structTuple3).[1], box (struct (2, "tuple"))) + + // invalid value + CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeTupleReader(typeof) |> ignore) [] - member this.PreComputeUnionConstructor() = + member __.PreComputeUnionConstructor() = // SingleCaseUnion - let (singlecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseUnion1, typeof) let singleUnionCtor = FSharpValue.PreComputeUnionConstructor(singlecaseinfo) - let resuleSingleCaseUnion = singleUnionCtor([|box(1.0);box(2.0);box(3.0)|]) - Assert.AreEqual(resuleSingleCaseUnion,singlecaseunion1) + let resuleSingleCaseUnion = singleUnionCtor([| box 1.0; box 2.0; box 3.0|]) + Assert.AreEqual(resuleSingleCaseUnion, singleCaseUnion1) // DiscUnion - let (discunioninfo,discunionvaluearray) = FSharpValue.GetUnionFields(discUniontypeB,typeof>) + let (discunioninfo, _discunionvaluearray) = FSharpValue.GetUnionFields(discUnionCaseB, typeof>) let discUnionCtor = FSharpValue.PreComputeUnionConstructor(discunioninfo) - let resuleDiscUnionB = discUnionCtor([|box(1);box(Some(discUniontypeB))|]) - Assert.AreEqual(resuleDiscUnionB,recDiscUniontypeB) - - () + let resuleDiscUnionB = discUnionCtor([| box 1; box(Some(discUnionCaseB)) |]) + Assert.AreEqual(resuleDiscUnionB, discUnionRecCaseB) + + [] + member __.PreComputeStructUnionConstructor() = + + // SingleCaseUnion + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseStructUnion1, typeof) + let singleUnionCtor = FSharpValue.PreComputeUnionConstructor(singlecaseinfo) + let resuleSingleCaseUnion = singleUnionCtor([| box 1.0; box 2.0; box 3.0|]) + Assert.AreEqual(resuleSingleCaseUnion, singleCaseStructUnion1) + + // DiscUnion + let (discunioninfo, _discunionvaluearray) = FSharpValue.GetUnionFields(discStructUnionCaseB, typeof>) + let discUnionCtor = FSharpValue.PreComputeUnionConstructor(discunioninfo) + let resuleDiscUnionB = discUnionCtor([| box 1|]) + Assert.AreEqual(resuleDiscUnionB, discStructUnionCaseB) [] - member this.PreComputeUnionConstructorInfo() = + member __.PreComputeUnionConstructorInfo() = // SingleCaseUnion - let (singlecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseUnion1, typeof) let singlecaseMethodInfo = FSharpValue.PreComputeUnionConstructorInfo(singlecaseinfo) - Assert.AreEqual(singlecaseMethodInfo.ReflectedType,typeof) + Assert.AreEqual(singlecaseMethodInfo.ReflectedType, typeof) // DiscUnion - let (discUnionInfo,discvaluearray) = FSharpValue.GetUnionFields(discUniontypeB,typeof>) + let (discUnionInfo, _discvaluearray) = FSharpValue.GetUnionFields(discUnionCaseB, typeof>) let discUnionMethodInfo = FSharpValue.PreComputeUnionConstructorInfo(discUnionInfo) - Assert.AreEqual(discUnionMethodInfo.ReflectedType,typeof>) - - () + Assert.AreEqual(discUnionMethodInfo.ReflectedType, typeof>) + + [] + member __.PreComputeStructUnionConstructorInfo() = + + // SingleCaseUnion + let (singlecaseinfo, _singlevaluearray) = FSharpValue.GetUnionFields(singleCaseStructUnion1, typeof) + let singlecaseMethodInfo = FSharpValue.PreComputeUnionConstructorInfo(singlecaseinfo) + Assert.AreEqual(singlecaseMethodInfo.ReflectedType, typeof) + // DiscUnion + let (discUnionInfo, _discvaluearray) = FSharpValue.GetUnionFields(discStructUnionCaseB, typeof>) + let discUnionMethodInfo = FSharpValue.PreComputeUnionConstructorInfo(discUnionInfo) + Assert.AreEqual(discUnionMethodInfo.ReflectedType, typeof>) + [] - member this.PreComputeUnionReader() = + member __.PreComputeUnionReader() = // SingleCaseUnion - let (singlecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let (singlecaseinfo, singlevaluearray) = FSharpValue.GetUnionFields(singleCaseUnion1, typeof) let singlecaseUnionReader = FSharpValue.PreComputeUnionReader(singlecaseinfo) - Assert.AreEqual(singlecaseUnionReader(box(singlecaseunion1)),[|box(1.0);box(2.0);box(3.0)|]) + Assert.AreEqual(singlecaseUnionReader(box(singleCaseUnion1)), [| box 1.0; box 2.0; box 3.0|]) // DiscUnion - let (discUnionInfo,discvaluearray) = FSharpValue.GetUnionFields(recDiscUniontypeB,typeof>) + let (discUnionInfo, discvaluearray) = FSharpValue.GetUnionFields(discUnionRecCaseB, typeof>) let discUnionReader = FSharpValue.PreComputeUnionReader(discUnionInfo) - Assert.AreEqual(discUnionReader(box(recDiscUniontypeB)) , [|box(1);box(Some(discUniontypeB))|]) - - () + Assert.AreEqual(discUnionReader(box(discUnionRecCaseB)) , [| box 1; box(Some(discUnionCaseB)) |]) [] - member this.PreComputeUnionTagMemberInfo() = + member __.PreComputeStructUnionReader() = + + // SingleCaseUnion + let (singlecaseinfo, singlevaluearray) = FSharpValue.GetUnionFields(singleCaseStructUnion1, typeof) + let singlecaseUnionReader = FSharpValue.PreComputeUnionReader(singlecaseinfo) + Assert.AreEqual(singlecaseUnionReader(box(singleCaseStructUnion1)), [| box 1.0; box 2.0; box 3.0|]) + + // DiscUnion + let (discUnionInfo, discvaluearray) = FSharpValue.GetUnionFields(discStructUnionCaseB, typeof>) + let discUnionReader = FSharpValue.PreComputeUnionReader(discUnionInfo) + Assert.AreEqual(discUnionReader(box(discStructUnionCaseB)) , [| box 1|]) + + [] + member __.PreComputeUnionTagMemberInfo() = // SingleCaseUnion let singlecaseUnionMemberInfo = FSharpValue.PreComputeUnionTagMemberInfo(typeof) @@ -543,48 +792,64 @@ type FSharpValueTests() = // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeUnionTagMemberInfo(typeof) |> ignore) - () - + [] - member this.PreComputeUnionTagReader() = + member __.PreComputeStructUnionTagMemberInfo() = + + // SingleCaseUnion + let singlecaseUnionMemberInfo = FSharpValue.PreComputeUnionTagMemberInfo(typeof) + Assert.AreEqual(singlecaseUnionMemberInfo.ReflectedType, typeof) + + // DiscUnion + let discUnionMemberInfo = FSharpValue.PreComputeUnionTagMemberInfo(typeof>) + Assert.AreEqual(discUnionMemberInfo.ReflectedType, typeof>) + + [] + member __.PreComputeUnionTagReader() = // SingleCaseUnion let singlecaseUnionTagReader = FSharpValue.PreComputeUnionTagReader(typeof) - Assert.AreEqual(singlecaseUnionTagReader(box(singlecaseunion1)), 0) + Assert.AreEqual(singlecaseUnionTagReader(box(singleCaseUnion1)), 0) // DiscUnion let discUnionTagReader = FSharpValue.PreComputeUnionTagReader(typeof>) - Assert.AreEqual(discUnionTagReader(box(discUniontypeB)), 1) + Assert.AreEqual(discUnionTagReader(box(discUnionCaseB)), 1) // null value CheckThrowsArgumentException(fun () ->FSharpValue.PreComputeUnionTagReader(null)|> ignore) // invalid value CheckThrowsArgumentException(fun () -> FSharpValue.PreComputeUnionTagReader(typeof) |> ignore) - () + [] + member __.PreComputeStructUnionTagReader() = + // SingleCaseUnion + let singlecaseUnionTagReader = FSharpValue.PreComputeUnionTagReader(typeof) + Assert.AreEqual(singlecaseUnionTagReader(box(singleCaseStructUnion1)), 0) + + // DiscUnion + let discUnionTagReader = FSharpValue.PreComputeUnionTagReader(typeof>) + Assert.AreEqual(discUnionTagReader(box(discStructUnionCaseB)), 1) - - [] type FSharpTypeTests() = - // instance for member this.ObjectEquals - let rec recordtype1 : RecordType = { field1 = "field1"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1,"") )} - let recordtype2 : RecordType = { field1 = "field2"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1,"") )} - let rec genericRecordType1 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} - let genericRecordType2 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} + // instance for member __.ObjectEquals + let rec recordtype1 : RecordType = { field1 = "field1"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1, "") )} + let recordtype2 : RecordType = { field1 = "field2"; field2 = Some(recordtype1); field3 = ( fun () -> (recordtype1, "") )} + let rec genericRecordType1 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} + let genericRecordType2 : GenericRecordType = { field1 = "field1"; field2 = 1; field3 = ( fun () -> genericRecordType1 )} let nullValue = null - let singlecaseunion1 = SingleCaseDiscUnion.SingleCaseTag(1.0,2.0,3.0) - let singlecaseunion2 = SingleCaseDiscUnion.SingleCaseTag(4.0,5.0,6.0) + let singlecaseunion1 = SingleCaseDiscUnion.SingleCaseTag(1.0, 2.0, 3.0) + let singlecaseunion2 = SingleCaseDiscUnion.SingleCaseTag(4.0, 5.0, 6.0) let discUniontypeA = DiscUnionType.A - let discUniontypeB = DiscUnionType.B(1,Some(discUniontypeA)) - let discUniontypeC = DiscUnionType.C(1.0,"stringparam") + let discUniontypeB = DiscUnionType.B(1, Some(discUniontypeA)) + let discUniontypeC = DiscUnionType.C(1.0, "stringparam") let fsharpdelegate1 = new FSharpDelegate(fun (x:int) -> "delegate1") let fsharpdelegate2 = new FSharpDelegate(fun (x:int) -> "delegate2") @@ -601,7 +866,7 @@ type FSharpTypeTests() = // Base class methods [] - member this.ObjectEquals() = + member __.ObjectEquals() = // Record value Assert.IsTrue(FSharpValue.Equals(recordtype1, recordtype1)) @@ -612,35 +877,33 @@ type FSharpTypeTests() = Assert.IsFalse(FSharpValue.Equals(genericRecordType1, genericRecordType2)) // null value - Assert.IsTrue(FSharpValue.Equals(nullValue,nullValue)) - Assert.IsFalse(FSharpValue.Equals(nullValue,1)) + Assert.IsTrue(FSharpValue.Equals(nullValue, nullValue)) + Assert.IsFalse(FSharpValue.Equals(nullValue, 1)) // Single Case Union - Assert.IsTrue(FSharpValue.Equals(singlecaseunion1,singlecaseunion1)) - Assert.IsFalse(FSharpValue.Equals(singlecaseunion1,singlecaseunion2)) + Assert.IsTrue(FSharpValue.Equals(singlecaseunion1, singlecaseunion1)) + Assert.IsFalse(FSharpValue.Equals(singlecaseunion1, singlecaseunion2)) // Discriminated Union - Assert.IsTrue(FSharpValue.Equals(discUniontypeA,discUniontypeA)) - Assert.IsFalse(FSharpValue.Equals(discUniontypeB,discUniontypeC)) + Assert.IsTrue(FSharpValue.Equals(discUniontypeA, discUniontypeA)) + Assert.IsFalse(FSharpValue.Equals(discUniontypeB, discUniontypeC)) // FSharpDelegate - Assert.IsTrue(FSharpValue.Equals(fsharpdelegate1,fsharpdelegate1)) - Assert.IsFalse(FSharpValue.Equals(fsharpdelegate1,fsharpdelegate2)) + Assert.IsTrue(FSharpValue.Equals(fsharpdelegate1, fsharpdelegate1)) + Assert.IsFalse(FSharpValue.Equals(fsharpdelegate1, fsharpdelegate2)) // Tuple - Assert.IsTrue(FSharpValue.Equals(tuple1,tuple1)) - Assert.IsFalse(FSharpValue.Equals(tuple1,tuple2)) + Assert.IsTrue(FSharpValue.Equals(tuple1, tuple1)) + Assert.IsFalse(FSharpValue.Equals(tuple1, tuple2)) // Exception - Assert.IsTrue(FSharpValue.Equals(exInt,exInt)) - Assert.IsFalse(FSharpValue.Equals(exInt,exDataless)) - - () + Assert.IsTrue(FSharpValue.Equals(exInt, exInt)) + Assert.IsFalse(FSharpValue.Equals(exInt, exDataless)) // Static methods [] - member this.GetExceptionFields() = + member __.GetExceptionFields() = // positive let forallexistedInt = @@ -651,7 +914,7 @@ type FSharpTypeTests() = let forallexistedDataless = FSharpType.GetExceptionFields(typeof) - |> Array.forall (fun property -> (Array.IndexOf(typeof.GetProperties(),property) > -1)) + |> Array.forall (fun property -> (Array.IndexOf(typeof.GetProperties(), property) > -1)) Assert.IsTrue(forallexistedDataless) // Argument Exception @@ -660,15 +923,13 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () ->FSharpType.GetExceptionFields(null) |> ignore ) - () - [] - member this.GetFunctionElements() = + member __.GetFunctionElements() = // positive - Assert.AreEqual(FSharpType.GetFunctionElements(typeof string>),(typeof,typeof)) - Assert.AreEqual(FSharpType.GetFunctionElements(typeof int -> string>), (typeof, typeof>)) + Assert.AreEqual(FSharpType.GetFunctionElements(typeof string>), (typeof, typeof)) + Assert.AreEqual(FSharpType.GetFunctionElements(typeof int -> string>), (typeof, typeof>)) // argument exception CheckThrowsArgumentException(fun () ->FSharpType.GetFunctionElements(typeof) |> ignore ) @@ -676,14 +937,12 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () ->FSharpType.GetFunctionElements(null) |> ignore ) - () - [] - member this.GetRecordFields() = + member __.GetRecordFields() = // positive - Assert.AreEqual(FSharpType.GetRecordFields(typeof),(typeof.GetProperties())) - Assert.AreEqual(FSharpType.GetRecordFields(typeof>),(typeof>.GetProperties())) + Assert.AreEqual(FSharpType.GetRecordFields(typeof), (typeof.GetProperties())) + Assert.AreEqual(FSharpType.GetRecordFields(typeof>), (typeof>.GetProperties())) // argument exception CheckThrowsArgumentException(fun () ->FSharpType.GetRecordFields(typeof) |> ignore ) @@ -691,15 +950,13 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () ->FSharpType.GetRecordFields(null) |> ignore ) - () - [] - member this.GetTupleElements() = + member __.GetTupleElements() = // positive - Assert.AreEqual(FSharpType.GetTupleElements(typeof>),[|typeof; typeof|]) - Assert.AreEqual(FSharpType.GetTupleElements(typeof>),[|typeof; typeof;typeof|]) + Assert.AreEqual(FSharpType.GetTupleElements(typeof>), [|typeof; typeof|]) + Assert.AreEqual(FSharpType.GetTupleElements(typeof>), [|typeof; typeof;typeof|]) // argument exception CheckThrowsArgumentException(fun () ->FSharpType.GetTupleElements(typeof) |> ignore ) @@ -707,20 +964,17 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () ->FSharpType.GetTupleElements(null) |> ignore ) - () - [] - member this.GetUnionCases() = + member __.GetUnionCases() = // SingleCaseUnion let singlecaseUnionCaseInfoArray = FSharpType.GetUnionCases(typeof) - let (expectedSinglecaseinfo,singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let (expectedSinglecaseinfo, singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1, typeof) Assert.AreEqual(singlecaseUnionCaseInfoArray.[0], expectedSinglecaseinfo) // DiscUnionType - let discunionCaseInfoArray = FSharpType.GetUnionCases(typeof>) - let (expectedDuCaseinfoArray, duValueArray) = FSharpValue.GetUnionFields(discUniontypeB,typeof>) - Assert.AreEqual(discunionCaseInfoArray.[1],expectedDuCaseinfoArray) + let (expectedDuCaseinfoArray, duValueArray) = FSharpValue.GetUnionFields(discUniontypeB, typeof>) + Assert.AreEqual(discunionCaseInfoArray.[1], expectedDuCaseinfoArray) // null value CheckThrowsArgumentNullException(fun () ->FSharpType.GetUnionCases(null)|> ignore) @@ -728,10 +982,8 @@ type FSharpTypeTests() = // invalid value CheckThrowsArgumentException(fun () -> FSharpType.GetUnionCases(typeof) |> ignore) - () - [] - member this.IsExceptionRepresentation() = + member __.IsExceptionRepresentation() = // positive Assert.IsTrue(FSharpType.IsExceptionRepresentation(typeof)) @@ -744,10 +996,8 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () -> FSharpType.IsExceptionRepresentation(null) |> ignore ) - () - [] - member this.IsFunction() = + member __.IsFunction() = // positive Assert.IsTrue(FSharpType.IsFunction(typeof int>)) @@ -758,11 +1008,9 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () -> FSharpType.IsFunction(null) |> ignore ) - - () [] - member this.IsModule() = + member __.IsModule() = let getasm (t : Type) = t.Assembly @@ -791,27 +1039,24 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () -> FSharpType.IsModule(null) |> ignore ) - - () [] - member this.IsRecord() = + member __.IsRecord() = // positive Assert.IsTrue(FSharpType.IsRecord(typeof)) - Assert.IsTrue(FSharpType.IsRecord(typeof>)) + Assert.IsTrue(FSharpType.IsRecord(typeof)) + Assert.IsTrue(FSharpType.IsRecord(typeof>)) // negative Assert.IsFalse(FSharpType.IsRecord(typeof)) // null CheckThrowsArgumentNullException(fun () ->FSharpType.IsRecord(null) |> ignore ) - - () // Regression for 5588, Reflection: unit is still treated as a record type, but only if you pass BindingFlags.NonPublic [] - member this.``IsRecord.Regression5588``() = + member __.``IsRecord.Regression5588``() = // negative Assert.IsFalse(FSharpType.IsRecord(typeof)) @@ -825,11 +1070,14 @@ type FSharpTypeTests() = [] - member this.IsTuple() = + member __.IsTuple() = // positive - Assert.IsTrue(FSharpType.IsTuple(typeof>)) - Assert.IsTrue(FSharpType.IsTuple(typeof>)) + Assert.IsTrue(FSharpType.IsTuple(typeof>)) + Assert.IsTrue(FSharpType.IsTuple(typeof>)) + + Assert.IsTrue(FSharpType.IsTuple(typeof)) + Assert.IsTrue(FSharpType.IsTuple(typeof)) // negative Assert.IsFalse(FSharpType.IsTuple(typeof)) @@ -838,54 +1086,57 @@ type FSharpTypeTests() = // null CheckThrowsArgumentNullException(fun () ->FSharpType.IsTuple(null) |> ignore ) - () - [] - member this.IsUnion() = + member __.IsUnion() = // positive Assert.IsTrue(FSharpType.IsUnion(typeof)) + Assert.IsTrue(FSharpType.IsUnion(typeof)) Assert.IsTrue(FSharpType.IsUnion(typeof>)) + Assert.IsTrue(FSharpType.IsUnion(typeof>)) // negative Assert.IsFalse(FSharpType.IsUnion(typeof)) Assert.IsFalse(FSharpType.IsUnion(typeof)) - // null CheckThrowsArgumentNullException(fun () ->FSharpType.IsUnion(null) |> ignore ) - () - [] - member this.MakeFunctionType() = + member __.MakeFunctionType() = // positive - Assert.AreEqual(FSharpType.MakeFunctionType(typeof,typeof),typeofstring>) + Assert.AreEqual(FSharpType.MakeFunctionType(typeof, typeof), typeofstring>) // negative - Assert.AreNotEqual(FSharpType.MakeFunctionType(typeof,typeof),typeofstring->int>) + Assert.AreNotEqual(FSharpType.MakeFunctionType(typeof, typeof), typeofstring->int>) // null - CheckThrowsArgumentNullException(fun () ->FSharpType.MakeFunctionType(null,null) |> ignore ) - - () + CheckThrowsArgumentNullException(fun () ->FSharpType.MakeFunctionType(null, null) |> ignore ) [] - member this.MakeTupleType() = + member __.MakeTupleType() = // positive - Assert.AreEqual(FSharpType.MakeTupleType([|typeof; typeof|]),typeof>) + Assert.AreEqual(FSharpType.MakeTupleType([|typeof; typeof|]), typeof>) // negative - Assert.AreNotEqual(FSharpType.MakeTupleType([|typeof; typeof|]),typeof>) + Assert.AreNotEqual(FSharpType.MakeTupleType([|typeof; typeof|]), typeof>) // null CheckThrowsArgumentException(fun () ->FSharpType.MakeTupleType([|null;null|]) |> ignore ) + + [] + member __.MakeStructTupleType() = + let asm = typeof.Assembly + // positive + Assert.AreEqual(FSharpType.MakeStructTupleType(asm, [|typeof; typeof|]), typeof) + // negative + Assert.AreNotEqual(FSharpType.MakeStructTupleType(asm, [|typeof; typeof|]), typeof) - - () + // null + CheckThrowsArgumentException(fun () ->FSharpType.MakeStructTupleType(asm, [|null;null|]) |> ignore ) [] @@ -897,23 +1148,23 @@ type UnionCaseInfoTests() = let singlecaseunion2 = SingleCaseDiscUnion.SingleCaseTag(4.0, 5.0, 6.0) let discUniontypeA = DiscUnionType.A - let discUniontypeB = DiscUnionType.B(1,Some(discUniontypeA)) + let discUniontypeB = DiscUnionType.B(1, Some(discUniontypeA)) let discUniontypeC = DiscUnionType.C(1.0, "stringparam") - let recDiscUniontypeB = DiscUnionType.B(1,Some(discUniontypeB)) + let recDiscUniontypeB = DiscUnionType.B(1, Some(discUniontypeB)) - let ((singlenullarycaseinfo:UnionCaseInfo),singlenullaryvaluearray) = FSharpValue.GetUnionFields(singlenullarycaseunion,typeof) + let ((singlenullarycaseinfo:UnionCaseInfo), singlenullaryvaluearray) = FSharpValue.GetUnionFields(singlenullarycaseunion, typeof) - let ((singlecaseinfo:UnionCaseInfo),singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1,typeof) + let ((singlecaseinfo:UnionCaseInfo), singlevaluearray) = FSharpValue.GetUnionFields(singlecaseunion1, typeof) let ((discUnionInfoA:UnionCaseInfo), discvaluearray) = FSharpValue.GetUnionFields(discUniontypeA, typeof>) let ((discUnionInfoB:UnionCaseInfo), discvaluearray) = FSharpValue.GetUnionFields(discUniontypeB, typeof>) let ((discUnionInfoC:UnionCaseInfo), discvaluearray) = FSharpValue.GetUnionFields(discUniontypeC, typeof>) - let ((recDiscCaseinfo:UnionCaseInfo),recDiscCasevaluearray) = FSharpValue.GetUnionFields(recDiscUniontypeB,typeof>) + let ((recDiscCaseinfo:UnionCaseInfo), recDiscCasevaluearray) = FSharpValue.GetUnionFields(recDiscUniontypeB, typeof>) [] - member this.Equals() = + member __.Equals() = //positive // single case Assert.IsTrue(singlecaseinfo.Equals(singlecaseinfo)) @@ -936,97 +1187,86 @@ type UnionCaseInfoTests() = // null Assert.IsFalse(singlecaseinfo.Equals(null)) - () [] - member this.GetCustomAttributes() = + member __.GetCustomAttributes() = // single case let singlecaseAttribute = (singlecaseinfo.GetCustomAttributes()).[0] :?> Attribute - Assert.AreEqual(singlecaseAttribute.ToString(),"Microsoft.FSharp.Core.CompilationMappingAttribute" ) + Assert.AreEqual(singlecaseAttribute.ToString(), "Microsoft.FSharp.Core.CompilationMappingAttribute" ) // disc union let discunionAttribute = (discUnionInfoA.GetCustomAttributes()).[0] :?> Attribute - Assert.AreEqual(discunionAttribute.ToString(),"Microsoft.FSharp.Core.CompilationMappingAttribute" ) + Assert.AreEqual(discunionAttribute.ToString(), "Microsoft.FSharp.Core.CompilationMappingAttribute" ) // rec disc union let recdiscAttribute = (recDiscCaseinfo.GetCustomAttributes()).[0] :?> Attribute - Assert.AreEqual(recdiscAttribute.ToString(),"Microsoft.FSharp.Core.CompilationMappingAttribute" ) + Assert.AreEqual(recdiscAttribute.ToString(), "Microsoft.FSharp.Core.CompilationMappingAttribute" ) // null CheckThrowsArgumentNullException(fun () -> singlecaseinfo.GetCustomAttributes(null) |> ignore ) - () [] - member this.GetFields() = + member __.GetFields() = // single case let singlecaseFieldInfo = (singlecaseinfo.GetFields()).[0] - Assert.AreEqual(singlecaseFieldInfo.PropertyType ,typeof<(float)>) + Assert.AreEqual(singlecaseFieldInfo.PropertyType , typeof<(float)>) // disc union null empty let discunionFieldInfoEpt = discUnionInfoA.GetFields() - Assert.AreEqual(discunionFieldInfoEpt.Length ,0) + Assert.AreEqual(discunionFieldInfoEpt.Length , 0) // disc union int let discunionFieldInfo = (discUnionInfoB.GetFields()).[0] - Assert.AreEqual(discunionFieldInfo.PropertyType ,typeof) + Assert.AreEqual(discunionFieldInfo.PropertyType , typeof) // rec disc union let recdiscFieldInfo = (recDiscCaseinfo.GetFields()).[0] - Assert.AreEqual(recdiscFieldInfo.PropertyType ,typeof) - - - () + Assert.AreEqual(recdiscFieldInfo.PropertyType , typeof) [] - member this.GetHashCode() = + member __.GetHashCode() = // positive // single case - Assert.AreEqual(singlecaseinfo.GetHashCode(),singlecaseinfo.GetHashCode()) + Assert.AreEqual(singlecaseinfo.GetHashCode(), singlecaseinfo.GetHashCode()) // disc union - Assert.AreEqual(discUnionInfoA.GetHashCode(),discUnionInfoA.GetHashCode()) + Assert.AreEqual(discUnionInfoA.GetHashCode(), discUnionInfoA.GetHashCode()) // rec disc union - Assert.AreEqual(recDiscCaseinfo.GetHashCode(),recDiscCaseinfo.GetHashCode()) + Assert.AreEqual(recDiscCaseinfo.GetHashCode(), recDiscCaseinfo.GetHashCode()) // negative // disc union - Assert.AreNotEqual(discUnionInfoA.GetHashCode(),discUnionInfoB.GetHashCode()) - - () - + Assert.AreNotEqual(discUnionInfoA.GetHashCode(), discUnionInfoB.GetHashCode()) [] - member this.GetType() = + member __.GetType() = // single case - Assert.AreEqual(singlecaseinfo.GetType(),typeof ) + Assert.AreEqual(singlecaseinfo.GetType(), typeof ) // disc union - Assert.AreEqual(discUnionInfoA.GetType(),typeof ) + Assert.AreEqual(discUnionInfoA.GetType(), typeof ) // rec disc union - Assert.AreEqual(recDiscCaseinfo.GetType(),typeof ) - () - + Assert.AreEqual(recDiscCaseinfo.GetType(), typeof ) [] - member this.ToString() = + member __.ToString() = // single case - Assert.AreEqual(singlenullarycaseinfo.ToString(),"SingleNullaryCaseDiscUnion.SingleNullaryCaseTag") + Assert.AreEqual(singlenullarycaseinfo.ToString(), "SingleNullaryCaseDiscUnion.SingleNullaryCaseTag") // single case - Assert.AreEqual(singlecaseinfo.ToString(),"SingleCaseDiscUnion.SingleCaseTag") + Assert.AreEqual(singlecaseinfo.ToString(), "SingleCaseDiscUnion.SingleCaseTag") // disc union Assert.IsTrue((discUnionInfoA.ToString()).Contains("DiscUnionType") ) // rec disc union Assert.IsTrue((recDiscCaseinfo.ToString()).Contains("DiscUnionType")) - () \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 43bbf53c89a..4f777facb31 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -106,7 +106,7 @@ type LanguagePrimitivesModule() = Assert.AreEqual(1, resultRef) -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 // TODO named #define ? #else [] @@ -604,7 +604,7 @@ type UnitType() = CheckThrowsNullRefException(fun() ->u.Equals(null) |>ignore) -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 // TODO named #define ? #else [] @@ -816,3 +816,16 @@ type RangeTests() = if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) +open NonStructuralComparison + + +[] +type NonStructuralComparisonTests() = + + [] + member __.CompareFloat32() = // https://github.com/Microsoft/visualfsharp/pull/4493 + + let x = 32 |> float32 + let y = 32 |> float32 + let comparison = compare x y + Assert.AreEqual(0, comparison) \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj index 23d1a8f54d8..c4e46fb6901 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj @@ -25,7 +25,7 @@ - ..\..\..\..\..\packages\System.ValueTuple.4.3.1\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\..\..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs index 49704963f75..1d122d213cb 100644 --- a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs +++ b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs @@ -76,24 +76,24 @@ module SurfaceArea = // get current FSharp.Core let asm = - #if portable7 || portable78 || portable259 || coreclr +#if FX_RESHAPED_REFLECTION typeof.GetTypeInfo().Assembly - #else +#else typeof.Assembly - #endif +#endif // public types only let types = - #if portable7 || portable78 || portable259 || coreclr +#if FX_RESHAPED_REFLECTION asm.ExportedTypes |> Seq.filter (fun ty -> let ti = ty.GetTypeInfo() in ti.IsPublic || ti.IsNestedPublic) |> Array.ofSeq - #else +#else asm.GetExportedTypes() - #endif +#endif // extract canonical string form for every public member of every type let getTypeMemberStrings (t : Type) = // for System.Runtime-based profiles, need to do lots of manual work - #if portable7 || portable78 || portable259 || coreclr +#if FX_RESHAPED_REFLECTION let getMembers (t : Type) = let ti = t.GetTypeInfo() let cast (info : #MemberInfo) = (t, info :> MemberInfo) @@ -108,10 +108,10 @@ module SurfaceArea = getMembers t |> Array.map (fun (ty, m) -> sprintf "%s: %s" (ty.ToString()) (m.ToString())) - #else +#else t.GetMembers() |> Array.map (fun v -> sprintf "%s: %s" (v.ReflectedType.ToString()) (v.ToString())) - #endif +#endif let actual = types |> Array.collect getTypeMemberStrings diff --git a/tests/FSharp.Core.UnitTests/NuGet.Config b/tests/FSharp.Core.UnitTests/NuGet.Config new file mode 100644 index 00000000000..0a86752fee0 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/NuGet.Config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index d8b0292fe2e..1fbbf31f7b1 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -619,6 +619,7 @@ Microsoft.FSharp.Control.FSharpAsync: System.String ToString() Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken DefaultCancellationToken Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken get_DefaultCancellationToken() Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.Tasks.TaskCreationOptions], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) +Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartImmediateAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) Microsoft.FSharp.Control.FSharpAsync: System.Tuple`3[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[TArg,System.AsyncCallback,System.Object],System.IAsyncResult],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,Microsoft.FSharp.Core.Unit]] AsBeginEnd[TArg,T](Microsoft.FSharp.Core.FSharpFunc`2[TArg,Microsoft.FSharp.Control.FSharpAsync`1[T]]) Microsoft.FSharp.Control.FSharpAsync: System.Type GetType() Microsoft.FSharp.Control.FSharpAsync: T RunSynchronously[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) @@ -3126,6 +3127,7 @@ 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) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index 2cea1d10c8b..61f0e92df32 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -606,6 +606,7 @@ Microsoft.FSharp.Control.FSharpAsync: System.String ToString() Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken DefaultCancellationToken Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken get_DefaultCancellationToken() Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.Tasks.TaskCreationOptions], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) +Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartImmediateAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) Microsoft.FSharp.Control.FSharpAsync: System.Tuple`3[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[TArg,System.AsyncCallback,System.Object],System.IAsyncResult],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,Microsoft.FSharp.Core.Unit]] AsBeginEnd[TArg,T](Microsoft.FSharp.Core.FSharpFunc`2[TArg,Microsoft.FSharp.Control.FSharpAsync`1[T]]) Microsoft.FSharp.Control.FSharpAsync: System.Type GetType() Microsoft.FSharp.Control.FSharpAsync: T RunSynchronously[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) @@ -3273,6 +3274,7 @@ 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) diff --git a/tests/FSharp.Core.UnitTests/TypeForwarding.fs b/tests/FSharp.Core.UnitTests/TypeForwarding.fs index fce38193a60..b0ca6fa9044 100644 --- a/tests/FSharp.Core.UnitTests/TypeForwarding.fs +++ b/tests/FSharp.Core.UnitTests/TypeForwarding.fs @@ -8,7 +8,7 @@ open System open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework -#if FX_PORTABLE_OR_NETSTANDARD +#if NETSTANDARD1_6 // TODO named #define ? #else [] diff --git a/tests/FSharp.Core.UnitTests/project.json b/tests/FSharp.Core.UnitTests/project.json index cc3fa696476..36a6823bf21 100644 --- a/tests/FSharp.Core.UnitTests/project.json +++ b/tests/FSharp.Core.UnitTests/project.json @@ -8,8 +8,9 @@ "dependencies": { "nunit": "3.5.0", "nunitlite": "3.5.0", - "System.ValueTuple": "4.3.1", - "FsCheck": "2.6.2", + "System.ValueTuple": "4.4.0", + "FsCheck": "3.0.0-alpha3", + "Testing.FSharp.Core": "4.2.4", "Microsoft.FSharp.TupleSample": "1.0.0-alpha-161112" }, "runtimes": { diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs index edfd0ec742e..00633234ea3 100644 --- a/tests/fsharp/TypeProviderTests.fs +++ b/tests/fsharp/TypeProviderTests.fs @@ -248,15 +248,16 @@ let ``negative type provider tests`` (name:string) = SingleTest.singleNegTest cfg name -[] -let splitAssembly () = +let splitAssembly subdir project = - let cfg = testConfig "typeProviders/splitAssembly" + let cfg = testConfig project let clean() = rm cfg "providerDesigner.dll" rmdir cfg "typeproviders" + rmdir cfg "tools" rmdir cfg (".." ++ "typeproviders") + rmdir cfg (".." ++ "tools") clean() @@ -276,20 +277,11 @@ let splitAssembly () = // check a few load locations let someLoadPaths = - [ "typeproviders" ++ "fsharp41" ++ "net461" ++ "x86" - "typeproviders" ++ "fsharp41" ++ "net461" - "typeproviders" ++ "fsharp41" ++ "net45" + [ subdir ++ "fsharp41" ++ "net461" + subdir ++ "fsharp41" ++ "net45" // include up one directory - ".." ++ "typeproviders" ++ "fsharp41" ++ "net45" - "typeproviders" ++ "fsharp41" ++ "netstandard2.0" ] - - let someLoadPaths64 = - [ "typeproviders" ++ "fsharp41" ++ "net461" ++ "x64" - "typeproviders" ++ "fsharp41" ++ "net461" ] - - let someNegativeLoadPaths64 = - [ "typeproviders" ++ "fsharp41" ++ "net461" ++ "x86" ] - + ".." ++ subdir ++ "fsharp41" ++ "net45" + subdir ++ "fsharp41" ++ "netstandard2.0" ] for dir in someLoadPaths do @@ -311,31 +303,13 @@ let splitAssembly () = SingleTest.singleTestBuildAndRunAux cfg FSI_BASIC - for dir in someLoadPaths64 do - - clean() - - // put providerDesigner.dll into a different place - mkdir cfg dir - fsc cfg "--out:%s/providerDesigner.dll -a" dir ["providerDesigner.fsx"] - - SingleTest.singleTestBuildAndRunAux cfg FSIANYCPU_BASIC - - for dir in someNegativeLoadPaths64 do - - clean() - - // put providerDesigner.dll into a different place - mkdir cfg dir - fsc cfg "--out:%s/providerDesigner.dll -a" dir ["providerDesigner.fsx"] + clean() - // We expect a failure here - an error correctly gets printed on the console - try - SingleTest.singleTestBuildAndRunAux cfg FSIANYCPU_BASIC |> ignore - failwith "expected an AssertionException" - with :? NUnit.Framework.AssertionException -> () +[] +let splitAssemblyTools () = splitAssembly "tools" "typeProviders/splitAssemblyTools" - clean() +[] +let splitAssemblyTypeProviders () = splitAssembly "typeproviders" "typeProviders/splitAssemblyTypeproviders" [] let wedgeAssembly () = diff --git a/tests/fsharp/core/array/test.fsx b/tests/fsharp/core/array/test.fsx index eb91597dd76..0e25ee5e966 100644 --- a/tests/fsharp/core/array/test.fsx +++ b/tests/fsharp/core/array/test.fsx @@ -589,7 +589,6 @@ module Array2Tests = begin end -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW module ArrayNonZeroBasedTestsSlice = let runTest () = let arr = (Array2D.initBased 5 4 3 2 (fun i j -> (i,j))) @@ -636,7 +635,6 @@ module ArrayNonZeroBasedTestsSlice = test "fewoih16" (arr3d.[5,5,3] = (0,1,0)) test "fewoih16" (arr3d.[6,5,3] = (0,1,1)) let _ = runTest() -#endif module Array3Tests = begin @@ -1409,7 +1407,7 @@ module bug872632 = module CheckUnionTypesAreSealed = open System -#if FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 open System.Reflection type System.Type with member this.IsSealed @@ -1471,7 +1469,7 @@ module manyIndexes = 0 -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 e31a35b9106..66d6a183934 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 #load "testlib.fsi" "testlib.fs" // a warning is expected here #endif -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 #r "cslib.dll" #endif @@ -38,7 +38,7 @@ open System.Diagnostics (* ATTRIBUTES *) -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 [] #endif @@ -58,7 +58,7 @@ let fx3 (x:x2) = fx2 x (* attribute on a method *) let [] myLoggingMethod x = stderr.WriteLine(x:string) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let [] myLoggingMethod2 x = stderr.WriteLine(x:string) #endif @@ -228,7 +228,7 @@ let ca4 = typeof.GetCustomAttributes(typeof,false) do if Array.length ca4 <> 1 then failwith "could not find CA on type" -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 open System.Runtime.InteropServices [] @@ -325,7 +325,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 #if COMPILED [<``module``: DontPressThisButton3(1, "", -2)>] do() @@ -376,7 +376,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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 module CheckAttributesOnElementsWithSignatures = let checkOneAttribute msg (cas: _ []) = @@ -432,7 +432,7 @@ end // -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 #r "System.Security.dll";; #r "System.Configuration.dll";; @@ -511,7 +511,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 && !FX_PORTABLE_OR_NETSTANDARD +#if !MONO && !NETCOREAPP1_0 let N = 1000 let main() = let t1 = @@ -561,7 +561,7 @@ end (*------------------------------------------------------------------------- !* System.Runtime.InteropServices.In/OUT attributes *------------------------------------------------------------------------- *) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 open System let g ( [] x : int byref) = 0 let g2 (( [] x : int byref), ([] y : int byref)) = 0 @@ -611,7 +611,7 @@ type C = end -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let test2179 = let ty = typeof in @@ -884,7 +884,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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 let _ = let ty = typeof let ca = ty.GetCustomAttributes(typeof,false) @@ -1090,7 +1090,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module Bug5762 = open System open System.IO @@ -1333,7 +1333,7 @@ module BugWithOverloadedAttributes = [] type Bar = class end -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 module Bug719b = open TestLibModule.Bug719 diff --git a/tests/fsharp/core/attributes/testlib.fs b/tests/fsharp/core/attributes/testlib.fs index 7b3863ac70d..f83ed790953 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module Bug719 = open System.Runtime.InteropServices diff --git a/tests/fsharp/core/attributes/testlib.fsi b/tests/fsharp/core/attributes/testlib.fsi index 64eca10749a..e83aa9e4f11 100644 --- a/tests/fsharp/core/attributes/testlib.fsi +++ b/tests/fsharp/core/attributes/testlib.fsi @@ -103,7 +103,7 @@ type ThisLibAssembly -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module Bug719 = open System.Runtime.InteropServices diff --git a/tests/fsharp/core/comprehensions-hw/test.fsx b/tests/fsharp/core/comprehensions-hw/test.fsx index 38d7f8c316f..19535574cd1 100644 --- a/tests/fsharp/core/comprehensions-hw/test.fsx +++ b/tests/fsharp/core/comprehensions-hw/test.fsx @@ -447,7 +447,7 @@ test "coic23" -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module MoreExtensions = open Microsoft.FSharp.Control diff --git a/tests/fsharp/core/comprehensions/test.fsx b/tests/fsharp/core/comprehensions/test.fsx index 1339196c638..3bf078fcc8d 100644 --- a/tests/fsharp/core/comprehensions/test.fsx +++ b/tests/fsharp/core/comprehensions/test.fsx @@ -15,10 +15,6 @@ let test (s : string) b = if b then stderr.WriteLine " OK" else report_failure (s) -#if FSCORE_PORTABLE_OLD -let printfn s = printfn "%s" s -#endif - let _ = test "coic23a" (Seq.toList { 'a' .. 'c' } = ['a';'b';'c']) let _ = test "coic23q" (Seq.toList {1 .. 0} = []) @@ -522,7 +518,7 @@ module MaxIntMinIntBOundaryCases = begin end -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 open System.IO open System.Xml diff --git a/tests/fsharp/core/control/test.fsx b/tests/fsharp/core/control/test.fsx index 86bd362be32..ea2aafcd663 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 open System.Threading.Tasks #endif @@ -32,7 +32,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -363,7 +363,7 @@ module SpawnTests = result) 1 -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Run(fun _ -> Task.Delay(sleep).Wait() #else @@ -465,7 +465,7 @@ module Bug6078 = "foo" Test() -#if !MONO && !FX_PORTABLE_OR_NETSTANDARD +#if !MONO && !NETCOREAPP1_0 module AwaitEventTests = let AwaitEventTest() = // AwaitEvent @@ -486,7 +486,7 @@ module AwaitEventTests = if completeSynchronously then ev.Trigger(r) else -#if FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -782,7 +782,7 @@ module OnCancelTests = res) 0 -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -1134,7 +1134,7 @@ module ParallelTests = [| 0..n-1 |] -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module AsyncWaitOneTest1 = let Run() = @@ -1259,7 +1259,7 @@ Async.RunSynchronously (async { let! n = s.AsyncRead(buffer,0,9) in return n }) *) #endif -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module AsyncGenerateTests = let Run() = for length in 1 .. 10 do @@ -1315,7 +1315,7 @@ module AsyncGenerateTests = [| 0 .. length-1|];; #endif -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* #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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 // 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(100).Wait() #else System.Threading.Thread.Sleep(100) @@ -1659,7 +1659,7 @@ let test15b() = test1() test2() -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 test3() #endif test8() @@ -1685,7 +1685,7 @@ let test22() = let p = Path "test22" let a = async { do p.Check 1 -#if FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(100).Wait() #else System.Threading.Thread.Sleep(100) #endif p.Check 2 group.Cancel() -#if FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(200).Wait() #else System.Threading.Thread.Sleep(2000) @@ -1780,7 +1780,7 @@ module ParallelTest = Test() -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 // 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(500).Wait(); #else System.Threading.Thread.Sleep(500) @@ -2062,7 +2062,7 @@ module Bug391710 = try Bug391710() -#if FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Delay(500).Wait(); #else System.Threading.Thread.Sleep(2000) @@ -2079,13 +2079,13 @@ let RunAll() = StartChildOutsideOfAsync.Run() SpawnTests.Run() AsBeginEndTests.AsBeginEndTest() -#if !MONO && !FX_PORTABLE_OR_NETSTANDARD +#if !MONO && !NETCOREAPP1_0 AwaitEventTests.AwaitEventTest() #endif OnCancelTests.Run() GenerateTests.Run() ParallelTests.Run() -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 AsyncWaitOneTest1.Run() AsyncGenerateTests.Run() #endif diff --git a/tests/fsharp/core/controlChamenos/test.fsx b/tests/fsharp/core/controlChamenos/test.fsx index f4199c92456..c4bc30f97a9 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 ac63919aef0..61345f46db9 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 open System.Threading.Tasks #endif @@ -31,7 +31,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 1a2da20aa49..6bc557ef28d 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 open System.Threading.Tasks #endif @@ -36,7 +36,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 Task.Run( fun _ -> async { diff --git a/tests/fsharp/core/csext/test.fsx b/tests/fsharp/core/csext/test.fsx index cfe0ec3759f..8df2ebae4d5 100644 --- a/tests/fsharp/core/csext/test.fsx +++ b/tests/fsharp/core/csext/test.fsx @@ -53,7 +53,7 @@ type Struct(i:int) = static member BlueStruct = blueStruct -#nowarn "3220" +#nowarn "3223" // See https://github.com/Microsoft/visualfsharp/pull/3729 module TestsExplicitUseOfTupleProperties = diff --git a/tests/fsharp/core/forexpression/test.fsx b/tests/fsharp/core/forexpression/test.fsx index 5ef6b494a91..671d67f820d 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 sum <- sum + ((int (i :?> char)) - (int '0')) #else sum <- sum + ((int i) - (int '0')) diff --git a/tests/fsharp/core/fsfromfsviacs/lib3.cs b/tests/fsharp/core/fsfromfsviacs/lib3.cs index b688b710bc2..b6dc7e9b989 100644 --- a/tests/fsharp/core/fsfromfsviacs/lib3.cs +++ b/tests/fsharp/core/fsfromfsviacs/lib3.cs @@ -24,3 +24,18 @@ public static void SomeMethod() { } } } + + +namespace StructTests +{ + // Check This should be preferred over the same type in lib2.cs + public struct SomeMutableStruct + { + public int x; + public System.DateTime y; + public void SetX(int v) { x = v; } + public void SetY(System.DateTime v) { y = v; } + public int SetZ() { return 1; } // no warning + public void set_X(int v) { x = v; } + } +} diff --git a/tests/fsharp/core/fsfromfsviacs/test.fsx b/tests/fsharp/core/fsfromfsviacs/test.fsx index 1fba263ef4a..1fb66557226 100644 --- a/tests/fsharp/core/fsfromfsviacs/test.fsx +++ b/tests/fsharp/core/fsfromfsviacs/test.fsx @@ -157,6 +157,27 @@ module TestExtensions = test "dfeweeon" (r1.ExtendFSharpType() = 5) test "dfeweeon" (Lib2().ExtendCSharpType() = 4) +module StructTestsTests = + open StructTests + let v = SomeMutableStruct() + v.SetX(1) // a "LikelyMutates" warning is expected + v.set_X(1) // a "LikelyMutates" warning is expected + v.SetY(System.DateTime.Now) // a "LikelyMutates" warning is expected + let _ = v.SetZ() // no "LikelyMutates" warning is expected + +module StructTestsTests2 = + open StructTests + let mutable v = SomeMutableStruct() + test "dfeweeon" (v.x = 0) + v.SetX(1) // no "LikelyMutates" warning is expected + test "dfeweeon" (v.x = 1) + v.set_X(2) // no "LikelyMutates" warning is expected + test "dfeweeon" (v.x = 2) + let now = System.DateTime.Now + v.SetY(now) // no "LikelyMutates" warning is expected + test "dfeweeon" (v.y = now) + let _ = v.SetZ() // no "LikelyMutates" warning is expected + #endif #if TESTS_AS_APP diff --git a/tests/fsharp/core/lazy/test.fsx b/tests/fsharp/core/lazy/test.fsx index 99ae8d4c24f..d16340be2a0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module Bug5770 = open System.Threading do diff --git a/tests/fsharp/core/letrec/test.fsx b/tests/fsharp/core/letrec/test.fsx index 2fa38292ae6..2c07ef1edee 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 open System open System.Windows.Forms @@ -303,7 +303,7 @@ module RecursiveInterfaceObjectExpressions = begin end -#if !TESTS_AS_APP && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 module RecursiveInnerConstrainedGenerics = begin open System.Windows.Forms diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index 95f90948f64..f6c432f55dd 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 // 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" @@ -2409,11 +2409,8 @@ module IEnumerableTests = begin do check "Seq.averageBy" (Seq.averageBy float [0..100]) 50. do check "Seq.min" (Seq.min [1; 4; 2; 5; 8; 4; 0; 3]) 0 do check "Seq.max" (Seq.max [1; 4; 2; 5; 8; 4; 0; 3]) 8 -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW - // strings don't have enumerators on portable do check "Seq.minBy" (Seq.minBy int "this is a test") ' ' do check "Seq.maxBy" (Seq.maxBy int "this is a test") 't' -#endif // Test where the key includes null values do check "dict - option key" (dict [ (None,10); (Some 3, 220) ]).[None] 10 @@ -2719,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 // strings don't have enumerators in portable do check "Seq.minBy" (Seq.minBy int (countEnumeratorsAndCheckedDisposedAtMostOnce "this is a test")) ' ' do check "" numActiveEnumerators 0 @@ -3521,7 +3518,6 @@ module GenericComparisonAndEquality = begin [] type RecordTypeA<'T> = {f1 : string ; f2 : 'T} -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW // IComparable let _ = @@ -3557,7 +3553,6 @@ module GenericComparisonAndEquality = begin check "d3wiojd32icr" (l1 = l2) true ; check "d3wiojd32icu" (l3 = l4) true -#endif // IEquatable let _ = @@ -3699,7 +3694,7 @@ module MiscIEnumerableTests = begin open System.Net open System.IO -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 /// generate the sequence of lines read off an internet connection let httpSeq (nm:string) = Seq.generate @@ -3871,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 @@ -4083,7 +4078,7 @@ module SetTests = begin let unionTest n (nx,ny) = let check (xs:'a Set) = -#if DEBUG && !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW +#if DEBUG test "vwnwer" (xs.CheckBalanceInvariant); #endif xs in @@ -4276,7 +4271,7 @@ do check "clwnwe91" 10m 10m do check "clwnwe92" 10m 10.000m do check "clwnwe93" 1000000000m 1000000000m do check "clwnwe94" (4294967296000000000m.ToString()) "4294967296000000000" -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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" @@ -4327,7 +4322,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 do check "lkvcnwd09l" 20.0M (round 20.300M) do check "lkvcnwd09z" 20.0M (round 20.500M) do check "lkvcnwd09x" 22.0M (round 21.500M) @@ -5569,7 +5564,7 @@ module bug122495 = let c = C( P = a.[0..1]) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (*--------------------------------------------------------------------------- !* 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 be3521edcc3..aa1579ef2b8 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* check lid setting bug *) open System.Diagnostics diff --git a/tests/fsharp/core/math/numbers/test.fsx b/tests/fsharp/core/math/numbers/test.fsx index ef7a24261af..3a198932cf3 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 NETSTANDARD1_6 +#if NETCOREAPP1_0 open CoreClrUtilities #endif diff --git a/tests/fsharp/core/math/numbersVS2008/test.fsx b/tests/fsharp/core/math/numbersVS2008/test.fsx index 857098de77a..b7e288616d2 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 // 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 3ab02fc80cc..9425bb52cdc 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let x1m : decimal = round 4.4M #endif let x1n : int = sign 4.4M @@ -499,14 +499,12 @@ module MembersTest = let s = 2.0f let d = 2.0M -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW let tmpCulture = System.Threading.Thread.CurrentThread.CurrentCulture System.Threading.Thread.CurrentThread.CurrentCulture <- System.Globalization.CultureInfo("en-US") test "f" (f.ToString().Equals("2")) test "s" (s.ToString().Equals("2")) test "d" (d.ToString().Equals("2.0")) System.Threading.Thread.CurrentThread.CurrentCulture <- tmpCulture -#endif let fc = (f :> System.IComparable>).CompareTo(f+f) let sc = (s :> System.IComparable>).CompareTo(s+s) @@ -518,7 +516,7 @@ module MembersTest = let f1 = (f :> System.IFormattable) let f2 = (f :> System.IComparable) let f3 = (f :> System.IEquatable>) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let f4 = (f :> System.IConvertible) #endif @@ -551,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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) @@ -599,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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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/basics-hw/test.fsx b/tests/fsharp/core/members/basics-hw/test.fsx index 2b807659d9a..3bb6859f0d1 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let x4 = (f1() : System.Windows.Forms.Form) #endif let f2 () = f1() let y1 = (f2() : obj) let y2 = (f2() : int) let y3 = (f2() : DateTime) -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module Ex5 = open System.Drawing type Label(?text,?font) = @@ -5584,7 +5584,7 @@ module Devdiv2_Bug_5385 = g "1" |> ignore; // note, use of non-generic 'g' within a generic, generalized memoized function 2 - and g : string -> int = memoize f // note, computed function value using generic “f” at an instance + and g : string -> int = memoize f // note, computed function value using generic �f� at an instance g "1" let res = test3e() diff --git a/tests/fsharp/core/members/incremental-hw/test.fsx b/tests/fsharp/core/members/incremental-hw/test.fsx index d65718a15fc..8454fd186a7 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module AreaVariations = (* Accepted *) open System.Drawing @@ -404,7 +404,7 @@ module ScalaPersonExample = //! Forms -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 bb27690f288..03076c34232 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !MONO && !NETCOREAPP1_0 module AreaVariations = begin (* Accepted *) open System.Drawing @@ -402,7 +402,7 @@ end //! Forms -#if !MONO && !FX_PORTABLE_OR_NETSTANDARD +#if !MONO && !NETCOREAPP1_0 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 3c3152b62df..b8e527d6bd3 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module XmlPattern_Examples = begin @@ -813,7 +813,7 @@ module RandomTEst = type IEvenCooler = inherit ICool -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module RandomCodeFragment = open System diff --git a/tests/fsharp/core/printing/testLoadFile2.fsx b/tests/fsharp/core/printing/testLoadFile2.fsx index 347cad242cf..f4b3ba260f4 100644 --- a/tests/fsharp/core/printing/testLoadFile2.fsx +++ b/tests/fsharp/core/printing/testLoadFile2.fsx @@ -1,4 +1,4 @@ -#if NETSTANDARD1_6 +#if NETCOREAPP1_0 open CoreClrUtilities #endif diff --git a/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx b/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx index 2a0cec078b7..166d5255db3 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 // Round dynamic dispatch on Decimal checkEval "vrewoinrv09FF" (<@ round 2.3M @>) (round 2.3M) #endif diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index 513f95f7859..16e37cedf8c 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 #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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !FSHARP_CORE_31 && !TESTS_AS_APP && !NETCOREAPP1_0 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 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 FX_PORTABLE_OR_NETSTANDARD +#if NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 module BasicUsingTEsts = let q1() = let a = ResizeArray<_>() diff --git a/tests/fsharp/core/reflect/test2.fs b/tests/fsharp/core/reflect/test2.fs index 6b299c21b0e..f562e9e0b94 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 NETSTANDARD1_6 +#if NETCOREAPP1_0 true #else System.Reflection.BindingFlags.Public ||| System.Reflection.BindingFlags.NonPublic diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index 046a8b6c72e..c82441caaf1 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* '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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* '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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 (* 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !UNIX && !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 let sumBigInt seq : BigInteger = Seq.reduce (+) seq #endif let sumDateTime (dt : DateTime) (seq : #seq) : DateTime = Seq.fold (+) dt seq diff --git a/tests/fsharp/core/syntax/test.fsx b/tests/fsharp/core/syntax/test.fsx index 57c217dfafb..cc3123be09c 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 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 !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 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 4e0a7707703..4319c31f981 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 1e78bb2ed25..11add13debc 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 && !FX_PORTABLE_OR_NETSTANDARD +#if !TESTS_AS_APP && !NETCOREAPP1_0 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 index 4715cb922cb..1d5c24f97f0 100644 --- a/tests/fsharp/packages.config +++ b/tests/fsharp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/tests/fsharp/regression/literal-value-bug-1/test.fs b/tests/fsharp/regression/literal-value-bug-1/test.fs new file mode 100644 index 00000000000..cca0b9e0e2f --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-1/test.fs @@ -0,0 +1,6 @@ +[] +let x = 7 + +[] +let main argv = + 0 \ No newline at end of file diff --git a/tests/fsharp/regression/literal-value-bug-1/test.il.bsl b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl new file mode 100644 index 00000000000..86655b9a6e7 --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl @@ -0,0 +1,79 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.5.22220.0 + + + +// 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:4:3:0 +} +.assembly test +{ + .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 01 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.test +{ + // Offset: 0x00000000 Length: 0x00000274 + // WARNING: managed resource file FSharpSignatureData.test created +} +.mresource public FSharpOptimizationData.test +{ + // Offset: 0x00000278 Length: 0x0000006F + // WARNING: managed resource file FSharpOptimizationData.test created +} +.module test.exe + // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02BF0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed Test + 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 ) + .field public static literal int32 x = int32(0x00000007) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static int32 main(string[] argv) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 2 (0x2) + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: ret + } // end of method Test::main + +} // end of class Test + +.class private abstract auto ansi sealed ''.$Test + extends [mscorlib]System.Object +{ +} // end of class ''.$Test + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file test.res diff --git a/tests/fsharp/regression/literal-value-bug-2/test.fsx b/tests/fsharp/regression/literal-value-bug-2/test.fsx new file mode 100644 index 00000000000..e529df8c863 --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-2/test.fsx @@ -0,0 +1,37 @@ +open System +open System.Linq +open System.Reflection + +type thisAssembly (_dummy:System.Object) = class end + +module public MyLiteralFields = + [] + let public literalFieldX = 7 + +printfn "MyFields.literalFieldX = %d" MyLiteralFields.literalFieldX + +// Use dotnet reflection to verify that x is a Literal Constant +// This works on full desktop / coreclr and also fsi +let asm = thisAssembly(null).GetType().GetTypeInfo().Assembly +let typ = asm.GetTypes() |> Array.filter(fun t -> t.FullName.EndsWith("+MyLiteralFields")) |> Array.tryLast +let result = + match typ with + | Some typ -> + // Gets literalFieldX checks to see if it is marked "Literal" + let fieldInfo = typ.GetTypeInfo().DeclaredFields |> Seq.tryFind(fun fi -> fi.Name.StartsWith("literalFieldX")) + match fieldInfo with + | Some fieldInfo -> + if fieldInfo.IsLiteral = true then 0 else 2 + | None -> + printfn "Failed to find fieldliteralFieldX =" + 3 + | None -> + printfn "Failed to find module public MyLiteralFields =" + 1 + +if result = 0 then + System.IO.File.WriteAllText("test.ok","ok"); + printfn "Succeeded" +else + printfn "Failed: %d" result +exit result diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index e8c050cb8c4..a2c401d6a49 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -47,7 +47,7 @@ let singleTestBuildAndRunCore cfg (copyFiles:string) p = makeDirectory (getDirectoryName outFile) let fscArgs = - sprintf """--debug:portable --debug+ --out:%s --target:exe -g --define:FX_RESHAPED_REFLECTION --define:NETSTANDARD1_6 --define:FSCORE_PORTABLE_NEW --define:FX_PORTABLE_OR_NETSTANDARD --define:FX_RESHAPED_REFLECTION "%s" %s """ + sprintf """--debug:portable --debug+ --out:%s --target:exe -g --define:FX_RESHAPED_REFLECTION --define:NETCOREAPP1_0 "%s" %s """ outFile extraSource (String.concat " " sources) @@ -72,7 +72,7 @@ let singleTestBuildAndRunCore cfg (copyFiles:string) p = 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:NETSTANDARD1_6 --define:FSCORE_PORTABLE_NEW --define:FX_RESHAPED_REFLECTION --define:FX_PORTABLE_OR_NETSTANDARD "%s" %s """ + sprintf """ --define:NETCOREAPP1_0 --define:FX_RESHAPED_REFLECTION "%s" %s """ extraSource (String.concat " " sources) diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index e356652dc2d..279a98f12b5 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -155,7 +155,7 @@ let config configurationName envVars = 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.4.0" ++ "tools" ++ "csc.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 (SCRIPT_ROOT ++ ".." ++ "fsharpqa" ++ "testenv" ++ "src" ++ "PEVerify" ++ "bin" ++ configurationName ++ "net46" ++ "PEVerify.exe") diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 4a4d35de55b..0ffa53f32b2 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -370,11 +370,14 @@ module CoreTests = peverify cfg "test.exe" + exec cfg ("." ++ "test.exe") "" + // Same with library references the other way around fsc cfg "%s -r:lib.dll -r:lib3.dll -r:lib2.dll -o:test.exe -g" cfg.fsc_flags ["test.fsx"] peverify cfg "test.exe" + exec cfg ("." ++ "test.exe") "" // Same without the reference to lib.dll - testing an incomplete reference set, but only compiling a subset of the code fsc cfg "%s -r:System.Runtime.dll --noframework --define:NO_LIB_REFERENCE -r:lib3.dll -r:lib2.dll -o:test.exe -g" cfg.fsc_flags ["test.fsx"] @@ -1457,7 +1460,13 @@ module ToolsTests = module RegressionTests = - [] + [] + let ``literal-value-bug-2-FSC_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSC_BASIC + + [] + let ``literal-value-bug-2-FSI_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSI_BASIC + + [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC [] @@ -2162,6 +2171,9 @@ module TypecheckTests = [] let ``type check neg101`` () = singleNegTest (testConfig "typecheck/sigs") "neg101" + [] + let ``type check neg_issue_3752`` () = singleNegTest (testConfig "typecheck/sigs") "neg_issue_3752" + [] let ``type check neg_byref_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_1" @@ -2297,7 +2309,7 @@ open System.Runtime.InteropServices fv.LegalTrademarks |> Assert.areEqual "CST \u2122" #endif -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETSTANDARD1_6 module ProductVersionTest = let informationalVersionAttrName = typeof.FullName diff --git a/tests/fsharp/tools/eval/test.fsx b/tests/fsharp/tools/eval/test.fsx index 80907e8a5c4..535a54799a4 100644 --- a/tests/fsharp/tools/eval/test.fsx +++ b/tests/fsharp/tools/eval/test.fsx @@ -1,6 +1,6 @@ #light -#if !FX_PORTABLE_OR_NETSTANDARD +#if !NETCOREAPP1_0 #r @"System.Core.dll" #r @"System.Data.Linq.dll" #endif diff --git a/tests/fsharp/typeProviders/splitAssembly/provider.fs b/tests/fsharp/typeProviders/splitAssemblyTools/provider.fs similarity index 100% rename from tests/fsharp/typeProviders/splitAssembly/provider.fs rename to tests/fsharp/typeProviders/splitAssemblyTools/provider.fs diff --git a/tests/fsharp/typeProviders/splitAssembly/providerDesigner.fsx b/tests/fsharp/typeProviders/splitAssemblyTools/providerDesigner.fsx similarity index 100% rename from tests/fsharp/typeProviders/splitAssembly/providerDesigner.fsx rename to tests/fsharp/typeProviders/splitAssemblyTools/providerDesigner.fsx diff --git a/tests/fsharp/typeProviders/splitAssembly/test.fsx b/tests/fsharp/typeProviders/splitAssemblyTools/test.fsx similarity index 100% rename from tests/fsharp/typeProviders/splitAssembly/test.fsx rename to tests/fsharp/typeProviders/splitAssemblyTools/test.fsx diff --git a/tests/fsharp/typeProviders/splitAssemblyTypeproviders/provider.fs b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/provider.fs new file mode 100644 index 00000000000..732486441a9 --- /dev/null +++ b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/provider.fs @@ -0,0 +1,17 @@ +namespace Microsoft.FSharp.Core.CompilerServices + +type TypeProviderAssemblyAttribute(assemblyName) = + inherit System.Attribute() + + new() = TypeProviderAssemblyAttribute(null) + member this.AssemblyName + with get () = assemblyName + +[] +do() + + +namespace My + type Runtime = + static member Id x = x + diff --git a/tests/fsharp/typeProviders/splitAssemblyTypeproviders/providerDesigner.fsx b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/providerDesigner.fsx new file mode 100644 index 00000000000..3f2183fd899 --- /dev/null +++ b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/providerDesigner.fsx @@ -0,0 +1,51 @@ +namespace Provider +#load @"..\helloWorld\TypeMagic.fs" +open Microsoft.FSharp.Core.CompilerServices +open System.Collections.Generic +open System.IO +open System +open System.Reflection +open System.Linq.Expressions +open FSharp.TypeMagic + +[] +type public Provider(config : TypeProviderConfig) = + let runtimeAssembly = Assembly.ReflectionOnlyLoadFrom(config.RuntimeAssembly) + let modul = runtimeAssembly.GetModules().[0] + + let ``My.Runtime`` = runtimeAssembly.GetType("My.Runtime") + let rootNamespace = "FSharp.SplitAssembly" + let invalidation = new Event() + + let theType = + let rec members = + lazy + [| let p = TypeBuilder.CreateSyntheticProperty(theType,"Foo",typeof,isStatic=true) + yield! TypeBuilder.JoinPropertiesIntoMemberInfos [p] + |] + and theType = + TypeBuilder.CreateSimpleType(TypeContainer.Namespace(modul,rootNamespace),"TheType", members = members) + theType + + interface IProvidedNamespace with + member this.NamespaceName = rootNamespace + member this.GetNestedNamespaces() = [||] + member this.ResolveTypeName typeName = + match typeName with + | "TheType" -> theType + | _ -> null + member this.GetTypes() = [| theType |] + + interface IDisposable with + member __.Dispose() = () + interface ITypeProvider with + member this.ApplyStaticArguments (st,_,_) = st + member this.GetInvokerExpression(mb,p) = + let mi = ``My.Runtime``.GetMethod("Id").MakeGenericMethod([|typeof|]) + Quotations.Expr.Call(mi, [ Quotations.Expr.Value(42) ]) + member this.GetNamespaces() = [| this |] + member this.GetStaticParameters st = [||] + [] + member this.Invalidate = invalidation.Publish + member this.GetGeneratedAssemblyContents(assembly) = failwith "GetGeneratedAssemblyContents - only erased types were provided!!" + diff --git a/tests/fsharp/typeProviders/splitAssemblyTypeproviders/test.fsx b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/test.fsx new file mode 100644 index 00000000000..e25871ab5f8 --- /dev/null +++ b/tests/fsharp/typeProviders/splitAssemblyTypeproviders/test.fsx @@ -0,0 +1,32 @@ +#r "provider.dll" + +let mutable failures = [] +let reportFailure s = + stdout.WriteLine "\n................TEST FAILED...............\n"; failures <- failures @ [s] + +let check s e r = + if r = e then stdout.WriteLine (s+": YES") + else (stdout.WriteLine ("\n***** "+s+": FAIL\n"); reportFailure s) + +let test s b = + if b then ( (* stdout.WriteLine ("passed: " + s) *) ) + else (stderr.WriteLine ("failure: " + s); + reportFailure s) +(*========================================================================*) + +check "fgdjkwefg" + FSharp.SplitAssembly.TheType.Foo + 42 + +(*--------------------------------------------------------------------------- +!* wrap up + *--------------------------------------------------------------------------- *) + +let _ = + if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) + +do (stdout.WriteLine "Test Passed"; + System.IO.File.WriteAllText("test.ok","ok"); + exit 0) + + diff --git a/tests/fsharp/typecheck/sigs/neg101.fs b/tests/fsharp/typecheck/sigs/neg101.fs index 76785bd35a4..46e642d20a9 100644 --- a/tests/fsharp/typecheck/sigs/neg101.fs +++ b/tests/fsharp/typecheck/sigs/neg101.fs @@ -1,6 +1,6 @@ module M - +open System type MyRec = { Foo: string } let x: int = 1 @@ -47,4 +47,16 @@ let x1 = (1,2,3,4,5,6,7,8).Item7 ] let x2 = (1,2,3,4,5,6,7,8).Rest // gives a warning -let x3 = (1,2).Rest // gives an actual error \ No newline at end of file +let x3 = (1,2).Rest // gives an actual error +let x4 = (struct (1,2)).ToTuple() // no error or warning + +open System.Runtime.CompilerServices + +[] +type TupleEx() = + [] + static member inline Do((x,y): (int*string)) = () + +let x = 1, "2" + +x.Do() // no warning diff --git a/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl b/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl new file mode 100644 index 00000000000..2f18f739a0a --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl @@ -0,0 +1,2 @@ + +neg_issue_3752.fs(4,19,4,46): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'string'. diff --git a/tests/fsharp/typecheck/sigs/neg_issue_3752.fs b/tests/fsharp/typecheck/sigs/neg_issue_3752.fs new file mode 100644 index 00000000000..27d70b9490d --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_issue_3752.fs @@ -0,0 +1,4 @@ +module Test +let memoizeBy (getKey : 'a -> string) (f: 'a -> 'b) : 'a -> 'b = + let cache = System.Collections.Concurrent.ConcurrentDictionary() + fun (x: 'a) -> cache.GetOrAdd(getKey x, f) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs new file mode 100644 index 00000000000..cca0b9e0e2f --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs @@ -0,0 +1,6 @@ +[] +let x = 7 + +[] +let main argv = + 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl new file mode 100644 index 00000000000..32a104642ee --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl @@ -0,0 +1,81 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.5.22220.0 + + + +// 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:4:3:0 +} +.assembly LiteralValue +{ + .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 01 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.LiteralValue +{ + // Offset: 0x00000000 Length: 0x00000274 + // WARNING: managed resource file FSharpSignatureData.test created +} +.mresource public FSharpOptimizationData.LiteralValue +{ + // Offset: 0x00000278 Length: 0x0000006F + // WARNING: managed resource file FSharpOptimizationData.test created +} +.module LiteralValue.exe + // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02BF0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed LiteralValue + 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 ) + .field public static literal int32 x = int32(0x00000007) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static int32 main(string[] argv) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 2 (0x2) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 6,6 : 5,6 'D:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\LiteralValue\\LiteralValue.fs' + IL_0000: ldc.i4.0 + IL_0001: ret + } // end of method LiteralValue::main + +} // end of class LiteralValue + +.class private abstract auto ansi sealed ''.$LiteralValue + extends [mscorlib]System.Object +{ +} // end of class ''.$LiteralValue + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file test.res diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst new file mode 100644 index 00000000000..5566c4d1da8 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst @@ -0,0 +1 @@ + SOURCE=LiteralValue.fs SCFLAGS="-g --test:LiteralValue --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LiteralValue.exe" # LiteralValue.fs - \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/W_DoBindingsNotUnit01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/W_DoBindingsNotUnit01.fs index e703b6ac2a4..f450d0ec592 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/W_DoBindingsNotUnit01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/W_DoBindingsNotUnit01.fs @@ -2,7 +2,7 @@ #light // Verify warning when 'do-bindings' do not return unit. -//The result of this expression is implicitly ignored +//The result of this expression has type 'int' and is implicitly ignored let square x = x * x diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in01.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in01.fs index 1d1442dc8e2..7ff3e6a7bb0 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in01.fs @@ -5,7 +5,7 @@ // Eventually, we will deprecated them - and the specs will be updated. // //The value or constructor 'a' is not defined -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ module A = let a = 3 in a + 1 |> ignore;; a > 4;; diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in02.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in02.fs index 323ff21db25..088eba8f3f4 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in02.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in02.fs @@ -4,7 +4,7 @@ // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. // -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ // module B = diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in03.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in03.fs index e0af19fb87c..e1bc60f8100 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in03.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in03.fs @@ -4,7 +4,7 @@ // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. // -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ // module C = let a = 3 diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in04.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in04.fs index 46ffb9b98b5..1f4ddad6348 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in04.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in04.fs @@ -4,7 +4,7 @@ // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. // -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ // module D = diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs index 87d95d8fd35..eaefd989c14 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs @@ -5,7 +5,7 @@ // Eventually, we will deprecated them - and the specs will be updated. //The type 'int' does not match the type 'unit'$ //Type mismatch\. Expecting a. ''a -> 'b' .but given a. ''a -> unit' .The type 'int' does not match the type 'unit'$ -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ module E = let a = 3 in a + 1 |> ignore diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/TryFinally/W-TryFinallyNotUnit.fs b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/TryFinally/W-TryFinallyNotUnit.fs index bdb54bf3d7b..e78a19b0fae 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/TryFinally/W-TryFinallyNotUnit.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/TryFinally/W-TryFinallyNotUnit.fs @@ -2,7 +2,7 @@ #light // Verify warning if a finally block does not return 'unit' -//The result of this expression is implicitly ignored +//The result of this expression has type 'bool' and is implicitly ignored let x : int = try diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternUnconstrained01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternUnconstrained01.fs index b930cbaba00..86e8689d061 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternUnconstrained01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternUnconstrained01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:5590 // This code used to compile, but fail peverification // Now, it just does not compile anymore telling the user to annotated it a bit. -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'int' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ //Active pattern '\|A1\|A2\|A3\|' 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'$ let (|A1|A2|A3|) (inp:int) : Choice = printfn "hello" diff --git a/tests/fsharpqa/Source/Diagnostics/General/W_Multiline02.fs b/tests/fsharpqa/Source/Diagnostics/General/W_Multiline02.fs index b68027a1693..9905cd93d87 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/W_Multiline02.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/W_Multiline02.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:3596 // Make sure that error spans correctly across multiple lines -//The result of this expression is implicitly ignored +//The result of this expression has type 'int' and is implicitly ignored #nowarn "988" let f g x = g x diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01.fs index f6f6443df63..42e04f7fa44 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2391, FSHARP1.0:1479 -//The result of this expression is implicitly ignored +//The result of this expression has type 'seq' and is implicitly ignored #light "off" <@@ 1 @@>.GetFreeVars() diff --git a/tests/fsharpqa/Source/Diagnostics/async/MissingIgnore.fs b/tests/fsharpqa/Source/Diagnostics/async/MissingIgnore.fs index 3fe0919320d..85381cea43e 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/MissingIgnore.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/MissingIgnore.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'int' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ async { 1; return 2 } |> ignore diff --git a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop01.fs b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop01.fs index 4dd57691e8d..22ebb43bd2a 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop01.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop01.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 // common mistake: forgetting the return! For a loop -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'Async<'a>' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ let rec loop() = async { let x = 1 in loop() } diff --git a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop02.fs b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop02.fs index a9bb89c9dac..a7c5b2b1468 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop02.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop02.fs @@ -1,5 +1,5 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 // common mistake: forgetting the return! For a loop -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'Async<'a>' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ let rec loop() = async { loop() } diff --git a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop03.fs b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop03.fs index dfba108aac0..277028e9bbf 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop03.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop03.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 // common mistake: forgetting the return! For a loop -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'Async<'a>' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ //This expression was expected to have type. 'Async<'a>' .but here has type. 'unit' let rec loop2() = async.Delay(fun () -> loop2(); ()); diff --git a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop04.fs b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop04.fs index b86efb67132..761020c2ec1 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop04.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/MissingReturnBangForLoop04.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 // common mistake: forgetting the return! For a loop -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'Async<'a>' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ //This expression was expected to have type. 'Async<'a>' .but here has type. 'unit' // Note: interestingly, this looks much better if a method call is not used let delay x = async.Delay x diff --git a/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs b/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs new file mode 100644 index 00000000000..b369ffad37f --- /dev/null +++ b/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs @@ -0,0 +1,6 @@ +// #ErrorMessages #NameResolution +//'global' may only be used as the first name in a qualified path + +let x = global.System.String.Empty.global.System.String.Empty + +exit 0 diff --git a/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst b/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst index 435fb96c42b..42209ddd28e 100644 --- a/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst +++ b/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst @@ -1,2 +1,3 @@ SOURCE=E_RecordFieldProposal.fs # E_RecordFieldProposal + SOURCE=E_GlobalQualifierAfterDot.fs # E_GlobalQualifierAfterDot SOURCE=E_FieldNotInRecord.fs # E_FieldNotInRecord \ No newline at end of file diff --git a/tests/fsharpqa/Source/Import/AccessibilityTests.cs b/tests/fsharpqa/Source/Import/AccessibilityTests.cs index e3df6a9fb70..1a8ac727bce 100644 --- a/tests/fsharpqa/Source/Import/AccessibilityTests.cs +++ b/tests/fsharpqa/Source/Import/AccessibilityTests.cs @@ -10,9 +10,7 @@ public class Accessibility private int Private { get; set; } protected int Protected { get; set; } internal int Internal { get; set; } - // Note: accessibility was modified using dnspy - public int FamOrAssembly { get; set; } - // Note: accessibility was modified using dnspy - public int FamAndAssembly { get; set; } + protected internal int FamOrAssembly { get; set; } + private protected int FamAndAssembly { get; set; } } diff --git a/tests/fsharpqa/Source/Import/AccessibilityTests.dll b/tests/fsharpqa/Source/Import/AccessibilityTests.dll deleted file mode 100644 index 0e01f245a7d..00000000000 Binary files a/tests/fsharpqa/Source/Import/AccessibilityTests.dll and /dev/null differ diff --git a/tests/fsharpqa/Source/Import/env.lst b/tests/fsharpqa/Source/Import/env.lst index 792c23a3ace..7e9100030a3 100644 --- a/tests/fsharpqa/Source/Import/env.lst +++ b/tests/fsharpqa/Source/Import/env.lst @@ -83,11 +83,11 @@ NOMONO SOURCE=reference2.fsx SCFLAGS="--nologo -r:reference1.dll" PRECMD="\$FSC_ ### ### F# can consume FamOrAssembly and FamAndAssembly in combination with IVT ### - SOURCE=FamAndAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamAndAssembly.fs + SOURCE=FamAndAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamAndAssembly.fs ### See issue https://github.com/Microsoft/visualfsharp/issues/2496 - ### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly.fs - SOURCE=FamAndAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamAndAssembly_NoIVT.fs - ### SOURCE=FamOrAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly_NoIVT.fs + ### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamOrAssembly.fs + SOURCE=FamAndAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamAndAssembly_NoIVT.fs + ### SOURCE=FamOrAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamOrAssembly_NoIVT.fs ### ### Iterate over BCL collections @@ -100,4 +100,4 @@ NOMONO SOURCE=reference2.fsx SCFLAGS="--nologo -r:reference1.dll" PRECMD="\$FSC_ SOURCE=ReferenceExe01.fsx PRECMD="\$FSC_PIPE ReferenceExe.fs" # ReferenceExe01.fsx - SOURCE=LineDirectiveFromCSharp.fs PRECMD="\$CSC_PIPE /t:library LineDirectiveLib.cs" SCFLAGS="-r:LineDirectiveLib.dll" # LineDirectiveFromCSharp.fs \ No newline at end of file + SOURCE=LineDirectiveFromCSharp.fs PRECMD="\$CSC_PIPE /t:library LineDirectiveLib.cs" SCFLAGS="-r:LineDirectiveLib.dll" # LineDirectiveFromCSharp.fs diff --git a/tests/fsharpqa/Source/Misc/Parsing02.fs b/tests/fsharpqa/Source/Misc/Parsing02.fs index 9a17369e870..55b5997b467 100644 --- a/tests/fsharpqa/Source/Misc/Parsing02.fs +++ b/tests/fsharpqa/Source/Misc/Parsing02.fs @@ -1,8 +1,8 @@ // #Regression #Misc // Verify warnings associated with top level expressions getting discarded -//The result of this expression is implicitly ignored -//The result of this expression is implicitly ignored +//The result of this expression has type +//The result of this expression has type // Note the comma between printf "%A", this results in a tuple expr which probably wasn't intended. let arr = [|"Foo"; "Bar"|] diff --git a/tests/fsharpqa/Source/Warnings/DontWarnIfPropertyWithoutSetter.fs b/tests/fsharpqa/Source/Warnings/DontWarnIfPropertyWithoutSetter.fs index f36f8919942..4492e6338c6 100644 --- a/tests/fsharpqa/Source/Warnings/DontWarnIfPropertyWithoutSetter.fs +++ b/tests/fsharpqa/Source/Warnings/DontWarnIfPropertyWithoutSetter.fs @@ -1,5 +1,5 @@ // #Warnings -//The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. +//The result of this equality expression has type 'bool' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. type MyClass(property1 : int) = member val Property2 = "" with get diff --git a/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList.fs b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList.fs new file mode 100644 index 00000000000..d47a4c13769 --- /dev/null +++ b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList.fs @@ -0,0 +1,14 @@ +// #Warnings +// + +let div _ _ = 1 +let subView _ _ = [1; 2] + +// elmish view +let view model dispatch = + [ + yield! subView model dispatch + div [] [] + ] + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList2.fs b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList2.fs new file mode 100644 index 00000000000..d360da4d666 --- /dev/null +++ b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList2.fs @@ -0,0 +1,19 @@ +// #Warnings +// + +// stupid things to make the sample compile +let div _ _ = 1 +let subView _ _ = [1; 2] +let y = 1 + +// elmish view +let view model dispatch = + [ + div [] [ + match y with + | 1 -> yield! subView model dispatch + | _ -> subView model dispatch + ] + ] + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList3.fs b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList3.fs new file mode 100644 index 00000000000..238d4388f9e --- /dev/null +++ b/tests/fsharpqa/Source/Warnings/WarnIfDiscardedInList3.fs @@ -0,0 +1,19 @@ +// #Warnings +// + +// stupid things to make the sample compile +let div _ _ = 1 +let subView _ _ = true +let y = 1 + +// elmish view +let view model dispatch = + [ + div [] [ + match y with + | 1 -> () + | _ -> subView model dispatch + ] + ] + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/WarnIfExpressionResultUnused.fs b/tests/fsharpqa/Source/Warnings/WarnIfExpressionResultUnused.fs index e43c60b38d9..9480f35b6b6 100644 --- a/tests/fsharpqa/Source/Warnings/WarnIfExpressionResultUnused.fs +++ b/tests/fsharpqa/Source/Warnings/WarnIfExpressionResultUnused.fs @@ -1,5 +1,5 @@ // #Warnings -//The result of this expression is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ +//The result of this expression has type 'int' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ 1 + 2 printfn "%d" 3 diff --git a/tests/fsharpqa/Source/Warnings/WarnIfImplicitlyDiscarded.fs b/tests/fsharpqa/Source/Warnings/WarnIfImplicitlyDiscarded.fs index d0acf39cbe0..ad7f9deacdd 100644 --- a/tests/fsharpqa/Source/Warnings/WarnIfImplicitlyDiscarded.fs +++ b/tests/fsharpqa/Source/Warnings/WarnIfImplicitlyDiscarded.fs @@ -1,5 +1,5 @@ // #Warnings -//The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. +//The result of this equality expression has type 'bool' and is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. let x = 10 let y = 20 diff --git a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs index ac96be2f92b..6f2ef4d9c45 100644 --- a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs +++ b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs @@ -1,5 +1,5 @@ // #Warnings -// +// let mutable x = 0 while x < 1 do diff --git a/tests/fsharpqa/Source/Warnings/env.lst b/tests/fsharpqa/Source/Warnings/env.lst index 8a80eb74d15..383c291e906 100644 --- a/tests/fsharpqa/Source/Warnings/env.lst +++ b/tests/fsharpqa/Source/Warnings/env.lst @@ -77,6 +77,9 @@ SOURCE=WarnIfPossibleDotNetPropertySetter.fs SOURCE=DontWarnIfPropertyWithoutSetter.fs SOURCE=WarnIfImplicitlyDiscarded.fs + SOURCE=WarnIfDiscardedInList.fs + SOURCE=WarnIfDiscardedInList2.fs + SOURCE=WarnIfDiscardedInList3.fs SOURCE=WarnOnlyOnLastExpression.fs SOURCE=WarnIfPossiblePropertySetter.fs SOURCE=DoCannotHaveVisibilityDeclarations.fs diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index d4301fedb94..c0c482eb69f 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -14,6 +14,7 @@ CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\DoNotBoxStruct CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\GeneratedIterators CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\InequalityComparison CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\ListExpressionStepping +CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\LiteralValue CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\MethodImplAttribute CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\Misc CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\Mutation diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx index 17621946c50..8554c7b46d2 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.8.0.1\lib\net45\Newtonsoft.Json.dll" +#r @"..\..\..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" open System open System.Diagnostics diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index c03e0df50f0..8a5ff94b442 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -50,7 +50,7 @@ FSharp.Compiler.Private - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj index 8a07b574594..43aa06b77c7 100644 --- a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj +++ b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj @@ -70,7 +70,7 @@ - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll decls = %A" decls |> Seq.exists (fun d -> d.Head.Symbol.DisplayName = "abc") |> shouldEqual true @@ -365,7 +366,7 @@ type Test() = let file = "/home/user/Test.fsx" let parseResult, typeCheckResults = parseAndCheckScript(file, input) - let decls = typeCheckResults.GetDeclarationListSymbols(Some parseResult, 4, inputLines.[3], PartialLongName.Empty(21), fun _ -> false)|> Async.RunSynchronously + let decls = typeCheckResults.GetDeclarationListSymbols(Some parseResult, 4, inputLines.[3], PartialLongName.Empty(21), (fun () -> []), fun _ -> false)|> Async.RunSynchronously //decls |> List.map (fun d -> d.Head.Symbol.DisplayName) |> printfn "---> decls = %A" decls |> Seq.exists (fun d -> d.Head.Symbol.DisplayName = "abc") |> shouldEqual true @@ -382,7 +383,7 @@ type Test() = let file = "/home/user/Test.fsx" let parseResult, typeCheckResults = parseAndCheckScript(file, input) - let decls = typeCheckResults.GetDeclarationListSymbols(Some parseResult, 4, inputLines.[3], PartialLongName.Empty(14), fun _ -> false)|> Async.RunSynchronously + let decls = typeCheckResults.GetDeclarationListSymbols(Some parseResult, 4, inputLines.[3], PartialLongName.Empty(14), (fun () -> []), fun _ -> false)|> Async.RunSynchronously //decls |> List.map (fun d -> d.Head.Symbol.DisplayName) |> printfn "---> decls = %A" decls |> Seq.exists (fun d -> d.Head.Symbol.DisplayName = "abc") |> shouldEqual true @@ -768,6 +769,17 @@ let _ = Threading.Buzz = null ("Threading", (6, 8, 6, 17)) ("Test", (1, 0, 1, 0))|] +[] +let ``GetDeclarationLocation should not require physical file`` () = + let input = "let abc = 1\nlet xyz = abc" + let file = "/home/user/Test.fsx" + let _, typeCheckResults = parseAndCheckScript(file, input) + let location = typeCheckResults.GetDeclarationLocation(2, 13, "let xyz = abc", ["abc"]) |> Async.RunSynchronously + match location with + | FSharpFindDeclResult.DeclFound r -> Some (r.StartLine, r.StartColumn, r.EndLine, r.EndColumn, "<=== Found here." ) + | _ -> Some (0 , 0 , 0 , 0 , "Not Found. Should not require physical file." ) + |> shouldEqual (Some (1 , 4 , 1 , 7 , "<=== Found here." )) + //------------------------------------------------------------------------------- @@ -957,3 +969,34 @@ let ``Test TPProject param info`` () = ``Basic cancellation test`` () ``Intro test`` () #endif + +[] +let ``FSharpField.IsNameGenerated`` () = + let checkFields source = + let file = "/home/user/Test.fsx" + let _, typeCheckResults = parseAndCheckScript(file, source) + let symbols = + typeCheckResults.GetAllUsesOfAllSymbolsInFile() + |> Async.RunSynchronously + symbols + |> Array.choose (fun su -> + match su.Symbol with + | :? FSharpEntity as entity -> Some entity.FSharpFields + | :? FSharpUnionCase as unionCase -> Some unionCase.UnionCaseFields + | _ -> None) + |> Seq.concat + |> Seq.map (fun (field: FSharpField) -> field.Name, field.IsNameGenerated) + |> List.ofSeq + + ["exception E of string", ["Data0", true] + "exception E of Data0: string", ["Data0", false] + "exception E of Name: string", ["Name", false] + "exception E of string * Data2: string * Data1: string * Name: string * Data4: string", + ["Data0", true; "Data2", false; "Data1", false; "Name", false; "Data4", false] + + "type U = Case of string", ["Item", true] + "type U = Case of Item: string", ["Item", false] + "type U = Case of Name: string", ["Name", false] + "type U = Case of string * Item2: string * string * Name: string", + ["Item1", true; "Item2", false; "Item3", true; "Name", false]] + |> List.iter (fun (source, expected) -> checkFields source |> shouldEqual expected) diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 5eea4c1a6e1..2770265abff 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1,6 +1,6 @@  #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../Debug/net40/bin/FSharp.Compiler.Service.ProjectCracker.dll" #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" @@ -96,6 +96,33 @@ module internal Utils = and printIimpls iis = String.concat ";" (List.map printImlementation iis) and printImlementation (i, ors) = "interface " + printTy i + " with " + printOverrides ors + let rec printFSharpDecls prefix decls = + seq { + let mutable i = 0 + for decl in decls do + i <- i + 1 + match decl with + | FSharpImplementationFileDeclaration.Entity (e, sub) -> + yield sprintf "%s%i) ENTITY: %s %A" prefix i e.CompiledName (attribsOfSymbol e) + if not (Seq.isEmpty e.Attributes) then + yield sprintf "%sattributes: %A" prefix (Seq.toList e.Attributes) + if not (Seq.isEmpty e.DeclaredInterfaces) then + yield sprintf "%sinterfaces: %A" prefix (Seq.toList e.DeclaredInterfaces) + yield "" + yield! printFSharpDecls (prefix + "\t") sub + | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (meth, args, body) -> + yield sprintf "%s%i) METHOD: %s %A" prefix i meth.CompiledName (attribsOfSymbol meth) + yield sprintf "%stype: %A" prefix meth.FullType + yield sprintf "%sargs: %A" prefix args + // if not meth.IsCompilerGenerated then + yield sprintf "%sbody: %A" prefix body + yield "" + | FSharpImplementationFileDeclaration.InitAction (expr) -> + yield sprintf "%s%i) ACTION" prefix i + yield sprintf "%s%A" prefix expr + yield "" + } + let rec printDeclaration (excludes:HashSet<_> option) (d: FSharpImplementationFileDeclaration) = seq { match d with @@ -283,7 +310,7 @@ let localGenericFunctionExample() = let funcEx1 (x:int) = x let genericFuncEx1 (x:'T) = x let (topPair1a, topPair1b) = (1,2) -let tyfuncEx1<'T> = typeof<'T> + let testILCall1 = new obj() let testILCall2 = System.Console.WriteLine("176") @@ -316,7 +343,7 @@ type ClassWithImplicitConstructor(compiledAsArg: int) = member __.M2() = compiledAsInstanceMethod() static member SM1() = compiledAsStaticField + compiledAsGenericStaticMethod compiledAsStaticField static member SM2() = compiledAsStaticMethod() - override __.ToString() = base.ToString() + string 999 + //override __.ToString() = base.ToString() + string 999 member this.TestCallinToString() = this.ToString() exception Error of int * int @@ -360,7 +387,7 @@ let v = c.InstanceProperty System.Console.WriteLine("777") // do a top-levl action let functionWithSubmsumption(x:obj) = x :?> string -let functionWithCoercion(x:string) = (x :> obj) :?> string |> functionWithSubmsumption |> functionWithSubmsumption +//let functionWithCoercion(x:string) = (x :> obj) :?> string |> functionWithSubmsumption |> functionWithSubmsumption type MultiArgMethods(c:int,d:int) = member x.Method(a:int, b : int) = 1 @@ -370,14 +397,14 @@ let testFunctionThatCallsMultiArgMethods() = let m = MultiArgMethods(3,4) (m.Method(7,8) + m.CurriedMethod (9,10) (11,12)) -let functionThatUsesObjectExpression() = - { new obj() with member x.ToString() = string 888 } - -let functionThatUsesObjectExpressionWithInterfaceImpl() = - { new obj() with - member x.ToString() = string 888 - interface System.IComparable with - member x.CompareTo(y:obj) = 0 } +//let functionThatUsesObjectExpression() = +// { new obj() with member x.ToString() = string 888 } +// +//let functionThatUsesObjectExpressionWithInterfaceImpl() = +// { new obj() with +// member x.ToString() = string 888 +// interface System.IComparable with +// member x.CompareTo(y:obj) = 0 } let testFunctionThatUsesUnitsOfMeasure (x : float<_>) (y: float<_>) = x + y @@ -517,20 +544,89 @@ module N type IntAbbrev = int - let bool2 = false +let testHashChar (x:char) = hash x +let testHashSByte (x:sbyte) = hash x +let testHashInt16 (x:int16) = hash x +let testHashInt64 (x:int64) = hash x +let testHashUInt64 (x:uint64) = hash x +let testHashIntPtr (x:nativeint) = hash x +let testHashUIntPtr (x:unativeint) = hash x + +let testHashString (x:string) = hash x +let testTypeOf (x:'T) = typeof<'T> + """ + File.WriteAllText(fileName2, fileSource2) let fileNames = [fileName1; fileName2] let args = mkProjectCommandLineArgs (dllName, fileNames) let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + let operatorTests = """ +module OperatorTests{0} + +let test{0}EqualsOperator (e1:{1}) (e2:{1}) = (=) e1 e2 +let test{0}NotEqualsOperator (e1:{1}) (e2:{1}) = (<>) e1 e2 +let test{0}LessThanOperator (e1:{1}) (e2:{1}) = (<) e1 e2 +let test{0}LessThanOrEqualsOperator (e1:{1}) (e2:{1}) = (<=) e1 e2 +let test{0}GreaterThanOperator (e1:{1}) (e2:{1}) = (>) e1 e2 +let test{0}GreaterThanOrEqualsOperator (e1:{1}) (e2:{1}) = (>=) e1 e2 + +let test{0}AdditionOperator (e1:{1}) (e2:{1}) = (+) e1 e2 +let test{0}SubtractionOperator (e1:{1}) (e2:{1}) = (-) e1 e2 +let test{0}MultiplyOperator (e1:{1}) (e2:{1}) = (*) e1 e2 +let test{0}DivisionOperator (e1:{1}) (e2:{1}) = (/) e1 e2 +let test{0}ModulusOperator (e1:{1}) (e2:{1}) = (%) e1 e2 +let test{0}BitwiseAndOperator (e1:{1}) (e2:{1}) = (&&&) e1 e2 +let test{0}BitwiseOrOperator (e1:{1}) (e2:{1}) = (|||) e1 e2 +let test{0}BitwiseXorOperator (e1:{1}) (e2:{1}) = (^^^) e1 e2 +let test{0}ShiftLeftOperator (e1:{1}) (e2:int) = (<<<) e1 e2 +let test{0}ShiftRightOperator (e1:{1}) (e2:int) = (>>>) e1 e2 + +let test{0}UnaryNegOperator (e1:{1}) = (~-) e1 + +let test{0}AdditionChecked (e1:{1}) (e2:{1}) = Checked.(+) e1 e2 +let test{0}SubtractionChecked (e1:{1}) (e2:{1}) = Checked.(-) e1 e2 +let test{0}MultiplyChecked (e1:{1}) (e2:{1}) = Checked.(*) e1 e2 +let test{0}UnaryNegChecked (e1:{1}) = Checked.(~-) e1 + +let test{0}ToByteChecked (e1:{1}) = Checked.byte e1 +let test{0}ToSByteChecked (e1:{1}) = Checked.sbyte e1 +let test{0}ToInt16Checked (e1:{1}) = Checked.int16 e1 +let test{0}ToUInt16Checked (e1:{1}) = Checked.uint16 e1 +let test{0}ToIntChecked (e1:{1}) = Checked.int e1 +let test{0}ToInt32Checked (e1:{1}) = Checked.int32 e1 +let test{0}ToUInt32Checked (e1:{1}) = Checked.uint32 e1 +let test{0}ToInt64Checked (e1:{1}) = Checked.int64 e1 +let test{0}ToUInt64Checked (e1:{1}) = Checked.uint64 e1 +let test{0}ToIntPtrChecked (e1:{1}) = Checked.nativeint e1 +let test{0}ToUIntPtrChecked (e1:{1}) = Checked.unativeint e1 + +let test{0}ToByteOperator (e1:{1}) = byte e1 +let test{0}ToSByteOperator (e1:{1}) = sbyte e1 +let test{0}ToInt16Operator (e1:{1}) = int16 e1 +let test{0}ToUInt16Operator (e1:{1}) = uint16 e1 +let test{0}ToIntOperator (e1:{1}) = int e1 +let test{0}ToInt32Operator (e1:{1}) = int32 e1 +let test{0}ToUInt32Operator (e1:{1}) = uint32 e1 +let test{0}ToInt64Operator (e1:{1}) = int64 e1 +let test{0}ToUInt64Operator (e1:{1}) = uint64 e1 +let test{0}ToIntPtrOperator (e1:{1}) = nativeint e1 +let test{0}ToUIntPtrOperator (e1:{1}) = unativeint e1 +let test{0}ToSingleOperator (e1:{1}) = float32 e1 +let test{0}ToDoubleOperator (e1:{1}) = float e1 +let test{0}ToDecimalOperator (e1:{1}) = decimal e1 +let test{0}ToCharOperator (e1:{1}) = char e1 +let test{0}ToStringOperator (e1:{1}) = string e1 + +""" + //<@ let x = Some(3) in x.IsSome @> -#if !NO_EXTENSIONTYPING [] -let ``Test Declarations project1`` () = +let ``Test Unoptimized Declarations Project1`` () = let wholeProjectResults = exprChecker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously for e in wholeProjectResults.Errors do @@ -553,102 +649,2013 @@ let ``Test Declarations project1`` () = s.Replace("ILArrayShape [(Some 0, None)]", "ILArrayShapeFIX") .Replace("ILArrayShape [(Some 0, null)]", "ILArrayShapeFIX")) - let expected = - ["type M"; "type IntAbbrev"; "let boolEx1 = True @ (6,14--6,18)"; - "let intEx1 = 1 @ (7,13--7,14)"; "let int64Ex1 = 1 @ (8,15--8,17)"; - "let tupleEx1 = (1,1) @ (9,16--9,21)"; - "let tupleEx2 = (1,1,1) @ (10,16--10,25)"; - "let tupleEx3 = (1,1,1,1) @ (11,16--11,29)"; - "let localExample = let y: Microsoft.FSharp.Core.int = 1 in let z: Microsoft.FSharp.Core.int = 1 in (y,z) @ (14,7--14,8)"; - "let localGenericFunctionExample(unitVar0) = let y: Microsoft.FSharp.Core.int = 1 in let compiledAsLocalGenericFunction: 'a -> 'a = FUN ... -> fun x -> x in (compiledAsLocalGenericFunction y,compiledAsLocalGenericFunction 1) @ (19,7--19,8)"; - "let funcEx1(x) = x @ (23,23--23,24)"; - "let genericFuncEx1(x) = x @ (24,29--24,30)"; - "let topPair1b = M.patternInput@25 ().Item1 @ (25,4--25,26)"; - "let topPair1a = M.patternInput@25 ().Item0 @ (25,4--25,26)"; - "let tyfuncEx1 = Operators.TypeOf<'T> () @ (26,20--26,26)"; - "let testILCall1 = new Object() @ (27,18--27,27)"; - "let testILCall2 = Console.WriteLine (\"176\") @ (28,18--28,49)"; - "let recValNeverUsedAtRuntime = recValNeverUsedAtRuntime@31.Force(()) @ (31,8--31,32)"; - "let recFuncIgnoresFirstArg(g) (v) = v @ (32,33--32,34)"; - "let testFun4(unitVar0) = let rec ... in recValNeverUsedAtRuntime @ (36,4--39,28)"; - "type ClassWithImplicitConstructor"; - "member .ctor(compiledAsArg) = (new Object(); (this.compiledAsArg <- compiledAsArg; (this.compiledAsField <- 1; let compiledAsLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsLocal,compiledAsLocal) in ()))) @ (41,5--41,33)"; - "member .cctor(unitVar) = (compiledAsStaticField <- 1; let compiledAsStaticLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsStaticLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsStaticLocal,compiledAsStaticLocal) in ()) @ (49,11--49,40)"; - "member M1(__) (unitVar1) = Operators.op_Addition (Operators.op_Addition (__.compiledAsField,let x: Microsoft.FSharp.Core.int = __.compiledAsField in __.compiledAsGenericInstanceMethod(x)),__.compiledAsArg) @ (55,21--55,102)"; - "member M2(__) (unitVar1) = __.compiledAsInstanceMethod(()) @ (56,21--56,47)"; - "member SM1(unitVar0) = Operators.op_Addition (compiledAsStaticField,let x: Microsoft.FSharp.Core.int = compiledAsStaticField in ClassWithImplicitConstructor.compiledAsGenericStaticMethod (x)) @ (57,26--57,101)"; - "member SM2(unitVar0) = ClassWithImplicitConstructor.compiledAsStaticMethod (()) @ (58,26--58,50)"; - "member ToString(__) (unitVar1) = Operators.op_Addition (base.ToString(),Operators.ToString (999)) @ (59,29--59,57)"; - "member TestCallinToString(this) (unitVar1) = this.ToString() @ (60,39--60,54)"; - "type Error"; "let err = {Data0 = 3; Data1 = 4} @ (64,10--64,20)"; - "let matchOnException(err) = match (if err :? M.Error then $0 else $1) targets ... @ (66,33--66,36)"; - "let upwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (69,16--69,17)"; - "let upwardForLoop2(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (74,16--74,17)"; - "let downwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (79,16--79,17)"; - "let quotationTest1(unitVar0) = quote(Operators.op_Addition (1,1)) @ (83,24--83,35)"; - "let quotationTest2(v) = quote(Operators.op_Addition (ExtraTopLevelOperators.SpliceExpression (v),1)) @ (84,24--84,36)"; - "type RecdType"; "type UnionType"; "type ClassWithEventsAndProperties"; - "member .ctor(unitVar0) = (new Object(); (this.ev <- new FSharpEvent`1(()); ())) @ (89,5--89,33)"; - "member .cctor(unitVar) = (sev <- new FSharpEvent`1(()); ()) @ (91,11--91,35)"; - "member get_InstanceProperty(x) (unitVar1) = (x.ev.Trigger(1); 1) @ (92,32--92,48)"; - "member get_StaticProperty(unitVar0) = (sev.Trigger(1); 1) @ (93,35--93,52)"; - "member get_InstanceEvent(x) (unitVar1) = x.ev.get_Publish(()) @ (94,29--94,39)"; - "member get_StaticEvent(x) (unitVar1) = sev.get_Publish(()) @ (95,27--95,38)"; - "let c = new ClassWithEventsAndProperties(()) @ (97,8--97,38)"; - "let v = M.c ().get_InstanceProperty(()) @ (98,8--98,26)"; - "do Console.WriteLine (\"777\")"; - "let functionWithSubmsumption(x) = IntrinsicFunctions.UnboxGeneric (x) @ (102,40--102,52)"; - "let functionWithCoercion(x) = Operators.op_PipeRight (Operators.op_PipeRight (IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)) @ (103,39--103,116)"; - "type MultiArgMethods"; - "member .ctor(c,d) = (new Object(); ()) @ (105,5--105,20)"; - "member Method(x) (a,b) = 1 @ (106,37--106,38)"; - "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; - "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (m.Method(7,8),fun tupledArg -> let arg00: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg01: Microsoft.FSharp.Core.int = tupledArg.Item1 in fun tupledArg -> let arg10: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg11: Microsoft.FSharp.Core.int = tupledArg.Item1 in m.CurriedMethod(arg00,arg01,arg10,arg11) (9,10) (11,12)) @ (110,8--110,9)"; - "let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) } @ (114,3--114,55)"; - "let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; - "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (x,y) @ (122,70--122,75)"; - "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShape [(Some 0, None)],TypeVar 0us)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; - "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; - "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = Operators.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = Operators.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; - "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (x,1) done; x) @ (152,15--152,16)"; - "let testFunctionThatUsesTryWith(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) with matchValue -> match (if matchValue :? System.ArgumentException then $0 else $1) targets ... @ (158,3--160,60)"; - "let testFunctionThatUsesTryFinally(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) finally Console.WriteLine (\"8888\") @ (164,3--167,37)"; - "member Console.WriteTwoLines.Static(unitVar0) = (Console.WriteLine (); Console.WriteLine ()) @ (170,36--170,90)"; - "member DateTime.get_TwoMinute(x) (unitVar1) = Operators.op_Addition (x.get_Minute(),x.get_Minute()) @ (173,25--173,44)"; - "let testFunctionThatUsesExtensionMembers(unitVar0) = (M.Console.WriteTwoLines.Static (()); let v: Microsoft.FSharp.Core.int = DateTime.get_Now ().DateTime.get_TwoMinute(()) in M.Console.WriteTwoLines.Static (())) @ (176,3--178,33)"; - "let testFunctionThatUsesOptionMembers(unitVar0) = let x: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.option = Some(3) in (x.get_IsSome() (),x.get_IsNone() ()) @ (181,7--181,8)"; - "let testFunctionThatUsesOverAppliedFunction(unitVar0) = Operators.Identity Microsoft.FSharp.Core.int> (fun x -> Operators.Identity (x)) 3 @ (185,3--185,10)"; - "let testFunctionThatUsesPatternMatchingOnLists(x) = match (if x.Isop_ColonColon then (if x.Tail.Isop_ColonColon then (if x.Tail.Tail.Isop_Nil then $2 else $3) else $1) else $0) targets ... @ (188,10--188,11)"; - "let testFunctionThatUsesPatternMatchingOnOptions(x) = match (if x.IsSome then $1 else $0) targets ... @ (195,10--195,11)"; - "let testFunctionThatUsesPatternMatchingOnOptions2(x) = match (if x.IsSome then $1 else $0) targets ... @ (200,10--200,11)"; - "let testFunctionThatUsesConditionalOnOptions2(x) = (if x.get_IsSome() () then 1 else 2) @ (205,4--205,29)"; - "let f(x) (y) = Operators.op_Addition (x,y) @ (207,12--207,15)"; - "let g = let x: Microsoft.FSharp.Core.int = 1 in fun y -> M.f (x,y) @ (208,8--208,11)"; - "let h = Operators.op_Addition (M.g () 2,3) @ (209,8--209,17)"; - "type TestFuncProp"; - "member .ctor(unitVar0) = (new Object(); ()) @ (211,5--211,17)"; - "member get_Id(this) (unitVar1) = fun x -> x @ (212,21--212,31)"; - "let wrong = Operators.op_Equality (new TestFuncProp(()).get_Id(()) 0,0) @ (214,12--214,35)"; - "let start(name) = (name,name) @ (217,4--217,14)"; - "let last(name,values) = Operators.Identity ((name,values)) @ (220,4--220,21)"; - "let last2(name) = Operators.Identity (name) @ (223,4--223,11)"; - "let test7(s) = Operators.op_PipeRight (M.start (s),fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values)) @ (226,4--226,19)"; - "let test8(unitVar0) = fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values) @ (229,4--229,8)"; - "let test9(s) = Operators.op_PipeRight ((s,s),fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values)) @ (232,4--232,17)"; - "let test10(unitVar0) = fun name -> M.last2 (name) @ (235,4--235,9)"; - "let test11(s) = Operators.op_PipeRight (s,fun name -> M.last2 (name)) @ (238,4--238,14)"; - "let badLoop = badLoop@240.Force Microsoft.FSharp.Core.int>(()) @ (240,8--240,15)"; - "type LetLambda"; - "let f = ((); fun a -> fun b -> Operators.op_Addition (a,b)) @ (246,8--247,24)"; - "let letLambdaRes = Operators.op_PipeRight<(Microsoft.FSharp.Core.int * Microsoft.FSharp.Core.int) Microsoft.FSharp.Collections.list,Microsoft.FSharp.Core.int Microsoft.FSharp.Collections.list> (Cons((1,2),Empty()),let mapping: Microsoft.FSharp.Core.int * Microsoft.FSharp.Core.int -> Microsoft.FSharp.Core.int = fun tupledArg -> let a: Microsoft.FSharp.Core.int = tupledArg.Item0 in let b: Microsoft.FSharp.Core.int = tupledArg.Item1 in (LetLambda.f () a) b in fun list -> ListModule.Map (mapping,list)) @ (249,19--249,71)"] + let expected = [ + "type M"; "type IntAbbrev"; "let boolEx1 = True @ (6,14--6,18)"; + "let intEx1 = 1 @ (7,13--7,14)"; "let int64Ex1 = 1 @ (8,15--8,17)"; + "let tupleEx1 = (1,1) @ (9,16--9,21)"; + "let tupleEx2 = (1,1,1) @ (10,16--10,25)"; + "let tupleEx3 = (1,1,1,1) @ (11,16--11,29)"; + "let localExample = let y: Microsoft.FSharp.Core.int = 1 in let z: Microsoft.FSharp.Core.int = 1 in (y,z) @ (14,7--14,8)"; + "let localGenericFunctionExample(unitVar0) = let y: Microsoft.FSharp.Core.int = 1 in let compiledAsLocalGenericFunction: 'a -> 'a = FUN ... -> fun x -> x in (compiledAsLocalGenericFunction y,compiledAsLocalGenericFunction 1) @ (19,7--19,8)"; + "let funcEx1(x) = x @ (23,23--23,24)"; + "let genericFuncEx1(x) = x @ (24,29--24,30)"; + "let topPair1b = M.patternInput@25 ().Item1 @ (25,4--25,26)"; + "let topPair1a = M.patternInput@25 ().Item0 @ (25,4--25,26)"; + "let testILCall1 = new Object() @ (27,18--27,27)"; + "let testILCall2 = Console.WriteLine (\"176\") @ (28,18--28,49)"; + "let recValNeverUsedAtRuntime = recValNeverUsedAtRuntime@31.Force(()) @ (31,8--31,32)"; + "let recFuncIgnoresFirstArg(g) (v) = v @ (32,33--32,34)"; + "let testFun4(unitVar0) = let rec ... in recValNeverUsedAtRuntime @ (36,4--39,28)"; + "type ClassWithImplicitConstructor"; + "member .ctor(compiledAsArg) = (new Object(); (this.compiledAsArg <- compiledAsArg; (this.compiledAsField <- 1; let compiledAsLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsLocal,compiledAsLocal) in ()))) @ (41,5--41,33)"; + "member .cctor(unitVar) = (compiledAsStaticField <- 1; let compiledAsStaticLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsStaticLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsStaticLocal,compiledAsStaticLocal) in ()) @ (49,11--49,40)"; + "member M1(__) (unitVar1) = Operators.op_Addition (Operators.op_Addition (__.compiledAsField,let x: Microsoft.FSharp.Core.int = __.compiledAsField in __.compiledAsGenericInstanceMethod(x)),__.compiledAsArg) @ (55,21--55,102)"; + "member M2(__) (unitVar1) = __.compiledAsInstanceMethod(()) @ (56,21--56,47)"; + "member SM1(unitVar0) = Operators.op_Addition (compiledAsStaticField,let x: Microsoft.FSharp.Core.int = compiledAsStaticField in ClassWithImplicitConstructor.compiledAsGenericStaticMethod (x)) @ (57,26--57,101)"; + "member SM2(unitVar0) = ClassWithImplicitConstructor.compiledAsStaticMethod (()) @ (58,26--58,50)"; + //"member ToString(__) (unitVar1) = Operators.op_Addition (base.ToString(),Operators.ToString (999)) @ (59,29--59,57)"; + "member TestCallinToString(this) (unitVar1) = this.ToString() @ (60,39--60,54)"; + "type Error"; "let err = {Data0 = 3; Data1 = 4} @ (64,10--64,20)"; + "let matchOnException(err) = match (if err :? M.Error then $0 else $1) targets ... @ (66,33--66,36)"; + "let upwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (69,16--69,17)"; + "let upwardForLoop2(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (74,16--74,17)"; + "let downwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (79,16--79,17)"; + "let quotationTest1(unitVar0) = quote(Operators.op_Addition (1,1)) @ (83,24--83,35)"; + "let quotationTest2(v) = quote(Operators.op_Addition (ExtraTopLevelOperators.SpliceExpression (v),1)) @ (84,24--84,36)"; + "type RecdType"; "type UnionType"; "type ClassWithEventsAndProperties"; + "member .ctor(unitVar0) = (new Object(); (this.ev <- new FSharpEvent`1(()); ())) @ (89,5--89,33)"; + "member .cctor(unitVar) = (sev <- new FSharpEvent`1(()); ()) @ (91,11--91,35)"; + "member get_InstanceProperty(x) (unitVar1) = (x.ev.Trigger(1); 1) @ (92,32--92,48)"; + "member get_StaticProperty(unitVar0) = (sev.Trigger(1); 1) @ (93,35--93,52)"; + "member get_InstanceEvent(x) (unitVar1) = x.ev.get_Publish(()) @ (94,29--94,39)"; + "member get_StaticEvent(x) (unitVar1) = sev.get_Publish(()) @ (95,27--95,38)"; + "let c = new ClassWithEventsAndProperties(()) @ (97,8--97,38)"; + "let v = M.c ().get_InstanceProperty(()) @ (98,8--98,26)"; + "do Console.WriteLine (\"777\")"; + "let functionWithSubmsumption(x) = IntrinsicFunctions.UnboxGeneric (x) @ (102,40--102,52)"; + //"let functionWithCoercion(x) = Operators.op_PipeRight (Operators.op_PipeRight (IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)) @ (103,39--103,116)"; + "type MultiArgMethods"; + "member .ctor(c,d) = (new Object(); ()) @ (105,5--105,20)"; + "member Method(x) (a,b) = 1 @ (106,37--106,38)"; + "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; + "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (m.Method(7,8),fun tupledArg -> let arg00: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg01: Microsoft.FSharp.Core.int = tupledArg.Item1 in fun tupledArg -> let arg10: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg11: Microsoft.FSharp.Core.int = tupledArg.Item1 in m.CurriedMethod(arg00,arg01,arg10,arg11) (9,10) (11,12)) @ (110,8--110,9)"; + //"let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) } @ (114,3--114,55)"; + //"let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; + "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (x,y) @ (122,70--122,75)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShape [(Some 0, None)],TypeVar 0us)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; + "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = Operators.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = Operators.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; + "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (x,1) done; x) @ (152,15--152,16)"; + "let testFunctionThatUsesTryWith(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) with matchValue -> match (if matchValue :? System.ArgumentException then $0 else $1) targets ... @ (158,3--160,60)"; + "let testFunctionThatUsesTryFinally(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) finally Console.WriteLine (\"8888\") @ (164,3--167,37)"; + "member Console.WriteTwoLines.Static(unitVar0) = (Console.WriteLine (); Console.WriteLine ()) @ (170,36--170,90)"; + "member DateTime.get_TwoMinute(x) (unitVar1) = Operators.op_Addition (x.get_Minute(),x.get_Minute()) @ (173,25--173,44)"; + "let testFunctionThatUsesExtensionMembers(unitVar0) = (M.Console.WriteTwoLines.Static (()); let v: Microsoft.FSharp.Core.int = DateTime.get_Now ().DateTime.get_TwoMinute(()) in M.Console.WriteTwoLines.Static (())) @ (176,3--178,33)"; + "let testFunctionThatUsesOptionMembers(unitVar0) = let x: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.option = Some(3) in (x.get_IsSome() (),x.get_IsNone() ()) @ (181,7--181,8)"; + "let testFunctionThatUsesOverAppliedFunction(unitVar0) = Operators.Identity Microsoft.FSharp.Core.int> (fun x -> Operators.Identity (x)) 3 @ (185,3--185,10)"; + "let testFunctionThatUsesPatternMatchingOnLists(x) = match (if x.Isop_ColonColon then (if x.Tail.Isop_ColonColon then (if x.Tail.Tail.Isop_Nil then $2 else $3) else $1) else $0) targets ... @ (188,10--188,11)"; + "let testFunctionThatUsesPatternMatchingOnOptions(x) = match (if x.IsSome then $1 else $0) targets ... @ (195,10--195,11)"; + "let testFunctionThatUsesPatternMatchingOnOptions2(x) = match (if x.IsSome then $1 else $0) targets ... @ (200,10--200,11)"; + "let testFunctionThatUsesConditionalOnOptions2(x) = (if x.get_IsSome() () then 1 else 2) @ (205,4--205,29)"; + "let f(x) (y) = Operators.op_Addition (x,y) @ (207,12--207,15)"; + "let g = let x: Microsoft.FSharp.Core.int = 1 in fun y -> M.f (x,y) @ (208,8--208,11)"; + "let h = Operators.op_Addition (M.g () 2,3) @ (209,8--209,17)"; + "type TestFuncProp"; + "member .ctor(unitVar0) = (new Object(); ()) @ (211,5--211,17)"; + "member get_Id(this) (unitVar1) = fun x -> x @ (212,21--212,31)"; + "let wrong = Operators.op_Equality (new TestFuncProp(()).get_Id(()) 0,0) @ (214,12--214,35)"; + "let start(name) = (name,name) @ (217,4--217,14)"; + "let last(name,values) = Operators.Identity ((name,values)) @ (220,4--220,21)"; + "let last2(name) = Operators.Identity (name) @ (223,4--223,11)"; + "let test7(s) = Operators.op_PipeRight (M.start (s),fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values)) @ (226,4--226,19)"; + "let test8(unitVar0) = fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values) @ (229,4--229,8)"; + "let test9(s) = Operators.op_PipeRight ((s,s),fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values)) @ (232,4--232,17)"; + "let test10(unitVar0) = fun name -> M.last2 (name) @ (235,4--235,9)"; + "let test11(s) = Operators.op_PipeRight (s,fun name -> M.last2 (name)) @ (238,4--238,14)"; + "let badLoop = badLoop@240.Force Microsoft.FSharp.Core.int>(()) @ (240,8--240,15)"; + "type LetLambda"; + "let f = ((); fun a -> fun b -> Operators.op_Addition (a,b)) @ (246,8--247,24)"; + "let letLambdaRes = Operators.op_PipeRight<(Microsoft.FSharp.Core.int * Microsoft.FSharp.Core.int) Microsoft.FSharp.Collections.list,Microsoft.FSharp.Core.int Microsoft.FSharp.Collections.list> (Cons((1,2),Empty()),let mapping: Microsoft.FSharp.Core.int * Microsoft.FSharp.Core.int -> Microsoft.FSharp.Core.int = fun tupledArg -> let a: Microsoft.FSharp.Core.int = tupledArg.Item0 in let b: Microsoft.FSharp.Core.int = tupledArg.Item1 in (LetLambda.f () a) b in fun list -> ListModule.Map (mapping,list)) @ (249,19--249,71)"; + ] + + let expected2 = [ + "type N"; "type IntAbbrev"; "let bool2 = False @ (6,12--6,17)"; + "let testHashChar(x) = Operators.Hash (x) @ (8,28--8,34)"; + "let testHashSByte(x) = Operators.Hash (x) @ (9,30--9,36)"; + "let testHashInt16(x) = Operators.Hash (x) @ (10,30--10,36)"; + "let testHashInt64(x) = Operators.Hash (x) @ (11,30--11,36)"; + "let testHashUInt64(x) = Operators.Hash (x) @ (12,32--12,38)"; + "let testHashIntPtr(x) = Operators.Hash (x) @ (13,35--13,41)"; + "let testHashUIntPtr(x) = Operators.Hash (x) @ (14,37--14,43)"; + "let testHashString(x) = Operators.Hash (x) @ (16,32--16,38)"; + "let testTypeOf(x) = Operators.TypeOf<'T> () @ (17,24--17,30)"; + ] printDeclarations None (List.ofSeq file1.Declarations) |> Seq.toList |> filterHack |> shouldEqual (filterHack expected) + printDeclarations None (List.ofSeq file2.Declarations) + |> Seq.toList + |> filterHack + |> shouldEqual (filterHack expected2) + () -#endif + + +[] +//#if NETCOREAPP2_0 +//[] +//#endif +let ``Test Optimized Declarations Project1`` () = + let wholeProjectResults = exprChecker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously + + for e in wholeProjectResults.Errors do + printfn "Project1 error: <<<%s>>>" e.Message + + wholeProjectResults.Errors.Length |> shouldEqual 3 // recursive value warning + wholeProjectResults.Errors.[0].Severity |> shouldEqual FSharpErrorSeverity.Warning + wholeProjectResults.Errors.[1].Severity |> shouldEqual FSharpErrorSeverity.Warning + wholeProjectResults.Errors.[2].Severity |> shouldEqual FSharpErrorSeverity.Warning + + wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.Length |> shouldEqual 2 + let file1 = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0] + let file2 = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[1] + + // This behaves slightly differently on Mono versions, 'null' is printed somethimes, 'None' other times + // Presumably this is very small differences in Mono reflection causing F# printing to change behavious + // For now just disabling this test. See https://github.com/fsharp/FSharp.Compiler.Service/pull/766 + let filterHack l = + l |> List.map (fun (s:string) -> + s.Replace("ILArrayShape [(Some 0, None)]", "ILArrayShapeFIX") + .Replace("ILArrayShape [(Some 0, null)]", "ILArrayShapeFIX")) + + let expected = [ + "type M"; "type IntAbbrev"; "let boolEx1 = True @ (6,14--6,18)"; + "let intEx1 = 1 @ (7,13--7,14)"; "let int64Ex1 = 1 @ (8,15--8,17)"; + "let tupleEx1 = (1,1) @ (9,16--9,21)"; + "let tupleEx2 = (1,1,1) @ (10,16--10,25)"; + "let tupleEx3 = (1,1,1,1) @ (11,16--11,29)"; + "let localExample = let y: Microsoft.FSharp.Core.int = 1 in let z: Microsoft.FSharp.Core.int = 1 in (y,z) @ (14,7--14,8)"; + "let localGenericFunctionExample(unitVar0) = let y: Microsoft.FSharp.Core.int = 1 in let compiledAsLocalGenericFunction: 'a -> 'a = FUN ... -> fun x -> x in (compiledAsLocalGenericFunction y,compiledAsLocalGenericFunction 1) @ (19,7--19,8)"; + "let funcEx1(x) = x @ (23,23--23,24)"; + "let genericFuncEx1(x) = x @ (24,29--24,30)"; + "let topPair1b = M.patternInput@25 ().Item1 @ (25,4--25,26)"; + "let topPair1a = M.patternInput@25 ().Item0 @ (25,4--25,26)"; + "let testILCall1 = new Object() @ (27,18--27,27)"; + "let testILCall2 = Console.WriteLine (\"176\") @ (28,18--28,49)"; + "let recValNeverUsedAtRuntime = recValNeverUsedAtRuntime@31.Force(()) @ (31,8--31,32)"; + "let recFuncIgnoresFirstArg(g) (v) = v @ (32,33--32,34)"; + "let testFun4(unitVar0) = let rec ... in recValNeverUsedAtRuntime @ (36,4--39,28)"; + "type ClassWithImplicitConstructor"; + "member .ctor(compiledAsArg) = (new Object(); (this.compiledAsArg <- compiledAsArg; (this.compiledAsField <- 1; let compiledAsLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsLocal,compiledAsLocal) in ()))) @ (41,5--41,33)"; + "member .cctor(unitVar) = (compiledAsStaticField <- 1; let compiledAsStaticLocal: Microsoft.FSharp.Core.int = 1 in let compiledAsStaticLocal2: Microsoft.FSharp.Core.int = Operators.op_Addition (compiledAsStaticLocal,compiledAsStaticLocal) in ()) @ (49,11--49,40)"; + "member M1(__) (unitVar1) = Operators.op_Addition (Operators.op_Addition (__.compiledAsField,__.compiledAsGenericInstanceMethod(__.compiledAsField)),__.compiledAsArg) @ (55,21--55,102)"; + "member M2(__) (unitVar1) = __.compiledAsInstanceMethod(()) @ (56,21--56,47)"; + "member SM1(unitVar0) = Operators.op_Addition (compiledAsStaticField,ClassWithImplicitConstructor.compiledAsGenericStaticMethod (compiledAsStaticField)) @ (57,26--57,101)"; + "member SM2(unitVar0) = ClassWithImplicitConstructor.compiledAsStaticMethod (()) @ (58,26--58,50)"; +//#if NO_PROJECTCRACKER // proxy for COMPILER +// "member ToString(__) (unitVar1) = String.Concat (base.ToString(),let value: Microsoft.FSharp.Core.int = 999 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ...) @ (59,29--59,57)"; +//#else +// //"member ToString(__) (unitVar1) = String.Concat (base.ToString(),let x: Microsoft.FSharp.Core.int = 999 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ...) @ (59,29--59,57)"; +//#endif + "member TestCallinToString(this) (unitVar1) = this.ToString() @ (60,39--60,54)"; + "type Error"; "let err = {Data0 = 3; Data1 = 4} @ (64,10--64,20)"; + "let matchOnException(err) = match (if err :? M.Error then $0 else $1) targets ... @ (66,33--66,36)"; + "let upwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (69,16--69,17)"; + "let upwardForLoop2(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (74,16--74,17)"; + "let downwardForLoop(unitVar0) = let mutable a: Microsoft.FSharp.Core.int = 1 in (for-loop; a) @ (79,16--79,17)"; + "let quotationTest1(unitVar0) = quote(Operators.op_Addition (1,1)) @ (83,24--83,35)"; + "let quotationTest2(v) = quote(Operators.op_Addition (ExtraTopLevelOperators.SpliceExpression (v),1)) @ (84,24--84,36)"; + "type RecdType"; "type UnionType"; "type ClassWithEventsAndProperties"; + "member .ctor(unitVar0) = (new Object(); (this.ev <- new FSharpEvent`1(()); ())) @ (89,5--89,33)"; + "member .cctor(unitVar) = (sev <- new FSharpEvent`1(()); ()) @ (91,11--91,35)"; + "member get_InstanceProperty(x) (unitVar1) = (x.ev.Trigger(1); 1) @ (92,32--92,48)"; + "member get_StaticProperty(unitVar0) = (sev.Trigger(1); 1) @ (93,35--93,52)"; + "member get_InstanceEvent(x) (unitVar1) = x.ev.get_Publish(()) @ (94,29--94,39)"; + "member get_StaticEvent(x) (unitVar1) = sev.get_Publish(()) @ (95,27--95,38)"; + "let c = new ClassWithEventsAndProperties(()) @ (97,8--97,38)"; + "let v = M.c ().get_InstanceProperty(()) @ (98,8--98,26)"; + "do Console.WriteLine (\"777\")"; + "let functionWithSubmsumption(x) = IntrinsicFunctions.UnboxGeneric (x) @ (102,40--102,52)"; +//#if NO_PROJECTCRACKER // proxy for COMPILER +// "let functionWithCoercion(x) = let arg: Microsoft.FSharp.Core.string = let arg: Microsoft.FSharp.Core.string = IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (arg :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (arg :> Microsoft.FSharp.Core.obj) @ (103,39--103,116)"; +//#else +// "let functionWithCoercion(x) = let x: Microsoft.FSharp.Core.string = let x: Microsoft.FSharp.Core.string = IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj) @ (103,39--103,116)"; +//#endif + "type MultiArgMethods"; + "member .ctor(c,d) = (new Object(); ()) @ (105,5--105,20)"; + "member Method(x) (a,b) = 1 @ (106,37--106,38)"; + "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; + "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (m.Method(7,8),let arg00: Microsoft.FSharp.Core.int = 9 in let arg01: Microsoft.FSharp.Core.int = 10 in let arg10: Microsoft.FSharp.Core.int = 11 in let arg11: Microsoft.FSharp.Core.int = 12 in m.CurriedMethod(arg00,arg01,arg10,arg11)) @ (110,8--110,9)"; +//#if NO_PROJECTCRACKER // proxy for COMPILER +// "let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = let value: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... } @ (114,3--114,55)"; +// "let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = let value: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; +//#else +// "let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = let x: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... } @ (114,3--114,55)"; +// "let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = let x: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; +//#endif + "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (x,y) @ (122,70--122,75)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShapeFIX,TypeVar 0us)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; + "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = DateTime.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = DateTime.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; + "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (x,1) done; x) @ (152,15--152,16)"; + "let testFunctionThatUsesTryWith(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) with matchValue -> match (if matchValue :? System.ArgumentException then $0 else $1) targets ... @ (158,3--160,60)"; + "let testFunctionThatUsesTryFinally(unitVar0) = try M.testFunctionThatUsesWhileLoop (()) finally Console.WriteLine (\"8888\") @ (164,3--167,37)"; + "member Console.WriteTwoLines.Static(unitVar0) = (Console.WriteLine (); Console.WriteLine ()) @ (170,36--170,90)"; + "member DateTime.get_TwoMinute(x) (unitVar1) = Operators.op_Addition (x.get_Minute(),x.get_Minute()) @ (173,25--173,44)"; + "let testFunctionThatUsesExtensionMembers(unitVar0) = (M.Console.WriteTwoLines.Static (()); let v: Microsoft.FSharp.Core.int = DateTime.get_Now ().DateTime.get_TwoMinute(()) in M.Console.WriteTwoLines.Static (())) @ (176,3--178,33)"; + "let testFunctionThatUsesOptionMembers(unitVar0) = let x: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.option = Some(3) in (x.get_IsSome() (),x.get_IsNone() ()) @ (181,7--181,8)"; + "let testFunctionThatUsesOverAppliedFunction(unitVar0) = Operators.Identity Microsoft.FSharp.Core.int> (fun x -> Operators.Identity (x)) 3 @ (185,3--185,10)"; + "let testFunctionThatUsesPatternMatchingOnLists(x) = match (if x.Isop_ColonColon then (if x.Tail.Isop_ColonColon then (if x.Tail.Tail.Isop_Nil then $2 else $3) else $1) else $0) targets ... @ (188,10--188,11)"; + "let testFunctionThatUsesPatternMatchingOnOptions(x) = match (if x.IsSome then $1 else $0) targets ... @ (195,10--195,11)"; + "let testFunctionThatUsesPatternMatchingOnOptions2(x) = match (if x.IsSome then $1 else $0) targets ... @ (200,10--200,11)"; + "let testFunctionThatUsesConditionalOnOptions2(x) = (if x.get_IsSome() () then 1 else 2) @ (205,4--205,29)"; + "let f(x) (y) = Operators.op_Addition (x,y) @ (207,12--207,15)"; + "let g = let x: Microsoft.FSharp.Core.int = 1 in fun y -> M.f (x,y) @ (208,8--208,11)"; + "let h = Operators.op_Addition (M.g () 2,3) @ (209,8--209,17)"; + "type TestFuncProp"; + "member .ctor(unitVar0) = (new Object(); ()) @ (211,5--211,17)"; + "member get_Id(this) (unitVar1) = fun x -> x @ (212,21--212,31)"; + "let wrong = Operators.op_Equality (new TestFuncProp(()).get_Id(()) 0,0) @ (214,12--214,35)"; + "let start(name) = (name,name) @ (217,4--217,14)"; + "let last(name,values) = Operators.Identity ((name,values)) @ (220,4--220,21)"; + "let last2(name) = Operators.Identity (name) @ (223,4--223,11)"; + "let test7(s) = let tupledArg: Microsoft.FSharp.Core.string * Microsoft.FSharp.Core.string = M.start (s) in let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values) @ (226,4--226,19)"; + "let test8(unitVar0) = fun tupledArg -> let name: Microsoft.FSharp.Core.string = tupledArg.Item0 in let values: Microsoft.FSharp.Core.string = tupledArg.Item1 in M.last (name,values) @ (229,4--229,8)"; + "let test9(s) = M.last (s,s) @ (232,4--232,17)"; + "let test10(unitVar0) = fun name -> M.last2 (name) @ (235,4--235,9)"; + "let test11(s) = M.last2 (s) @ (238,4--238,14)"; + "let badLoop = badLoop@240.Force Microsoft.FSharp.Core.int>(()) @ (240,8--240,15)"; + "type LetLambda"; + "let f = fun a -> fun b -> Operators.op_Addition (a,b) @ (247,8--247,24)"; + "let letLambdaRes = ListModule.Map (fun tupledArg -> let a: Microsoft.FSharp.Core.int = tupledArg.Item0 in let b: Microsoft.FSharp.Core.int = tupledArg.Item1 in (LetLambda.f () a) b,Cons((1,2),Empty())) @ (249,19--249,71)"; + ] + + let expected2 = [ + "type N"; "type IntAbbrev"; "let bool2 = False @ (6,12--6,17)"; + "let testHashChar(x) = Operators.op_BitwiseOr (Operators.op_LeftShift (x,16),x) @ (8,28--8,34)"; + "let testHashSByte(x) = Operators.op_ExclusiveOr (Operators.op_LeftShift (x,8),x) @ (9,30--9,36)"; + "let testHashInt16(x) = Operators.op_BitwiseOr (Operators.ToUInt16 (x),Operators.op_LeftShift (x,16)) @ (10,30--10,36)"; + "let testHashInt64(x) = Operators.op_ExclusiveOr (Operators.ToInt32 (x),Operators.ToInt32 (Operators.op_RightShift (x,32))) @ (11,30--11,36)"; + "let testHashUInt64(x) = Operators.op_ExclusiveOr (Operators.ToInt32 (x),Operators.ToInt32 (Operators.op_RightShift (x,32))) @ (12,32--12,38)"; + "let testHashIntPtr(x) = Operators.ToInt32 (Operators.ToUInt64 (x)) @ (13,35--13,41)"; + "let testHashUIntPtr(x) = Operators.op_BitwiseAnd (Operators.ToInt32 (Operators.ToUInt64 (x)),2147483647) @ (14,37--14,43)"; + "let testHashString(x) = (if Operators.op_Equality (x,dflt) then 0 else Operators.Hash (x)) @ (16,32--16,38)"; + "let testTypeOf(x) = Operators.TypeOf<'T> () @ (17,24--17,30)"; + ] + + // printFSharpDecls "" file2.Declarations |> Seq.iter (printfn "%s") + + printDeclarations None (List.ofSeq file1.Declarations) + |> Seq.toList + |> filterHack + |> shouldEqual (filterHack expected) + + printDeclarations None (List.ofSeq file2.Declarations) + |> Seq.toList + |> filterHack + |> shouldEqual (filterHack expected2) + + () + +let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimized = + let basePath = Path.GetTempFileName() + let fileName = Path.ChangeExtension(basePath, ".fs") + let dllName = Path.ChangeExtension(basePath, ".dll") + let projFileName = Path.ChangeExtension(basePath, ".fsproj") + let source = System.String.Format(Project1.operatorTests, dnName, fsName) + let replace (s:string) r = s.Replace("let " + r, "// let " + r) + let fileSource = excludedTests |> List.fold replace source + File.WriteAllText(fileName, fileSource) + + let args = mkProjectCommandLineArgsSilent (dllName, [fileName]) + let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunSynchronously + + for e in wholeProjectResults.Errors do + printfn "%s Operator Tests error: <<<%s>>>" dnName e.Message + + wholeProjectResults.Errors.Length |> shouldEqual 0 + + let fileUnoptimized = wholeProjectResults.AssemblyContents.ImplementationFiles.[0] + let fileOptimized = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0] + + printDeclarations None (List.ofSeq fileUnoptimized.Declarations) + |> Seq.toList |> shouldEqual expectedUnoptimized + + printDeclarations None (List.ofSeq fileOptimized.Declarations) + |> Seq.toList |> shouldEqual expectedOptimized + + () + +[] +let ``Test Operator Declarations for Byte`` () = + let excludedTests = [ + "testByteUnaryNegOperator"; + "testByteUnaryNegChecked"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsByte"; + "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,64--4,72)"; + "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,64--5,73)"; + "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,64--6,72)"; + "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,64--7,73)"; + "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,64--8,72)"; + "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,64--9,73)"; + "let testByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,56--11,64)"; + "let testByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,56--12,64)"; + "let testByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,55--13,64)"; + "let testByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,56--14,64)"; + "let testByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,56--15,64)"; + "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,56--16,66)"; + "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,56--17,66)"; + "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,56--18,66)"; + "let testByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,55--19,65)"; + "let testByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,55--20,65)"; + "let testByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; + "let testByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,53--25,70)"; + "let testByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,53--26,70)"; + "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + "let testByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; + "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + "let testByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; + "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + "let testByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; + "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + "let testByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; + "let testByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; + "let testByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,43--54,53)"; + "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + "let testByteToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; + ] + + let expectedOptimized = [ + "type OperatorTestsByte"; + "let testByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,64--4,72)"; + "let testByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,64--5,73)"; + "let testByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,64--6,72)"; + "let testByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,64--7,73)"; + "let testByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,64--8,72)"; + "let testByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,64--9,73)"; + "let testByteAdditionOperator(e1) (e2) = Operators.ToByte (Operators.op_Addition (e1,e2)) @ (11,56--11,64)"; + "let testByteSubtractionOperator(e1) (e2) = Operators.ToByte (Operators.op_Subtraction (e1,e2)) @ (12,56--12,64)"; + "let testByteMultiplyOperator(e1) (e2) = Operators.ToByte (Operators.op_Multiply (e1,e2)) @ (13,55--13,64)"; + "let testByteDivisionOperator(e1) (e2) = Operators.ToByte (Operators.op_Division (e1,e2)) @ (14,56--14,64)"; + "let testByteModulusOperator(e1) (e2) = Operators.ToByte (Operators.op_Modulus (e1,e2)) @ (15,56--15,64)"; + "let testByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,56--16,66)"; + "let testByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,56--17,66)"; + "let testByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,56--18,66)"; + "let testByteShiftLeftOperator(e1) (e2) = Operators.ToByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,55--19,65)"; + "let testByteShiftRightOperator(e1) (e2) = Operators.ToByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,55--20,65)"; + "let testByteAdditionChecked(e1) (e2) = Checked.ToByte (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; + "let testByteSubtractionChecked(e1) (e2) = Checked.ToByte (Checked.op_Subtraction (e1,e2)) @ (25,53--25,70)"; + "let testByteMultiplyChecked(e1) (e2) = Checked.ToByte (Checked.op_Multiply (e1,e2)) @ (26,53--26,70)"; + "let testByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + "let testByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + "let testByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + "let testByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; + "let testByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + "let testByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + "let testByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + "let testByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + "let testByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + "let testByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + "let testByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; + "let testByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + "let testByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + "let testByteToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; + "let testByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + "let testByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + "let testByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + "let testByteToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; + "let testByteToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; + "let testByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,43--54,53)"; + "let testByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + "let testByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; + ] + + testOperators "Byte" "byte" excludedTests expectedUnoptimized expectedOptimized + + +[] +let ``Test Operator Declarations for SByte`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsSByte"; + "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,76)"; + "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,76)"; + "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,76)"; + "let testSByteAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; "let testSByteSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testSByteMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testSByteDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testSByteModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testSByteShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,57--19,67)"; + "let testSByteShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,57--20,67)"; + "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testSByteAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testSByteSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testSByteMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testSByteUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testSByteToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testSByteToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testSByteToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testSByteToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testSByteToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testSByteToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + ] + + let expectedOptimized = [ + "type OperatorTestsSByte"; + "let testSByteEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testSByteNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,76)"; + "let testSByteLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testSByteLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,76)"; + "let testSByteGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testSByteGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,76)"; + "let testSByteAdditionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Addition (e1,e2)) @ (11,59--11,67)"; + "let testSByteSubtractionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Subtraction (e1,e2)) @ (12,59--12,67)"; + "let testSByteMultiplyOperator(e1) (e2) = Operators.ToSByte (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; + "let testSByteDivisionOperator(e1) (e2) = Operators.ToSByte (Operators.op_Division (e1,e2)) @ (14,59--14,67)"; + "let testSByteModulusOperator(e1) (e2) = Operators.ToSByte (Operators.op_Modulus (e1,e2)) @ (15,59--15,67)"; + "let testSByteBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testSByteBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testSByteBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testSByteShiftLeftOperator(e1) (e2) = Operators.ToSByte (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (19,57--19,67)"; + "let testSByteShiftRightOperator(e1) (e2) = Operators.ToSByte (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,7))) @ (20,57--20,67)"; + "let testSByteUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testSByteAdditionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; + "let testSByteSubtractionChecked(e1) (e2) = Checked.ToSByte (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; + "let testSByteMultiplyChecked(e1) (e2) = Checked.ToSByte (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; + "let testSByteUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + "let testSByteToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testSByteToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testSByteToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testSByteToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + "let testSByteToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testSByteToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testSByteToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testSByteToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testSByteToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testSByteToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testSByteToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testSByteToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + "let testSByteToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testSByteToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testSByteToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testSByteToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + "let testSByteToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testSByteToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + "let testSByteToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testSByteToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testSByteToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + "let testSByteToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testSByteToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; + ] + + testOperators "SByte" "sbyte" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Int16`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsInt16"; + "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,76)"; + "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,76)"; + "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,76)"; + "let testInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; + "let testInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,57--19,67)"; + "let testInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,57--20,67)"; + "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testInt16UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + ] + + let expectedOptimized = [ + "type OperatorTestsInt16"; + "let testInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,76)"; + "let testInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,76)"; + "let testInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,76)"; + "let testInt16AdditionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Addition (e1,e2)) @ (11,59--11,67)"; + "let testInt16SubtractionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Subtraction (e1,e2)) @ (12,59--12,67)"; + "let testInt16MultiplyOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Multiply (e1,e2)) @ (13,58--13,67)"; + "let testInt16DivisionOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Division (e1,e2)) @ (14,59--14,67)"; + "let testInt16ModulusOperator(e1) (e2) = Operators.ToInt16 (Operators.op_Modulus (e1,e2)) @ (15,59--15,67)"; + "let testInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt16ShiftLeftOperator(e1) (e2) = Operators.ToInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,57--19,67)"; + "let testInt16ShiftRightOperator(e1) (e2) = Operators.ToInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,57--20,67)"; + "let testInt16UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt16AdditionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Addition (e1,e2)) @ (24,56--24,73)"; + "let testInt16SubtractionChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Subtraction (e1,e2)) @ (25,56--25,73)"; + "let testInt16MultiplyChecked(e1) (e2) = Checked.ToInt16 (Checked.op_Multiply (e1,e2)) @ (26,56--26,73)"; + "let testInt16UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + "let testInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt16ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + "let testInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt16ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + "let testInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; + ] + + testOperators "Int16" "int16" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for UInt16`` () = + let excludedTests = [ + "testUInt16UnaryNegOperator"; + "testUInt16UnaryNegChecked"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsUInt16"; + "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,70--5,79)"; + "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,70--7,79)"; + "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,70--9,79)"; + "let testUInt16AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testUInt16SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,62--12,70)"; + "let testUInt16MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + "let testUInt16DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,62--14,70)"; + "let testUInt16ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,62--15,70)"; + "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,59--19,69)"; + "let testUInt16ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,59--20,69)"; + "let testUInt16AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testUInt16SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + "let testUInt16MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt16ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt16ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt16ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testUInt16ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + "let testUInt16ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt16ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + ] + + let expectedOptimized = [ + "type OperatorTestsUInt16"; + "let testUInt16EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt16NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,70--5,79)"; + "let testUInt16LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt16LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,70--7,79)"; + "let testUInt16GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt16GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,70--9,79)"; + "let testUInt16AdditionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Addition (e1,e2)) @ (11,62--11,70)"; + "let testUInt16SubtractionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Subtraction (e1,e2)) @ (12,62--12,70)"; + "let testUInt16MultiplyOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Multiply (e1,e2)) @ (13,61--13,70)"; + "let testUInt16DivisionOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Division (e1,e2)) @ (14,62--14,70)"; + "let testUInt16ModulusOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_Modulus (e1,e2)) @ (15,62--15,70)"; + "let testUInt16BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt16BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt16BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt16ShiftLeftOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (19,59--19,69)"; + "let testUInt16ShiftRightOperator(e1) (e2) = Operators.ToUInt16 (Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,15))) @ (20,59--20,69)"; + "let testUInt16AdditionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Addition (e1,e2)) @ (24,59--24,76)"; + "let testUInt16SubtractionChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Subtraction (e1,e2)) @ (25,59--25,76)"; + "let testUInt16MultiplyChecked(e1) (e2) = Checked.ToUInt16 (Checked.op_Multiply (e1,e2)) @ (26,59--26,76)"; + "let testUInt16ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt16ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt16ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt16ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt16ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt16ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt16ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt16ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; + "let testUInt16ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testUInt16ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + "let testUInt16ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt16ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt16ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; + ] + + testOperators "UInt16" "uint16" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Int`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsInt"; + "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,61--4,69)"; + "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,61--5,70)"; + "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,61--6,69)"; + "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,61--7,70)"; + "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,61--8,69)"; + "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,61--9,70)"; + "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,53--11,61)"; + "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,53--12,61)"; + "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; + "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,53--14,61)"; + "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,53--15,61)"; + "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,53--16,63)"; + "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,53--17,63)"; + "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,53--18,63)"; + "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,53--19,63)"; + "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,53--20,63)"; + "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,42--22,48)"; + "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; + "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; + "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; + "let testIntUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,41--27,56)"; + "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; + "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; + "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; + "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; + "let testIntToIntChecked(e1) = Checked.ToInt (e1) @ (33,41--33,55)"; + "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; + "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; + "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; + "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; + "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; + "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; + "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; + "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; + "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; + "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; + "let testIntToIntOperator(e1) = Operators.ToInt (e1) @ (45,41--45,47)"; + "let testIntToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,41--46,49)"; + "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; + "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; + "let testIntToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,41--49,50)"; + "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; + "let testIntToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,41--51,54)"; + "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; + "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; + "let testIntToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,41--54,51)"; + "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; + "let testIntToStringOperator(e1) = Operators.ToString (e1) @ (56,41--56,50)"; + ] + + let expectedOptimized = [ + "type OperatorTestsInt"; + "let testIntEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,61--4,69)"; + "let testIntNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,61--5,70)"; + "let testIntLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,61--6,69)"; + "let testIntLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,61--7,70)"; + "let testIntGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,61--8,69)"; + "let testIntGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,61--9,70)"; + "let testIntAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,53--11,61)"; + "let testIntSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,53--12,61)"; + "let testIntMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,52--13,61)"; + "let testIntDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,53--14,61)"; + "let testIntModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,53--15,61)"; + "let testIntBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,53--16,63)"; + "let testIntBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,53--17,63)"; + "let testIntBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,53--18,63)"; + "let testIntShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,53--19,63)"; + "let testIntShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,53--20,63)"; + "let testIntUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,42--22,48)"; + "let testIntAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,50--24,67)"; + "let testIntSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,50--25,67)"; + "let testIntMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,50--26,67)"; + "let testIntUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,41--27,56)"; + "let testIntToByteChecked(e1) = Checked.ToByte (e1) @ (29,41--29,56)"; + "let testIntToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,41--30,57)"; + "let testIntToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,41--31,57)"; + "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,41--32,58)"; + "let testIntToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,41--33,55)"; + "let testIntToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,41--34,57)"; + "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,41--35,58)"; + "let testIntToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,41--36,57)"; + "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,41--37,58)"; + "let testIntToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,41--38,61)"; + "let testIntToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,41--39,62)"; + "let testIntToByteOperator(e1) = Operators.ToByte (e1) @ (41,41--41,48)"; + "let testIntToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,41--42,49)"; + "let testIntToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,41--43,49)"; + "let testIntToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,41--44,50)"; + "let testIntToIntOperator(e1) = e1 @ (45,45--45,47)"; + "let testIntToInt32Operator(e1) = e1 @ (46,47--46,49)"; + "let testIntToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,41--47,50)"; + "let testIntToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,41--48,49)"; + "let testIntToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,41--49,50)"; + "let testIntToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,41--50,53)"; + "let testIntToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,41--51,54)"; + "let testIntToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,41--52,51)"; + "let testIntToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,41--53,49)"; + "let testIntToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,41--54,51)"; + "let testIntToCharOperator(e1) = Operators.ToChar (e1) @ (55,41--55,48)"; + "let testIntToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,41--56,50)"; + ] + + testOperators "Int" "int" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Int32`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsInt32"; + "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,76)"; + "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,76)"; + "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,76)"; + "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; + "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,57--19,67)"; + "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,57--20,67)"; + "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testInt32UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + "let testInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + ] + + let expectedOptimized = [ + "type OperatorTestsInt32"; + "let testInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,76)"; + "let testInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,76)"; + "let testInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,76)"; + "let testInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; + "let testInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,57--19,67)"; + "let testInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,57--20,67)"; + "let testInt32UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testInt32UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + "let testInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt32ToIntOperator(e1) = e1 @ (45,49--45,51)"; + "let testInt32ToInt32Operator(e1) = e1 @ (46,51--46,53)"; + "let testInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt32ToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,45--49,54)"; + "let testInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt32ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + "let testInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; + ] + + testOperators "Int32" "int32" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for UInt32`` () = + let excludedTests = [ + "testUInt32UnaryNegOperator"; + "testUInt32UnaryNegChecked"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsUInt32"; + "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,70--5,79)"; + "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,70--7,79)"; + "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,70--9,79)"; + "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,62--12,70)"; + "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,62--14,70)"; + "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,62--15,70)"; + "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,59--19,69)"; + "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,59--20,69)"; + "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt32ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt32ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt32ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testUInt32ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + "let testUInt32ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt32ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + ] + + let expectedOptimized = [ + "type OperatorTestsUInt32"; + "let testUInt32EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt32NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,70--5,79)"; + "let testUInt32LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt32LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,70--7,79)"; + "let testUInt32GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt32GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,70--9,79)"; + "let testUInt32AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testUInt32SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,62--12,70)"; + "let testUInt32MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + "let testUInt32DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,62--14,70)"; + "let testUInt32ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,62--15,70)"; + "let testUInt32BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt32BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt32BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt32ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (19,59--19,69)"; + "let testUInt32ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,31)) @ (20,59--20,69)"; + "let testUInt32AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testUInt32SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + "let testUInt32MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + "let testUInt32ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt32ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt32ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt32ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt32ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt32ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt32ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt32ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,47--48,55)"; + "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testUInt32ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + "let testUInt32ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt32ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + "let testUInt32ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + "let testUInt32ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt32ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt32ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; + ] + + testOperators "UInt32" "uint32" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Int64`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsInt64"; + "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,67--5,76)"; + "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,67--7,76)"; + "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,67--9,76)"; + "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; + "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,57--19,67)"; + "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,57--20,67)"; + "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testInt64UnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,45--27,60)"; + "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,45--33,59)"; + "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,45--45,51)"; + "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,45--51,58)"; + "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,45--56,54)"; + ] + + let expectedOptimized = [ + "type OperatorTestsInt64"; + "let testInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,67--4,75)"; + "let testInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,67--5,76)"; + "let testInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,67--6,75)"; + "let testInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,67--7,76)"; + "let testInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,67--8,75)"; + "let testInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,67--9,76)"; + "let testInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,59--11,67)"; + "let testInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,59--12,67)"; + "let testInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,58--13,67)"; + "let testInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,59--14,67)"; + "let testInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,59--15,67)"; + "let testInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,59--16,69)"; + "let testInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,59--17,69)"; + "let testInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,59--18,69)"; + "let testInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,57--19,67)"; + "let testInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,57--20,67)"; + "let testInt64UnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,46--22,52)"; + "let testInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,56--24,73)"; + "let testInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,56--25,73)"; + "let testInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,56--26,73)"; + "let testInt64UnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,45--27,60)"; + "let testInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,45--29,60)"; + "let testInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,45--30,61)"; + "let testInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,45--31,61)"; + "let testInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,45--32,62)"; + "let testInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,45--33,59)"; + "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,45--34,61)"; + "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,45--35,62)"; + "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,45--36,61)"; + "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,45--37,62)"; + "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,45--38,65)"; + "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,45--39,66)"; + "let testInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,45--41,52)"; + "let testInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,45--42,53)"; + "let testInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,45--43,53)"; + "let testInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,45--44,54)"; + "let testInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,45--45,51)"; + "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,45--46,53)"; + "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,45--47,54)"; + "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,45--48,53)"; + "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,45--49,54)"; + "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,45--50,57)"; + "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (51,45--51,58)"; + "let testInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,45--52,55)"; + "let testInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,45--53,53)"; + "let testInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,45--54,55)"; + "let testInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,45--55,52)"; + "let testInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,45--56,54)"; + ] + + testOperators "Int64" "int64" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for UInt64`` () = + let excludedTests = [ + "testUInt64UnaryNegOperator"; + "testUInt64UnaryNegChecked"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsUInt64"; + "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,70--5,79)"; + "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,70--7,79)"; + "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,70--9,79)"; + "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,62--12,70)"; + "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,62--14,70)"; + "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,62--15,70)"; + "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,59--19,69)"; + "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,59--20,69)"; + "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt64ToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt64ToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + "let testUInt64ToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testUInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,47--50,59)"; + "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + "let testUInt64ToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt64ToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + ] + + let expectedOptimized = [ + "type OperatorTestsUInt64"; + "let testUInt64EqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testUInt64NotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,70--5,79)"; + "let testUInt64LessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testUInt64LessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,70--7,79)"; + "let testUInt64GreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testUInt64GreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,70--9,79)"; + "let testUInt64AdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testUInt64SubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,62--12,70)"; + "let testUInt64MultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,61--13,70)"; + "let testUInt64DivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,62--14,70)"; + "let testUInt64ModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,62--15,70)"; + "let testUInt64BitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,62--16,72)"; + "let testUInt64BitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,62--17,72)"; + "let testUInt64BitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,62--18,72)"; + "let testUInt64ShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (19,59--19,69)"; + "let testUInt64ShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,Operators.op_BitwiseAnd (e2,63)) @ (20,59--20,69)"; + "let testUInt64AdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testUInt64SubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,59--25,76)"; + "let testUInt64MultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,59--26,76)"; + "let testUInt64ToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testUInt64ToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testUInt64ToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testUInt64ToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testUInt64ToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,47--33,61)"; + "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,47--38,67)"; + "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,47--39,68)"; + "let testUInt64ToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testUInt64ToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testUInt64ToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testUInt64ToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testUInt64ToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,47--45,53)"; + "let testUInt64ToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testUInt64ToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testUInt64ToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + "let testUInt64ToUInt64Operator(e1) = e1 @ (49,54--49,56)"; + "let testUInt64ToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,47--50,59)"; + "let testUInt64ToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,47--51,60)"; + "let testUInt64ToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,47--52,57)"; + "let testUInt64ToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,47--53,55)"; + "let testUInt64ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)"; + "let testUInt64ToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testUInt64ToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; + ] + + testOperators "UInt64" "uint64" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for IntPtr`` () = + let excludedTests = [ ] + + let expectedUnoptimized = [ + "type OperatorTestsIntPtr"; + "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,76--4,84)"; + "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,76--5,85)"; + "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,76--6,84)"; + "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,76--7,85)"; + "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,76--8,84)"; + "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,76--9,85)"; + "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,68--11,76)"; + "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,68--12,76)"; + "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; + "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,68--14,76)"; + "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,68--15,76)"; + "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,68--16,78)"; + "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,68--17,78)"; + "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,68--18,78)"; + "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,62--19,72)"; + "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,62--20,72)"; + "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,51--22,57)"; + "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; + "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; + "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; + "let testIntPtrUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,50--27,65)"; + "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; + "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; + "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; + "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; + "let testIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,50--33,64)"; + "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; + "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; + "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; + "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; + "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; + "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; + "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; + "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; + "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; + "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; + "let testIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,50--45,56)"; + "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; + "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; + "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; + "let testIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,50--49,59)"; + "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; + "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; + "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; + "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; + "let testIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,50--54,60)"; + "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; + "let testIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,50--56,59)"; + ] + + let expectedOptimized = [ + "type OperatorTestsIntPtr"; + "let testIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,76--4,84)"; + "let testIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,76--5,85)"; + "let testIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,76--6,84)"; + "let testIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,76--7,85)"; + "let testIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,76--8,84)"; + "let testIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,76--9,85)"; + "let testIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,68--11,76)"; + "let testIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,68--12,76)"; + "let testIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,67--13,76)"; + "let testIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,68--14,76)"; + "let testIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,68--15,76)"; + "let testIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,68--16,78)"; + "let testIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,68--17,78)"; + "let testIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,68--18,78)"; + "let testIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,62--19,72)"; + "let testIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,62--20,72)"; + "let testIntPtrUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,51--22,57)"; + "let testIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,65--24,82)"; + "let testIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,65--25,82)"; + "let testIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,65--26,82)"; + "let testIntPtrUnaryNegChecked(e1) = Checked.op_Subtraction (0,e1) @ (27,50--27,65)"; + "let testIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,50--29,65)"; + "let testIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,50--30,66)"; + "let testIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,50--31,66)"; + "let testIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,50--32,67)"; + "let testIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,50--33,64)"; + "let testIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,50--34,66)"; + "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,50--35,67)"; + "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,50--36,66)"; + "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,50--37,67)"; + "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,50--38,70)"; + "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,50--39,71)"; + "let testIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,50--41,57)"; + "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,50--42,58)"; + "let testIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,50--43,58)"; + "let testIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,50--44,59)"; + "let testIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,50--45,56)"; + "let testIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,50--46,58)"; + "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,50--47,59)"; + "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,50--48,58)"; + "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (e1) @ (49,50--49,59)"; + "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,50--50,62)"; + "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,50--51,63)"; + "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,50--52,60)"; + "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,50--53,58)"; + "let testIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToInt64 (e1)) @ (54,50--54,60)"; + "let testIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,50--55,57)"; + "let testIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,50--56,59)"; + ] + + testOperators "IntPtr" "nativeint" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for UIntPtr`` () = + let excludedTests = [ + "testUIntPtrUnaryNegOperator"; + "testUIntPtrUnaryNegChecked"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsUIntPtr"; + "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,79--4,87)"; + "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,79--5,88)"; + "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,79--6,87)"; + "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,79--7,88)"; + "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,79--8,87)"; + "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,79--9,88)"; + "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,71--11,79)"; + "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,71--12,79)"; + "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; + "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,71--14,79)"; + "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,71--15,79)"; + "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,71--16,81)"; + "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,71--17,81)"; + "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,71--18,81)"; + "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,64--19,74)"; + "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,64--20,74)"; + "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; + "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; + "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; + "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; + "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; + "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; + "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; + "let testUIntPtrToIntChecked(e1) = Checked.ToInt (e1) @ (33,52--33,66)"; + "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; + "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; + "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; + "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; + "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; + "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; + "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; + "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; + "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; + "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; + "let testUIntPtrToIntOperator(e1) = Operators.ToInt (e1) @ (45,52--45,58)"; + "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; + "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; + "let testUIntPtrToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,52--48,60)"; + "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; + "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; + "let testUIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,52--51,65)"; + "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,52--52,62)"; + "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,52--53,60)"; + "let testUIntPtrToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,52--54,62)"; + "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; + "let testUIntPtrToStringOperator(e1) = Operators.ToString (e1) @ (56,52--56,61)"; + ] + + let expectedOptimized = [ + "type OperatorTestsUIntPtr"; + "let testUIntPtrEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,79--4,87)"; + "let testUIntPtrNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,79--5,88)"; + "let testUIntPtrLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,79--6,87)"; + "let testUIntPtrLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,79--7,88)"; + "let testUIntPtrGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,79--8,87)"; + "let testUIntPtrGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,79--9,88)"; + "let testUIntPtrAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,71--11,79)"; + "let testUIntPtrSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,71--12,79)"; + "let testUIntPtrMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,70--13,79)"; + "let testUIntPtrDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,71--14,79)"; + "let testUIntPtrModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,71--15,79)"; + "let testUIntPtrBitwiseAndOperator(e1) (e2) = Operators.op_BitwiseAnd (e1,e2) @ (16,71--16,81)"; + "let testUIntPtrBitwiseOrOperator(e1) (e2) = Operators.op_BitwiseOr (e1,e2) @ (17,71--17,81)"; + "let testUIntPtrBitwiseXorOperator(e1) (e2) = Operators.op_ExclusiveOr (e1,e2) @ (18,71--18,81)"; + "let testUIntPtrShiftLeftOperator(e1) (e2) = Operators.op_LeftShift (e1,e2) @ (19,64--19,74)"; + "let testUIntPtrShiftRightOperator(e1) (e2) = Operators.op_RightShift (e1,e2) @ (20,64--20,74)"; + "let testUIntPtrAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,68--24,85)"; + "let testUIntPtrSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,68--25,85)"; + "let testUIntPtrMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,68--26,85)"; + "let testUIntPtrToByteChecked(e1) = Checked.ToByte (e1) @ (29,52--29,67)"; + "let testUIntPtrToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,52--30,68)"; + "let testUIntPtrToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,52--31,68)"; + "let testUIntPtrToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,52--32,69)"; + "let testUIntPtrToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,52--33,66)"; + "let testUIntPtrToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,52--34,68)"; + "let testUIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,52--35,69)"; + "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,52--36,68)"; + "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,52--37,69)"; + "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,52--38,72)"; + "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,52--39,73)"; + "let testUIntPtrToByteOperator(e1) = Operators.ToByte (e1) @ (41,52--41,59)"; + "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,52--42,60)"; + "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,52--43,60)"; + "let testUIntPtrToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,52--44,61)"; + "let testUIntPtrToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,52--45,58)"; + "let testUIntPtrToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,52--46,60)"; + "let testUIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,52--47,61)"; + "let testUIntPtrToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,52--48,60)"; + "let testUIntPtrToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,52--49,61)"; + "let testUIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,52--50,64)"; + "let testUIntPtrToUIntPtrOperator(e1) = e1 @ (51,63--51,65)"; + "let testUIntPtrToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,52--52,62)"; + "let testUIntPtrToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,52--53,60)"; + "let testUIntPtrToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToUInt64 (e1)) @ (54,52--54,62)"; + "let testUIntPtrToCharOperator(e1) = Operators.ToChar (e1) @ (55,52--55,59)"; + "let testUIntPtrToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,52--56,61)"; + ] + + testOperators "UIntPtr" "unativeint" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Single`` () = + let excludedTests = [ + "testSingleBitwiseAndOperator"; + "testSingleBitwiseOrOperator"; + "testSingleBitwiseXorOperator"; + "testSingleShiftLeftOperator"; + "testSingleShiftRightOperator"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsSingle"; + "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,72--4,80)"; + "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,72--5,81)"; + "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,72--6,80)"; + "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,72--7,81)"; + "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,72--8,80)"; + "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,72--9,81)"; + "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,64--11,72)"; + "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,64--12,72)"; + "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; + "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,64--14,72)"; + "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,64--15,72)"; + "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,49--22,55)"; + "let testSingleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,61--24,78)"; + "let testSingleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,61--25,78)"; + "let testSingleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,61--26,78)"; + "let testSingleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,48--27,63)"; + "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; + "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; + "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; + "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; + "let testSingleToIntChecked(e1) = Checked.ToInt (e1) @ (33,48--33,62)"; + "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; + "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; + "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; + "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; + "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; + "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; + "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; + "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; + "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; + "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; + "let testSingleToIntOperator(e1) = Operators.ToInt (e1) @ (45,48--45,54)"; + "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; + "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; + "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; + "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; + "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; + "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; + "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; + "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; + "let testSingleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,48--54,58)"; + "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; + "let testSingleToStringOperator(e1) = Operators.ToString (e1) @ (56,48--56,57)"; + ] + + let expectedOptimized = [ + "type OperatorTestsSingle"; + "let testSingleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,72--4,80)"; + "let testSingleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,72--5,81)"; + "let testSingleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,72--6,80)"; + "let testSingleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,72--7,81)"; + "let testSingleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,72--8,80)"; + "let testSingleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,72--9,81)"; + "let testSingleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,64--11,72)"; + "let testSingleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,64--12,72)"; + "let testSingleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,63--13,72)"; + "let testSingleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,64--14,72)"; + "let testSingleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,64--15,72)"; + "let testSingleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,49--22,55)"; + "let testSingleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,61--24,78)"; + "let testSingleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,61--25,78)"; + "let testSingleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,61--26,78)"; + "let testSingleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,48--27,63)"; + "let testSingleToByteChecked(e1) = Checked.ToByte (e1) @ (29,48--29,63)"; + "let testSingleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,48--30,64)"; + "let testSingleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,48--31,64)"; + "let testSingleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,48--32,65)"; + "let testSingleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,48--33,62)"; + "let testSingleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,48--34,64)"; + "let testSingleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,48--35,65)"; + "let testSingleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,48--36,64)"; + "let testSingleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,48--37,65)"; + "let testSingleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,48--38,68)"; + "let testSingleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,48--39,69)"; + "let testSingleToByteOperator(e1) = Operators.ToByte (e1) @ (41,48--41,55)"; + "let testSingleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,48--42,56)"; + "let testSingleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,48--43,56)"; + "let testSingleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,48--44,57)"; + "let testSingleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,48--45,54)"; + "let testSingleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,48--46,56)"; + "let testSingleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,48--47,57)"; + "let testSingleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,48--48,56)"; + "let testSingleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,48--49,57)"; + "let testSingleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,48--50,60)"; + "let testSingleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,48--51,61)"; + "let testSingleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,48--52,58)"; + "let testSingleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,48--53,56)"; + "let testSingleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,48--54,58)"; + "let testSingleToCharOperator(e1) = Operators.ToChar (e1) @ (55,48--55,55)"; + "let testSingleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,48--56,57)"; + ] + + testOperators "Single" "float32" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Double`` () = + let excludedTests = [ + "testDoubleBitwiseAndOperator"; + "testDoubleBitwiseOrOperator"; + "testDoubleBitwiseXorOperator"; + "testDoubleShiftLeftOperator"; + "testDoubleShiftRightOperator"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsDouble"; + "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,68--4,76)"; + "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,68--5,77)"; + "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,68--6,76)"; + "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,68--7,77)"; + "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,68--8,76)"; + "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,68--9,77)"; + "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,60--11,68)"; + "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,60--12,68)"; + "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; + "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,60--14,68)"; + "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,60--15,68)"; + "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,47--22,53)"; + "let testDoubleAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,57--24,74)"; + "let testDoubleSubtractionChecked(e1) (e2) = Checked.op_Subtraction (e1,e2) @ (25,57--25,74)"; + "let testDoubleMultiplyChecked(e1) (e2) = Checked.op_Multiply (e1,e2) @ (26,57--26,74)"; + "let testDoubleUnaryNegChecked(e1) = Checked.op_UnaryNegation (e1) @ (27,46--27,61)"; + "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; + "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; + "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; + "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; + "let testDoubleToIntChecked(e1) = Checked.ToInt (e1) @ (33,46--33,60)"; + "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; + "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; + "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; + "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; + "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; + "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; + "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; + "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; + "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; + "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; + "let testDoubleToIntOperator(e1) = Operators.ToInt (e1) @ (45,46--45,52)"; + "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; + "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; + "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; + "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; + "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; + "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; + "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; + "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; + "let testDoubleToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,46--54,56)"; + "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; + "let testDoubleToStringOperator(e1) = Operators.ToString (e1) @ (56,46--56,55)"; + ] + + let expectedOptimized = [ + "type OperatorTestsDouble"; + "let testDoubleEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,68--4,76)"; + "let testDoubleNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,68--5,77)"; + "let testDoubleLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,68--6,76)"; + "let testDoubleLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,68--7,77)"; + "let testDoubleGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,68--8,76)"; + "let testDoubleGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,68--9,77)"; + "let testDoubleAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,60--11,68)"; + "let testDoubleSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,60--12,68)"; + "let testDoubleMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,59--13,68)"; + "let testDoubleDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,60--14,68)"; + "let testDoubleModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,60--15,68)"; + "let testDoubleUnaryNegOperator(e1) = Operators.op_UnaryNegation (e1) @ (22,47--22,53)"; + "let testDoubleAdditionChecked(e1) (e2) = Operators.op_Addition (e1,e2) @ (24,57--24,74)"; + "let testDoubleSubtractionChecked(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (25,57--25,74)"; + "let testDoubleMultiplyChecked(e1) (e2) = Operators.op_Multiply (e1,e2) @ (26,57--26,74)"; + "let testDoubleUnaryNegChecked(e1) = Operators.op_UnaryNegation (e1) @ (27,46--27,61)"; + "let testDoubleToByteChecked(e1) = Checked.ToByte (e1) @ (29,46--29,61)"; + "let testDoubleToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,46--30,62)"; + "let testDoubleToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,46--31,62)"; + "let testDoubleToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,46--32,63)"; + "let testDoubleToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,46--33,60)"; + "let testDoubleToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,46--34,62)"; + "let testDoubleToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,46--35,63)"; + "let testDoubleToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,46--36,62)"; + "let testDoubleToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,46--37,63)"; + "let testDoubleToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,46--38,66)"; + "let testDoubleToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,46--39,67)"; + "let testDoubleToByteOperator(e1) = Operators.ToByte (e1) @ (41,46--41,53)"; + "let testDoubleToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,46--42,54)"; + "let testDoubleToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,46--43,54)"; + "let testDoubleToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,46--44,55)"; + "let testDoubleToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,46--45,52)"; + "let testDoubleToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,46--46,54)"; + "let testDoubleToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,46--47,55)"; + "let testDoubleToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,46--48,54)"; + "let testDoubleToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,46--49,55)"; + "let testDoubleToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,46--50,58)"; + "let testDoubleToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,46--51,59)"; + "let testDoubleToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,46--52,56)"; + "let testDoubleToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,46--53,54)"; + "let testDoubleToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,46--54,56)"; + "let testDoubleToCharOperator(e1) = Operators.ToChar (e1) @ (55,46--55,53)"; + "let testDoubleToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,46--56,55)"; + ] + + testOperators "Double" "float" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Decimal`` () = + let excludedTests = [ + "testDecimalBitwiseAndOperator"; + "testDecimalBitwiseOrOperator"; + "testDecimalBitwiseXorOperator"; + "testDecimalShiftLeftOperator"; + "testDecimalShiftRightOperator"; + "testDecimalUnaryNegOperator"; + "testDecimalSubtractionChecked"; + "testDecimalMultiplyChecked"; + "testDecimalUnaryNegChecked"; + "testDecimalToIntPtrChecked"; + "testDecimalToUIntPtrChecked"; + "testDecimalToIntPtrOperator"; + "testDecimalToUIntPtrOperator"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsDecimal"; + "let testDecimalEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,73--4,81)"; + "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,73--5,82)"; + "let testDecimalLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,73--6,81)"; + "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,73--7,82)"; + "let testDecimalGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,73--8,81)"; + "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,73--9,82)"; + "let testDecimalAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,65--11,73)"; + "let testDecimalSubtractionOperator(e1) (e2) = Operators.op_Subtraction (e1,e2) @ (12,65--12,73)"; + "let testDecimalMultiplyOperator(e1) (e2) = Operators.op_Multiply (e1,e2) @ (13,64--13,73)"; + "let testDecimalDivisionOperator(e1) (e2) = Operators.op_Division (e1,e2) @ (14,65--14,73)"; + "let testDecimalModulusOperator(e1) (e2) = Operators.op_Modulus (e1,e2) @ (15,65--15,73)"; + "let testDecimalAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,62--24,79)"; + "let testDecimalToByteChecked(e1) = Checked.ToByte (e1) @ (29,49--29,64)"; + "let testDecimalToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,49--30,65)"; + "let testDecimalToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,49--31,65)"; + "let testDecimalToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,49--32,66)"; + "let testDecimalToIntChecked(e1) = Checked.ToInt (e1) @ (33,49--33,63)"; + "let testDecimalToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,49--34,65)"; + "let testDecimalToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,49--35,66)"; + "let testDecimalToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,49--36,65)"; + "let testDecimalToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,49--37,66)"; + "let testDecimalToByteOperator(e1) = Operators.ToByte (e1) @ (41,49--41,56)"; + "let testDecimalToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,49--42,57)"; + "let testDecimalToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,49--43,57)"; + "let testDecimalToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,49--44,58)"; + "let testDecimalToIntOperator(e1) = Operators.ToInt (e1) @ (45,49--45,55)"; + "let testDecimalToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,49--46,57)"; + "let testDecimalToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,49--47,58)"; + "let testDecimalToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,49--48,57)"; + "let testDecimalToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,49--49,58)"; + "let testDecimalToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,49--52,59)"; + "let testDecimalToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,49--53,57)"; + "let testDecimalToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,49--54,59)"; + "let testDecimalToCharOperator(e1) = Operators.ToChar (e1) @ (55,49--55,56)"; + "let testDecimalToStringOperator(e1) = Operators.ToString (e1) @ (56,49--56,58)"; + ] + + let expectedOptimized = [ + "type OperatorTestsDecimal"; + "let testDecimalEqualsOperator(e1) (e2) = Decimal.op_Equality (e1,e2) @ (4,73--4,81)"; + "let testDecimalNotEqualsOperator(e1) (e2) = Operators.op_Equality (Decimal.op_Equality (e1,e2),False) @ (5,73--5,82)"; + "let testDecimalLessThanOperator(e1) (e2) = Decimal.op_LessThan (e1,e2) @ (6,73--6,81)"; + "let testDecimalLessThanOrEqualsOperator(e1) (e2) = Decimal.op_LessThanOrEqual (e1,e2) @ (7,73--7,82)"; + "let testDecimalGreaterThanOperator(e1) (e2) = Decimal.op_GreaterThan (e1,e2) @ (8,73--8,81)"; + "let testDecimalGreaterThanOrEqualsOperator(e1) (e2) = Decimal.op_GreaterThanOrEqual (e1,e2) @ (9,73--9,82)"; + "let testDecimalAdditionOperator(e1) (e2) = Decimal.op_Addition (e1,e2) @ (11,65--11,73)"; + "let testDecimalSubtractionOperator(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (12,65--12,73)"; + "let testDecimalMultiplyOperator(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (13,64--13,73)"; + "let testDecimalDivisionOperator(e1) (e2) = Decimal.op_Division (e1,e2) @ (14,65--14,73)"; + "let testDecimalModulusOperator(e1) (e2) = Decimal.op_Modulus (e1,e2) @ (15,65--15,73)"; + "let testDecimalAdditionChecked(e1) (e2) = Decimal.op_Addition (e1,e2) @ (24,62--24,79)"; + "let testDecimalToByteChecked(e1) = Decimal.op_Explicit (e1) @ (29,49--29,64)"; + "let testDecimalToSByteChecked(e1) = Decimal.op_Explicit (e1) @ (30,49--30,65)"; + "let testDecimalToInt16Checked(e1) = Decimal.op_Explicit (e1) @ (31,49--31,65)"; + "let testDecimalToUInt16Checked(e1) = Decimal.op_Explicit (e1) @ (32,49--32,66)"; + "let testDecimalToIntChecked(e1) = Decimal.op_Explicit (e1) @ (33,49--33,63)"; + "let testDecimalToInt32Checked(e1) = Decimal.op_Explicit (e1) @ (34,49--34,65)"; + "let testDecimalToUInt32Checked(e1) = Decimal.op_Explicit (e1) @ (35,49--35,66)"; + "let testDecimalToInt64Checked(e1) = Decimal.op_Explicit (e1) @ (36,49--36,65)"; + "let testDecimalToUInt64Checked(e1) = Decimal.op_Explicit (e1) @ (37,49--37,66)"; + "let testDecimalToByteOperator(e1) = Decimal.op_Explicit (e1) @ (41,49--41,56)"; + "let testDecimalToSByteOperator(e1) = Decimal.op_Explicit (e1) @ (42,49--42,57)"; + "let testDecimalToInt16Operator(e1) = Decimal.op_Explicit (e1) @ (43,49--43,57)"; + "let testDecimalToUInt16Operator(e1) = Decimal.op_Explicit (e1) @ (44,49--44,58)"; + "let testDecimalToIntOperator(e1) = Decimal.op_Explicit (e1) @ (45,49--45,55)"; + "let testDecimalToInt32Operator(e1) = Decimal.op_Explicit (e1) @ (46,49--46,57)"; + "let testDecimalToUInt32Operator(e1) = Decimal.op_Explicit (e1) @ (47,49--47,58)"; + "let testDecimalToInt64Operator(e1) = Decimal.op_Explicit (e1) @ (48,49--48,57)"; + "let testDecimalToUInt64Operator(e1) = Decimal.op_Explicit (e1) @ (49,49--49,58)"; + "let testDecimalToSingleOperator(e1) = Decimal.op_Explicit (e1) @ (52,49--52,59)"; + "let testDecimalToDoubleOperator(e1) = Convert.ToDouble (e1) @ (53,49--53,57)"; + "let testDecimalToDecimalOperator(e1) = e1 @ (54,57--54,59)"; + "let testDecimalToCharOperator(e1) = Decimal.op_Explicit (e1) @ (55,49--55,56)"; + "let testDecimalToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,49--56,58)"; + ] + + testOperators "Decimal" "decimal" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for Char`` () = + let excludedTests = [ + "testCharSubtractionOperator"; + "testCharMultiplyOperator"; + "testCharDivisionOperator"; + "testCharModulusOperator"; + "testCharBitwiseAndOperator"; + "testCharBitwiseOrOperator"; + "testCharBitwiseXorOperator"; + "testCharShiftLeftOperator"; + "testCharShiftRightOperator"; + "testCharUnaryNegOperator"; + "testCharSubtractionChecked"; + "testCharMultiplyChecked"; + "testCharUnaryNegChecked"; + "testCharToDecimalOperator"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsChar"; + "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,64--4,72)"; + "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,64--5,73)"; + "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,64--6,72)"; + "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,64--7,73)"; + "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,64--8,72)"; + "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,64--9,73)"; + "let testCharAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,56--11,64)"; + "let testCharAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,53--24,70)"; + "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + "let testCharToIntChecked(e1) = Checked.ToInt (e1) @ (33,43--33,57)"; + "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + "let testCharToIntOperator(e1) = Operators.ToInt (e1) @ (45,43--45,49)"; + "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + "let testCharToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,43--48,51)"; + "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + "let testCharToIntPtrOperator(e1) = Operators.ToIntPtr (e1) @ (50,43--50,55)"; + "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + "let testCharToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,43--52,53)"; + "let testCharToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,43--53,51)"; + "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + "let testCharToStringOperator(e1) = Operators.ToString (e1) @ (56,43--56,52)"; + ] + + let expectedOptimized = [ + "type OperatorTestsChar"; + "let testCharEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,64--4,72)"; + "let testCharNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality (e1,e2),False) @ (5,64--5,73)"; + "let testCharLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,64--6,72)"; + "let testCharLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan (e1,e2),False) @ (7,64--7,73)"; + "let testCharGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,64--8,72)"; + "let testCharGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan (e1,e2),False) @ (9,64--9,73)"; + "let testCharAdditionOperator(e1) (e2) = Operators.ToChar (Operators.op_Addition (e1,e2)) @ (11,56--11,64)"; + "let testCharAdditionChecked(e1) (e2) = Operators.ToChar (Checked.op_Addition (e1,e2)) @ (24,53--24,70)"; + "let testCharToByteChecked(e1) = Checked.ToByte (e1) @ (29,43--29,58)"; + "let testCharToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,43--30,59)"; + "let testCharToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,43--31,59)"; + "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,43--32,60)"; + "let testCharToIntChecked(e1) = Checked.ToInt32 (e1) @ (33,43--33,57)"; + "let testCharToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,43--34,59)"; + "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,43--35,60)"; + "let testCharToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,43--36,59)"; + "let testCharToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,43--37,60)"; + "let testCharToIntPtrChecked(e1) = Checked.ToIntPtr (e1) @ (38,43--38,63)"; + "let testCharToUIntPtrChecked(e1) = Checked.ToUIntPtr (e1) @ (39,43--39,64)"; + "let testCharToByteOperator(e1) = Operators.ToByte (e1) @ (41,43--41,50)"; + "let testCharToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,43--42,51)"; + "let testCharToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,43--43,51)"; + "let testCharToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,43--44,52)"; + "let testCharToIntOperator(e1) = Operators.ToInt32 (e1) @ (45,43--45,49)"; + "let testCharToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,43--46,51)"; + "let testCharToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,43--47,52)"; + "let testCharToInt64Operator(e1) = Operators.ToUInt64 (e1) @ (48,43--48,51)"; + "let testCharToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,43--49,52)"; + "let testCharToIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (50,43--50,55)"; + "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (e1) @ (51,43--51,56)"; + "let testCharToSingleOperator(e1) = Operators.ToSingle (Operators.ToDouble (e1)) @ (52,43--52,53)"; + "let testCharToDoubleOperator(e1) = Operators.ToDouble (Operators.ToDouble (e1)) @ (53,43--53,51)"; + "let testCharToCharOperator(e1) = Operators.ToChar (e1) @ (55,43--55,50)"; + "let testCharToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,43--56,52)"; + ] + + testOperators "Char" "char" excludedTests expectedUnoptimized expectedOptimized + +[] +let ``Test Operator Declarations for String`` () = + let excludedTests = [ + "testStringSubtractionOperator"; + "testStringMultiplyOperator"; + "testStringDivisionOperator"; + "testStringModulusOperator"; + "testStringBitwiseAndOperator"; + "testStringBitwiseOrOperator"; + "testStringBitwiseXorOperator"; + "testStringShiftLeftOperator"; + "testStringShiftRightOperator"; + "testStringUnaryNegOperator"; + "testStringSubtractionChecked"; + "testStringMultiplyChecked"; + "testStringUnaryNegChecked"; + "testStringToIntPtrChecked"; + "testStringToUIntPtrChecked"; + "testStringToIntPtrOperator"; + "testStringToUIntPtrOperator"; + ] + + let expectedUnoptimized = [ + "type OperatorTestsString"; + "let testStringEqualsOperator(e1) (e2) = Operators.op_Equality (e1,e2) @ (4,70--4,78)"; + "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Inequality (e1,e2) @ (5,70--5,79)"; + "let testStringLessThanOperator(e1) (e2) = Operators.op_LessThan (e1,e2) @ (6,70--6,78)"; + "let testStringLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual (e1,e2) @ (7,70--7,79)"; + "let testStringGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan (e1,e2) @ (8,70--8,78)"; + "let testStringGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual (e1,e2) @ (9,70--9,79)"; + "let testStringAdditionOperator(e1) (e2) = Operators.op_Addition (e1,e2) @ (11,62--11,70)"; + "let testStringAdditionChecked(e1) (e2) = Checked.op_Addition (e1,e2) @ (24,59--24,76)"; + "let testStringToByteChecked(e1) = Checked.ToByte (e1) @ (29,47--29,62)"; + "let testStringToSByteChecked(e1) = Checked.ToSByte (e1) @ (30,47--30,63)"; + "let testStringToInt16Checked(e1) = Checked.ToInt16 (e1) @ (31,47--31,63)"; + "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (e1) @ (32,47--32,64)"; + "let testStringToIntChecked(e1) = Checked.ToInt (e1) @ (33,47--33,61)"; + "let testStringToInt32Checked(e1) = Checked.ToInt32 (e1) @ (34,47--34,63)"; + "let testStringToUInt32Checked(e1) = Checked.ToUInt32 (e1) @ (35,47--35,64)"; + "let testStringToInt64Checked(e1) = Checked.ToInt64 (e1) @ (36,47--36,63)"; + "let testStringToUInt64Checked(e1) = Checked.ToUInt64 (e1) @ (37,47--37,64)"; + "let testStringToByteOperator(e1) = Operators.ToByte (e1) @ (41,47--41,54)"; + "let testStringToSByteOperator(e1) = Operators.ToSByte (e1) @ (42,47--42,55)"; + "let testStringToInt16Operator(e1) = Operators.ToInt16 (e1) @ (43,47--43,55)"; + "let testStringToUInt16Operator(e1) = Operators.ToUInt16 (e1) @ (44,47--44,56)"; + "let testStringToIntOperator(e1) = Operators.ToInt (e1) @ (45,47--45,53)"; + "let testStringToInt32Operator(e1) = Operators.ToInt32 (e1) @ (46,47--46,55)"; + "let testStringToUInt32Operator(e1) = Operators.ToUInt32 (e1) @ (47,47--47,56)"; + "let testStringToInt64Operator(e1) = Operators.ToInt64 (e1) @ (48,47--48,55)"; + "let testStringToUInt64Operator(e1) = Operators.ToUInt64 (e1) @ (49,47--49,56)"; + "let testStringToSingleOperator(e1) = Operators.ToSingle (e1) @ (52,47--52,57)"; + "let testStringToDoubleOperator(e1) = Operators.ToDouble (e1) @ (53,47--53,55)"; + "let testStringToDecimalOperator(e1) = Operators.ToDecimal (e1) @ (54,47--54,57)"; + "let testStringToCharOperator(e1) = Operators.ToChar (e1) @ (55,47--55,54)"; + "let testStringToStringOperator(e1) = Operators.ToString (e1) @ (56,47--56,56)"; + ] + + let expectedOptimized = [ + "type OperatorTestsString"; + "let testStringEqualsOperator(e1) (e2) = String.Equals (e1,e2) @ (4,70--4,78)"; + "let testStringNotEqualsOperator(e1) (e2) = Operators.op_Equality (String.Equals (e1,e2),False) @ (5,70--5,79)"; + "let testStringLessThanOperator(e1) (e2) = HashCompare.GenericLessThanIntrinsic (e1,e2) @ (6,70--6,78)"; + "let testStringLessThanOrEqualsOperator(e1) (e2) = HashCompare.GenericLessOrEqualIntrinsic (e1,e2) @ (7,70--7,79)"; + "let testStringGreaterThanOperator(e1) (e2) = HashCompare.GenericGreaterThanIntrinsic (e1,e2) @ (8,70--8,78)"; + "let testStringGreaterThanOrEqualsOperator(e1) (e2) = HashCompare.GenericGreaterOrEqualIntrinsic (e1,e2) @ (9,70--9,79)"; + "let testStringAdditionOperator(e1) (e2) = String.Concat (e1,e2) @ (11,62--11,70)"; + "let testStringAdditionChecked(e1) (e2) = String.Concat (e1,e2) @ (24,59--24,76)"; + "let testStringToByteChecked(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (29,47--29,62)"; + "let testStringToSByteChecked(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (30,47--30,63)"; + "let testStringToInt16Checked(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (31,47--31,63)"; + "let testStringToUInt16Checked(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (32,47--32,64)"; + "let testStringToIntChecked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (33,47--33,61)"; + "let testStringToInt32Checked(e1) = LanguagePrimitives.ParseInt32 (e1) @ (34,47--34,63)"; + "let testStringToUInt32Checked(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (35,47--35,64)"; + "let testStringToInt64Checked(e1) = LanguagePrimitives.ParseInt64 (e1) @ (36,47--36,63)"; + "let testStringToUInt64Checked(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (37,47--37,64)"; + "let testStringToByteOperator(e1) = Checked.ToByte (LanguagePrimitives.ParseUInt32 (e1)) @ (41,47--41,54)"; + "let testStringToSByteOperator(e1) = Checked.ToSByte (LanguagePrimitives.ParseInt32 (e1)) @ (42,47--42,55)"; + "let testStringToInt16Operator(e1) = Checked.ToInt16 (LanguagePrimitives.ParseInt32 (e1)) @ (43,47--43,55)"; + "let testStringToUInt16Operator(e1) = Checked.ToUInt16 (LanguagePrimitives.ParseUInt32 (e1)) @ (44,47--44,56)"; + "let testStringToIntOperator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (45,47--45,53)"; + "let testStringToInt32Operator(e1) = LanguagePrimitives.ParseInt32 (e1) @ (46,47--46,55)"; + "let testStringToUInt32Operator(e1) = LanguagePrimitives.ParseUInt32 (e1) @ (47,47--47,56)"; + "let testStringToInt64Operator(e1) = LanguagePrimitives.ParseInt64 (e1) @ (48,47--48,55)"; + "let testStringToUInt64Operator(e1) = LanguagePrimitives.ParseUInt64 (e1) @ (49,47--49,56)"; + "let testStringToSingleOperator(e1) = Single.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (52,47--52,57)"; + "let testStringToDoubleOperator(e1) = Double.Parse ((if Operators.op_Equality (e1,dflt) then dflt else e1.Replace(\"_\",\"\")),167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (53,47--53,55)"; + "let testStringToDecimalOperator(e1) = Decimal.Parse (e1,167,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (54,47--54,57)"; + "let testStringToCharOperator(e1) = Char.Parse (e1) @ (55,47--55,54)"; + "let testStringToStringOperator(e1) = let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (e1) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... @ (56,47--56,56)"; + ] + + testOperators "String" "string" excludedTests expectedUnoptimized expectedOptimized + //--------------------------------------------------------------------------------------------------------- // This big list expression was causing us trouble @@ -866,9 +2873,23 @@ let ``Test expressions of declarations stress big expressions`` () = // This should not stack overflow printDeclarations None (List.ofSeq file1.Declarations) |> Seq.toList |> ignore + +[] +let ``Test expressions of optimized declarations stress big expressions`` () = + let wholeProjectResults = exprChecker.ParseAndCheckProject(ProjectStressBigExpressions.options) |> Async.RunSynchronously + + wholeProjectResults.Errors.Length |> shouldEqual 0 + + wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.Length |> shouldEqual 1 + let file1 = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0] + + // This should not stack overflow + printDeclarations None (List.ofSeq file1.Declarations) |> Seq.toList |> ignore + + #if NOT_YET_ENABLED -#if !NO_PROJECTCRACKER && !DOTNETCORE +#if !NO_PROJECTCRACKER && !NETCOREAPP2_0 [] let ``Check use of type provider that provides calls to F# code`` () = diff --git a/tests/service/FileSystemTests.fs b/tests/service/FileSystemTests.fs index 4e92e98b70c..16a0bdcc266 100644 --- a/tests/service/FileSystemTests.fs +++ b/tests/service/FileSystemTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -71,9 +71,11 @@ let UseMyFileSystem() = Shim.FileSystem <- myFileSystem { new IDisposable with member x.Dispose() = Shim.FileSystem <- myFileSystem } -#if !FX_ATLEAST_PORTABLE [] +#if NETCOREAPP2_0 +[] +#endif let ``FileSystem compilation test``() = if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows use myFileSystem = UseMyFileSystem() @@ -113,4 +115,3 @@ let ``FileSystem compilation test``() = results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.Count |> shouldEqual 1 results.AssemblySignature.Entities.[0].MembersFunctionsAndValues.[0].DisplayName |> shouldEqual "B" -#endif diff --git a/tests/service/FscTests.fs b/tests/service/FscTests.fs index 61c3a29003f..82914dbdbae 100644 --- a/tests/service/FscTests.fs +++ b/tests/service/FscTests.fs @@ -1,6 +1,6 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -41,7 +41,7 @@ type PEVerifier () = static let runsOnMono = try System.Type.GetType("Mono.Runtime") <> null with _ -> false let verifierInfo = -#if FX_ATLEAST_PORTABLE +#if NETCOREAPP2_0 None #else if runsOnMono then @@ -96,7 +96,7 @@ let checker = FSharpChecker.Create() /// Ensures the default FSharp.Core referenced by the F# compiler service (if none is /// provided explicitly) is available in the output directory. let ensureDefaultFSharpCoreAvailable tmpDir = -#if FX_ATLEAST_PORTABLE +#if NETCOREAPP2_0 ignore tmpDir #else // FSharp.Compiler.Service references FSharp.Core 4.3.0.0 by default. That's wrong? But the output won't verify diff --git a/tests/service/FsiTests.fs b/tests/service/FsiTests.fs index bd80961002a..23bf52b33e3 100644 --- a/tests/service/FsiTests.fs +++ b/tests/service/FsiTests.fs @@ -1,6 +1,6 @@  #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -27,7 +27,7 @@ let errStream = new CompilerOutputStream() let argv = [| "C:\\fsi.exe" |] let allArgs = Array.append argv [|"--noninteractive"|] -#if DOTNETCORE +#if NETCOREAPP2_0 let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() #else let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration(fsi) diff --git a/tests/service/InteractiveCheckerTests.fs b/tests/service/InteractiveCheckerTests.fs index ac17ec2e705..fba9adcb639 100644 --- a/tests/service/InteractiveCheckerTests.fs +++ b/tests/service/InteractiveCheckerTests.fs @@ -1,6 +1,6 @@  #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 1de6ab54757..cc8fb64e802 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -1,6 +1,6 @@  #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -129,6 +129,9 @@ let u = Case1 3 [] +#if NETCOREAPP2_0 +[] +#endif let ``Test multi project 1 whole project errors`` () = let wholeProjectResults = checker.ParseAndCheckProject(MultiProject1.options) |> Async.RunSynchronously @@ -311,6 +314,9 @@ let p = (""" FSharpChecker.Create(projectCacheSize=size) [] +#if NETCOREAPP2_0 +[] +#endif let ``Test ManyProjectsStressTest whole project errors`` () = let checker = ManyProjectsStressTest.makeCheckerForStressTest true @@ -831,9 +837,11 @@ let ``Test max memory gets triggered`` () = //------------------------------------------------------------------------------------ -#if !DOTNETCORE [] +#if NETCOREAPP2_0 +[] +#endif let ``Type provider project references should not throw exceptions`` () = //let options = ProjectCracker.GetProjectOptionsFromProjectFile(projectFile, [("Configuration", "Debug")]) let options = @@ -919,6 +927,9 @@ let ``Type provider project references should not throw exceptions`` () = //------------------------------------------------------------------------------------ [] +#if NETCOREAPP2_0 +[] +#endif let ``Projects creating generated types should not utilize cross-project-references but should still analyze oK once project is built`` () = //let options = ProjectCracker.GetProjectOptionsFromProjectFile(projectFile, [("Configuration", "Debug")]) let options = @@ -1005,6 +1016,5 @@ let ``Projects creating generated types should not utilize cross-project-referen -#endif //------------------------------------------------------------------------------------ diff --git a/tests/service/PerfTests.fs b/tests/service/PerfTests.fs index dcc8a453557..662e00c5645 100644 --- a/tests/service/PerfTests.fs +++ b/tests/service/PerfTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 826491c8aa9..d7eb1a801f6 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -123,15 +123,12 @@ let ``Test Project1 should have protected FullName and TryFullName return same r |> Seq.collect (Seq.collect getFullNameComparisons) |> Seq.iter (shouldEqual true) -[] +[] +[] let ``Test project1 should not throw exceptions on entities from referenced assemblies`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously let rec getAllBaseTypes (entity: FSharpEntity) = - #if !NO_EXTENSIONTYPING seq { if not entity.IsProvided && entity.Accessibility.IsPublic then - #else - seq{ - #endif if not entity.IsUnresolved then yield entity.BaseType for e in entity.NestedEntities do yield! getAllBaseTypes e } @@ -2203,9 +2200,7 @@ let ``Test Project13 all symbols`` () = ["type System.IComparable"; "type System.IFormattable"; "type System.IConvertible"; -#if !DOTNETCORE "type System.Runtime.Serialization.ISerializable"; -#endif "type System.IComparable"; "type System.IEquatable"]) @@ -3170,7 +3165,7 @@ let ``Test Project22 IList properties`` () = attribsOfSymbol ilistTypeDefn |> shouldEqual ["interface"] -#if !TODO_REWORK_ASSEMBLY_LOAD +#if !NETCOREAPP2_0 // TODO: check if this can be enabled in .NET Core testing of FSharp.Compiler.Service ilistTypeDefn.Assembly.SimpleName |> shouldEqual coreLibAssemblyName #endif @@ -3631,10 +3626,9 @@ let _ = XmlProvider<"13">.GetSample() yield @"-r:" + sysLib "System.Xml.Linq" |] let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) -#if DOTNETCORE -[] -#else [] +#if NETCOREAPP2_0 +[] #endif let ``Test Project25 whole project errors`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project25.options) |> Async.RunSynchronously @@ -3642,10 +3636,9 @@ let ``Test Project25 whole project errors`` () = printfn "Project25 error: <<<%s>>>" e.Message wholeProjectResults.Errors.Length |> shouldEqual 0 -#if DOTNETCORE -[] -#else [] +#if NETCOREAPP2_0 +[] #endif let ``Test Project25 symbol uses of type-provided members`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project25.options) |> Async.RunSynchronously @@ -3702,10 +3695,9 @@ let ``Test Project25 symbol uses of type-provided members`` () = usesOfGetSampleSymbol |> shouldEqual [|("file1", ((5, 8), (5, 25))); ("file1", ((10, 8), (10, 78)))|] -#if DOTNETCORE -[] -#else [] +#if NETCOREAPP2_0 +[] #endif let ``Test symbol uses of type-provided types`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project25.options) |> Async.RunSynchronously @@ -4131,8 +4123,8 @@ let ``Test project31 whole project errors`` () = wholeProjectResults.Errors.Length |> shouldEqual 0 [] -#if DOTNETCORE -[] +#if NETCOREAPP2_0 +[] #endif let ``Test project31 C# type attributes`` () = if not runningOnMono then @@ -4174,14 +4166,14 @@ let ``Test project31 C# method attributes`` () = |> set |> shouldEqual (set [ -#if !DOTNETCORE +#if !NETCOREAPP2_0 "(SecuritySafeCriticalAttribute, [], [])"; #endif "(CLSCompliantAttribute, [(type Microsoft.FSharp.Core.bool, false)], [])"]) [] -#if DOTNETCORE -[] +#if NETCOREAPP2_0 +[] #endif let ``Test project31 Format C# type attributes`` () = if not runningOnMono then @@ -4215,7 +4207,7 @@ let ``Test project31 Format C# method attributes`` () = |> set |> shouldEqual (set ["[]"; -#if !DOTNETCORE +#if !NETCOREAPP2_0 "[]"; #endif ]) @@ -4370,6 +4362,9 @@ let ``Test Project34 whole project errors`` () = wholeProjectResults.Errors.Length |> shouldEqual 0 [] +#if NETCOREAPP2_0 +[] +#endif let ``Test project34 should report correct accessibility for System.Data.Listeners`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project34.options) |> Async.RunSynchronously let rec getNestedEntities (entity: FSharpEntity) = @@ -4491,7 +4486,7 @@ module internal Project35b = let cleanFileName a = if a = fileName1 then "file1" else "??" let fileNames = [fileName1] -#if TODO_REWORK_ASSEMBLY_LOAD +#if NETCOREAPP2_0 let projPath = Path.ChangeExtension(fileName1, ".fsproj") let dllPath = Path.ChangeExtension(fileName1, ".dll") let args = mkProjectCommandLineArgs(dllPath, fileNames) @@ -5208,3 +5203,144 @@ let ``#4030, Incremental builder creation warnings`` (args, errorSeverities) = let _, checkResults = parseAndCheckFile fileName source options checkResults.Errors |> Array.map (fun e -> e.Severity = FSharpErrorSeverity.Error) |> shouldEqual errorSeverities + + +//------------------------------------------------------ + +[] +let ``Unused opens smoke test 1``() = + + let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + let base2 = Path.GetTempFileName() + let dllName = Path.ChangeExtension(base2, ".dll") + let projFileName = Path.ChangeExtension(base2, ".fsproj") + let fileSource1 = """ +open System.Collections // unused +open System.Collections.Generic // used, should not appear +open FSharp.Control // unused +open FSharp.Data // unused +open System.Globalization // unused + +module SomeUnusedModule = + let f x = x + +module SomeUsedModuleContainingFunction = + let g x = x + +module SomeUsedModuleContainingActivePattern = + let (|ActivePattern|) x = x + +module SomeUsedModuleContainingExtensionMember = + type System.Int32 with member x.Q = 1 + +module SomeUsedModuleContainingUnion = + type Q = A | B + +open SomeUnusedModule +open SomeUsedModuleContainingFunction +open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingActivePattern +open SomeUsedModuleContainingUnion + +type UseTheThings(i:int) = + member x.Value = Dictionary() // use something from System.Collections.Generic, as a constructor + member x.UseSomeUsedModuleContainingFunction() = g 3 + member x.UseSomeUsedModuleContainingActivePattern(ActivePattern g) = g + member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q + member x.UseSomeUsedModuleContainingUnion() = A +""" + File.WriteAllText(fileName1, fileSource1) + + let fileNames = [fileName1] + let args = mkProjectCommandLineArgs (dllName, fileNames) + let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true) + let options = keepAssemblyContentsChecker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + + let fileCheckResults = + keepAssemblyContentsChecker.ParseAndCheckFileInProject(fileName1, 0, fileSource1, options) |> Async.RunSynchronously + |> function + | _, FSharpCheckFileAnswer.Succeeded(res) -> res + | _ -> failwithf "Parsing aborted unexpectedly..." + //let symbolUses = fileCheckResults.GetAllUsesOfAllSymbolsInFile() |> Async.RunSynchronously |> Array.indexed + // Fragments used to check hash codes: + //(snd symbolUses.[42]).Symbol.IsEffectivelySameAs((snd symbolUses.[37]).Symbol) + //(snd symbolUses.[42]).Symbol.GetEffectivelySameAsHash() + //(snd symbolUses.[37]).Symbol.GetEffectivelySameAsHash() + let lines = File.ReadAllLines(fileName1) + let unusedOpens = UnusedOpens.getUnusedOpens (fileCheckResults, (fun i -> lines.[i-1])) |> Async.RunSynchronously + let unusedOpensData = [ for uo in unusedOpens -> tups uo, lines.[uo.StartLine-1] ] + let expected = + [(((2, 5), (2, 23)), "open System.Collections // unused"); + (((4, 5), (4, 19)), "open FSharp.Control // unused"); + (((5, 5), (5, 16)), "open FSharp.Data // unused"); + (((6, 5), (6, 25)), "open System.Globalization // unused"); + (((23, 5), (23, 21)), "open SomeUnusedModule")] + unusedOpensData |> shouldEqual expected + +[] +let ``Unused opens smoke test auto open``() = + + let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + let base2 = Path.GetTempFileName() + let dllName = Path.ChangeExtension(base2, ".dll") + let projFileName = Path.ChangeExtension(base2, ".fsproj") + let fileSource1 = """ +open System.Collections // unused +open System.Collections.Generic // used, should not appear +open FSharp.Control // unused +open FSharp.Data // unused +open System.Globalization // unused + +[] +module Helpers = + module SomeUnusedModule = + let f x = x + + module SomeUsedModuleContainingFunction = + let g x = x + + module SomeUsedModuleContainingActivePattern = + let (|ActivePattern|) x = x + + module SomeUsedModuleContainingExtensionMember = + type System.Int32 with member x.Q = 1 + + module SomeUsedModuleContainingUnion = + type Q = A | B + +open SomeUnusedModule +open SomeUsedModuleContainingFunction +open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingActivePattern +open SomeUsedModuleContainingUnion + +type UseTheThings(i:int) = + member x.Value = Dictionary() // use something from System.Collections.Generic, as a constructor + member x.UseSomeUsedModuleContainingFunction() = g 3 + member x.UseSomeUsedModuleContainingActivePattern(ActivePattern g) = g + member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q + member x.UseSomeUsedModuleContainingUnion() = A +""" + File.WriteAllText(fileName1, fileSource1) + + let fileNames = [fileName1] + let args = mkProjectCommandLineArgs (dllName, fileNames) + let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true) + let options = keepAssemblyContentsChecker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + + let fileCheckResults = + keepAssemblyContentsChecker.ParseAndCheckFileInProject(fileName1, 0, fileSource1, options) |> Async.RunSynchronously + |> function + | _, FSharpCheckFileAnswer.Succeeded(res) -> res + | _ -> failwithf "Parsing aborted unexpectedly..." + let lines = File.ReadAllLines(fileName1) + let unusedOpens = UnusedOpens.getUnusedOpens (fileCheckResults, (fun i -> lines.[i-1])) |> Async.RunSynchronously + let unusedOpensData = [ for uo in unusedOpens -> tups uo, lines.[uo.StartLine-1] ] + let expected = + [(((2, 5), (2, 23)), "open System.Collections // unused"); + (((4, 5), (4, 19)), "open FSharp.Control // unused"); + (((5, 5), (5, 16)), "open FSharp.Data // unused"); + (((6, 5), (6, 25)), "open System.Globalization // unused"); + (((25, 5), (25, 21)), "open SomeUnusedModule")] + unusedOpensData |> shouldEqual expected + diff --git a/tests/service/ProjectOptionsTests.fs b/tests/service/ProjectOptionsTests.fs index d82fca93727..3ab2e1c2dab 100644 --- a/tests/service/ProjectOptionsTests.fs +++ b/tests/service/ProjectOptionsTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../Debug/net40/bin/FSharp.Compiler.Service.ProjectCracker.dll" #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" @@ -19,7 +19,7 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Service.Tests.Common -#if !NO_PROJECTCRACKER +#if !NO_PROJECTCRACKER && DISABLED // Disabled tests because of MSBuild API dependencies. The ProjectCracker is basically deprecated in any case let hasMSBuild14 = use engine = new Microsoft.Build.Evaluation.ProjectCollection() @@ -236,12 +236,12 @@ let ``Project file parsing -- Logging``() = let _, logMap = ProjectCracker.GetProjectOptionsFromProjectFileLogged(projectFileName, enableLogging=true) let log = logMap.[projectFileName] - Assert.That(log, Is.StringContaining("ResolveAssemblyReference")) + Assert.That(log, Does.Contain("ResolveAssemblyReference")) if runningOnMono then - Assert.That(log, Is.StringContaining("System.Core")) - Assert.That(log, Is.StringContaining("Microsoft.Build.Tasks.ResolveAssemblyReference")) + Assert.That(log, Does.Contain("System.Core")) + Assert.That(log, Does.Contain("Microsoft.Build.Tasks.ResolveAssemblyReference")) else - Assert.That(log, Is.StringContaining("Microsoft.Build.Tasks.Core")) + Assert.That(log, Does.Contain("Microsoft.Build.Tasks.Core")) [] let ``Project file parsing -- FSharpProjectOptions.SourceFiles contains both fs and fsi files``() = @@ -520,6 +520,9 @@ let ``Test SourceFiles order for GetProjectOptionsFromScript`` () = // See #594 test "MainBad" [|"MainBad"|] [] +#if NETCOREAPP2_0 +[] +#endif let ``Script load closure project`` () = let fileName1 = Path.GetTempPath() + Path.DirectorySeparatorChar.ToString() + "Impl.fs" let fileName2 = Path.ChangeExtension(Path.GetTempFileName(), ".fsx") @@ -540,10 +543,15 @@ ImplFile.x File.WriteAllText(fileName1, fileSource1) File.WriteAllText(fileName2, fileSource2) + printfn "------Starting Script load closure project----" + printfn "Getting project options..." let projectOptions, diagnostics = - checker.GetProjectOptionsFromScript(fileName2, fileSource2) |> Async.RunSynchronously + checker.GetProjectOptionsFromScript(fileName2, fileSource2, useFsiAuxLib=false) |> Async.RunSynchronously + for d in diagnostics do + printfn "ERROR: %A" d diagnostics.IsEmpty |> shouldEqual true + printfn "Parse and check..." let _, checkResults = checker.ParseAndCheckFileInProject(fileName2, 0, fileSource2, projectOptions) |> Async.RunSynchronously @@ -552,13 +560,20 @@ ImplFile.x results.Errors |> shouldEqual [| |] | _ -> failwith "type check was aborted" + printfn "Getting parsing options..." let parsingOptions, diagnostics = checker.GetParsingOptionsFromProjectOptions(projectOptions) + for d in diagnostics do + printfn "ERROR: %A" d diagnostics.IsEmpty |> shouldEqual true + printfn "Parsing file..." let parseResults = checker.ParseFile(fileName1, fileSource1, parsingOptions) |> Async.RunSynchronously + printfn "Checking parsetree..." parseResults.ParseTree.IsSome |> shouldEqual true + printfn "Checking decls..." match parseResults.ParseTree.Value with | ParsedInput.ImplFile (ParsedImplFileInput (_, _, _, _, _, modules, _)) -> let (SynModuleOrNamespace (_, _, _, decls, _, _, _, _)) = modules.Head decls.Length |> shouldEqual 1 | _ -> failwith "got sig file" + printfn "------Finished Script load closure project----" diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index 0ad29b23e4d..d47acf69de2 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" diff --git a/tests/service/StructureTests.fs b/tests/service/StructureTests.fs index cbfc937a384..f24948890fe 100644 --- a/tests/service/StructureTests.fs +++ b/tests/service/StructureTests.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -53,7 +53,7 @@ let (=>) (source: string) (expectedRanges: (Range * Range) list) = |> List.ofSeq let expected = List.sort expectedRanges if actual <> expected then - failwithf "Expected %s, but was %s" (formatList expected) (formatList actual) + failwithf "Expected %s, but was %s" (formatList expected) (formatList actual) | None -> failwithf "Expected there to be a parse tree for source:\n%s" source with _ -> printfn "AST:\n%+A" ast diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index 03001fe87c9..0219bcfc1f1 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -1,5 +1,5 @@ #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" diff --git a/tests/service/TokenizerTests.fs b/tests/service/TokenizerTests.fs index 1a9776c7a3f..4973d398f29 100644 --- a/tests/service/TokenizerTests.fs +++ b/tests/service/TokenizerTests.fs @@ -1,6 +1,6 @@  #if INTERACTIVE -#r "../../Debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive +#r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -20,19 +20,21 @@ open System.IO let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx") +let rec parseLine(line: string, state: int64 ref, tokenizer: FSharpLineTokenizer) = seq { + match tokenizer.ScanToken(!state) with + | Some(tok), nstate -> + let str = line.Substring(tok.LeftColumn, tok.RightColumn - tok.LeftColumn + 1) + yield str, tok + state := nstate + yield! parseLine(line, state, tokenizer) + | None, nstate -> + state := nstate } + let tokenizeLines (lines:string[]) = [ let state = ref 0L - for n, line in lines |> Seq.zip [ 0 .. lines.Length ] do + for n, line in lines |> Seq.zip [ 0 .. lines.Length-1 ] do let tokenizer = sourceTok.CreateLineTokenizer(line) - let rec parseLine() = seq { - match tokenizer.ScanToken(!state) with - | Some(tok), nstate -> - let str = line.Substring(tok.LeftColumn, tok.RightColumn - tok.LeftColumn + 1) - yield str, tok - state := nstate - yield! parseLine() - | None, nstate -> state := nstate } - yield n, parseLine() |> List.ofSeq ] + yield n, parseLine(line, state, tokenizer) |> List.ofSeq ] [] let ``Tokenizer test 1``() = diff --git a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj index 7966db8e946..8e6ca906740 100644 --- a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj @@ -48,7 +48,7 @@ - + diff --git a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj index 85e94a19ca5..caf90567084 100644 --- a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj @@ -54,7 +54,7 @@ Test1 - + diff --git a/tests/service/data/FsAndFsiFiles.fsproj b/tests/service/data/FsAndFsiFiles.fsproj index aa575fbace2..509c940e78c 100644 --- a/tests/service/data/FsAndFsiFiles.fsproj +++ b/tests/service/data/FsAndFsiFiles.fsproj @@ -48,7 +48,7 @@ - + diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj index 4afeee66ed2..16909bc1ee3 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj @@ -64,7 +64,7 @@ 11 - + diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj index d2b29591d40..654d2113673 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj @@ -56,7 +56,7 @@ True - + diff --git a/tests/service/data/Space in name.fsproj b/tests/service/data/Space in name.fsproj index 86dc385fcc8..36ff02de930 100644 --- a/tests/service/data/Space in name.fsproj +++ b/tests/service/data/Space in name.fsproj @@ -52,7 +52,7 @@ Test1 - + diff --git a/tests/service/data/Test1.fsproj b/tests/service/data/Test1.fsproj index 2d813e2b2eb..11917790084 100644 --- a/tests/service/data/Test1.fsproj +++ b/tests/service/data/Test1.fsproj @@ -46,7 +46,7 @@ - + diff --git a/tests/service/data/Test2.fsproj b/tests/service/data/Test2.fsproj index 8ce5a58a268..fff033794e4 100644 --- a/tests/service/data/Test2.fsproj +++ b/tests/service/data/Test2.fsproj @@ -53,7 +53,7 @@ Test1 - + diff --git a/tests/service/data/Test3.fsproj b/tests/service/data/Test3.fsproj index cc3a3501041..5ea53f2766c 100644 --- a/tests/service/data/Test3.fsproj +++ b/tests/service/data/Test3.fsproj @@ -47,7 +47,7 @@ - + diff --git a/tests/service/data/TestProject/TestProject.fsproj b/tests/service/data/TestProject/TestProject.fsproj index 80c50f31090..6737ca00c05 100644 --- a/tests/service/data/TestProject/TestProject.fsproj +++ b/tests/service/data/TestProject/TestProject.fsproj @@ -56,7 +56,7 @@ True - + diff --git a/tests/service/data/ToolsVersion12.fsproj b/tests/service/data/ToolsVersion12.fsproj index 92bad59c135..e56a9961808 100644 --- a/tests/service/data/ToolsVersion12.fsproj +++ b/tests/service/data/ToolsVersion12.fsproj @@ -43,7 +43,7 @@ 11 - + diff --git a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj index 3affe9671d4..4c710eb1221 100644 --- a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj +++ b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj @@ -56,7 +56,7 @@ True - + diff --git a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj index 28e44d8661d..418a07dbe57 100644 --- a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj +++ b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj @@ -44,5 +44,5 @@ - + \ No newline at end of file diff --git a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj index 9f13bc475f7..aec8ba39246 100644 --- a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj +++ b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj @@ -60,5 +60,5 @@ True - + \ No newline at end of file diff --git a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj index f2e74b93d78..52056e47c9b 100644 --- a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj +++ b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj @@ -50,5 +50,5 @@ True - + \ No newline at end of file diff --git a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj index 48359e32e22..9655c32ab55 100644 --- a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj +++ b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj @@ -47,7 +47,7 @@ - + diff --git a/vsintegration/Directory.Build.props b/vsintegration/Directory.Build.props new file mode 100644 index 00000000000..fa9f1e6747f --- /dev/null +++ b/vsintegration/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + true + + + diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets new file mode 100644 index 00000000000..161dfe3babf --- /dev/null +++ b/vsintegration/Directory.Build.targets @@ -0,0 +1,21 @@ + + + + + + + net462 + + + + + + + + + + diff --git a/vsintegration/DisableVsixManifestTargets.targets b/vsintegration/DisableVsixManifestTargets.targets new file mode 100644 index 00000000000..86c5ada70cb --- /dev/null +++ b/vsintegration/DisableVsixManifestTargets.targets @@ -0,0 +1,4 @@ + + + + diff --git a/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj b/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj index 0a53562afc4..48500b15a86 100644 --- a/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj +++ b/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src AppConfig - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj b/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj index 8f726c6d9a3..cf6a5e3e4f6 100644 --- a/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj +++ b/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src CodeFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/Directory.Build.props b/vsintegration/ItemTemplates/Directory.Build.props new file mode 100644 index 00000000000..ef2e2875099 --- /dev/null +++ b/vsintegration/ItemTemplates/Directory.Build.props @@ -0,0 +1,9 @@ + + + + ItemTemplates + + + + + diff --git a/vsintegration/ItemTemplates/Directory.Build.targets b/vsintegration/ItemTemplates/Directory.Build.targets new file mode 100644 index 00000000000..6dd437b28fb --- /dev/null +++ b/vsintegration/ItemTemplates/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj b/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj index 61287d631d9..17760a303bf 100644 --- a/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj +++ b/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj @@ -1,49 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src ResourceFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - {0385564F-07B4-4264-AB8A-17C393E9140C} - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj b/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj index 583e0c3e236..d8affe83605 100644 --- a/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj +++ b/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj @@ -1,47 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src ScriptFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj b/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj index 0bc28446b53..89a34c354b7 100644 --- a/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj +++ b/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src SignatureFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/TextFile/TextFile.csproj b/vsintegration/ItemTemplates/TextFile/TextFile.csproj index d8d84130c75..880085abaaa 100644 --- a/vsintegration/ItemTemplates/TextFile/TextFile.csproj +++ b/vsintegration/ItemTemplates/TextFile/TextFile.csproj @@ -1,48 +1,18 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - TextFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + TextFile - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj b/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj index 1f4178befcd..bef2612dc20 100644 --- a/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj +++ b/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj @@ -1,47 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src XMLFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj b/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj index bec2b66b387..82e55b95ec9 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj @@ -1,34 +1,11 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - ConsoleProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {604F0DAA-2D33-48DD-B162-EDF0B672803D} - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + ConsoleProject - - @@ -38,8 +15,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index c7d3ac014af..ccd1f912b9f 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -49,7 +49,7 @@ $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\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 fbc9099ba02..de642efe4af 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -26,7 +26,7 @@ - + diff --git a/vsintegration/ProjectTemplates/Directory.Build.props b/vsintegration/ProjectTemplates/Directory.Build.props new file mode 100644 index 00000000000..a67b0e382ed --- /dev/null +++ b/vsintegration/ProjectTemplates/Directory.Build.props @@ -0,0 +1,9 @@ + + + + ProjectTemplates + + + + + diff --git a/vsintegration/ProjectTemplates/Directory.Build.targets b/vsintegration/ProjectTemplates/Directory.Build.targets new file mode 100644 index 00000000000..6dd437b28fb --- /dev/null +++ b/vsintegration/ProjectTemplates/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj b/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj index 57f5428915e..23239f00471 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj +++ b/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj @@ -1,34 +1,11 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - LibraryProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7} - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + LibraryProject - - @@ -38,8 +15,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index 35512503ea6..2a4860f1cdf 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -45,7 +45,7 @@ $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\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 5bf652b59bd..b8a72c8b776 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -26,7 +26,7 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index e388d819f9b..4d1bb6a54a5 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -59,7 +59,7 @@ - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\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 1b7ea993d60..8dabbfe3359 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -24,7 +24,7 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj b/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj index 86b7c4649a7..72afa7b760d 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj +++ b/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj @@ -1,33 +1,11 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src TutorialProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4} - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - @@ -36,8 +14,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/Templates.Directory.Build.props b/vsintegration/Templates.Directory.Build.props new file mode 100644 index 00000000000..9be1daa15b8 --- /dev/null +++ b/vsintegration/Templates.Directory.Build.props @@ -0,0 +1,22 @@ + + + + + + net46 + v4.6 + true + true + false + false + false + false + false + false + false + false + false + false + + + diff --git a/vsintegration/Templates.Directory.Build.targets b/vsintegration/Templates.Directory.Build.targets new file mode 100644 index 00000000000..84513c489fc --- /dev/null +++ b/vsintegration/Templates.Directory.Build.targets @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 5af51a83ca2..08d3108041f 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -1,80 +1,32 @@  - - + + - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - - - - Debug - AnyCPU - 2.0 - e7fa3a71-51af-4fca-9c2f-7c853e515903 + net46 Exe - LanguageServiceProfiling - LanguageServiceProfiling - v4.6 - true - 4.4.3.0 - LanguageServiceProfiling - - - true - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - x86 - - - true - - - true - true - bin\$(Configuration)\ - TRACE - 3 - x86 - - - true + true + true + - + + + + + + - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - - - - FSharp.Core - {ded3bbd7-53f4-428a-8c9f-27968e768605} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - - \ No newline at end of file + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/Options.fs b/vsintegration/Utils/LanguageServiceProfiling/Options.fs index f325850a3a0..db3200baf1e 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/Options.fs +++ b/vsintegration/Utils/LanguageServiceProfiling/Options.fs @@ -200,10 +200,9 @@ let FCS (repositoryDir: string) : Options = OtherOptions = [|@"-o:obj\Release\FSharp.Compiler.Private.dll"; "-g"; "--noframework"; @"--baseaddress:0x06800000"; "--define:DEBUG"; - @"--define:CROSS_PLATFORM_COMPILER"; "--define:FX_ATLEAST_45"; + @"--define:CROSS_PLATFORM_COMPILER"; @"--define:FX_ATLEAST_40"; "--define:BE_SECURITY_TRANSPARENT"; - @"--define:TYPE_PROVIDER_SECURITY"; "--define:EXTENSIBLE_DUMPER"; - @"--define:INCLUDE_METADATA_WRITER"; "--define:COMPILER"; + @"--define:COMPILER"; @"--define:ENABLE_MONO_SUPPORT"; "--define:FX_MSBUILDRESOLVER_RUNTIMELIKE"; @"--define:FX_LCIDFROMCODEPAGE"; "--define:FX_RESX_RESOURCE_READER"; @"--define:FX_RESIDENT_COMPILER"; "--define:SHADOW_COPY_REFERENCES"; diff --git a/vsintegration/Utils/LanguageServiceProfiling/packages.config b/vsintegration/Utils/LanguageServiceProfiling/packages.config deleted file mode 100644 index 222429db2bd..00000000000 --- a/vsintegration/Utils/LanguageServiceProfiling/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/vsintegration/Vsix/Directory.Build.props b/vsintegration/Vsix/Directory.Build.props new file mode 100644 index 00000000000..9f5ffe146fe --- /dev/null +++ b/vsintegration/Vsix/Directory.Build.props @@ -0,0 +1,38 @@ + + + + + + RoslynDev + false + false + true + $(VSRootSuffix) + true + publish\ + true + Disk + false + Foreground + 7 + Days + true + false + true + false + false + false + false + false + false + false + false + true + true + CommonExtensions + None + true + true + + + diff --git a/vsintegration/Vsix/Directory.Build.targets b/vsintegration/Vsix/Directory.Build.targets new file mode 100644 index 00000000000..fa37bc2cd13 --- /dev/null +++ b/vsintegration/Vsix/Directory.Build.targets @@ -0,0 +1,23 @@ + + + + + + + False + Microsoft .NET Framework 4.6 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + + diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index a145c9b0e9b..d7c59b2b380 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -16,7 +16,6 @@ "Package"="{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}" "ProductDetails"="#9002" "LogoID"="#400" -"UseVSProductID"="1" @="#9001" [$RootKey$\AD7Metrics\ExpressionEvaluator\{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}\{994B45C4-E6E9-11D2-903F-00C04FA302A1}] diff --git a/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json new file mode 100644 index 00000000000..18d884aa2e7 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "VisualFSharpFull": { + "commandName": "Executable", + "executablePath": "$(DevEnvDir)devenv.exe", + "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" + } + } +} \ No newline at end of file diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 954c8ac8c34..3f1be894831 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -1,78 +1,14 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - 0 - v4.6 - false - false - false - false - false - false - false - false - true - true - CommonExtensions - Microsoft\FSharp - None - Debug - AnyCPU + net46 Library - Properties - RoslynDev - true - False - True - {59ADCE46-9740-4079-834D-9A03A3494EBC} - true - VisualFSharpFull - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - VisualFSharpFull - $(RootBinPath) - true - cs - false - - - - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) + Microsoft\FSharp + netcoreapp1.0 + Designer @@ -87,29 +23,13 @@ License.txt true - + PreserveNewest - packages\System.ValueTuple.4.3.1.nupkg + packages\System.ValueTuple.4.4.0.nupkg true - - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - + {649FA588-F02E-457C-9FCF-87E46407481E} @@ -266,12 +186,9 @@ True + - - False - $(FSharpSourcesRoot)\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - + - - + diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest deleted file mode 100644 index 86a241cedbd..00000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Visual F# Tools - Deploy Visual F# Tools Binaries and Templates to Visual Studio - Microsoft.FSharp.VSIX.OpenSource.Core - https://docs.microsoft.com/en-us/dotnet/articles/fsharp/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj deleted file mode 100644 index 7aa2bb60aa9..00000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj +++ /dev/null @@ -1,303 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - 0 - v4.6 - false - false - false - false - false - false - false - false - true - false - CommonExtensions - Microsoft\FSharp - None - Debug - AnyCPU - Library - Properties - RoslynDev - true - True - False - {E6A45CDF-B408-420F-B475-74611BEFC52B} - true - VisualFSharpOpenSource - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - VisualFSharpOpenSource - $(RootBinPath) - true - cs - - - - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - - - - Designer - - - Always - true - RegisterFsharpPackage.pkgdef - - - PreserveNewest - License.txt - true - - - PreserveNewest - packages\System.ValueTuple.4.3.1.nupkg - true - - - - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - - {649FA588-F02E-457C-9FCF-87E46407481E} - FSharp.Compiler.Interactive.Settings - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} - FSharp.Compiler.Server.Shared - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B} - FsiAnyCPU - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {D0E98C0D-490B-4C61-9329-0862F6E87645} - Fsi - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {65e0e82a-eace-4787-8994-888674c2fe87} - FSharp.Editor - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {c4586a06-1402-48bc-8e35-a1b8642f895b} - FSharp.UIResources - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} - FSharp.LanguageService.Base - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} - FSharp.LanguageService - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} - ProjectSystem.Base - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - ProjectSystem - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {FCFB214C-462E-42B3-91CA-FC557EFEE74F} - FSharp.PropertiesPages - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519} - FSharp.VS.FSI - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {6ba13aa4-c25f-480f-856b-8e8000299a72} - AppConfig - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {12ac2813-e895-4aaa-ae6c-94e21da09f64} - CodeFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {0385564F-07B4-4264-AB8A-17C393E9140C} - ResourceFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {a333b85a-dc23-49b6-9797-b89a7951e92d} - ScriptFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {e3fdd4ac-46b6-4b9f-b672-317d1202cc50} - SignatureFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {d11fc318-8f5d-4c8c-9287-ab40a016d13c} - TextFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {1fb1dd07-06aa-45b4-b5ac-20ff5bee98b6} - XMLFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {604f0daa-2d33-48dd-b162-edf0b672803d} - ConsoleProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - {01678cda-a11f-4dee-9344-2edf91cf1ae7} - LibraryProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - {2facee44-48bd-40b5-a2ee-b54a0c9bb7c4} - TutorialProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - - - False - $(FSharpSourcesRoot)\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - - - diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 4080b65175b..c3a446ae602 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -1,98 +1,23 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - 0 - v4.6 - false - false - false - false - false - false - false - false - true - true - CommonExtensions - Microsoft\FSharpTemplates - None - Debug - AnyCPU - Library - Properties - RoslynDev - true - False - True - {385035C1-9171-408A-8EAA-67DDC14E2CF3} - true - VisualFSharpTemplate - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpTemplate - $(RootBinPath) - true - cs + net46 + Library + Microsoft\FSharpTemplates false - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - + Designer + - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - + {604f0daa-2d33-48dd-b162-edf0b672803d} ConsoleProject ProjectTemplates @@ -100,7 +25,7 @@ false True - + {01678cda-a11f-4dee-9344-2edf91cf1ae7} LibraryProject ProjectTemplates @@ -108,7 +33,7 @@ false True - + {2facee44-48bd-40b5-a2ee-b54a0c9bb7c4} TutorialProject ProjectTemplates @@ -117,6 +42,5 @@ True - - + diff --git a/vsintegration/fsharp-vsintegration-item-templates-build.proj b/vsintegration/fsharp-vsintegration-item-templates-build.proj index 0442857df1a..7a463780dca 100644 --- a/vsintegration/fsharp-vsintegration-item-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-item-templates-build.proj @@ -15,5 +15,9 @@ - + + + + + diff --git a/vsintegration/fsharp-vsintegration-project-templates-build.proj b/vsintegration/fsharp-vsintegration-project-templates-build.proj index d810cea4de3..59683fa3f98 100644 --- a/vsintegration/fsharp-vsintegration-project-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-project-templates-build.proj @@ -11,5 +11,10 @@ + + + + + diff --git a/vsintegration/fsharp-vsintegration-src-build.proj b/vsintegration/fsharp-vsintegration-src-build.proj index 8a0d8a35828..4e0c3eb16dc 100644 --- a/vsintegration/fsharp-vsintegration-src-build.proj +++ b/vsintegration/fsharp-vsintegration-src-build.proj @@ -1,5 +1,6 @@ + net40 @@ -12,9 +13,13 @@ - + - + + + + + diff --git a/vsintegration/fsharp-vsintegration-unittests-build.proj b/vsintegration/fsharp-vsintegration-unittests-build.proj index 73bb45764ee..f461ddc9e9c 100644 --- a/vsintegration/fsharp-vsintegration-unittests-build.proj +++ b/vsintegration/fsharp-vsintegration-unittests-build.proj @@ -5,24 +5,34 @@ - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index 518b3639ebc..d7f6d10b430 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -5,12 +5,14 @@ - - - + + - - + + + + + diff --git a/vsintegration/packages.config b/vsintegration/packages.config deleted file mode 100644 index 43a4e62ba24..00000000000 --- a/vsintegration/packages.config +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index be4f0b37ec8..ec876ff9d5e 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -3,9 +3,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System -open System.Configuration -open System.Diagnostics -open Microsoft.CodeAnalysis.Classification [] module internal FSharpConstants = @@ -17,7 +14,11 @@ module internal FSharpConstants = [] /// "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" let languageServiceGuidString = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" - + + [] + /// "91a04a73-4f2c-4e7c-ad38-c1a68e7da05c" + let projectPackageGuidString = "91a04a73-4f2c-4e7c-ad38-c1a68e7da05c" + [] /// "F#" let FSharpLanguageName = "F#" @@ -45,7 +46,6 @@ module internal FSharpProviderConstants = /// "Session Capturing Quick Info Source Provider" let SessionCapturingProvider = "Session Capturing Quick Info Source Provider" - [] module internal Guids = @@ -69,4 +69,7 @@ module internal Guids = /// "8FDA964A-263D-4B4E-9560-29897535217C" let languageServicePerformanceOptionPageIdString = "8FDA964A-263D-4B4E-9560-29897535217C" + [] + let advancedSettingsPageIdSring = "9007718C-357A-4327-A193-AB3EC38D7EE8" + let blueHighContrastThemeId = Guid "{ce94d289-8481-498b-8ca9-9b6191a315b9}" diff --git a/vsintegration/src/FSharp.Editor/Common/Error.fs b/vsintegration/src/FSharp.Editor/Common/Error.fs index 101baa10909..d6b6678f0de 100644 --- a/vsintegration/src/FSharp.Editor/Common/Error.fs +++ b/vsintegration/src/FSharp.Editor/Common/Error.fs @@ -8,7 +8,3 @@ type internal Assert() = /// Display a good exception for this error message and then rethrow. static member Exception(e:Exception) = System.Diagnostics.Debug.Assert(false, "Unexpected exception seen in language service", e.ToString()) - - - - diff --git a/vsintegration/src/FSharp.Editor/Common/Vs.fs b/vsintegration/src/FSharp.Editor/Common/Vs.fs index 33fd16e6930..526166f05d6 100644 --- a/vsintegration/src/FSharp.Editor/Common/Vs.fs +++ b/vsintegration/src/FSharp.Editor/Common/Vs.fs @@ -3,16 +3,84 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Runtime.InteropServices open Microsoft.VisualStudio +open Microsoft.VisualStudio.Editor open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.TextManager.Interop /// Helper methods for interoperating with COM -module internal Com = +module internal Com = + let ThrowOnFailure0(hr) = + ErrorHandler.ThrowOnFailure(hr) |> ignore + + let ThrowOnFailure1(hr,res) = + ErrorHandler.ThrowOnFailure(hr) |> ignore; + res + + let ThrowOnFailure2(hr,res1,res2) = + ErrorHandler.ThrowOnFailure(hr) |> ignore; + res1,res2 + + let ThrowOnFailure3(hr,res1,res2,res3) = + ErrorHandler.ThrowOnFailure(hr) |> ignore; + res1,res2,res3 + + let ThrowOnFailure4(hr,res1,res2,res3,res4) = + ErrorHandler.ThrowOnFailure(hr) |> ignore; + res1,res2,res3,res4 + let Succeeded hr = // REVIEW: Not the correct check for succeeded hr = VSConstants.S_OK +module internal VsUserData = + + let vsBufferMoniker = Guid("978A8E17-4DF8-432A-9623-D530A26452BC") + + // This is the file name of the buffer. + let GetBufferMonker(ud:IVsUserData) : string = + downcast Com.ThrowOnFailure1(ud.GetData(ref vsBufferMoniker)) + +module internal VsTextLines = + /// Get the length of the given line. + let LengthOfLine (buffer:IVsTextBuffer) (line:int) : int = + Com.ThrowOnFailure1(buffer.GetLengthOfLine(line)) + + /// Get the text for a particular line. + let LineText (buffer:IVsTextLines) line = + Com.ThrowOnFailure1(buffer.GetLineText(line, 0, line, LengthOfLine buffer line)) + + /// Get the color state + let TextColorState (buffer:IVsTextLines) : IVsTextColorState= unbox(box(buffer)) + + /// Get the filename of the given buffer (via IVsUserData). Not all buffers have a file. This will be an exception. + let GetFilename(buffer : IVsTextLines) = + let ud = (box buffer) :?> IVsUserData + VsUserData.GetBufferMonker(ud) + + /// Get the string contents of a given buffer (the current snapshot). + let GetFileContents(buffer: IVsTextBuffer, editorAdaptersFactoryService: IVsEditorAdaptersFactoryService) = + let dataBuffer = editorAdaptersFactoryService.GetDataBuffer(buffer) + dataBuffer.CurrentSnapshot.GetText() + +module internal VsRunningDocumentTable = + let FindDocumentWithoutLocking(rdt:IVsRunningDocumentTable, url:string) : (IVsHierarchy * IVsTextLines) option = + let (hr:int, hier:IVsHierarchy, _itemid:uint32, unkData:IntPtr, _cookie:uint32) = rdt.FindAndLockDocument(uint32 _VSRDTFLAGS.RDT_NoLock, url) + try + if Com.Succeeded(hr) then + let bufferObject = + if unkData=IntPtr.Zero then null + else Marshal.GetObjectForIUnknown(unkData) + let buffer = + match bufferObject with + | :? IVsTextLines as tl -> tl + | _ -> null + Some(hier, buffer) + else None + finally + if IntPtr.Zero <> unkData then Marshal.Release(unkData)|>ignore + [] module internal ServiceProviderExtensions = type internal System.IServiceProvider with diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 5f0b7f51a8e..a03ba5b93f8 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -1,38 +1,25 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - true - - - - Debug - AnyCPU - 2.0 - {65E0E82A-EACE-4787-8994-888674C2FE87} + net46 Library - FSharp.Editor - true - LIBRARY - v4.6 - $(NoWarn);75 - false - $(OtherFlags) --warnon:1182 --subsystemversion:6.00 - true - true + true false - false - true - true - true + $(NoWarn);75 + true + $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + true + false + + true @@ -42,11 +29,11 @@ + - @@ -54,6 +41,9 @@ + + + @@ -102,189 +92,54 @@ + - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - FSharp.UIResources - {c4586a06-1402-48bc-8e35-a1b8642f895b} - True - - - FSharp.VS.FSI - {991dcf75-c2eb-42b6-9a0d-aa1d2409d519} - True - + + + + + + + - + + + - - - + - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.Intellisense.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.Intellisense.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.StandardClassification.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.StandardClassification.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ComponentModelHost.15.0.26201-alpha\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Wpf.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - $(FSharpSourcesRoot)\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - + + + + + + + + + + + + + + + + + + + + + + + - - - - \ No newline at end of file + + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 1414d45144d..d812b3320d0 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -204,4 +204,7 @@ Rename '{0}' to '__' + + Advanced + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 81d87ed4a5e..cde09f1dbea 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -4,7 +4,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Composition -open System.Collections.Generic open System.Linq open System.Threading open System.Threading.Tasks @@ -29,44 +28,43 @@ type internal FailureInlineRenameInfo private () = member __.DisplayName = "" member __.FullDisplayName = "" member __.Glyph = Glyph.MethodPublic - member __.GetFinalSymbolName _replacementText = "" - member __.GetReferenceEditSpan(_location, _cancellationToken) = Unchecked.defaultof<_> - member __.GetConflictEditSpan(_location, _replacementText, _cancellationToken) = Nullable() - member __.FindRenameLocationsAsync(_optionSet, _cancellationToken) = Task.FromResult null - member __.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = false - member __.TryOnAfterGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = false + member __.GetFinalSymbolName _ = "" + member __.GetReferenceEditSpan(_, _) = Unchecked.defaultof<_> + member __.GetConflictEditSpan(_, _, _) = Nullable() + member __.FindRenameLocationsAsync(_, _) = Task.FromResult null + member __.TryOnBeforeGlobalSymbolRenamed(_, _, _) = false + member __.TryOnAfterGlobalSymbolRenamed(_, _, _) = false static member Instance = FailureInlineRenameInfo() :> IInlineRenameInfo -type internal DocumentLocations = - { Document: Document - Locations: InlineRenameLocation [] } - -type internal InlineRenameLocationSet(locationsByDocument: DocumentLocations [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = +type internal InlineRenameLocationSet(locations: InlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = interface IInlineRenameLocationSet with - member __.Locations : IList = - upcast [| for doc in locationsByDocument do yield! doc.Locations |].ToList() + member __.Locations = upcast locations.ToList() - member this.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = - let rec applyChanges i (solution: Solution) = + member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = + let rec applyChanges (solution: Solution) (locationsByDocument: (Document * InlineRenameLocation list) list) = async { - if i = locationsByDocument.Length then - return solution - else - let doc = locationsByDocument.[i] - let! oldSourceText = doc.Document.GetTextAsync(cancellationToken) |> Async.AwaitTask - let changes = doc.Locations |> Seq.map (fun loc -> TextChange(loc.TextSpan, replacementText)) - let newSource = oldSourceText.WithChanges(changes) - return! applyChanges (i + 1) (solution.WithDocumentText(doc.Document.Id, newSource)) + match locationsByDocument with + | [] -> return solution + | (document, locations) :: rest -> + let! oldSource = document.GetTextAsync(cancellationToken) |> Async.AwaitTask + let newSource = oldSource.WithChanges(locations |> List.map (fun l -> TextChange(l.TextSpan, replacementText))) + return! applyChanges (solution.WithDocumentText(document.Id, newSource)) rest } async { - let! newSolution = applyChanges 0 originalSolution + let! newSolution = applyChanges originalSolution (locations |> Array.toList |> List.groupBy (fun x -> x.Document)) + // > debug + let newDoc = newSolution.GetDocument(locations.[0].Document.Id) + let! newSource = newDoc.GetTextAsync(cancellationToken) |> Async.AwaitTask + let newText = newSource.ToString() + let _ = newText + // < debug return { new IInlineRenameReplacementInfo with member __.NewSolution = newSolution member __.ReplacementTextValid = Tokenizer.isValidNameForSymbol(symbolKind, symbol, replacementText) - member __.DocumentIds = locationsByDocument |> Seq.map (fun doc -> doc.Document.Id) - member __.GetReplacements(documentId) = Seq.empty } + member __.DocumentIds = locations |> Seq.map (fun doc -> doc.Document.Id) |> Seq.distinct + member __.GetReplacements _ = Seq.empty } } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) @@ -98,7 +96,7 @@ type internal InlineRenameInfo member __.LocalizedErrorMessage = null member __.TriggerSpan = triggerSpan member __.HasOverloads = false - member __.ForceRenameOverloads = true + member __.ForceRenameOverloads = false member __.DisplayName = symbolUse.Symbol.DisplayName member __.FullDisplayName = try symbolUse.Symbol.FullName with _ -> symbolUse.Symbol.DisplayName member __.Glyph = Glyph.MethodPublic @@ -108,30 +106,34 @@ type internal InlineRenameInfo let text = getDocumentText location.Document cancellationToken Tokenizer.fixupSpan(text, location.TextSpan) - member __.GetConflictEditSpan(location, _replacementText, _cancellationToken) = Nullable(location.TextSpan) + member __.GetConflictEditSpan(location, replacementText, cancellationToken) = + let text = getDocumentText location.Document cancellationToken + let spanText = text.ToString(location.TextSpan) + let position = spanText.LastIndexOf(replacementText, StringComparison.Ordinal) + if position < 0 then Nullable() + else Nullable(TextSpan(location.TextSpan.Start + position, replacementText.Length)) member __.FindRenameLocationsAsync(_optionSet, cancellationToken) = async { let! symbolUsesByDocumentId = symbolUses - let! locationsByDocument = + let! locations = symbolUsesByDocumentId |> Seq.map (fun (KeyValue(documentId, symbolUses)) -> async { let document = document.Project.Solution.GetDocument(documentId) - let! cancellationToken = Async.CancellationToken let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask - let locations = - symbolUses - |> Array.choose (fun symbolUse -> - RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) - |> Option.map (fun span -> - let textSpan = Tokenizer.fixupSpan(sourceText, span) - InlineRenameLocation(document, textSpan))) - - return { Document = document; Locations = locations } + return + [| for symbolUse in symbolUses do + match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) with + | Some span -> + let textSpan = Tokenizer.fixupSpan(sourceText, span) + yield InlineRenameLocation(document, textSpan) + | None -> () |] }) |> Async.Parallel - return InlineRenameLocationSet(locationsByDocument, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IInlineRenameLocationSet + |> Async.map Array.concat + + return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IInlineRenameLocationSet } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) member __.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true @@ -142,8 +144,7 @@ type internal InlineRenameService [] ( projectInfoManager: FSharpProjectOptionsManager, - checkerProvider: FSharpCheckerProvider, - [] _refactorNotifyServices: seq + checkerProvider: FSharpCheckerProvider ) = static let userOpName = "InlineRename" diff --git a/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs b/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs new file mode 100644 index 00000000000..71d53fe406f --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System.Runtime.InteropServices + +/// Narrow abstraction over the project system. +type internal AdviseProjectSiteChanges = delegate of unit -> unit + +[] +type internal IProvideProjectSite = + abstract GetProjectSite : unit -> IProjectSite + +/// Represents known F#-specific information about a project. +and internal IProjectSite = + + /// List of files in the project. In the correct order. + abstract CompilationSourceFiles : string[] + + /// Flags that the compiler would need to understand how to compile. Includes '-r' + /// options but not source files + abstract CompilationOptions : string[] + + /// The normalized '-r:' assembly references, without the '-r:' + abstract CompilationReferences : string [] + + /// The '-o:' output bin path, without the '-o:' + abstract CompilationBinOutputPath : string option + + /// The name of the project file. + abstract ProjectFileName : string + + /// Register for notifications for when the above change + abstract AdviseProjectSiteChanges : callbackOwnerKey: string * AdviseProjectSiteChanges -> unit + + /// Register for notifications when project is cleaned/rebuilt (and thus any live TypeProviders should be refreshed) + abstract AdviseProjectSiteCleaned : callbackOwnerKey: string * AdviseProjectSiteChanges -> unit + + // Register for notifications when project is closed. + abstract AdviseProjectSiteClosed : callbackOwnerKey: string * AdviseProjectSiteChanges -> unit + + /// A user-friendly description of the project. Used only for developer/DEBUG tooltips and such. + abstract Description : string + + /// The error list task reporter + abstract BuildErrorReporter : Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2 option with get, set + + /// False type resolution errors are invalid. This occurs with orphaned source files. The prior + /// type checking state is unknown. In this case we don't want to squiggle the type checking files. + abstract IsIncompleteTypeCheckEnvironment : bool + + /// target framework moniker + abstract TargetFrameworkMoniker : string + + /// Project Guid + abstract ProjectGuid : string + + /// timestamp the site was last loaded + abstract LoadTime : System.DateTime + + abstract ProjectProvider : IProvideProjectSite option \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 25c9fe6a286..5b6ccb784e3 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -23,8 +23,8 @@ open Microsoft.FSharp.Compiler.CompileOps open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio open Microsoft.VisualStudio.Editor -open Microsoft.VisualStudio.FSharp.LanguageService -open Microsoft.VisualStudio.FSharp.LanguageService.SiteProvider +open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.FSharp.Editor.SiteProvider open Microsoft.VisualStudio.TextManager.Interop open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService @@ -34,6 +34,7 @@ open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.ComponentModelHost +open Microsoft.VisualStudio.Text.Outlining // Exposes FSharpChecker as MEF export [); Composition.Shared>] @@ -285,6 +286,8 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] + [, "F#", null, "Advanced", "6012")>] + [] [, strLanguageName = FSharpConstants.FSharpLanguageName, languageResourceID = 100, @@ -359,6 +362,7 @@ type override this.Initialize() = base.Initialize() + let workspaceChanged (args:WorkspaceChangeEventArgs) = match args.Kind with | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId) @@ -572,6 +576,13 @@ type let textViewAdapter = package.ComponentModel.GetService() + // Toggles outlining (or code folding) based on settings + let outliningManagerService = this.Package.ComponentModel.GetService() + let wpfTextView = this.EditorAdaptersFactoryService.GetWpfTextView(textView) + let outliningManager = outliningManagerService.GetOutliningManager(wpfTextView) + if not (isNull outliningManager) then + outliningManager.Enabled <- Settings.Advanced.IsOutliningEnabled + match textView.GetBuffer() with | (VSConstants.S_OK, textLines) -> let filename = VsTextLines.GetFilename textLines @@ -585,12 +596,13 @@ type match hier with | :? IProvideProjectSite as siteProvider when not (IsScript(filename)) -> this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") - | _ when not (IsScript(filename)) -> + | h when not (IsScript(filename)) -> let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with | null -> - let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) - this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) + if not (h.IsCapabilityMatch("CPS")) then + let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) + this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) | id -> projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=true) | _ -> diff --git a/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs new file mode 100644 index 00000000000..6c5a2c61cb8 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module internal rec Microsoft.VisualStudio.FSharp.Editor.SiteProvider + +open System +open System.IO +open System.Collections.Concurrent +open System.Diagnostics + +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.CodeAnalysis +open Microsoft.VisualStudio +open Microsoft.VisualStudio.LanguageServices +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.LanguageServices.Implementation.TaskList +open Microsoft.VisualStudio.Shell.Interop +open Microsoft.VisualStudio.TextManager.Interop + +open VSLangProj + +/// An additional interface that an IProjectSite object can implement to indicate it has an FSharpProjectOptions +/// already available, so we don't have to recreate it +type private IHaveCheckOptions = + abstract OriginalCheckOptions : unit -> string[] * FSharpProjectOptions + +let projectDisplayNameOf projectFileName = + if String.IsNullOrWhiteSpace projectFileName then projectFileName + else Path.GetFileNameWithoutExtension projectFileName + +/// A value and a function to recompute/refresh the value. The function is passed a flag indicating if a refresh is happening. +type Refreshable<'T> = 'T * (bool -> 'T) + +/// Convert from FSharpProjectOptions into IProjectSite. +type private ProjectSiteOfScriptFile(filename:string, referencedProjectFileNames, checkOptions: FSharpProjectOptions) = + interface IProjectSite with + override __.Description = sprintf "Script Closure at Root %s" filename + override __.CompilationSourceFiles = checkOptions.SourceFiles + override __.CompilationOptions = checkOptions.OtherOptions + override __.CompilationReferences = + checkOptions.OtherOptions + |> Array.choose (fun flag -> if flag.StartsWith("-r:") then Some flag.[3..] else None) + override __.CompilationBinOutputPath = None + override __.ProjectFileName = checkOptions.ProjectFileName + override __.BuildErrorReporter with get() = None and set _ = () + override __.AdviseProjectSiteChanges(_,_) = () + override __.AdviseProjectSiteCleaned(_,_) = () + override __.AdviseProjectSiteClosed(_,_) = () + override __.IsIncompleteTypeCheckEnvironment = checkOptions.IsIncompleteTypeCheckEnvironment + override __.TargetFrameworkMoniker = "" + override __.ProjectGuid = "" + override __.LoadTime = checkOptions.LoadTime + override __.ProjectProvider = None + + interface IHaveCheckOptions with + override __.OriginalCheckOptions() = (referencedProjectFileNames, checkOptions) + + override __.ToString() = sprintf "ProjectSiteOfScriptFile(%s)" filename + +/// An orphan file project is a .fs, .ml, .fsi, .mli that is not associated with a .fsproj. +/// By design, these are never going to typecheck because there is no affiliated references. +/// We show many squiggles in this case because they're not particularly informational. +type private ProjectSiteOfSingleFile(sourceFile) = + // CompilerFlags() gets called a lot, so pre-compute what we can + static let compilerFlags = + let flags = ["--noframework";"--warn:3"] + let assumeDotNetFramework = true + let defaultReferences = + [ for r in CompilerEnvironment.DefaultReferencesForOrphanSources(assumeDotNetFramework) do + yield sprintf "-r:%s%s" r (if r.EndsWith(".dll",StringComparison.OrdinalIgnoreCase) then "" else ".dll") ] + (flags @ defaultReferences) + |> List.toArray + |> Array.choose (fun flag -> if flag.StartsWith("-r:") then Some flag.[3..] elif flag.StartsWith("--reference:") then Some flag.[12..] else None) + + let projectFileName = sourceFile + ".orphan.fsproj" + + interface IProjectSite with + override __.Description = projectFileName + override __.CompilationSourceFiles = [|sourceFile|] + override __.CompilationOptions = compilerFlags + override __.CompilationReferences = compilerFlags + override __.CompilationBinOutputPath = None + override __.ProjectFileName = projectFileName + override __.BuildErrorReporter with get() = None and set _v = () + override __.AdviseProjectSiteChanges(_,_) = () + override __.AdviseProjectSiteCleaned(_,_) = () + override __.AdviseProjectSiteClosed(_,_) = () + override __.IsIncompleteTypeCheckEnvironment = true + override __.TargetFrameworkMoniker = "" + override __.ProjectGuid = "" + override __.LoadTime = new DateTime(2000,1,1) // any constant time is fine, orphan files do not interact with reloading based on update time + override __.ProjectProvider = None + + override __.ToString() = sprintf "ProjectSiteOfSingleFile(%s)" sourceFile + +/// Manage Storage of FSharpProjectOptions the options for a project +type internal FSharpProjectOptionsTable () = + + // A table of information about projects, excluding single-file projects. + let projectTable = ConcurrentDictionary>() + let commandLineOptions = new ConcurrentDictionary() + + /// Re-fetch all of the options for everything that references projectId + let refreshInfoForProjectsThatReferenceThisProject (projectId:ProjectId) = + for KeyValue(otherProjectId, ((referencedProjectIds, _parsingOptions, _site, _options), refresh)) in projectTable.ToArray() do + for referencedProjectId in referencedProjectIds do + if referencedProjectId = projectId then + projectTable.[otherProjectId] <- (refresh true, refresh) + + /// Add or update a project in the project table + member __.AddOrUpdateProject(projectId:ProjectId, refresh) = + projectTable.[projectId] <- (refresh false, refresh) + refreshInfoForProjectsThatReferenceThisProject(projectId) + + /// Clear a project from the project table + member __.ClearInfoForProject(projectId:ProjectId) = + projectTable.TryRemove(projectId) |> ignore + refreshInfoForProjectsThatReferenceThisProject projectId + + /// Get the options for a project + member __.TryGetOptionsForProject(projectId:ProjectId) = + match projectTable.TryGetValue(projectId) with + | true, ((_referencedProjects, parsingOptions, site, projectOptions), _) -> Some (parsingOptions, site, projectOptions) + | _ -> None + + /// Given a projectId return the most recent set of command line options for it + member __.GetCommandLineOptionsWithProjectId(projectId:ProjectId) = + match commandLineOptions.TryGetValue projectId with + | true, (sources, references, options) -> sources, references, options + | _ -> [||], [||], [||] + + /// Store the command line options for a projectId + member __.SetOptionsWithProjectId(projectId:ProjectId, sourcePaths:string[], referencePaths:string[], options:string[]) = + commandLineOptions.[projectId] <- (sourcePaths, referencePaths, options) + + +let internal provideProjectSiteProvider(workspace:VisualStudioWorkspaceImpl, project:Project, serviceProvider:System.IServiceProvider, projectOptionsTable:FSharpProjectOptionsTable option) = + let hier = workspace.GetHierarchy(project.Id) + let getCommandLineOptionsWithProjectId (projectId) = + match projectOptionsTable with + | Some (options) -> options.GetCommandLineOptionsWithProjectId(projectId) + | None -> [||], [||], [||] + { + new IProvideProjectSite with + member x.GetProjectSite() = + let fst (a, _, _) = a + let snd (_, b, _) = b + let mutable errorReporter = + let reporter = ProjectExternalErrorReporter(project.Id, "FS", serviceProvider) + Some(reporter:> IVsLanguageServiceBuildErrorReporter2) + + { + new IProjectSite with + member __.Description = project.Name + member __.CompilationSourceFiles = getCommandLineOptionsWithProjectId(project.Id) |> fst + member __.CompilationOptions = + let _,references,options = getCommandLineOptionsWithProjectId(project.Id) + Array.concat [options; references |> Array.map(fun r -> "-r:" + r)] + member __.CompilationReferences = getCommandLineOptionsWithProjectId(project.Id) |> snd + member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) + member __.ProjectFileName = project.FilePath + member __.AdviseProjectSiteChanges(_,_) = () + member __.AdviseProjectSiteCleaned(_,_) = () + member __.AdviseProjectSiteClosed(_,_) = () + member __.IsIncompleteTypeCheckEnvironment = false + member __.TargetFrameworkMoniker = "" + member __.ProjectGuid = project.Id.Id.ToString() + member __.LoadTime = System.DateTime.Now + member __.ProjectProvider = Some (x) + member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v + } + interface IVsHierarchy with + member __.SetSite(psp) = hier.SetSite(psp) + member __.GetSite(psp) = hier.GetSite(ref psp) + member __.QueryClose(pfCanClose)= hier.QueryClose(ref pfCanClose) + member __.Close() = hier.Close() + member __.GetGuidProperty(itemid, propid, pguid) = hier.GetGuidProperty(itemid, propid, ref pguid) + member __.SetGuidProperty(itemid, propid, rguid) = hier.SetGuidProperty(itemid, propid, ref rguid) + member __.GetProperty(itemid, propid, pvar) = hier.GetProperty(itemid, propid, ref pvar) + member __.SetProperty(itemid, propid, var) = hier.SetProperty(itemid, propid, var) + member __.GetNestedHierarchy(itemid, iidHierarchyNested, ppHierarchyNested, pitemidNested) = + hier.GetNestedHierarchy(itemid, ref iidHierarchyNested, ref ppHierarchyNested, ref pitemidNested) + member __.GetCanonicalName(itemid, pbstrName) = hier.GetCanonicalName(itemid, ref pbstrName) + member __.ParseCanonicalName(pszName, pitemid) = hier.ParseCanonicalName(pszName, ref pitemid) + member __.Unused0() = hier.Unused0() + member __.AdviseHierarchyEvents(pEventSink, pdwCookie) = hier.AdviseHierarchyEvents(pEventSink, ref pdwCookie) + member __.UnadviseHierarchyEvents(dwCookie) = hier.UnadviseHierarchyEvents(dwCookie) + member __.Unused1() = hier.Unused1() + member __.Unused2() = hier.Unused2() + member __.Unused3() = hier.Unused3() + member __.Unused4() = hier.Unused4() + } + +/// Information about projects, open files and other active artifacts in visual studio. +/// Keeps track of the relationship between IVsTextLines buffers, IFSharpSource_DEPRECATED objects, IProjectSite objects and FSharpProjectOptions +[] +type internal ProjectSitesAndFiles() = + static let mutable stamp = 0L + + static let fullOutputAssemblyPath (p:EnvDTE.Project) = + let getProperty tag = + try Some (p.Properties.[tag].Value.ToString()) with _ -> None + getProperty "FullPath" + |> Option.bind (fun fullPath -> + (try Some (p.ConfigurationManager.ActiveConfiguration.Properties.["OutputPath"].Value.ToString()) with _ -> None) + |> Option.bind (fun outputPath -> + getProperty "OutputFileName" + |> Option.map (fun outputFileName -> Path.Combine(fullPath, outputPath, outputFileName)))) + |> Option.bind (fun path -> try Some (Path.GetFullPath path) with _ -> None) + + static let referencedProjects (projectSite:IProjectSite) = + match projectSite.ProjectProvider with + | None -> None + | Some (:? IVsHierarchy as hier) -> + match hier.GetProperty(VSConstants.VSITEMID_ROOT, int __VSHPROPID.VSHPROPID_ExtObject) with + | VSConstants.S_OK, (:? EnvDTE.Project as p) when not (isNull p) -> + Some ((p.Object :?> VSLangProj.VSProject).References + |> Seq.cast + |> Seq.choose (fun r -> + Option.ofObj r + |> Option.bind (fun r -> try Option.ofObj r.SourceProject with _ -> None)) ) + | _ -> None + | Some _ -> None + + static let rec referencedProvideProjectSites(projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo:obj option, projectOptionsTable:FSharpProjectOptionsTable option) = + let getReferencesForSolutionService (solutionService:IVsSolution) = + [| + match referencedProjects projectSite, extraProjectInfo with + | None, Some (:? VisualStudioWorkspaceImpl as workspace) when not (isNull workspace.CurrentSolution)-> + let path = projectSite.ProjectFileName + if not (String.IsNullOrWhiteSpace(path)) then + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) + let project = workspace.CurrentSolution.GetProject(projectId) + if not (isNull project) then + for reference in project.ProjectReferences do + let project = workspace.CurrentSolution.GetProject(reference.ProjectId) + if not (isNull project) && project.Language = FSharpConstants.FSharpLanguageName then + let siteProvider = provideProjectSiteProvider (workspace, project, serviceProvider, projectOptionsTable) + let referenceProject = workspace.ProjectTracker.GetProject(reference.ProjectId) + let outputPath = referenceProject.BinOutputPath + yield Some projectId, project.FilePath, outputPath, siteProvider + + | (Some references), _ -> + 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 + | _ -> () + | None, _ -> () + |] + let solutionService = try Some (serviceProvider.GetService(typeof) :?> IVsSolution) with _ -> None + seq { match solutionService with + | Some solutionService -> + for reference in getReferencesForSolutionService solutionService do + yield reference + | None -> () + } + + static let rec referencedProjectsOf(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable, useUniqueStamp) = + [| for (projectId, projectFileName, outputPath, projectSiteProvider) in referencedProvideProjectSites (projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) do + let referencedProjectOptions = + // Lookup may not succeed if the project has not been established yet + // In this case we go and compute the options recursively. + match tryGetOptionsForReferencedProject projectFileName with + | None -> getProjectOptionsForProjectSite (enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSiteProvider.GetProjectSite(), serviceProvider, projectId, projectFileName, extraProjectInfo, projectOptionsTable, useUniqueStamp) |> snd + | Some options -> options + yield projectFileName, (outputPath, referencedProjectOptions) |] + + and getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, projectId, fileName, extraProjectInfo, projectOptionsTable, useUniqueStamp) = + let referencedProjectFileNames, referencedProjectOptions = + if enableInMemoryCrossProjectReferences then + referencedProjectsOf(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable, useUniqueStamp) + |> Array.unzip + else [| |], [| |] + let option = + let newOption () = { + ProjectFileName = projectSite.ProjectFileName + SourceFiles = projectSite.CompilationSourceFiles + OtherOptions = projectSite.CompilationOptions + ReferencedProjects = referencedProjectOptions + IsIncompleteTypeCheckEnvironment = projectSite.IsIncompleteTypeCheckEnvironment + UseScriptResolutionRules = SourceFile.MustBeSingleFileProject fileName + LoadTime = projectSite.LoadTime + UnresolvedReferences = None + OriginalLoadReferences = [] + ExtraProjectInfo=extraProjectInfo + Stamp = if useUniqueStamp then (stamp <- stamp + 1L; Some stamp) else None + } + match projectId, projectOptionsTable with + | Some id, Some optionsTable -> + // Get options from cache + match optionsTable.TryGetOptionsForProject(id) with + | Some (_parsingOptions, _site, projectOptions) -> + if projectSite.CompilationSourceFiles <> projectOptions.SourceFiles || + projectSite.CompilationOptions <> projectOptions.OtherOptions || + referencedProjectOptions <> projectOptions.ReferencedProjects then + newOption() + else + projectOptions + | _ -> newOption() + | _ -> newOption() + referencedProjectFileNames, option + + /// Construct a project site for a single file. May be a single file project (for scripts) or an orphan project site (for everything else). + static member ProjectSiteOfSingleFile(filename:string) : IProjectSite = + if SourceFile.MustBeSingleFileProject(filename) then + Debug.Assert(false, ".fsx or .fsscript should have been treated as implicit project") + failwith ".fsx or .fsscript should have been treated as implicit project" + new ProjectSiteOfSingleFile(filename) :> IProjectSite + + static member GetReferencedProjectSites(projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo, projectOptions) = + referencedProvideProjectSites (projectSite, serviceProvider, extraProjectInfo, projectOptions) + |> Seq.map (fun (_, _, _, ps) -> ps.GetProjectSite()) + |> Seq.toArray + + /// Create project options for this project site. + static member GetProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite:IProjectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable, useUniqueStamp) = + match projectSite with + | :? IHaveCheckOptions as hco -> hco.OriginalCheckOptions() + | _ -> getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable, useUniqueStamp) + + /// Create project site for these project options + static member CreateProjectSiteForScript (filename, referencedProjectFileNames, checkOptions) = + ProjectSiteOfScriptFile (filename, referencedProjectFileNames, checkOptions) :> IProjectSite \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs b/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs new file mode 100644 index 00000000000..4b6fa6ff05d --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs @@ -0,0 +1,24 @@ +// 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.Diagnostics +open Microsoft.VisualStudio.Shell + +type internal ProvideFSharpVersionRegistrationAttribute(packageGuidString:string, productName:string) = + inherit RegistrationAttribute() + + let keyName = "InstalledProducts\\" + productName + + override this.Register(context:RegistrationAttribute.RegistrationContext) = + // Get the version of this build. This code is executed by CreatePkgDef.exe at build time and NOT at runtime. + let version = FileVersionInfo.GetVersionInfo(typeof.Assembly.Location) + use key = context.CreateKey(keyName) + key.SetValue("Package", Guid.Parse(packageGuidString).ToString("B")) + key.SetValue("PID", version.ProductVersion) + key.SetValue("UseInterface", false) + key.SetValue("UseVSProductID", false) + + override this.Unregister(context:RegistrationAttribute.RegistrationContext) = + context.RemoveKey(keyName) diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 387b808b717..8444a3c1574 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -7,7 +7,6 @@ open Microsoft.VisualStudio.FSharp.UIResources open SettingsPersistence open OptionsUIHelpers - module DefaultTuning = let SemanticColorizationInitialDelay = 0 (* milliseconds *) let UnusedDeclarationsAnalyzerInitialDelay = 0 (* 1000 *) (* milliseconds *) @@ -42,6 +41,11 @@ type LanguageServicePerformanceOptions = { EnableInMemoryCrossProjectReferences: bool ProjectCheckCacheSize: int } +[] +type AdvancedOptions = + { IsBlockStructureEnabled: bool + IsOutliningEnabled: bool } + [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings @@ -67,12 +71,17 @@ type internal Settings [](store: SettingsStore) = { EnableInMemoryCrossProjectReferences = true ProjectCheckCacheSize = 200 } + store.RegisterDefault + { IsBlockStructureEnabled = true + IsOutliningEnabled = true } + interface ISettings static member IntelliSense : IntelliSenseOptions = getSettings() static member QuickInfo : QuickInfoOptions = getSettings() static member CodeFixes : CodeFixesOptions = getSettings() static member LanguageServicePerformance : LanguageServicePerformanceOptions = getSettings() + static member Advanced: AdvancedOptions = getSettings() module internal OptionsUI = @@ -106,4 +115,10 @@ module internal OptionsUI = type internal LanguageServicePerformanceOptionPage() = inherit AbstractOptionPage() override this.CreateView() = - upcast LanguageServicePerformanceOptionControl() \ No newline at end of file + upcast LanguageServicePerformanceOptionControl() + + [] + type internal AdvancedSettingsOptionPage() = + inherit AbstractOptionPage() + override __.CreateView() = + upcast AdvancedOptionsControl() \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs index 865165665a3..af5f570428e 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -16,54 +16,57 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.SourceCodeServices.Structure module internal BlockStructure = - let scopeToBlockType = function - | Scope.Open -> BlockTypes.Imports - | Scope.Namespace - | Scope.Module -> BlockTypes.Namespace - | Scope.Record - | Scope.Interface - | Scope.TypeExtension - | Scope.RecordDefn - | Scope.CompExpr - | Scope.ObjExpr - | Scope.UnionDefn - | Scope.Attribute - | Scope.Type -> BlockTypes.Type - | Scope.New - | Scope.RecordField - | Scope.Member -> BlockTypes.Member - | Scope.LetOrUse - | Scope.Match - | Scope.MatchClause - | Scope.EnumCase - | Scope.UnionCase - | Scope.MatchLambda - | Scope.ThenInIfThenElse - | Scope.ElseInIfThenElse - | Scope.TryWith - | Scope.TryInTryWith - | Scope.WithInTryWith - | Scope.TryFinally - | Scope.TryInTryFinally - | Scope.FinallyInTryFinally - | Scope.IfThenElse-> BlockTypes.Conditional - | Scope.Tuple - | Scope.ArrayOrList - | Scope.CompExprInternal - | Scope.Quote - | Scope.SpecialFunc - | Scope.Lambda - | Scope.LetOrUseBang - | Scope.Val - | Scope.YieldOrReturn - | Scope.YieldOrReturnBang - | Scope.TryWith -> BlockTypes.Expression - | Scope.Do -> BlockTypes.Statement - | Scope.While - | Scope.For -> BlockTypes.Loop - | Scope.HashDirective -> BlockTypes.PreprocessorRegion - | Scope.Comment - | Scope.XmlDocComment -> BlockTypes.Comment + let scopeToBlockType scope = + if not Settings.Advanced.IsBlockStructureEnabled then BlockTypes.Nonstructural + else + match scope with + | Scope.Open -> BlockTypes.Imports + | Scope.Namespace + | Scope.Module -> BlockTypes.Namespace + | Scope.Record + | Scope.Interface + | Scope.TypeExtension + | Scope.RecordDefn + | Scope.CompExpr + | Scope.ObjExpr + | Scope.UnionDefn + | Scope.Attribute + | Scope.Type -> BlockTypes.Type + | Scope.New + | Scope.RecordField + | Scope.Member -> BlockTypes.Member + | Scope.LetOrUse + | Scope.Match + | Scope.MatchClause + | Scope.EnumCase + | Scope.UnionCase + | Scope.MatchLambda + | Scope.ThenInIfThenElse + | Scope.ElseInIfThenElse + | Scope.TryWith + | Scope.TryInTryWith + | Scope.WithInTryWith + | Scope.TryFinally + | Scope.TryInTryFinally + | Scope.FinallyInTryFinally + | Scope.IfThenElse-> BlockTypes.Conditional + | Scope.Tuple + | Scope.ArrayOrList + | Scope.CompExprInternal + | Scope.Quote + | Scope.SpecialFunc + | Scope.Lambda + | Scope.LetOrUseBang + | Scope.Val + | Scope.YieldOrReturn + | Scope.YieldOrReturnBang + | Scope.TryWith -> BlockTypes.Expression + | Scope.Do -> BlockTypes.Statement + | Scope.While + | Scope.For -> BlockTypes.Loop + | Scope.HashDirective -> BlockTypes.PreprocessorRegion + | Scope.Comment + | Scope.XmlDocComment -> BlockTypes.Comment let isAutoCollapsible = function | Scope.New @@ -127,7 +130,7 @@ module internal BlockStructure = let hintSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, scopeRange.Range) match textSpan,hintSpan with | Some textSpan, Some hintSpan -> - let line = sourceText.Lines.GetLineFromPosition textSpan.Start + let line = sourceText.Lines.GetLineFromPosition textSpan.Start let bannerText = match Option.ofNullable (line.Span.Intersection textSpan) with | Some span -> sourceText.GetSubText(span).ToString()+"..." diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 0ede4b2a9bb..00a7f057973 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -147,6 +147,11 @@ Přejmenujte {0} na __. + + Advanced + Upřesnit + + \ 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 17ff35108ca..da1e2d33989 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -147,6 +147,11 @@ "{0}" in "__" umbenennen + + Advanced + Erweitert + + \ 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 7697e448374..1b08ecb74b0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf @@ -147,6 +147,11 @@ Rename '{0}' to '__' + + Advanced + Advanced + + \ 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 ecdfcef71ca..e9661c04897 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -147,6 +147,11 @@ Cambiar nombre de "{0}" por "__" + + Advanced + Avanzadas + + \ 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 69fad2ffa7c..2e41f543d26 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -147,6 +147,11 @@ Renommer '{0}' en '__' + + Advanced + Avancé + + \ 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 e64b7d154f2..1becd43e91d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -147,6 +147,11 @@ Rinomina '{0}' in '__' + + Advanced + Avanzate + + \ 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 483b00d09ef..1ea4b48b1f2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -147,6 +147,11 @@ '{0}' から '__' に名前を変更する + + Advanced + 詳細 + + \ 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 a37eda5d9b9..5c3177f7d9b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -147,6 +147,11 @@ '{0}'의 이름을 '__'로 바꾸기 + + Advanced + 고급 + + \ 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 073ec0b40f9..50c16a27f01 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -147,6 +147,11 @@ Zmień nazwę z „{0}” na „__” + + Advanced + Zaawansowane + + \ 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 c960f62982d..e4362c8c3f1 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -147,6 +147,11 @@ Renomear '{0}' para '__' + + Advanced + Avançado + + \ 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 2902161be1a..a31ffb183b2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -147,6 +147,11 @@ Переименовать "{0}" в "__" + + Advanced + Дополнительно + + \ 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 f35e52545c1..dee92da98ae 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -147,6 +147,11 @@ '{0}' öğesini '__' olarak yeniden adlandırma + + Advanced + Gelişmiş + + \ 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 83eb7bfb8c9..3936d51f0d8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -147,6 +147,11 @@ 将“{0}”重命名为“__” + + Advanced + 高级 + + \ 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 4b772e2c823..4a8801714b6 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -147,6 +147,11 @@ 將 '{0}' 重新命名為 '__' + + Advanced + 進階 + + \ 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 15f1ada9fef..636c1ff1717 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -1,251 +1,28 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - CSharp - true - cs - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - AnyCPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} + net46 Library - Properties - FSharp.LanguageService.Base - FSharp.LanguageService.Base - LIBRARY - true - $(NoWarn);3001,3002,3003 - $(DefineConstants);UITHREAD_FOR_LANGUAGESERVICE - v4.6 - - - true - true + false + true false - false - true - true - true - - - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants) - true - true + $(NoWarn);1570;1574;1587;1591;3001,3002,3003 + true + true + false + - - $(FSharpSourcesRoot)\..\loc\lcl\{Lang}\$(AssemblyName).dll.lcl - $(FSharpSourcesRoot)\..\loc\lci\$(AssemblyName).dll.lci - false - false - - - - - - {991dcf75-c2eb-42b6-9a0d-aa1d2409d519} - FSharp.VS.FSI - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.MSXML.8.0.0-alpha\lib\net46\microsoft.msxml.dll - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.StandardClassification.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.StandardClassification.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ComponentModelHost.15.0.26201-alpha\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Microsoft.VisualStudio.Package.LanguageService.resx - Code - - - - - - - - - + + + + + + + ResXCodeGenerator @@ -257,8 +34,36 @@ Resources.completionset.bmp - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.LanguageService.Base/InternalsVisibleTo.cs b/vsintegration/src/FSharp.LanguageService.Base/InternalsVisibleTo.cs deleted file mode 100644 index 0d0fd353a98..00000000000 --- a/vsintegration/src/FSharp.LanguageService.Base/InternalsVisibleTo.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("VisualFSharp.Salsa, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("VisualFSharp.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.LanguageService, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.ProjectSystem.Base, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.ProjectSystem.FSharp, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.Editor, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] - diff --git a/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs b/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs index cb03110f1aa..4cfaf6553c3 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs @@ -6,13 +6,6 @@ using System.Runtime.InteropServices; using Microsoft.VisualStudio.Shell; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index e934e149a64..3e5a4c453dd 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -1,36 +1,19 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - true - FSharp - v4.6 - true - false - false - true - true - true - true - - - Debug - AnyCPU - 2.0 - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} + net46 Library - FSharp.LanguageService - true + true + false $(NoWarn);75 - LIBRARY - false + true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + true + false - - - - + @@ -43,8 +26,9 @@ + - + true Microsoft.VisualStudio.FSharp.LanguageService.Strings @@ -62,179 +46,50 @@ + + + + + + + + + + - + - - - - - + + + - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ComponentModelHost.15.0.26201-alpha\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - True - - - FSharp.VS.FSI - {991dcf75-c2eb-42b6-9a0d-aa1d2409d519} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + + diff --git a/vsintegration/src/FSharp.LanguageService/GotoDefinition.fs b/vsintegration/src/FSharp.LanguageService/GotoDefinition.fs index b027528e689..c92721ea1c4 100644 --- a/vsintegration/src/FSharp.LanguageService/GotoDefinition.fs +++ b/vsintegration/src/FSharp.LanguageService/GotoDefinition.fs @@ -40,7 +40,7 @@ module internal GotoDefinition = let ls = textView.GetBuffer() |> Com.ThrowOnFailure1 let len = ls.GetLengthOfLine line |> Com.ThrowOnFailure1 let lineStr = ls.GetLineText(line, 0, line, len) |> Com.ThrowOnFailure1 - + // in many cases we assume gotodef should work even if we don't stand on the identifier directly // treatTokenAsIdentifier governs if we want to have raw value of token (possibly operator) or if should always be considered as identifier let rec gotoDefinition alwaysTreatTokenAsIdentifier = @@ -74,9 +74,6 @@ module internal GotoDefinition = |> GotoDefinitionResult_DEPRECATED.MakeError else match typedResults.GetDeclarationLocation (line+1, colIdent, lineStr, qualId, false) |> Async.RunSynchronously with - | FSharpFindDeclResult.DeclFound m -> - let span = TextSpan (iStartLine = m.StartLine-1, iEndLine = m.StartLine-1, iStartIndex = m.StartColumn, iEndIndex = m.StartColumn) - GotoDefinitionResult_DEPRECATED.MakeSuccess(m.FileName, span) | FSharpFindDeclResult.DeclNotFound(reason) -> if makeAnotherAttempt then gotoDefinition true else @@ -88,8 +85,13 @@ module internal GotoDefinition = | FSharpFindDeclFailureReason.ProvidedType(typeName) -> String.Format(Strings.GotoDefinitionFailed_ProvidedType(), typeName) | FSharpFindDeclFailureReason.ProvidedMember(name) -> String.Format(Strings.GotoDefinitionFailed_ProvidedMember(), name) GotoDefinitionResult_DEPRECATED.MakeError text + | FSharpFindDeclResult.DeclFound m when System.IO.File.Exists m.FileName -> + let span = TextSpan (iStartLine = m.StartLine-1, iEndLine = m.StartLine-1, iStartIndex = m.StartColumn, iEndIndex = m.StartColumn) + GotoDefinitionResult_DEPRECATED.MakeSuccess(m.FileName, span) + | FSharpFindDeclResult.DeclFound _ (* File does not exist *) -> + GotoDefinitionResult_DEPRECATED.MakeError(Strings.GotoDefinitionFailed_NotSourceCode()) | FSharpFindDeclResult.ExternalDecl _ -> - GotoDefinitionResult_DEPRECATED.MakeError(Strings.GotoDefinitionFailed_NotSourceCode()) + GotoDefinitionResult_DEPRECATED.MakeError(Strings.GotoDefinitionFailed_NotSourceCode()) else Trace.Write("LanguageService", "Goto definition: No 'TypeCheckInfo' available") Strings.GotoDefinitionFailed_NoTypecheckInfo() diff --git a/vsintegration/src/FSharp.LanguageService/LanguageServiceConstants.fs b/vsintegration/src/FSharp.LanguageService/LanguageServiceConstants.fs index b64d0405948..46bd6dd2f04 100644 --- a/vsintegration/src/FSharp.LanguageService/LanguageServiceConstants.fs +++ b/vsintegration/src/FSharp.LanguageService/LanguageServiceConstants.fs @@ -8,3 +8,7 @@ module internal LanguageServiceConstants = /// "F#" [] let FSharpLanguageName = "F#" + + [] + /// "F# Language Service" + let FSharpLanguageServiceCallbackName = "F# Language Service" \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs index 7c1f858184c..0e5934a6de8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs @@ -5,15 +5,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -/* F# additions: begin. */ -[assembly:AssemblyConfiguration("")] -[assembly:AssemblyCulture("")] [assembly:ComVisible(false)] - -/* Make internals visible to other project system DLLs */ -[assembly:System.Runtime.CompilerServices.InternalsVisibleTo("FSharp.ProjectSystem.FSharp, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly:System.Runtime.CompilerServices.InternalsVisibleTo("FSharp.ProjectSystem.PropertyPages, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.Salsa, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] - [assembly: Microsoft.VisualStudio.Shell.ProvideCodeBase(CodeBase = @"$PackageFolder$\FSharp.ProjectSystem.Base.dll")] diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyReferenceNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyReferenceNode.cs index 148525d664c..2d346e86c2b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyReferenceNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyReferenceNode.cs @@ -666,7 +666,7 @@ public override object GetProperty(int propId) { var objectBrowserGuid = VSProjectConstants.guidObjectBrowser; var logicalViewGuid = VSConstants.LOGVIEWID.Primary_guid; - IVsUIShellOpenDocument3 shellOpenDocument3 = Package.GetGlobalService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument3; + IVsUIShellOpenDocument3 shellOpenDocument3 = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsUIShellOpenDocument)) as IVsUIShellOpenDocument3; return shellOpenDocument3.GetProvisionalViewingStatusForEditor(ref objectBrowserGuid, ref logicalViewGuid); } diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/AutomationClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/AutomationClasses.cd deleted file mode 100644 index fb3c8138d2b..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/AutomationClasses.cd +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - Automation\OAFileItem.cs - AAAAAIAAAAAAMAAAAAAAAAAAAAAAAAACgBABAAAAAAA= - - - - - - Automation\OANavigableProjectItems.cs - AEQAAAAAEABACBAAAAgASAQkCAgAIAAAAgAAAAAAACA= - - - - - - Automation\OAProject.cs - AAQAAJQAAABEUIIhQAAcCAQAAAkAAAAAIBgFCABCAAQ= - - - - - - - Automation\OAProjectItem.cs - AQQAQJAAAABEYAAgQACMDCQBCAkAAAACgBAFAAECAAA= - - - - - - - - - Automation\OAProjectItems.cs - AEAAAAAAEAAAAAAAAAAgAAAggAAAAAAAAAAAAAAAAAA= - - - - - - Automation\OAProperties.cs - AAYAAAACABAAABAAIAAAQCQEAAAAAAAAAAAAAAACAAA= - - - - - - Automation\OAProperty.cs - AQSAAAAAABAAQAJgAAAQQAQAgAAAAAAAAAAgAAAAAAA= - - - - - - Automation\OANestedProjectItem.cs - AAAAABAAAAAAAAAAAAAAACAAAAAACAAAAAAAAAAAAAA= - - - - - - Automation\OARreferenceItem.cs - AAAAAAAAAAAAYAAAAAAAAAQAAAEAAAAAAAAAAAAAAAA= - - - - - - Automation\OAReferenceFolderItem.cs - AAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ= - - - - - - Automation\OASolutionFolder.cs - AUQAAAAAAAAAAAAAAAAAQAAgAAIAAAAAAAQAAAAEAAA= - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ConfigurationClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ConfigurationClasses.cd deleted file mode 100644 index 3586226cd9a..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ConfigurationClasses.cd +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ConfigProvider.cs - AAQAgEQBAAJIAhACAAgAABAEAQ4MAAAAACAEEAAAEQQ= - - - - - - - - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectNode.cs - PcL08fbsGjX+k5CfjpK+d69X9h87o1+nbxPdSeHRekI= - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\OutputGroup.cs - AAAAIgABgwRAAAAAAAAAiAAAAIgEQAAgAAAAEASAABA= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\Output.cs - AAAAAQQAAAAAAAAAAAAAgAAACAgAQBAAAAAAAACAABA= - - - - - - - - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectConfig.cs - AAgCAEJABBAAkQCFCCCgAAEAAEgAYEECAAAAGQDJUEA= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectElement.cs - AgAEAEAAAAAAAAQAhAQAAgAUABAAA4AAQAIAAAAAgiA= - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectConfig.cs - AABCAAAACgAACAAAAAAABAEIAAQAgAAAIABAEABQAAA= - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\StructuresEnums.cs - IAACAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA= - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/DocumentManagerClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/DocumentManagerClasses.cd deleted file mode 100644 index ee63d3a71f2..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/DocumentManagerClasses.cd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - FileDocumentManager.cs - AACAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - - - - - - DocumentManager.cs - AQCAQIQAAAAAIAEAAAAAAAAAIAAAAAAAAAAAACGAAAE= - - - - - - - - - - - - ProjectDesignerDocumentManager.cs - AACAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - - - - - - HierarchyNode.cs - NKl4a26oCodRuoDQodAKZKQQxKtwgtmAOJLYAHLHccE= - - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/HierarchyClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/HierarchyClasses.cd deleted file mode 100644 index 25f3d4c9fd5..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/HierarchyClasses.cd +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\HierarchyNode.cs - NKl4a26oCodRuoDQodAKZKQQxKtwgtmAOJLYAHLHccE= - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\FolderNode.cs - AAAAEAKAAAEAAAAAgIAAJAAAAAIAAAAACAAQAAAAAQA= - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\FileNode.cs - AAhACECAAAFAAAEAABACZAAAAAAAAAAQSAAQAABEAAA= - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectNode.cs - PcL08fbsGjX+k5CfjpK+N69X9h87o1+nbxPdSaHRekI= - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectContainerNode.cs - AABFABAAAAQAAAAAQAAAAAAEQIABAAAARASAAAAAAAE= - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ComReferenceNode.cs - AACACCIAAAIAACAAQAAEAAQAgACAAAABCAAQAQACAAA= - - - - - - - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ReferenceContainerNode.cs - AABACACgAAEAAAAAgAACIAAAAAIQAAAACAAQAABAARA= - - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ReferenceNode.cs - AABAAGaAAAFAAAAAgAAiIAAAAAAQAAEAGAAQAABAAAA= - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\ProjectReferenceNode.cs - CAACCFYCAgAAgAEAAIACBAQAAAAAAAAACAAAAACACAA= - - - - - - D:\Program Files\Visual Studio 2005 SDK\2005.12\VisualStudioIntegration\Common\Source\CSharp\Project\AssemblyReferenceNode.cs - AAAACCIAAAAAAAAAAAIAAAACAABAAAAAGAAAEAAAABg= - - - - - - - - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/PropertiesClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/PropertiesClasses.cd deleted file mode 100644 index 2fbb404bebd..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/PropertiesClasses.cd +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - NodeProperties.cs - EQACAAAAAAAAAQAAAAAAAAQAAAEAAggAAABACAEAAAA= - - - - - - - - - - - - - LocalizableProperties.cs - AAAACAAACAAAAAAgAAAAgAAAABAEIAAAAERAAAAACAA= - - - - - - HierarchyNode.cs - NKl4a26oCodRuoDQodAKZKQQxKtwgtmAOJLYAHLHccE= - - - - - - - NodeProperties.cs - CAAAAAAgAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABAAAA= - - - - - - NodeProperties.cs - AAAAAAAABAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAA= - - - - - - NodeProperties.cs - CAAAAAAAAAAAAAAAAAAAAAQAAAAAIAAAAAAAAAAAAAA= - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ReferenceClasses.cd b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ReferenceClasses.cd deleted file mode 100644 index 55a2b56dc4e..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Diagrams/ReferenceClasses.cd +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - ReferenceNode.cs - AABAAGaAAAFAAAAAgAAiIAAAAAAQAAEAGAAQAABAAAA= - - - - - ReferenceNode.cs - - - - - - - - ProjectReferenceNode.cs - CAACCFYCAgAAgAEAAIACBAQAAAAAAAAACAAAAACACAA= - - - - - - - - - - - - - - - - - - BuildDependency.cs - AAAQAAYAAAQAgAAQAEAAAAAAAAAAAAAAEQAAAACAAAA= - - - - - - - - - AssemblyReferenceNode.cs - AAAACCIAAAAAAAAAAAIAAAACAABAAAAAGAAAEAAAABg= - - - - - - ComReferenceNode.cs - AACACCIAAAIAACAAQAAEAAQAgACAAAABCAAQAQACAAA= - - - - - - - - - - - - SolutionListenerForProjectReferenceUpdate.cs - AAAAAAAAAAAAAAAAAQAAIAAAAgAAAAAIAAAAgABAAAA= - - - - - - SolutionListener.cs - AAIACRBQoCAQCCAAEAIAJAAACgQBAAAYAQAiiAIAAAA= - - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/FSharpEditorFactory.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/FSharpEditorFactory.cs index 3d938fa1898..bb27865b5ba 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/FSharpEditorFactory.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/FSharpEditorFactory.cs @@ -13,6 +13,7 @@ using System.Text; using System.Threading.Tasks; using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; +using ShellPackage = Microsoft.VisualStudio.Shell.Package; namespace Microsoft.VisualStudio.FSharp.ProjectSystem { @@ -27,7 +28,7 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem [ProvideEditorExtension(typeof(FSharpEditorFactory), ".mli", 64)] public class FSharpEditorFactory : IVsEditorFactory { - private Package _parentPackage; + private ShellPackage _parentPackage; private IOleServiceProvider _oleServiceProvider; private IVsEditorAdaptersFactoryService _editorAdaptersFactoryService; private IContentTypeRegistryService _contentTypeRegistryService; @@ -41,7 +42,7 @@ private IServiceProvider ServiceProvider } } - public FSharpEditorFactory(Package parentPackage) + public FSharpEditorFactory(ShellPackage parentPackage) { if (parentPackage == null) { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs index a8e766877e7..9c14f377ca9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs @@ -20,15 +20,7 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem { public static class LoggingConstants { -#if VS_VERSION_DEV12 - public const string DefaultVSRegistryRoot = @"Software\Microsoft\VisualStudio\12.0"; -#endif -#if VS_VERSION_DEV14 - public const string DefaultVSRegistryRoot = @"Software\Microsoft\VisualStudio\14.0"; -#endif -#if VS_VERSION_DEV15 public const string DefaultVSRegistryRoot = @"Software\Microsoft\VisualStudio\15.0"; -#endif public const string BuildVerbosityRegistrySubKey = @"General"; public const string BuildVerbosityRegistryValue = "MSBuildLoggerVerbosity"; public const string UpToDateVerbosityRegistryValue = "U2DCheckVerbosity"; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/InternalsVisibleTo.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/InternalsVisibleTo.cs deleted file mode 100644 index 8a08659c881..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/InternalsVisibleTo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -[assembly:InternalsVisibleTo("FSharp.ProjectSystem.FSharp, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("VisualFSharp.Salsa, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("VisualFSharp.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.ProjectSystem.PropertyPages, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/MPFProjectAll.files b/vsintegration/src/FSharp.ProjectSystem.Base/Project/MPFProjectAll.files deleted file mode 100644 index 624da1ad750..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/MPFProjectAll.files +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - . - - - - - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index 56f9048f451..fae3278f5d9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -2182,7 +2182,7 @@ internal virtual void BuildAsync(uint vsopts, ConfigCanonicalName configCanonica /// Do the build by invoking msbuild /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "vsopts")] - internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsOutputWindowPane output, string target) + internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsOutputWindowPane output, string target, IEnumerable> extraProperties) { bool engineLogOnlyCritical = BuildPrelude(output); BuildResult result = BuildResult.FAILED; @@ -2190,7 +2190,7 @@ internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsO try { this.SetBuildConfigurationProperties(configCanonicalName); - result = this.InvokeMsBuild(target); + result = this.InvokeMsBuild(target, extraProperties); } finally { @@ -3277,16 +3277,9 @@ internal virtual BuildSubmission DoMSBuildSubmission(BuildKind buildKind, string projectInstance.SetProperty("UTFOutput", "true"); -#if FX_PREFERRED_UI_LANG // The CoreCLR build of FSC will use the CultureName since lcid doesn't apply very well // so that the errors reported by fsc.exe are in the right locale projectInstance.SetProperty("PREFERREDUILANG", System.Threading.Thread.CurrentThread.CurrentUICulture.Name); -#else - // When building, we need to set the flags for the fsc.exe that we spawned - // so that the errors reported by fsc.exe are in the right locale - projectInstance.SetProperty("LCID", System.Threading.Thread.CurrentThread.CurrentUICulture.LCID.ToString()); -#endif - this.BuildProject.ProjectCollection.HostServices.SetNodeAffinity(projectInstance.FullPath, NodeAffinity.InProc); BuildRequestData requestData = new BuildRequestData(projectInstance, targetsToBuild, this.BuildProject.ProjectCollection.HostServices, BuildRequestDataFlags.ReplaceExistingProjectInstance); submission = BuildManager.DefaultBuildManager.PendBuildRequest(requestData); @@ -4122,15 +4115,23 @@ internal string GetCurrentOutputAssembly() /// internal BuildResult Build(string target) { - return this.Build(new ConfigCanonicalName(), null, target); + return this.Build(new ConfigCanonicalName(), null, target, null); + } + + /// + /// Overloaded method. Invokes MSBuild using the default configuration and does without logging on the output window pane. + /// + internal BuildResult BuildWithExtraProperties(string target, IEnumerable> extraProperties) + { + return this.Build(new ConfigCanonicalName(), null, target, extraProperties); } /// /// Overloaded method. Invokes MSBuild using the default configuration. /// - internal BuildResult BuildToOutput(string target, IVsOutputWindowPane output) + internal BuildResult BuildToOutput(string target, IVsOutputWindowPane output, IEnumerable> extraProperties) { - return this.Build(new ConfigCanonicalName(), output, target); + return this.Build(new ConfigCanonicalName(), output, target, extraProperties); } /// @@ -6519,9 +6520,15 @@ Tuple ResolveAssemblyPathInTargetFxImpl(string[] prgAssemblySpecs, ui { return new Tuple(0, VSConstants.E_FAIL); } + var projectInstance = this.buildProject.CreateProjectInstance(); - projectInstance.SetProperty("DesignTimeReference", String.Join(";", prgAssemblySpecs)); - BuildSubmission submission = DoMSBuildSubmission(BuildKind.SYNC, target, ref projectInstance, null); + var extraProperties = new KeyValuePair[] + { + new KeyValuePair("DesignTimeBuild", "true"), + new KeyValuePair("DesignTimeReference", String.Join(";", prgAssemblySpecs)) + }.AsEnumerable(); + + BuildSubmission submission = DoMSBuildSubmission(BuildKind.SYNC, target, ref projectInstance, null, extraProperties); if (submission.BuildResult.OverallResult != BuildResultCode.Success) { // can fail, e.g. if call happens during project unload/close, in which case failure is ok diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 795c9c465b8..f2e30ac08ad 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -1,297 +1,85 @@  - - - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - 11 - 3001,3002,3003,3005,3008,3009,3021,3024 - true - cs - $(VsSDKTools) - + + + net46 Library FSharp.ProjectSystem.Base - true - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - AnyCPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} - $(DefineConstants);CODE_ANALYSIS - true - v4.6 - $(DefineConstants);FX_PREFERRED_UI_LANG - - - true - true + false + true false - false - true - true - true - - + $(NoWarn),1570,1572,1573,1574,1591,3001,3002,3003,3005,3008,3009,3021,3024 + $(DefineConstants);CODE_ANALYSIS Microsoft.VisualStudio.FSharp.ProjectSystem + true + true + false - - - - - - - - - - - - - - - + - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Conversion.Core.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ComponentModelHost.15.0.26201-alpha\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - ImmutableShell - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26201\lib\Microsoft.VisualStudio.Shell.15.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll - Shell14 - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Microsoft.VisualStudio.Shell.UI.Internal.14.0.25420\lib\net45\Microsoft.VisualStudio.Shell.UI.Internal.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Microsoft.VisualStudio.Package.Project.resources Designer - - Resources.imagelis.bmp + + + + + + + + + + + + + + + + + + + + + - - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} - FSharp.LanguageService.Base - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + + + + + + + + + + + + + + - - - - - \ No newline at end of file + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs index 4beee7b4d0e..3850d0c4e0b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs @@ -371,7 +371,11 @@ public void LoadReferencesFromBuildProject(Microsoft.Build.Evaluation.Project bu } } - BuildResult buildResult = this.ProjectMgr.Build(MsBuildTarget.ResolveAssemblyReferences); + var extraProperties = new KeyValuePair[] + { + new KeyValuePair("DesignTimeBuild", "true"), + }.AsEnumerable(); + BuildResult buildResult = this.ProjectMgr.BuildWithExtraProperties(MsBuildTarget.ResolveAssemblyReferences, extraProperties); foreach (string referenceType in SupportedReferenceTypes) { bool isAssemblyReference = referenceType == ProjectFileConstants.Reference; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.Designer.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.Designer.cs deleted file mode 100644 index b2f7c6a8bc6..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.Designer.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem -{ - partial class SecurityWarningDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SecurityWarningDialog)); - this.warningText = new System.Windows.Forms.Label(); - this.detailsButton = new System.Windows.Forms.Button(); - this.optionBox = new System.Windows.Forms.GroupBox(); - this.loadButton = new System.Windows.Forms.RadioButton(); - this.browseButton = new System.Windows.Forms.RadioButton(); - this.loadText = new System.Windows.Forms.Label(); - this.browseText = new System.Windows.Forms.Label(); - this.askAgainCheckBox = new System.Windows.Forms.CheckBox(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.optionBox.SuspendLayout(); - this.SuspendLayout(); - // - // warningText - // - resources.ApplyResources(this.warningText, "warningText"); - this.warningText.Name = "warningText"; - // - // detailsButton - // - resources.ApplyResources(this.detailsButton, "detailsButton"); - this.detailsButton.Name = "detailsButton"; - this.detailsButton.UseVisualStyleBackColor = true; - this.detailsButton.Click += new System.EventHandler(this.detailsButton_Click); - // - // optionBox - // - this.optionBox.Controls.Add(this.loadButton); - this.optionBox.Controls.Add(this.browseButton); - this.optionBox.Controls.Add(this.loadText); - this.optionBox.Controls.Add(this.browseText); - resources.ApplyResources(this.optionBox, "optionBox"); - this.optionBox.Name = "optionBox"; - this.optionBox.TabStop = false; - // - // loadButton - // - resources.ApplyResources(this.loadButton, "loadButton"); - this.loadButton.Name = "loadButton"; - this.loadButton.TabStop = true; - this.loadButton.UseVisualStyleBackColor = true; - // - // browseButton - // - resources.ApplyResources(this.browseButton, "browseButton"); - this.browseButton.Name = "browseButton"; - this.browseButton.TabStop = true; - this.browseButton.UseVisualStyleBackColor = true; - // - // loadText - // - resources.ApplyResources(this.loadText, "loadText"); - this.loadText.Name = "loadText"; - // - // browseText - // - resources.ApplyResources(this.browseText, "browseText"); - this.browseText.Name = "browseText"; - // - // askAgainCheckBox - // - resources.ApplyResources(this.askAgainCheckBox, "askAgainCheckBox"); - this.askAgainCheckBox.Name = "askAgainCheckBox"; - this.askAgainCheckBox.UseVisualStyleBackColor = true; - // - // okButton - // - this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - resources.ApplyResources(this.okButton, "okButton"); - this.okButton.Name = "okButton"; - this.okButton.UseVisualStyleBackColor = true; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - resources.ApplyResources(this.cancelButton, "cancelButton"); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // SecurityWarningDialog - // - this.AcceptButton = this.okButton; - resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelButton; - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.askAgainCheckBox); - this.Controls.Add(this.optionBox); - this.Controls.Add(this.detailsButton); - this.Controls.Add(this.warningText); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SecurityWarningDialog"; - this.ShowInTaskbar = false; - this.optionBox.ResumeLayout(false); - this.optionBox.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label warningText; - private System.Windows.Forms.Button detailsButton; - private System.Windows.Forms.GroupBox optionBox; - private System.Windows.Forms.Label browseText; - private System.Windows.Forms.Label loadText; - private System.Windows.Forms.RadioButton browseButton; - private System.Windows.Forms.RadioButton loadButton; - private System.Windows.Forms.CheckBox askAgainCheckBox; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; - } -} diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.cs deleted file mode 100644 index a7e38957564..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.cs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.Data; - using System.Drawing; - using System.Text; - using System.Windows.Forms; - using System.IO; - using Microsoft.VisualStudio.Shell.Interop; - using System.Globalization; - using Microsoft.VisualStudio.Shell; - using System.Windows.Forms.Design; - - internal partial class SecurityWarningDialog: Form - { - #region fields - /// - /// The associated service provider - /// - private IServiceProvider serviceProvider; - - /// - /// The dialog message to be presented when the 'More' button is pressed. - /// - private string dialogMessage; - - /// - /// Teh full path to teh project. - /// - private string projectFullPath; - - /// - /// The value of the ask again check box. - /// - private bool askAgainCheckBoxValue; - - /// - /// The project load option the userwill choose on this form. - /// - private ProjectLoadOption projectLoadOption = ProjectLoadOption.DonNotLoad; - #endregion - - #region properties - /// - /// The value of the ask again check box. - /// - /*internal, but public for FSharp.Project.dll*/ public bool AskAgainCheckBoxValue - { - get - { - return this.askAgainCheckBoxValue; - } - } - - /// - /// The project load option the user has chosen to perform. - /// - internal ProjectLoadOption ProjectLoadOption - { - get - { - return this.projectLoadOption; - } - } - #endregion - - #region ctors - /// - /// Overloaded ctor. - /// - /// The associated service provider. - /// The message that will be shown when the 'More' button is pressed. - /// The full path of the project. - public SecurityWarningDialog(IServiceProvider serviceProvider, string dialogMessage, string projectFullpath) - { - if (serviceProvider == null) - { - throw new ArgumentNullException("serviceProvider"); - } - - if (String.IsNullOrEmpty(projectFullpath)) - { - throw new ArgumentException(SR.GetString(SR.ParameterCannotBeNullOrEmpty, CultureInfo.CurrentUICulture), "projectFullpath"); - } - - this.serviceProvider = serviceProvider; - - this.projectFullPath = projectFullpath; - - this.dialogMessage = dialogMessage; - - this.InitializeComponent(); - - this.SetupComponents(); - } - #endregion - - #region helpers - /// - /// Shows the dialog if possible hosted by the IUIService. - /// - /// A DialogResult - /*internal, but public for FSharp.Project.dll*/ public new DialogResult ShowDialog() - { - IUIService uiService = this.serviceProvider.GetService(typeof(IUIService)) as IUIService; - if (uiService == null) - { - return this.ShowDialog(); - } - - return uiService.ShowDialog(this); - } - - /// - /// Sets up the different UI elements. - /// - private void SetupComponents() - { - // Get the project name. - string projectFileName = Path.GetFileName(this.projectFullPath); - string projectName = Path.GetFileNameWithoutExtension(this.projectFullPath); - - IVsUIShell shell = this.serviceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell; - - if (shell == null) - { - throw new InvalidOperationException(); - } - - String applicationName; - - // Get the name of the SKU. - shell.GetAppName(out applicationName); - - // Set the dialog box caption (title). - this.Text = String.Format(CultureInfo.CurrentCulture, this.Text, projectName); - - // Set the text at the top of the dialog that gives a brief description of the security - // implications of loading this project. - this.warningText.Text = String.Format(CultureInfo.CurrentCulture, this.warningText.Text, projectName, applicationName); - - // Set the text that describes the "Browse" option. - this.browseText.Text = String.Format(CultureInfo.CurrentCulture, this.browseText.Text, applicationName); - - // Set the text that describes the "Load" option. - this.loadText.Text = String.Format(CultureInfo.CurrentCulture, this.loadText.Text, applicationName); - - // The default selection is "Browse" so select that radio button. - this.browseButton.Checked = true; - - // Turn on the "Ask me always" checkbox by default. - this.askAgainCheckBox.Checked = true; - - // Set the focus to the Browse button, so hitting Enter will press the OK button - this.browseButton.Focus(); - - this.CenterToScreen(); - } - - /// - /// The Cancel button was clicked. - /// - /// The sender of the event - /// An event arg Associated to the event. - private void cancelButton_Click(object sender, EventArgs e) - { - // In case the user presses the Cancel button, we assume he never wants to see this dialog again - // and pretend the "Ask me every time" checkbox is unchecked even if it is really checked. - this.askAgainCheckBoxValue = false; - this.projectLoadOption = ProjectLoadOption.DonNotLoad; - } - - /// - /// The OK button was clicked. - /// - /// The sender of the event - /// An event arg Associated to the event. - private void okButton_Click(object sender, EventArgs e) - { - if (this.browseButton.Checked && !this.loadButton.Checked) - { - this.projectLoadOption = ProjectLoadOption.LoadOnlyForBrowsing; - } - else - { - this.projectLoadOption = ProjectLoadOption.LoadNormally; - } - - this.askAgainCheckBoxValue = this.askAgainCheckBox.Checked; - - this.Close(); - } - - /// - /// Loads a messagebox explaining in detail the security problem - /// - /// The sender of the event - /// An event arg Associated to the event. - private void detailsButton_Click(object sender, EventArgs e) - { - string title = null; - OLEMSGICON icon = OLEMSGICON.OLEMSGICON_INFO; - OLEMSGBUTTON buttons = OLEMSGBUTTON.OLEMSGBUTTON_OK; - OLEMSGDEFBUTTON defaultButton = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST; - VsShellUtilities.ShowMessageBox(this.serviceProvider, title, this.dialogMessage, icon, buttons, defaultButton); - } - - #endregion - } -} diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.resx b/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.resx deleted file mode 100644 index be768102725..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/SecurityWarningDialog.resx +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Microsoft Sans Serif, 8.25pt - - - 7, 7 - - - 488, 39 - - - - 0 - - - The {0} project file has been customized and could present a security risk by executing custom build steps when opened in {1}. If this project came from an untrustworthy source, it could cause damage to your computer or compromise your private information. - - - warningText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - Microsoft Sans Serif, 8.25pt - - - 12, 65 - - - 74, 23 - - - 1 - - - &More Details - - - detailsButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - loadButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 0 - - - browseButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 1 - - - loadText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 2 - - - browseText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 3 - - - Microsoft Sans Serif, 8.25pt - - - 10, 103 - - - 488, 176 - - - 2 - - - Project load options - - - optionBox - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - True - - - 6, 100 - - - 125, 17 - - - 3 - - - &Load project normally - - - loadButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 0 - - - True - - - 6, 20 - - - 144, 17 - - - 2 - - - Load project for &browsing - - - browseButton - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 1 - - - 20, 120 - - - 462, 53 - - - 1 - - - Opens the project normally in {0}. Use this option if you trust the source and understand the potential risks involved. {0} does not restrict any project functionality and will not prompt you again for this project. - - - loadText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 2 - - - 20, 40 - - - 454, 47 - - - 0 - - - Opens the project in {0} with increased security. This option allows you to browse the contents of the project, but some functionality, such as IntelliSense, is restricted. When a project is loaded for browsing, actions such as building, cleaning, publishing, or opening designers could still remain unsafe. - - - browseText - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - optionBox - - - 3 - - - True - - - 10, 295 - - - 209, 17 - - - 3 - - - &Ask me for every project in this solution - - - askAgainCheckBox - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 327, 328 - - - 75, 23 - - - 4 - - - OK - - - okButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - 420, 328 - - - 75, 23 - - - 5 - - - Cancel - - - cancelButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - True - - - 6, 13 - - - 507, 363 - - - Microsoft Sans Serif, 8.25pt - - - Security Warning for {0} - - - SecurityWarningDialog - - - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs new file mode 100644 index 00000000000..1a0bb06e4ec --- /dev/null +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +using System; +using System.Runtime.InteropServices; +using System.Xml; +using System.Collections; +using System.Collections.Generic; +using System.Threading; +using System.IO; +using System.Text; +using System.Drawing; +using System.Windows.Forms; +using System.Diagnostics; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.OLE.Interop; +using Microsoft.VisualStudio.TextManager.Interop; +using Microsoft.VisualStudio.Threading; +using Microsoft.VisualStudio.Shell; +using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; +using IServiceProvider = System.IServiceProvider; +using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; +using System.Diagnostics.CodeAnalysis; + +namespace Microsoft.VisualStudio.FSharp.LanguageService +{ + internal static class UIThread + { + static SynchronizationContext ctxt; + static bool isUnitTestingMode = false; +#if DEBUG + static StackTrace captureStackTrace; // stack trace when ctxt was captured + static Thread uithread; +#endif + public static SynchronizationContext TheSynchronizationContext + { + get + { + Debug.Assert(ctxt != null, "Tried to get TheSynchronizationContext before it was captured"); + return ctxt; + } + } + + public static void InitUnitTestingMode() + { + Debug.Assert(ctxt == null, "Context has already been captured; too late to InitUnitTestingMode"); + isUnitTestingMode = true; + } + + [Conditional("DEBUG")] + public static void MustBeCalledFromUIThread() + { +#if DEBUG + Debug.Assert(uithread == System.Threading.Thread.CurrentThread || isUnitTestingMode, "This must be called from the GUI thread"); +#endif + } + public static void CaptureSynchronizationContext() + { + if (isUnitTestingMode) return; +#if DEBUG + uithread = System.Threading.Thread.CurrentThread; +#endif + + if (ctxt == null) + { +#if DEBUG + // This is a handy place to do this, since the product and all interesting unit tests + // must go through this code path. + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(delegate (object sender, UnhandledExceptionEventArgs args) + { + if (args.IsTerminating) + { + string s = String.Format("An unhandled exception is about to terminate the process. Exception info:\n{0}", args.ExceptionObject.ToString()); + Debug.Assert(false, s); + } + }); + captureStackTrace = new StackTrace(true); +#endif + ctxt = new WindowsFormsSynchronizationContext(); + } + else + { +#if DEBUG + // Make sure we are always capturing the same thread. + Debug.Assert(uithread == Thread.CurrentThread); +#endif + } + } + private static readonly Queue ourUIQueue = new Queue(); + private static bool ourIsReentrancy; + + // Runs the action on UI thread. Prevents from reentracy. + public static void Run(Action action) + { + if (isUnitTestingMode) + { + action(); + return; + } + Debug.Assert(ctxt != null, "The SynchronizationContext must be captured before calling this method"); +#if DEBUG + StackTrace stackTrace = new StackTrace(true); +#endif + ctxt.Post(delegate (object ignore) + { + UIThread.MustBeCalledFromUIThread(); + ourUIQueue.Enqueue(action); + if (ourIsReentrancy) return; + ourIsReentrancy = true; + try + { + while (ourUIQueue.Count > 0) + { + try + { + var a = ourUIQueue.Dequeue(); + a(); + } +#if DEBUG + catch (Exception e) + { + // swallow, random exceptions should not kill process + Debug.Assert(false, string.Format("UIThread.Run caught and swallowed exception: {0}\n\noriginally invoked from stack:\n{1}", e.ToString(), stackTrace.ToString())); + } +#else + catch (Exception) { + // swallow, random exceptions should not kill process + } +#endif + + } + } + finally + { + ourIsReentrancy = false; + } + }, null); + + } + + /// + /// RunSync puts orignal exception stacktrace to Exception.Data by this key if action throws on UI thread + /// + /// WrappedStacktraceKey is a string to keep exception serializable. + public static readonly string WrappedStacktraceKey = "$$Microsoft.VisualStudio.Package.UIThread.WrappedStacktraceKey$$"; + + public static void RunSync(Action a) + { + if (isUnitTestingMode) + { + a(); + return; + } + Exception exn = null; + Debug.Assert(ctxt != null, "The SynchronizationContext must be captured before calling this method"); + // Send on UI thread will execute immediately. + ctxt.Send(ignore => + { + try + { + UIThread.MustBeCalledFromUIThread(); + a(); + } + catch (Exception e) + { + exn = e; + } + }, null + ); + if (exn != null) + { + // throw exception on calling thread, preserve stacktrace + if (!exn.Data.Contains(WrappedStacktraceKey)) exn.Data[WrappedStacktraceKey] = exn.StackTrace; + throw exn; + } + } + + /// + /// Local JoinableTaskContext + /// ensuring non-reentrancy. + /// + private static JoinableTaskContext jtc = null; + private static JoinableTaskFactory JTF + { + get + { + if (jtc == null) + { + JoinableTaskContext j = null; + if (VsTaskLibraryHelper.ServiceInstance == null) + { + j = new JoinableTaskContext(); + } + else + { + j = ThreadHelper.JoinableTaskContext; + } + Interlocked.CompareExchange(ref jtc, j, null); + } + + return jtc.Factory; + } + } + + /// + /// Performs a callback on the UI thread and blocks until it is done, using the VS mechanism for + /// ensuring non-reentrancy. + /// + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + internal static T DoOnUIThread(Func callback) + { + return JTF.Run(async delegate + { + await JTF.SwitchToMainThreadAsync(); + return callback(); + }); + } + + /// + /// Performs a callback on the UI thread and blocks until it is done, using the VS mechanism for + /// ensuring non-reentrancy. + /// + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + internal static void DoOnUIThread(Action callback) + { + JTF.Run(async delegate + { + await JTF.SwitchToMainThreadAsync(); + callback(); + }); + } + } +} \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs index 7ad501608ad..d725e493327 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs @@ -849,7 +849,7 @@ private static bool IsFilePartInValid(string filePart) { extension = Path.GetExtension(filePart); } - // We catch the ArgumentException because we want this method to return true if the filename is not valid. FilePart could be for example #¤&%"¤&"% and that would throw ArgumentException on GetExtension + // We catch the ArgumentException because we want this method to return true if the filename is not valid. FilePart could be for example #�&%"�&"% and that would throw ArgumentException on GetExtension catch (ArgumentException) { return true; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/CodeBehindCodeGenerator.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/CodeBehindCodeGenerator.cs deleted file mode 100644 index c35120aadd9..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/CodeBehindCodeGenerator.cs +++ /dev/null @@ -1,861 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Globalization; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using EnvDTE; -using EnvDTE80; -using Microsoft.VisualStudio.Designer.Interfaces; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell.Design; -using Microsoft.VisualStudio.Shell.Design.Serialization; - -using IServiceProvider = System.IServiceProvider; -using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; -using IVsCodeBehindCodeGenerator = Microsoft.VisualStudio.Web.Application.IVsCodeBehindCodeGenerator; - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Web -{ - [ComVisible(true)] - internal class CodeBehindCodeGenerator : IVsCodeBehindCodeGenerator - { - private ServiceProvider _serviceProvider; - private IVsHierarchy _hierarchy; - private CodeGeneratorOptions _codeGeneratorOptions; - - // Generate state - private VsHierarchyItem _itemCode; - private VsHierarchyItem _itemDesigner; - private CodeDomProvider _codeDomProvider; - private CodeCompileUnit _ccu; - private CodeTypeDeclaration _ctd; - private bool _create; - private bool _isPartialClassDisabled; - private FieldDataDictionary _codeFields; - private FieldDataDictionary _designerFields; - private string _className_Full; - private string _className_Namespace; - private string _className_Name; - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Constructor - /// - ///------------------------------------------------------------------------------------------------------------- - public CodeBehindCodeGenerator() - { - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Finalizer - /// - ///------------------------------------------------------------------------------------------------------------- - ~CodeBehindCodeGenerator() - { - Debug.Fail("CodeBehindCodeGenerator was not disposed."); - Dispose(); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Initializes the generator state. - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.Initialize(IVsHierarchy hierarchy) - { - IOleServiceProvider serviceProvider = null; - _hierarchy = hierarchy; - _hierarchy.GetSite(out serviceProvider); - _serviceProvider = new ServiceProvider(serviceProvider); - _codeGeneratorOptions = new CodeGeneratorOptions(); - _codeGeneratorOptions.BlankLinesBetweenMembers = false; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Cleans up state. - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.Close() - { - Dispose(); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Cleans up member state. - /// - ///------------------------------------------------------------------------------------------------------------- - public virtual void Dispose() - { - if (_serviceProvider != null) - { - _serviceProvider.Dispose(); - _serviceProvider = null; - } - - _hierarchy = null; - _codeGeneratorOptions = null; - - DisposeGenerateState(); - - GC.SuppressFinalize(this); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Cleans up Generate member state. - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual void DisposeGenerateState() - { - try - { - _itemCode = null; - _itemDesigner = null; - _ccu = null; - _ctd = null; - _create = false; - _codeFields = null; - _designerFields = null; - _className_Full = null; - _className_Namespace = null; - _className_Name = null; - - if (_codeDomProvider != null) - { - _codeDomProvider.Dispose(); - _codeDomProvider = null; - } - } - catch - { - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// The full class name currently generating for - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ string ClassName_Full - { - get - { - return _className_Full; - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// The class namespace currently generating for - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ string ClassName_Namespace - { - get - { - return _className_Namespace; - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// The class name currently generating for - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ string ClassName_Name - { - get - { - return _className_Name; - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// The code behind item - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ VsHierarchyItem ItemCode - { - get - { - return _itemCode; - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Languages that do NOT support partial class in a .designer file should disable partial classes - /// using this property. - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ bool IsPartialClassDisabled - { - get - { - return _isPartialClassDisabled; - } - set - { - _isPartialClassDisabled = value; - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Create CodeDomProvider for the language of the file - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual CodeDomProvider CreateCodeDomProvider(uint itemid) - { - Microsoft.VisualStudio.OLE.Interop.IServiceProvider oleServiceProvider; - ErrorHandler.ThrowOnFailure(((IVsProject)this._hierarchy).GetItemContext(itemid, out oleServiceProvider)); - ServiceProvider serviceProvider = new ServiceProvider(oleServiceProvider); - IVSMDCodeDomProvider provider = serviceProvider.GetService(typeof(SVSMDCodeDomProvider)) as IVSMDCodeDomProvider; - CodeDomProvider codeDomProvider = null; - if (provider != null) - { - codeDomProvider = provider.CodeDomProvider as CodeDomProvider; - } - - Debug.Assert(codeDomProvider!=null, "Failed to create CodeDomProvider"); - return codeDomProvider; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Returns public field names in dictionary - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ FieldDataDictionary GetFieldNames(string[] publicFields, bool caseSensitive) - { - FieldDataDictionary fields = null; - - if (publicFields != null) - { - foreach (string name in publicFields) - { - if (!string.IsNullOrEmpty(name)) - { - FieldData field = new FieldData(name); - - if (field != null) - { - if (fields == null) - { - fields = new FieldDataDictionary(caseSensitive); - } - - try - { - if (!fields.ContainsKey(field.Name)) - { - fields.Add(field.Name, field); - } - } - catch - { - } - } - } - } - } - - return fields; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Returns field names in the specified class using code model. - /// If publicOnly is true only public fields are returned. - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ FieldDataDictionary GetFieldNames(VsHierarchyItem itemCode, string className, bool caseSensitive, bool onlyBaseClasses, int maxDepth) - { - FieldDataDictionary fields = null; - - if (itemCode != null) - { - CodeClass codeClass = FindClass(itemCode, className); - if (codeClass != null) - { - GetFieldNames(codeClass, caseSensitive, onlyBaseClasses, 0, maxDepth, ref fields); - } - } - - return fields; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Returns field names in the specified class using code model. - /// If publicOnly is true only public fields are returned. - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ void GetFieldNames(CodeClass codeClass, bool caseSensitive, bool onlyBaseClasses, int depth, int maxDepth, ref FieldDataDictionary fields) - { - if (codeClass != null && depth <= maxDepth) - { - if (!(onlyBaseClasses && depth == 0)) - { - foreach (CodeElement codeElement in codeClass.Members) - { - //vsCMElement kind = codeElement.Kind; //vsCMElementVariable - CodeVariable codeVariable = codeElement as CodeVariable; - if (codeVariable != null) - { - FieldData field = new FieldData(codeClass, codeVariable, depth); - - if (field != null && !string.IsNullOrEmpty(field.Name)) - { - if (fields == null) - { - fields = new FieldDataDictionary(caseSensitive); - } - - try - { - if (!fields.ContainsKey(field.Name)) - { - fields.Add(field.Name, field); - } - } - catch - { - } - } - } - } - } - - foreach (CodeElement baseCodeElement in codeClass.Bases) - { - CodeClass baseCodeClass = baseCodeElement as CodeClass; - if (baseCodeClass != null) - { - CodeElements partCodeElements = null; - CodeClass2 baseCodeClass2 = baseCodeClass as CodeClass2; - if (baseCodeClass2 != null) - { - vsCMClassKind classKind = baseCodeClass2.ClassKind; - if ((classKind | vsCMClassKind.vsCMClassKindPartialClass) == vsCMClassKind.vsCMClassKindPartialClass) - { - try - { - partCodeElements = baseCodeClass2.Parts; - } - catch - { - } - } - } - - if (partCodeElements != null && partCodeElements.Count > 1) - { - foreach (CodeElement partCodeElement in partCodeElements) - { - CodeClass partCodeClass = partCodeElement as CodeClass; - if (partCodeClass != null) - { - GetFieldNames(partCodeClass, caseSensitive, onlyBaseClasses, depth + 1, maxDepth, ref fields); - } - } - } - else - { - GetFieldNames(baseCodeClass, caseSensitive, onlyBaseClasses, depth + 1, maxDepth, ref fields); - } - } - } - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Locates the code model CodeClass - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual CodeClass FindClass(VsHierarchyItem item, string className) - { - if (item != null) - { - try - { - ProjectItem projectItem = item.ProjectItem(); - if (projectItem != null) - { - FileCodeModel fileCodeModel = projectItem.FileCodeModel; - if (fileCodeModel != null) - { - return FindClass(fileCodeModel.CodeElements, className); - } - } - } - catch - { - } - } - return null; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Recursively searches the CodeElements for the specified class - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual CodeClass FindClass(CodeElements codeElements, string className) - { - if (codeElements != null && !string.IsNullOrEmpty(className)) - { - foreach (CodeElement codeElement in codeElements) - { - vsCMElement kind = codeElement.Kind; - if (kind == vsCMElement.vsCMElementClass) - { - CodeClass codeClass = codeElement as CodeClass; - if (codeClass != null && string.Compare(codeClass.FullName, className, StringComparison.Ordinal) == 0) - { - return codeClass; - } - } - else if (kind == vsCMElement.vsCMElementNamespace) - { - EnvDTE.CodeNamespace codeNamespace = codeElement as EnvDTE.CodeNamespace; - if (codeNamespace != null) - { - CodeClass codeClass = FindClass(codeNamespace.Children, className); - if (codeClass != null) - { - return codeClass; - } - } - } - } - } - return null; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Gets a VshierarchyItem for the designer file if possible. - /// Will create new file if specified and not existing. - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual VsHierarchyItem GetDesignerItem(VsHierarchyItem itemCode, bool create) - { - VsHierarchyItem itemDesigner = null; - - if (itemCode != null) - { - // Calculate codebehind and designer file paths - string codeBehindFile = itemCode.FullPath(); - string designerFile = null; - if (_isPartialClassDisabled) - { - designerFile = codeBehindFile; - } - else if (!string.IsNullOrEmpty(codeBehindFile)) - { - designerFile = codeBehindFile.Insert(codeBehindFile.LastIndexOf("."), ".designer"); - } - - // Try to locate existing designer file - if (!string.IsNullOrEmpty(designerFile)) - { - itemDesigner = VsHierarchyItem.CreateFromMoniker(designerFile, _hierarchy); - if (itemDesigner != null) - { - return itemDesigner; - } - } - - // Create empty designer file if requested - if (create && !string.IsNullOrEmpty(designerFile)) - { - ProjectItem projectItemCode = itemCode.ProjectItem(); - if (projectItemCode != null) - { - ProjectItems projectItems = projectItemCode.Collection; - if (projectItems != null) - { - try - { - using (StreamWriter sw = File.CreateText(designerFile)) - { - sw.WriteLine(" "); - } - - projectItems.AddFromFileCopy(designerFile); - } - catch - { - } - - itemDesigner = VsHierarchyItem.CreateFromMoniker(designerFile, _hierarchy); - if (itemDesigner != null) - { - return itemDesigner; - } - } - } - } - } - - return itemDesigner; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Checks CodeDomProvider for case sensitivity - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ bool IsCaseSensitive(CodeDomProvider codeDomProvider) - { - return !((codeDomProvider.LanguageOptions & LanguageOptions.CaseInsensitive) == LanguageOptions.CaseInsensitive); - } - - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - bool IVsCodeBehindCodeGenerator.IsGenerateAllowed(string document, string codeBehindFile, bool create) - { - VsHierarchyItem itemCode = VsHierarchyItem.CreateFromMoniker(codeBehindFile, _hierarchy); - VsHierarchyItem itemDesigner = GetDesignerItem(itemCode, false); - - if ((itemDesigner != null && itemDesigner.IsBuildActionCompile()) - || (itemDesigner == null && create)) - { - return true; - } - - return false; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.BeginGenerate(string document, string codeBehindFile, string className_Full, bool create) - { - DisposeGenerateState(); - - _itemCode = VsHierarchyItem.CreateFromMoniker(codeBehindFile, _hierarchy); - _itemDesigner = GetDesignerItem(_itemCode, false); - _create = create; - _className_Full = className_Full; - - if (_itemCode != null) - { - // Get the CodeDomProvider for the language (MergedCodeDomProvider C#/VB) - _codeDomProvider = CreateCodeDomProvider(_itemCode.VsItemID); - - if (_codeDomProvider != null) - { - // Get the field names so we can preserve location and access - bool caseSensitive = IsCaseSensitive(_codeDomProvider); - - _codeFields = GetFieldNames(_itemCode, _className_Full, caseSensitive, false, 30); - _designerFields = GetFieldNames(_itemDesigner, _className_Full, caseSensitive, false, 0); - - // Generate the class - string designerContents = _itemDesigner.GetDocumentText(); - TextReader reader = new StringReader(designerContents); - _ccu = _codeDomProvider.Parse(reader); - GenerateClass(); - } - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - private void GenerateClass() - { - // Break full name into namespace and name - if (!string.IsNullOrEmpty(_className_Full)) - { - int lastdot = _className_Full.LastIndexOf('.'); - if (lastdot >= 0) - { - _className_Name = _className_Full.Substring(lastdot + 1); - _className_Namespace = _className_Full.Substring(0, lastdot); - } - else - { - _className_Name = _className_Full; - _className_Namespace = null; - } - } - - - // Create namespace and add to compile unit - System.CodeDom.CodeNamespace codeNS = null; - string ns = GetClassNamespace(); - if (!string.IsNullOrEmpty(ns)) - { - codeNS = new System.CodeDom.CodeNamespace(ns); - } - else - { - codeNS = new System.CodeDom.CodeNamespace(); - } - if (_ccu.Namespaces != null && _ccu.Namespaces.Count>0 && String.CompareOrdinal(_ccu.Namespaces[0].Name, ns) == 0) - codeNS = _ccu.Namespaces[0]; - else - _ccu.Namespaces.Add(codeNS); - - // Create class definition and add to namespace - _ctd = new CodeTypeDeclaration(_className_Name); - _ctd.IsPartial = !IsPartialClassDisabled; - if (codeNS.Types != null && codeNS.Types.Count > 0 && String.CompareOrdinal(codeNS.Types[0].Name, _className_Name) == 0) - _ctd = codeNS.Types[0]; - else - codeNS.Types.Add(_ctd); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.EnsureStronglyTypedProperty(string propertyName, string propertyTypeName) - { - CodeMemberProperty prop = new CodeMemberProperty(); - prop.Attributes &= ~MemberAttributes.AccessMask; - prop.Attributes &= ~MemberAttributes.ScopeMask; - prop.Attributes |= MemberAttributes.Final | MemberAttributes.New | MemberAttributes.Public; - prop.Name = propertyName; - prop.Type = new CodeTypeReference(propertyTypeName); - - CodePropertyReferenceExpression propRef = new CodePropertyReferenceExpression( - new CodeBaseReferenceExpression(), propertyName); - - prop.GetStatements.Add(new CodeMethodReturnStatement(new CodeCastExpression(propertyTypeName, propRef))); - _ctd.Members.Add(prop); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.EnsureControlDeclaration(string name, string typeName) - { - if (ShouldDeclareField(name, typeName)) - { - typeName = GetDeclarationTypeName(name, typeName); - - CodeMemberField field = new CodeMemberField(typeName, name); - - // Check if someone made the declaration public in the designer file - bool isPublic = false; - if (_designerFields != null && _designerFields.ContainsKey(name)) - { - FieldData fieldData = _designerFields[name]; - if (fieldData != null) - { - isPublic = fieldData.IsPublic; - } - } - - // Set access to public or protected - field.Attributes &= ~MemberAttributes.AccessMask; - if (isPublic) - { - field.Attributes |= MemberAttributes.Public; - } - else - { - field.Attributes |= MemberAttributes.Family; - } - - SetAdditionalFieldData(field); - - _ctd.Members.Add(field); - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// - /// - ///------------------------------------------------------------------------------------------------------------- - void IVsCodeBehindCodeGenerator.Generate() - { - DocData ddDesigner = null; - DocDataTextWriter designerWriter = null; - - try - { - if (_itemCode != null && _codeDomProvider != null) - { - - // Generate the code - StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture); - _codeDomProvider.GenerateCodeFromCompileUnit(_ccu, stringWriter, _codeGeneratorOptions); - string generatedCode = stringWriter.ToString(); - - // Create designer file if requested - if (_itemDesigner == null && _create) - { - _itemDesigner = GetDesignerItem(_itemCode, true); - } - - // See if generated code changed - string designerContents = _itemDesigner.GetDocumentText(); - if (!BufferEquals(designerContents, generatedCode)) // Would be nice to just compare lengths but the buffer gets formatted after insertion - { - ddDesigner = new LockedDocData(_serviceProvider, _itemDesigner.FullPath()); - - // Try to check out designer file (this throws) - ddDesigner.CheckoutFile(_serviceProvider); - - // Write out the new code - designerWriter = new DocDataTextWriter(ddDesigner); - designerWriter.Write(generatedCode); - designerWriter.Flush(); - designerWriter.Close(); - } - } - } - finally - { - if (designerWriter != null) - { - designerWriter.Dispose(); - } - if (ddDesigner != null) - { - ddDesigner.Dispose(); - } - } - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Virtual method to allow language specific determination - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual bool ShouldDeclareField(string name, string typeName) - { - // Don't add field if already defined in codebehind or exposed from base class - bool declareField = true; - if (_codeFields != null && _codeFields.ContainsKey(name)) - { - FieldData fieldData = _codeFields[name]; - if (fieldData != null) - { - if (fieldData.Depth == 0) - { - // For immediate class we don't re-declare regardless - // of access modifiers. If the field is not visible to the run-time - // it will not be set and code against it will fail. - declareField = false; - } - else if (fieldData.IsProtected || fieldData.IsPublic) - { - // For bases we do not re-declare if already accessible - // (internal, private are not accesible to page assembly) - declareField = false; - } - } - } - - return declareField; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Virtual method to allow language specific adjustments - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual string GetDeclarationTypeName(string name, string typeName) - { - return typeName; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Virtual method to allow language specific adjustment of root classname namespace - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual string GetClassNamespace() - { - return _className_Namespace; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Virtual method to allow language specific adjustment of field - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ virtual void SetAdditionalFieldData(CodeMemberField field) - { - return; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Compare buffers ignoring whitespace - /// - ///------------------------------------------------------------------------------------------------------------- - public /*protected, but public for FSharp.Project.dll*/ bool BufferEquals(string str1, string str2) - { - int i1 = 0; - int i2 = 0; - int len1 = str1.Length; - int len2 = str2.Length; - - for (; ; ) - { - while (i1 < len1 && char.IsWhiteSpace(str1[i1])) - i1++; - - while (i2 < len2 && char.IsWhiteSpace(str2[i2])) - i2++; - - if (i1 >= len1) - { - if (i2 >= len2) - { - return true; // ended with whitespace - } - return false; // str1 ended before str2 - } - else if (i2 >= len2) - { - return false; // str2 ended before str1 - } - else if (str1[i1] != str2[i2]) - { - return false; // different chars - } - - i1++; i2++; // advance - } - } - } -} - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/FieldData.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/FieldData.cs deleted file mode 100644 index a68af5d6574..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/FieldData.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Globalization; -using System.Reflection; -using EnvDTE; -using EnvDTE80; -using Microsoft.VisualStudio.Designer.Interfaces; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell.Design; -using Microsoft.VisualStudio.Shell.Design.Serialization; - -using IServiceProvider = System.IServiceProvider; -using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Web -{ - internal class FieldData - { - private string _name; - private string _class; - private int _depth; - private bool _isPrivate; - private bool _isProtected; - private bool _isPublic; - - public FieldData(CodeClass codeClass, CodeVariable codeVariable, int depth) - { - _name = codeVariable.Name; - _class = codeClass.FullName; - _depth = depth; - vsCMAccess access = codeVariable.Access; - _isPrivate = ((access & vsCMAccess.vsCMAccessPrivate) == vsCMAccess.vsCMAccessPrivate); - _isProtected = ((access & vsCMAccess.vsCMAccessProtected) == vsCMAccess.vsCMAccessProtected); - - // Special casing vsCMAccessAssemblyOrFamily - if ((access & vsCMAccess.vsCMAccessAssemblyOrFamily) == vsCMAccess.vsCMAccessAssemblyOrFamily) - _isProtected = true; - - _isPublic = ((access & vsCMAccess.vsCMAccessPublic) == vsCMAccess.vsCMAccessPublic); - } - - public FieldData(string name) - { - _name = name; - _class = null; - _depth = 0; - _isPrivate = false; - _isProtected = false; - _isPublic = true; - } - - public bool IsPrivate - { - get - { - return _isPrivate; - } - } - - public bool IsProtected - { - get - { - return _isProtected; - } - } - - public bool IsPublic - { - get - { - return _isPublic; - } - } - - public string Name - { - get - { - return _name; - } - } - - public int Depth - { - get - { - return _depth; - } - } - - public string Class - { - get - { - return _class; - } - } - } - - internal class FieldDataDictionary : Dictionary - { - public FieldDataDictionary(bool caseSensitive) : base(caseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase) - { - } - } -} diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/LockedDocData.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/LockedDocData.cs deleted file mode 100644 index d44f1779827..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/LockedDocData.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell.Design.Serialization; - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Web -{ - internal class LockedDocData : DocData - { - private IServiceProvider _serviceProvider; - private RunningDocumentTable _rdt; - private uint _cookie; - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Constructor. Aquires edit lock on document. - /// - ///------------------------------------------------------------------------------------------------------------- - public LockedDocData(IServiceProvider serviceProvider, string fileName) : base(serviceProvider, fileName) - { - _serviceProvider = serviceProvider; - _rdt = new RunningDocumentTable(serviceProvider); - - // Locate and lock the document - _rdt.FindDocument(fileName, out _cookie); - _rdt.LockDocument(_VSRDTFLAGS.RDT_EditLock , _cookie); - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Override of Dispose so we can free our lock after DocData. - /// - ///------------------------------------------------------------------------------------------------------------- - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - if (disposing) - { - if (_cookie != 0 && _rdt != null) - { - // prevent recursion - uint cookie = _cookie; - _cookie = 0; - - try - { - // Unlock the document, specifying to save if this is the last lock and the buffer is dirty - _rdt.UnlockDocument(_VSRDTFLAGS.RDT_EditLock | _VSRDTFLAGS.RDT_Unlock_SaveIfDirty, cookie); - } - finally - { - _cookie = 0; - _rdt = null; - } - } - _serviceProvider = null; - } - } - } -} - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/VsHierarchyItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/VsHierarchyItem.cs deleted file mode 100644 index 00b73a4f23b..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/VsHierarchyItem.cs +++ /dev/null @@ -1,697 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Runtime.InteropServices; -using EnvDTE; -using EnvDTE80; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TextManager.Interop; -using VSLangProj; - -using IServiceProvider = System.IServiceProvider; -using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; -using ErrorHandler = Microsoft.VisualStudio.ErrorHandler; - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Web -{ - internal class VsHierarchyItem - { - private uint _vsitemid; - private IVsHierarchy _hier; - private ServiceProvider _serviceProvider; - - //-------------------------------------------------------------------------------------------- - /// - /// Constructor - /// - /// Hiearchy item id - /// Hiearchy interface (typically the project) - //-------------------------------------------------------------------------------------------- - internal VsHierarchyItem(uint id, IVsHierarchy hier) - { - Debug.Assert(hier != null, "hier cannot be null"); - _vsitemid = id; - _hier = hier; - } - - internal VsHierarchyItem(IVsHierarchy hier) - { - Debug.Assert(hier != null, "hier cannot be null"); - _vsitemid = VSConstants.VSITEMID_ROOT; - _hier = hier; - } - - public override string ToString() - { - return Name(); - } - - //-------------------------------------------------------------------------------------------- - /// - /// Locates the item in the provided hierarchy using the provided moniker - /// and return a VsHierarchyItem for it - /// - //-------------------------------------------------------------------------------------------- - internal static VsHierarchyItem CreateFromMoniker(string moniker, IVsHierarchy hier) - { - VsHierarchyItem item = null; - - if (!string.IsNullOrEmpty(moniker) && hier != null) - { - IVsProject proj = hier as IVsProject; - if (proj != null) - { - int hr; - int isFound = 0; - uint itemid = VSConstants.VSITEMID_NIL; - VSDOCUMENTPRIORITY[] priority = new VSDOCUMENTPRIORITY[1]; - hr = proj.IsDocumentInProject(moniker, out isFound, priority, out itemid); - if (ErrorHandler.Succeeded(hr) && isFound != 0 && itemid != VSConstants.VSITEMID_NIL) - { - item = new VsHierarchyItem(itemid, hier); - } - - } - } - - return item; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Item's id which is unique for the hieararchy - /// - //-------------------------------------------------------------------------------------------- - internal uint VsItemID - { - get - { - return _vsitemid; - } - set - { - _vsitemid = value; - } - } - - //-------------------------------------------------------------------------------------------- - /// - /// Read only access to the hierarchy interface - /// - //-------------------------------------------------------------------------------------------- - internal IVsHierarchy Hierarchy - { - get - { - return _hier; - } - } - - //-------------------------------------------------------------------------------------------- - /// - /// Read only access to the uihierarchy interface - /// - //-------------------------------------------------------------------------------------------- - public IVsUIHierarchy UIHierarchy() - { - return _hier as IVsUIHierarchy; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Get the root as a VsHierarchyItem - /// - //-------------------------------------------------------------------------------------------- - internal VsHierarchyItem Root() - { - return new VsHierarchyItem(VSConstants.VSITEMID_ROOT, _hier); - } - - //-------------------------------------------------------------------------------------------- - /// - /// Gets the save name for the item. The save name is the string - /// shown in the save and save changes dialog boxes. - /// - /// - //-------------------------------------------------------------------------------------------- - internal string SaveName() - { - object o = GetPropHelper(__VSHPROPID.VSHPROPID_SaveName); - - return (o is string) ? (string)o : string.Empty; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Gets the string displayed in the project window for a particular item - /// - /// Display name for item - //-------------------------------------------------------------------------------------------- - internal string Caption() - { - object o = GetPropHelper(__VSHPROPID.VSHPROPID_Caption); - - return (o is string) ? (string)o : string.Empty; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Get the name of the item which is basically the file name - /// plus extension minus the directory - /// - /// Name of item - //-------------------------------------------------------------------------------------------- - internal string Name() - { - object o = GetPropHelper(__VSHPROPID.VSHPROPID_Name); - - return (o is string) ? (string)o : string.Empty; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Returns the extensibility object - /// - /// Name of item - //-------------------------------------------------------------------------------------------- - internal object ExtObject() - { - return GetPropHelper(__VSHPROPID.VSHPROPID_ExtObject); - } - - //-------------------------------------------------------------------------------------------- - /// - /// Returns the ProjectItem extensibility object - /// - /// Name of item - //-------------------------------------------------------------------------------------------- - internal ProjectItem ProjectItem() - { - return ExtObject() as ProjectItem; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Returns the ProjectItems extensibility object - /// - /// Name of item - //-------------------------------------------------------------------------------------------- - internal ProjectItems ProjectItems() - { - if (IsRootNode()) - { - Project project = ExtObject() as Project; - if (project != null) - { - return project.ProjectItems; - } - } - else - { - ProjectItem projectItem = ProjectItem(); - if (projectItem != null) - { - return projectItem.ProjectItems; - } - } - return null; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Returns the the full path of the item using extensibility. - /// - /// Name of item - //-------------------------------------------------------------------------------------------- - internal string FullPath() - { - string fullPath = ""; - try - { - object obj = ExtObject(); - - if(obj is EnvDTE.Project) - { - EnvDTE.Project project = obj as EnvDTE.Project; - if(project != null) - fullPath = project.Properties.Item("FullPath").Value as string; - } - else if(obj is EnvDTE.ProjectItem) - { - EnvDTE.ProjectItem projItem = obj as EnvDTE.ProjectItem; - if(projItem != null) - fullPath = projItem.Properties.Item("FullPath").Value as string; - } - } - catch - { - } - return fullPath; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Returns the relative path of the project item - /// - /// folder\file.ext - /// - ///-------------------------------------------------------------------------------------------- - internal string ProjRelativePath() - { - string projRelativePath = null; - - string rootProjectDir = Root().ProjectDir(); - rootProjectDir = WAUtilities.EnsureTrailingBackSlash(rootProjectDir); - string fullPath = FullPath(); - - if (!string.IsNullOrEmpty(rootProjectDir) && !string.IsNullOrEmpty(fullPath)) - { - projRelativePath = WAUtilities.MakeRelativePath(fullPath, rootProjectDir); - } - - return projRelativePath; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Returns the relative path of the project item - /// - /// folder/file.ext - /// - ///-------------------------------------------------------------------------------------------- - internal string ProjRelativeUrl() - { - string projRelativeUrl = null; - - string projRelativePath = ProjRelativePath(); - if (!string.IsNullOrEmpty(projRelativePath)) - { - projRelativeUrl = projRelativePath.Replace(Path.DirectorySeparatorChar, '/'); - } - - return projRelativeUrl; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Gets full path to project directory for this item - /// - /// - //-------------------------------------------------------------------------------------------- - internal string ProjectDir() - { - object o = GetPropHelper(__VSHPROPID.VSHPROPID_ProjectDir); - - return (o is string) ? (string)o : string.Empty; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Get type name for this item. This is the display name used in the - /// title bar to identify the type of the node or hierarchy. - /// - /// - //-------------------------------------------------------------------------------------------- - internal bool IsRootNode() - { - return _vsitemid == VSConstants.VSITEMID_ROOT; - } - - //-------------------------------------------------------------------------------------------- - /// - /// Gets the type guid for this item and compares against GUID_ItemType_PhysicalFile - /// - /// - //-------------------------------------------------------------------------------------------- - internal bool IsFile() - { - Guid guid = GetGuidPropHelper(__VSHPROPID.VSHPROPID_TypeGuid); - return guid.CompareTo(VSConstants.GUID_ItemType_PhysicalFile) == 0; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Returns the current contents of a document - /// - ///------------------------------------------------------------------------------------------------------------- - public string GetDocumentText() - { - string text = null; - IVsPersistDocData docData = null; - - try - { - // Get or create the buffer - IVsTextLines buffer = GetRunningDocumentTextBuffer(); - if (buffer == null) - { - docData = CreateDocumentData(); - buffer = docData as IVsTextLines; - } - - // get the text from the buffer - if (buffer != null) - { - IVsTextStream textStream = buffer as IVsTextStream; - if (textStream != null) - { - int length; - int hr = textStream.GetSize(out length); - if (ErrorHandler.Succeeded(hr)) - { - if (length > 0) - { - IntPtr pText = Marshal.AllocCoTaskMem((length + 1) * 2); - try - { - hr = textStream.GetStream(0, length, pText); - if (ErrorHandler.Succeeded(hr)) - { - text = Marshal.PtrToStringUni(pText); - } - } - finally - { - Marshal.FreeCoTaskMem(pText); - } - } - else - { - text = string.Empty; - } - } - } - } - } - finally - { - if (docData != null) - { - docData.Close(); - } - } - - return text; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Creates and loads the document data - /// (You must Close() it when done) - /// - ///------------------------------------------------------------------------------------------------------------- - public IVsPersistDocData CreateDocumentData() - { - if (IsFile()) - { - string fullPath = FullPath(); - if (!string.IsNullOrEmpty(fullPath)) - { - IOleServiceProvider serviceProvider = (IOleServiceProvider)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(IOleServiceProvider)); - IVsPersistDocData docData = WAUtilities.CreateSitedInstance(serviceProvider, typeof(VsTextBufferClass).GUID); - if (docData != null) - { - int hr = docData.LoadDocData(fullPath); - if (ErrorHandler.Succeeded(hr)) - { - return docData; - } - } - } - } - return null; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// If the document is open, it returns the IVsTextLines. - /// - ///------------------------------------------------------------------------------------------------------------- - public IVsTextLines GetRunningDocumentTextBuffer() - { - IVsTextLines buffer = null; - - IVsPersistDocData docData = GetRunningDocumentData(); - if (docData != null) - { - buffer = docData as IVsTextLines; - if (buffer == null) - { - IVsTextBufferProvider provider = docData as IVsTextBufferProvider; - if (provider != null) - { - provider.GetTextBuffer(out buffer); - } - } - } - - return buffer; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// If the document is open, it returns the IVsPersistDocData for it. - /// - ///------------------------------------------------------------------------------------------------------------- - public IVsPersistDocData GetRunningDocumentData() - { - IVsPersistDocData persistDocData = null; - - IntPtr docData = IntPtr.Zero; - try - { - docData = GetRunningDocData(); - if (docData != IntPtr.Zero) - { - persistDocData = Marshal.GetObjectForIUnknown(docData) as IVsPersistDocData; - } - } - finally - { - if (docData != IntPtr.Zero) - { - Marshal.Release(docData); - } - } - - return persistDocData; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// If the document is open, it returns the IntPtr to the doc data. - /// (This is ref-counted and must be released with Marshal.Release()) - /// - ///------------------------------------------------------------------------------------------------------------- - public IntPtr GetRunningDocData() - { - IntPtr docData = IntPtr.Zero; - - if (IsFile()) - { - string fullPath = FullPath(); - if (!string.IsNullOrEmpty(fullPath)) - { - IVsRunningDocumentTable rdt = GetService(); - if (rdt != null) - { - _VSRDTFLAGS flags = _VSRDTFLAGS.RDT_NoLock; - uint itemid; - IVsHierarchy hierarchy; - uint docCookie; - rdt.FindAndLockDocument - ( - (uint)flags, - fullPath, - out hierarchy, - out itemid, - out docData, - out docCookie - ); - } - } - } - - return docData; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Gets the project item Properties collection. - /// - ///------------------------------------------------------------------------------------------------------------- - public Properties Properties() - { - object obj = ExtObject(); - if(obj is EnvDTE.Project) - return ((EnvDTE.Project)obj).Properties; - else if(obj is EnvDTE.ProjectItem) - return ((EnvDTE.ProjectItem)obj).Properties; - return null; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Gets the build action of the item. - /// If not found returns build action none. - /// - ///------------------------------------------------------------------------------------------------------------- - public prjBuildAction BuildAction() - { - Properties props = Properties(); - if (props != null) - { - Property propBuildAction = props.Item("BuildAction"); - if (propBuildAction != null) - { - object objValue = propBuildAction.Value; - if (objValue != null) - { - prjBuildAction buildAction = (prjBuildAction)objValue; - return buildAction; - } - } - } - return prjBuildAction.prjBuildActionNone; - } - - ///------------------------------------------------------------------------------------------------------------- - /// - /// Returns true if the build action of the item is compile. - /// - ///------------------------------------------------------------------------------------------------------------- - public bool IsBuildActionCompile() - { - prjBuildAction buildAction = BuildAction(); - if (buildAction == prjBuildAction.prjBuildActionCompile) - { - return true; - } - return false; - } - - - //-------------------------------------------------------------------------------------------- - /// - /// Get the specified property from the __VSHPROPID enumeration for this item - /// - //-------------------------------------------------------------------------------------------- - private object GetPropHelper(__VSHPROPID propid) - { - return GetPropHelper(_vsitemid, (int)propid); - } - - //-------------------------------------------------------------------------------------------- - /// - /// Get the specified property from the __VSHPROPID2 enumeration for this item - /// - //-------------------------------------------------------------------------------------------- - private object GetPropHelper(__VSHPROPID2 propid) - { - return GetPropHelper(_vsitemid, (int)propid); - } - - //-------------------------------------------------------------------------------------------- - /// - /// Get the specified property for the specified item - /// - //-------------------------------------------------------------------------------------------- - private object GetPropHelper(uint itemid, int propid) - { - try - { - object o = null; - - if (_hier != null) - { - int hr = _hier.GetProperty(itemid, propid, out o); - } - - return o; - } - catch(Exception) - { - return null; - } - } - - //-------------------------------------------------------------------------------------------- - /// - /// Calls IVsHIerachy::GetGuidProperty - /// - //-------------------------------------------------------------------------------------------- - internal Guid GetGuidPropHelper(Microsoft.VisualStudio.Shell.Interop.__VSHPROPID propid) - { - Guid guid; - try - { - _hier.GetGuidProperty(_vsitemid, (int)propid, out guid); - } - catch(Exception) - { - guid = Guid.Empty; - } - return guid; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Get hierarchy site - /// - ///-------------------------------------------------------------------------------------------- - public IOleServiceProvider Site() - { - IOleServiceProvider serviceProvider = null; - if (_hier != null) - { - _hier.GetSite(out serviceProvider); - } - return serviceProvider; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Helper to get a shell service interface - /// - ///-------------------------------------------------------------------------------------------- - public InterfaceType GetService() where InterfaceType : class - { - InterfaceType service = null; - - try - { - if (_serviceProvider == null) - { - IOleServiceProvider serviceProvider = Site(); - if (serviceProvider != null) - { - _serviceProvider = new ServiceProvider(serviceProvider); - } - } - - if (_serviceProvider != null) - { - service = _serviceProvider.GetService(typeof(InterfaceType)) as InterfaceType; - } - } - catch - { - } - - return service; - } - - } - -} - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/WAUtilities.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/WAUtilities.cs deleted file mode 100644 index 53d6baf6f3c..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Web/WAUtilities.cs +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Collections; -using System.Diagnostics; -using System.Globalization; -using System.Text; -using System.Runtime.InteropServices; -using System.IO; -using System.Reflection; -using System.Threading; -using System.Windows.Forms; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.Win32; -using IServiceProvider = System.IServiceProvider; -using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; - -namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Web -{ - internal class WAUtilities - { - - ///-------------------------------------------------------------------------------------------- - /// - /// Helper to create an instance from the local registry given a CLSID Guid - /// - ///-------------------------------------------------------------------------------------------- - public static InterfaceType CreateInstance(IServiceProvider serviceProvider, Guid clsid) where InterfaceType : class - { - InterfaceType instance = null; - - if (clsid != Guid.Empty) - { - ILocalRegistry localRegistry = GetService(serviceProvider); - if (localRegistry != null) - { - IntPtr pInstance = IntPtr.Zero; - Guid iidUnknown = NativeMethods.IID_IUnknown; - - try - { - localRegistry.CreateInstance(clsid, null, ref iidUnknown, NativeMethods.CLSCTX_INPROC_SERVER, out pInstance); - } - catch { } - - if (pInstance != IntPtr.Zero) - { - try - { - instance = Marshal.GetObjectForIUnknown(pInstance) as InterfaceType; - } - catch { } - - try - { - Marshal.Release(pInstance); - } - catch { } - } - } - } - - return instance; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Helper to create an instance from the local registry given a CLSID Guid - /// - ///-------------------------------------------------------------------------------------------- - public static InterfaceType CreateSitedInstance(IServiceProvider serviceProvider, Guid clsid) where InterfaceType : class - { - InterfaceType instance = CreateInstance(serviceProvider, clsid); - - if (instance != null) - { - IObjectWithSite sitedObject = instance as IObjectWithSite; - IOleServiceProvider site = GetService(serviceProvider); - if (sitedObject != null && site != null) - { - sitedObject.SetSite(site); - } - else - { - instance = null; // failed to site - } - } - - return instance; - } - public static InterfaceType CreateSitedInstance(IOleServiceProvider serviceProvider, Guid clsid) where InterfaceType : class - { - return CreateSitedInstance(new ServiceProvider(serviceProvider), clsid); - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Helper to get a shell service interface - /// - ///-------------------------------------------------------------------------------------------- - public static InterfaceType GetService(IServiceProvider serviceProvider) where InterfaceType : class - { - InterfaceType service = null; - - try - { - service = serviceProvider.GetService(typeof(InterfaceType)) as InterfaceType; - } - catch - { - } - - return service; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Helpers to ensure (or remove) trailing slashes (or back slashes) - /// - ///-------------------------------------------------------------------------------------------- - public static string EnsureTrailingSlash(string str) - { - if (str != null && !str.EndsWith("/")) - { - str += "/"; - } - return str; - } - public static string EnsureTrailingBackSlash(string str) - { - if (str != null && !str.EndsWith("\\")) - { - str += "\\"; - } - return str; - } - - ///-------------------------------------------------------------------------------------------- - /// - /// Helpers to make relative paths/urls from physical paths - /// - ///-------------------------------------------------------------------------------------------- - public static string MakeRelativePath(string fullPath, string basePath) - { - string separator = Path.DirectorySeparatorChar.ToString(); - string tempBasePath = basePath; - string tempFullPath = fullPath; - string relativePath = null; - - if (!tempBasePath.EndsWith(separator)) - tempBasePath += separator; - tempFullPath = tempFullPath.ToLowerInvariant(); - tempBasePath = tempBasePath.ToLowerInvariant(); - - while (!string.IsNullOrEmpty(tempBasePath)) - { - if (tempFullPath.StartsWith(tempBasePath)) - { - relativePath += fullPath.Remove(0, tempBasePath.Length); - if (relativePath == separator) - relativePath = ""; - return relativePath; - } - else - { - tempBasePath = tempBasePath.Remove(tempBasePath.Length - 1); - int nLastIndex = tempBasePath.LastIndexOf(separator); - if (-1 != nLastIndex) - { - tempBasePath = tempBasePath.Remove(nLastIndex + 1); - relativePath += ".."; - relativePath += separator; - } - else - return fullPath; - } - } - - return fullPath; - } - } - - -} diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/WebProjectBase.Files b/vsintegration/src/FSharp.ProjectSystem.Base/Project/WebProjectBase.Files deleted file mode 100644 index d9e684eb298..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/WebProjectBase.Files +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - ProjectBase\Web\CodeBehindCodeGenerator.cs - true - - - ProjectBase\Web\FieldData.cs - true - - - ProjectBase\Web\LockedDocData.cs - true - - - ProjectBase\Web\VsHierarchyItem.cs - true - - - ProjectBase\Web\WAUtilities.cs - true - - - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index cf2cf8ecc0a..aedf8ea5e41 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -84,10 +84,8 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem let getConfigExtendedPropertyPages() = match lazyPropertyPages.Force() with (_,config,_) -> config let getPriorityExtendedPropertyPages() = match lazyPropertyPages.Force() with (_,_,priority) -> priority -////////////////////// - // An IProjectSite object with hot-swappable inner implementation - type internal DynamicProjectSite(origInnerImpl : Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite) = + type internal DynamicProjectSite(origInnerImpl : Microsoft.VisualStudio.FSharp.Editor.IProjectSite) = let mutable inner = origInnerImpl @@ -95,7 +93,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem inner <- newInner // This interface is thread-safe, assuming "inner" is thread-safe - interface Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite with + interface Microsoft.VisualStudio.FSharp.Editor.IProjectSite with member __.Description = inner.Description member __.CompilationSourceFiles = inner.CompilationSourceFiles member __.CompilationOptions = inner.CompilationOptions @@ -128,7 +126,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem // This member is thread-safe member x.GetProjectSite() = Debug.Assert(state <> ProjectSiteOptionLifetimeState.Opening, "ProjectSite is not available") - projectSite.Value :> Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite + projectSite.Value :> Microsoft.VisualStudio.FSharp.Editor.IProjectSite // This member is thread-safe member x.TryGetProjectSite() = @@ -136,7 +134,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem | ProjectSiteOptionLifetimeState.Opening, _ | ProjectSiteOptionLifetimeState.Closed, _ -> None | _, None -> None - | _, Some x -> Some(x :> Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite) + | _, Some x -> Some(x :> Microsoft.VisualStudio.FSharp.Editor.IProjectSite) member x.Open(site) = Debug.Assert((state = ProjectSiteOptionLifetimeState.Opening), "Called Open, but not in Opening state") @@ -159,7 +157,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem static member ExploreFolderInWindows = 1635u type internal Notifier() = - let notificationsDict = new System.Collections.Generic.Dictionary() + let notificationsDict = new System.Collections.Generic.Dictionary() member this.Notify() = for kvp in notificationsDict do kvp.Value.Invoke() @@ -1370,8 +1368,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem // If property is not set - msbuild will resolve only primary dependencies, // and compiler will be very unhappy when during processing of referenced assembly it will discover that all fundamental types should be // taken from System.Runtime that is not supplied - - let _ = x.InvokeMsBuild("Compile", extraProperties = [KeyValuePair("_ResolveReferenceDependencies", "true")]) + let _ = x.InvokeMsBuild("Compile", extraProperties = [KeyValuePair("_ResolveReferenceDependencies", "true"); KeyValuePair("DesignTimeBuild", "true")]) sourcesAndFlagsNotifier.Notify() finally actuallyBuild <- true @@ -1446,7 +1443,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem // Returns an IProjectSite that references "this" to get its information member private x.CreateRunningProjectSite() = let creationTime = System.DateTime.UtcNow - { new Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite with + { new Microsoft.VisualStudio.FSharp.Editor.IProjectSite with member __.CompilationSourceFiles = x.CompilationSourceFiles member __.CompilationOptions = x.CompilationOptions @@ -1471,8 +1468,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem member __.TargetFrameworkMoniker = x.GetTargetFrameworkMoniker() member __.ProjectGuid = x.GetProjectGuid() member __.LoadTime = creationTime - member __.ProjectProvider = Some (x :> IProvideProjectSite) - + member __.ProjectProvider = Some (x :> Microsoft.VisualStudio.FSharp.Editor.IProvideProjectSite) } // Snapshot-capture relevent values from "this", and returns an IProjectSite @@ -1490,7 +1486,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem let creationTime = DateTime.UtcNow // This object is thread-safe - { new Microsoft.VisualStudio.FSharp.LanguageService.IProjectSite with + { new Microsoft.VisualStudio.FSharp.Editor.IProjectSite with member __.Description = description member __.CompilationSourceFiles = sourceFiles member __.CompilationOptions = options @@ -1507,11 +1503,11 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem member __.TargetFrameworkMoniker = targetFrameworkMoniker member __.ProjectGuid = x.GetProjectGuid() member __.LoadTime = creationTime - member __.ProjectProvider = Some (x :> IProvideProjectSite) + member __.ProjectProvider = Some (x :> Microsoft.VisualStudio.FSharp.Editor.IProvideProjectSite) } // let the language service ask us questions - interface Microsoft.VisualStudio.FSharp.LanguageService.IProvideProjectSite with + interface Microsoft.VisualStudio.FSharp.Editor.IProvideProjectSite with member x.GetProjectSite() = match projectSite.State with | ProjectSiteOptionLifetimeState.Opening -> diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index c273d6d11ad..fd61a4063f7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -1,60 +1,30 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - true - FSharp - - - + - $(VsSDKTools) - Debug - AnyCPU - 2.0 - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} + net46 Library FSharp.ProjectSystem.FSharp - LIBRARY - $(NoWarn);52;75;62 - true - v4.6 - $(OtherFlags) --warnon:1182 --subsystemversion:6.00 - false - true + true false - false - true - true - true - - - - - - true - VSCTCompile;CopyCtoFile;CopyLocalizationResources;$(BuildDependsOn) + $(NoWarn);52;62;75 + true + $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + true + false - - - - - - - - - + + - false + Menus.ctmenu true @@ -68,170 +38,61 @@ + + + + + + + + + + + + + - - - - - + + + + - - $(FSharpSourcesRoot)\..\packages\VSSDK.DebuggerVisualizers.12.0.4\lib\net20\Microsoft.VisualStudio.DebuggerVisualizers.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.15.0.26201\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.15.0.15.0.25123-Dev15Preview\lib\net45\Microsoft.VisualStudio.Shell.Immutable.15.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - FSHarp.VS.FSI - {991dcf75-c2eb-42b6-9a0d-aa1d2409d519} - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - - - FSharp.PropertiesPages - {fcfb214c-462e-42b3-91ca-fc557efee74f} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - FSharp.Editor - {65e0e82a-eace-4787-8994-888674c2fe87} - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + + + + + + + + + + + + + + - - - \ No newline at end of file + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb index cc5533ac7e3..a852e3a3399 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb @@ -1,12 +1,5 @@ ' Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -Imports System -Imports System.Reflection -Imports System.Runtime.CompilerServices Imports Microsoft.VisualStudio.Shell -'/* F# additions: begin. */ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 918e1b74153..75b445bc6be 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -1,12 +1,7 @@  - - $(MSBuildProjectDirectory)\..\..\..\src - VisualBasic - true - vb - + Debug net40 @@ -29,35 +24,23 @@ false 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 40026;42105;42107;42353 - - true v4.6 - true + true false false true true true + true + true + false - - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY=True,$(DefineConstants) - true - true - - - - $(FSharpSourcesRoot)\..\loc\lcl\{Lang}\$(AssemblyName).dll.lcl - $(FSharpSourcesRoot)\..\loc\lci\$(AssemblyName).dll.lci - false - false - - - - + + + + @@ -78,106 +61,19 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.WCFReference.Interop.9.0.30729\lib\Microsoft.VisualStudio.WCFReference.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ManagedInterfaces.8.0.50727\lib\Microsoft.VisualStudio.ManagedInterfaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.9.9.0.4\lib\net20\VSLangProj90.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.10.10.0.4\lib\net20\VSLangProj100.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.11.11.0.4\lib\net20\VSLangProj110.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - + + + + + + + + + + + + + @@ -374,13 +270,7 @@ - + - - $(SuiteBinPath)\FSharp - - - - - - \ No newline at end of file + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb index b5f34639104..964304b02ee 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb @@ -75,14 +75,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages m_OutputTypeStringKeys(INDEX_COMMANDLINEAPP) = SR.GetString(SR.PPG_CommandLineApp) m_OutputTypeStringKeys(INDEX_WINDOWSCLASSLIB) = SR.GetString(SR.PPG_WindowsClassLib) -#If VS_VERSION_DEV14 Then - Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v2.0" - Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v4.0" -#End If -#If VS_VERSION_DEV15 Then Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v2.0" Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v4.0" -#End If m_v20FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey, Nothing, Nothing))) m_v40FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v40FSharpRedistKey, Nothing, Nothing))) diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml new file mode 100644 index 00000000000..7126d6efb8b --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs new file mode 100644 index 00000000000..571e8905213 --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.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 AdvancedOptionsControl.xaml + /// + public partial class AdvancedOptionsControl : UserControl + { + public AdvancedOptionsControl() + { + InitializeComponent(); + } + } +} diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index cd1012a326d..a6c9a18f0bf 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -1,112 +1,57 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - CSharp - true - cs - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - AnyCPU - {C4586A06-1402-48BC-8E35-A1B8642F895B} + net46 Library - Properties + false Microsoft.VisualStudio.FSharp.UIResources - FSharp.UIResources - LIBRARY - true - $(DefineConstants) - v4.6 - true - - - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY;$(DefineConstants) - true - true + $(NoWarn);1591 + - - $(FSharpSourcesRoot)\..\loc\lcl\{Lang}\$(AssemblyName).dll.lcl - $(FSharpSourcesRoot)\..\loc\lci\$(AssemblyName).dll.lci - false - false - + + + + + + - + - + + + - - CodeFixesOptionControl.xaml - - - - LanguageServicePerformanceOptionControl.xaml - - - IntelliSenseOptionControl.xaml - - - - QuickInfoOptionControl.xaml - - - - True - True - Strings.resx - + + + + + + + - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - PublicResXFileCodeGenerator - Strings.Designer.cs - Designer - - - - - + + + $(VS150COMNTOOLS)\..\..\MSBuild\$(VisualStudioVersion)\Bin + $(VSMSBuildBinDir)\Microsoft.CSharp.targets + + + + + false + + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/InternalsVisibleTo.cs b/vsintegration/src/FSharp.UIResources/InternalsVisibleTo.cs deleted file mode 100644 index 0d0fd353a98..00000000000 --- a/vsintegration/src/FSharp.UIResources/InternalsVisibleTo.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("VisualFSharp.Salsa, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("VisualFSharp.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.LanguageService, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.ProjectSystem.Base, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.ProjectSystem.FSharp, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] -[assembly: InternalsVisibleTo("FSharp.Editor, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")] - diff --git a/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs b/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs index a67fb081603..7c13fcd592a 100644 --- a/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs @@ -1,17 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -using System; -using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 930363c3ddb..75234c04d74 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -69,6 +69,15 @@ public static string Always_place_opens_at_top_level { } } + /// + /// Looks up a localized string similar to Block Structure Guides. + /// + public static string Block_Structure { + get { + return ResourceManager.GetString("Block_Structure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Code Fixes. /// @@ -132,6 +141,15 @@ public static string Navigation_links { } } + /// + /// Looks up a localized string similar to Outlining. + /// + public static string Outlining { + get { + return ResourceManager.GetString("Outlining", resourceCulture); + } + } + /// /// Looks up a localized string similar to Project check cache size. /// @@ -168,6 +186,15 @@ public static string Show_completion_list_after_a_character_is_typed { } } + /// + /// Looks up a localized string similar to Show structure guidelines for F# code. + /// + public static string Show_guides { + get { + return ResourceManager.GetString("Show_guides", resourceCulture); + } + } + /// /// Looks up a localized string similar to S_how navigation links as. /// @@ -177,6 +204,15 @@ public static string Show_navigation_links_as { } } + /// + /// Looks up a localized string similar to Show outlining and collapsable nodes for F# code. + /// + public static string Show_Outlining { + get { + return ResourceManager.GetString("Show_Outlining", resourceCulture); + } + } + /// /// Looks up a localized string similar to Simplify names (remove unnecessary qualifiers). /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 1e485e1734f..ebe45bf7321 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -168,4 +168,16 @@ Analyze and suggest fixes for unused values + + Block Structure Guides + + + Show structure guidelines for F# code + + + Outlining + + + Show outlining and collapsable nodes for F# code + \ 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 b5661fcf99c..a396705910a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -87,6 +87,26 @@ Analyzovat a navrhovat opravy pro nepoužité hodnoty + + Block Structure Guides + Vodítka pro strukturu bloku + + + + Show structure guidelines for F# code + Zobrazí pokyny pro strukturu kódu F#. + + + + Outlining + Sbalení + + + + Show outlining and collapsable nodes for F# code + Zobrazí osnovu a sbalitelné uzly kódu F#. + + \ 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 61b8644e763..218468a4f86 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -87,6 +87,26 @@ Korrekturen für nicht verwendete Werte analysieren und vorschlagen + + Block Structure Guides + Führungslinien für Blockstruktur + + + + Show structure guidelines for F# code + Strukturführungslinien für F#-Code anzeigen + + + + Outlining + Gliederung + + + + Show outlining and collapsable nodes for F# code + Gliederung und ausblendbare Knoten für F#-Code anzeigen + + \ 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 8f182327ec7..a9f0ba0ac19 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -87,6 +87,26 @@ Analyze and suggest fixes for unused values + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ 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 bbd423295ee..88318f48048 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -87,6 +87,26 @@ Analizar y sugerir correcciones para valores no utilizados + + Block Structure Guides + Guías de estructura de bloque + + + + Show structure guidelines for F# code + Mostrar las guías de la estructura del código F# + + + + Outlining + Esquematización + + + + Show outlining and collapsable nodes for F# code + Mostrar los nodos de esquematización y contraíbles del código F# + + \ 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 4a357f591cb..2df7e8e7119 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -87,6 +87,26 @@ Analyser et proposer des solutions pour les valeurs inutilisées + + Block Structure Guides + Repères de structure de bloc + + + + Show structure guidelines for F# code + Afficher les directives de structure pour le code F# + + + + Outlining + Mode plan + + + + Show outlining and collapsable nodes for F# code + Afficher le mode plan et les nœuds réductibles pour le code F# + + \ 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 45dab1e9e73..aea7e8a3358 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -87,6 +87,26 @@ Analizza e suggerisci correzioni per valori inutilizzati + + Block Structure Guides + Guide per strutture a blocchi + + + + Show structure guidelines for F# code + Mostra le linee guida della struttura per il codice F# + + + + Outlining + Struttura + + + + Show outlining and collapsable nodes for F# code + Mostra i nodi struttura e comprimibili per il codice F# + + \ 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 4259f31f548..fe3dad874a0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -87,6 +87,26 @@ 未使用の値を分析して修正を提案する + + Block Structure Guides + ブロック構造のガイド + + + + Show structure guidelines for F# code + F# コードの構造のガイドラインを表示する + + + + Outlining + アウトライン + + + + Show outlining and collapsable nodes for F# code + F# コードのアウトラインおよび折りたたみ可能なノードを表示する + + \ 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 09880b80383..310eeffa719 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -87,6 +87,26 @@ 사용되지 않는 값에 대해 수정 사항 분석 및 제안 + + Block Structure Guides + 블록 구조 가이드 + + + + Show structure guidelines for F# code + F# 코드에 대한 구조체 지침 표시 + + + + Outlining + 개요 + + + + Show outlining and collapsable nodes for F# code + F# 코드에 대한 개요 및 축소 가능한 노드 표시 + + \ 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 9789f982e96..1ff43eb0bdd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -87,6 +87,26 @@ Analizuj nieużywane wartości i sugeruj dla nich poprawki + + Block Structure Guides + Prowadnice struktury blokowej + + + + Show structure guidelines for F# code + Pokaż wskazówki dotyczące struktury dla kodu języka F# + + + + Outlining + Konspekt + + + + Show outlining and collapsable nodes for F# code + Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# + + \ 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 17c89633135..44da05912bb 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -87,6 +87,26 @@ Analisar e sugerir correções de valores não usados + + Block Structure Guides + Guias de Estrutura de Bloco + + + + Show structure guidelines for F# code + Mostrar as diretrizes de estrutura para o código F# + + + + Outlining + Estrutura de Tópicos + + + + Show outlining and collapsable nodes for F# code + Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# + + \ 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 af942d657da..c5141e2e97c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -87,6 +87,26 @@ Проанализировать и предложить исправления для неиспользуемых значений + + Block Structure Guides + Направляющие для структуры блоков + + + + Show structure guidelines for F# code + Показать рекомендации по структуре для кода F# + + + + Outlining + Структура + + + + Show outlining and collapsable nodes for F# code + Показать структурирование и сворачиваемые узлы для кода F# + + \ 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 3edba18c3a8..5198b19f729 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -87,6 +87,26 @@ Kullanılmayan değerlere yönelik düzeltmeleri çözümle + + Block Structure Guides + Blok Yapısı Kılavuzları + + + + Show structure guidelines for F# code + F# kodu için yapı yönergelerini göster + + + + Outlining + Ana Hat + + + + Show outlining and collapsable nodes for F# code + F# kodu için ana hattı ve daraltılabilir düğümleri göster + + \ 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 29b9ae3f5ff..2d251aa0375 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -87,6 +87,26 @@ 分析未使用的值并建议相应的修补程序 + + Block Structure Guides + 块结构指南 + + + + Show structure guidelines for F# code + 显示 F# 代码的结构指南 + + + + Outlining + 大纲 + + + + Show outlining and collapsable nodes for F# code + 显示 F# 代码的大纲和可折叠节点 + + \ 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 39042ef0d7f..be901b794c0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -87,6 +87,26 @@ 分析未使用的值並建議修正 + + Block Structure Guides + 區塊結構輔助線 + + + + Show structure guidelines for F# code + 顯示 F# 程式碼的結構方針 + + + + Outlining + 大綱 + + + + Show outlining and collapsable nodes for F# code + 顯示 F# 程式碼的大綱與可折疊的節點 + + \ 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 deleted file mode 100644 index 9eef82dcf36..00000000000 --- a/vsintegration/src/FSharp.VS.FSI/FSHarp.VS.FSI.fsproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - FSharp.VS.FSI - true - - - - Debug - AnyCPU - {991dcf75-c2eb-42b6-9a0d-aa1d2409d519} - Library - FSharp.VS.FSI - v4.6 - true - LIBRARY - $(NoWarn);47;75 - $(OtherFlags) --subsystemversion:6.00 - true - false - false - true - true - true - - - - - - - - - - - - - - - - - - CompilerLocationUtils.fs - - - - - - - - - - - true - Microsoft.VisualStudio.FSharp.Interactive.SRProperties - true - Properties - Properties.resx - - - - - - - FSharp.Compiler.Private - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - - - - - - - - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.TextManager.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.15.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Package.LanguageService.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.StandardClassification.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.StandardClassification.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ComponentModelHost.15.0.26201-alpha\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.Compiler.Server.Shared - {d5870cf0-ed51-4cbc-b3d7-6f56da84ac06} - - - \ 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 new file mode 100644 index 00000000000..03ff7cd35aa --- /dev/null +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -0,0 +1,91 @@ + + + + + + net46 + Library + true + false + $(NoWarn);47;75 + true + $(OtherFlags) --subsystemversion:6.00 + true + false + + + + + + + + + + + + + + + CompilerLocationUtils.fs + + + + + + + + + + + true + Microsoft.VisualStudio.FSharp.Interactive.SRProperties + true + Properties + Properties.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs b/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs index c9897d7153c..f7fa7f99934 100644 --- a/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs +++ b/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs @@ -286,7 +286,7 @@ type internal FsiToolWindow() as this = lock textLines (fun () -> let span = textStream.ReadOnlyMarkerSpan let lastLine,lastIndex = textLines.GetLastLineIndex() |> throwOnFailure2 - let strHandle = GCHandle.Alloc(str, GCHandleType.Pinned) + let mutable strHandle = GCHandle.Alloc(str, GCHandleType.Pinned) try textLines.ReplaceLines(span.iEndLine, span.iEndIndex, lastLine, lastIndex, strHandle.AddrOfPinnedObject(), str.Length, null) |> throwOnFailure0 finally diff --git a/vsintegration/src/fsharp.common.props b/vsintegration/src/fsharp.common.props deleted file mode 100644 index 47dee9fdbde..00000000000 --- a/vsintegration/src/fsharp.common.props +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Debug - AnyCPU - - - - - - - - ..\.. - net40 - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - - pdbonly - true - TRACE - prompt - 4 - - - \ No newline at end of file diff --git a/vsintegration/src/fsharp.tools.targets b/vsintegration/src/fsharp.tools.targets deleted file mode 100644 index 6ef78a70161..00000000000 --- a/vsintegration/src/fsharp.tools.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj index 798c014807f..0b2fc8a750b 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj index b66f8de6f02..cf8838f72ce 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj index 9895bd74f42..c4c480ee525 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj index 73c48bd1057..a02e9e3bfa9 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/MockTypeProviders/Directory.Build.props b/vsintegration/tests/MockTypeProviders/Directory.Build.props new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/vsintegration/tests/MockTypeProviders/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/tests/MockTypeProviders/Directory.Build.targets b/vsintegration/tests/MockTypeProviders/Directory.Build.targets new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/vsintegration/tests/MockTypeProviders/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj similarity index 91% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index 6b201cb4193..05c38f1a8ae 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src FSharp true @@ -38,5 +38,4 @@ - \ No newline at end of file diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj index 899401d6b29..66baa3dfe19 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs rename to vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj similarity index 91% rename from vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj rename to vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index 439e8d6aa3f..be555283db8 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src FSharp @@ -35,5 +35,4 @@ - \ No newline at end of file diff --git a/vsintegration/tests/unittests/MockTypeProviders/Helpers.cs b/vsintegration/tests/MockTypeProviders/Helpers.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/Helpers.cs rename to vsintegration/tests/MockTypeProviders/Helpers.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj index 762839f1b6f..865547fb515 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj index 8cb46c9898b..6c71fe60010 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj index a28c3ea6dd1..694fcd781e9 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj index ae2742811c8..90f90e87985 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj index 680fa119ac6..525153bff63 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs index 21b290c3819..ee82ab0807f 100644 --- a/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs +++ b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs @@ -18,7 +18,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.VisualStudio.FSharp.LanguageService.SiteProvider -open Microsoft.VisualStudio.FSharp.Editor type internal FSharpLanguageServiceTestable() as this = static let colorizerGuid = new Guid("{A2976312-7D71-4BB4-A5F8-66A08EBF46C8}") // Guid for colorized user data on IVsTextBuffer @@ -149,9 +148,9 @@ type internal FSharpLanguageServiceTestable() as this = match hier with | :? IProvideProjectSite as siteProvider -> let site = siteProvider.GetProjectSite() - site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, + site.AdviseProjectSiteChanges(LanguageServiceConstants.FSharpLanguageServiceCallbackName, new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(site))) - site.AdviseProjectSiteCleaned(FSharpConstants.FSharpLanguageServiceCallbackName, + site.AdviseProjectSiteCleaned(LanguageServiceConstants.FSharpLanguageServiceCallbackName, new AdviseProjectSiteChanges(fun () -> this.OnProjectCleaned(site))) | _ -> // This can happen when the file is in a solution folder or in, say, a C# project. diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index d0e0cbceb39..9b938e3b8c3 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -1,21 +1,14 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - VisualFSharp.Salsa - - + + - Debug - AnyCPU - 2.0 - {fbd4b354-dc6e-4032-8ec7-c81d8dfb1af7} + net46 Library - VisualFSharp.Salsa $(NoWarn);45;47;52;58;75 - v4.6 + true + true + false @@ -35,177 +28,40 @@ + + + + + + + + + + + - + - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Internal.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Text.Internal.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Platform.VSEditor.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Platform.VSEditor.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Platform.VSEditor.Interop.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Platform.VSEditor.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Telemetry.15.0.777-rtm6FAA2C78\lib\net45\Microsoft.VisualStudio.Telemetry.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - True - $(NUnitLibDir)\nunit.framework.dll - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.Build - {702a7979-bcf9-4c41-853e-3adfc9897890} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - FSharp.Editor - {65e0e82a-eace-4787-8994-888674c2fe87} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - - - FSharp.ProjectSystem.FSharp - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - True - + + + + + + + + + + + + + + - - - \ No newline at end of file + + diff --git a/vsintegration/tests/Salsa/VsMocks.fs b/vsintegration/tests/Salsa/VsMocks.fs index d5cc21f4fbf..270c41cfc88 100644 --- a/vsintegration/tests/Salsa/VsMocks.fs +++ b/vsintegration/tests/Salsa/VsMocks.fs @@ -1637,18 +1637,8 @@ module internal VsActual = let vsInstallDir = // use the environment variable to find the VS installdir -#if VS_VERSION_DEV12 - let vsvar = System.Environment.GetEnvironmentVariable("VS120COMNTOOLS") - if String.IsNullOrEmpty vsvar then failwith "VS120COMNTOOLS environment variable was not found." -#endif -#if VS_VERSION_DEV14 - let vsvar = System.Environment.GetEnvironmentVariable("VS140COMNTOOLS") - if String.IsNullOrEmpty vsvar then failwith "VS140COMNTOOLS environment variable was not found." -#endif -#if VS_VERSION_DEV15 let vsvar = System.Environment.GetEnvironmentVariable("VS150COMNTOOLS") if String.IsNullOrEmpty vsvar then failwith "VS150COMNTOOLS environment variable was not found." -#endif Path.Combine(vsvar, "..") let CreateEditorCatalog() = diff --git a/vsintegration/tests/unittests/BraceMatchingServiceTests.fs b/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/BraceMatchingServiceTests.fs rename to vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs diff --git a/vsintegration/tests/unittests/BreakpointResolutionService.fs b/vsintegration/tests/UnitTests/BreakpointResolutionService.fs similarity index 100% rename from vsintegration/tests/unittests/BreakpointResolutionService.fs rename to vsintegration/tests/UnitTests/BreakpointResolutionService.fs diff --git a/vsintegration/tests/unittests/ColorizationServiceTests.fs b/vsintegration/tests/UnitTests/ColorizationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/ColorizationServiceTests.fs rename to vsintegration/tests/UnitTests/ColorizationServiceTests.fs diff --git a/vsintegration/tests/unittests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/CompletionProviderTests.fs rename to vsintegration/tests/UnitTests/CompletionProviderTests.fs index 718e34b5ba2..4eec07695ff 100644 --- a/vsintegration/tests/unittests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/DocumentDiagnosticAnalyzerTests.fs b/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs similarity index 100% rename from vsintegration/tests/unittests/DocumentDiagnosticAnalyzerTests.fs rename to vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs diff --git a/vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs similarity index 98% rename from vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs rename to vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs index 49bacadf328..9568c64e67b 100644 --- a/vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs +++ b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/EditorFormattingServiceTests.fs b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/EditorFormattingServiceTests.fs rename to vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs diff --git a/vsintegration/tests/unittests/GoToDefinitionServiceTests.fs b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs similarity index 98% rename from vsintegration/tests/unittests/GoToDefinitionServiceTests.fs rename to vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs index 02d2e39b489..ba67994aa06 100644 --- a/vsintegration/tests/unittests/GoToDefinitionServiceTests.fs +++ b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs @@ -12,7 +12,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\GoToDefinitionServiceTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\GoToDefinitionServiceTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/HelpContextServiceTests.fs b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/HelpContextServiceTests.fs rename to vsintegration/tests/UnitTests/HelpContextServiceTests.fs diff --git a/vsintegration/tests/unittests/IndentationServiceTests.fs b/vsintegration/tests/UnitTests/IndentationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/IndentationServiceTests.fs rename to vsintegration/tests/UnitTests/IndentationServiceTests.fs diff --git a/vsintegration/tests/unittests/LanguageDebugInfoServiceTests.fs b/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/LanguageDebugInfoServiceTests.fs rename to vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Completion.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.General.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.General.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs similarity index 99% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs index f72aa5c93d8..0fad94e8e46 100644 --- a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs @@ -330,10 +330,7 @@ type UsingMSBuild() = type T = N1.T<"", 1> """, marker = "T<", - f = (fun (_, result) -> - Assert.IsFalse(result.Success) - Assert.That(result.ErrorDescription, Does.Contain("provided type 'T'")) - ), + f = (fun (_, result) -> Assert.IsFalse(result.Success) ), addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] ) diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs similarity index 99% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index 50450a205bb..5667becef1b 100644 --- a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -1335,16 +1335,7 @@ type UsingMSBuild() as this = use _guard = this.UsingNewVS() let solution = this.CreateSolution() let project = CreateProject(solution,"testproject") - let fsVersion = -#if VS_VERSION_DEV12 - "4.3.1.0" -#endif -#if VS_VERSION_DEV14 - "4.4.0.0" -#endif -#if VS_VERSION_DEV15 - "10.1.1.0" -#endif + let fsVersion = "10.1.1.0" let binariesFolder = match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None) with | Some(x) -> x | None -> failwith "Location of binaries folder cannot be found" diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs similarity index 99% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs index 361f6569b16..d8fbe01d502 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs @@ -15,6 +15,7 @@ open Microsoft.VisualStudio open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.FSharp.ProjectSystem +open Microsoft.VisualStudio.FSharp.Editor // Internal unittest namespaces open NUnit.Framework @@ -326,7 +327,7 @@ type Miscellaneous() = use project = TheTests.CreateProject(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "foo.fs" File.AppendAllText(srcFile, "#light\nlet foo () =\n printfn \"A\"\n") - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger let errors = List.filter (fun (s:string) -> s.Contains(expectedError)) !outputWindowPaneErrors AssertEqual 1 (List.length errors) ) @@ -418,7 +419,7 @@ type Miscellaneous() = let vso = VsMocks.vsOutputWindowPane(outputWindowPaneErrors) let srcFile = (Path.GetDirectoryName projFileName) + "\\" + "foo.fs" File.AppendAllText(srcFile, "let x = 5\n") - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger printfn "Build output:" !outputWindowPaneErrors |> Seq.iter (printfn "%s") let expectedRegex = new Regex("\\s*ProjectExt\\[.fsproj\\]") @@ -498,7 +499,7 @@ type Miscellaneous() = // Now the project system is in a state where ComputeSourcesAndFlags will fail. // Our goal is to at least be able to open individual source files and treat them like 'files outside a project' with regards to intellisense, etc. // Also, if the user does 'Build', he will get an error which will help diagnose the problem. - let ipps = project :> Microsoft.VisualStudio.FSharp.LanguageService.IProvideProjectSite + let ipps = project :> IProvideProjectSite let ips = ipps.GetProjectSite() let expected = [| |] // Ideal behavior is [|"foo.fs";"bar.fs"|], and we could choose to improve this in the future. For now we are just happy to now throw/crash. let actual = ips.CompilationSourceFiles diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs similarity index 99% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs index 6a37f44ba89..87994c1949f 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs @@ -847,7 +847,7 @@ type Project() = use project = TheTests.CreateProject(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "foo.fs" File.AppendAllText(srcFile, "bar") ; // foo.fs will be cleaned up by parent call to DoWithTempFile - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger let errors = List.filter (fun s -> (new Regex(expectedError)).IsMatch(s)) !outputWindowPaneErrors @@ -870,7 +870,7 @@ type Project() = use project = TheTests.CreateProjectWithUTF8Output(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "新規bcrogram.fs" File.AppendAllText(srcFile, "bar") ; // 新規bcrogram.fs will be cleaned up by parent call to DoWithTempFile - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger // The console inserts hard line breaks accumulate the output as a single line then look for the expected output. let output = (!outputWindowPaneErrors |> String.concat "").Replace("\r\n", "") diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.References.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs similarity index 96% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs index 0d079f2f01e..a101cce301c 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs @@ -60,7 +60,7 @@ type UpToDate() = File.AppendAllText(embedPath, "some embedded resource") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) // None items should not affect up-to-date (unless captured by well-known items, e.g. App.config) @@ -112,7 +112,7 @@ type UpToDate() = project.SetConfiguration(config.ConfigCanonicalName); Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) for path in [verPath; keyPath] do @@ -147,7 +147,7 @@ type UpToDate() = File.AppendAllText(absFilePath, "printfn \"hello\"") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) // touch proj file @@ -178,7 +178,7 @@ type UpToDate() = let config1 = project1.ConfigProvider.GetProjectConfiguration(configNameDebug) Assert.IsFalse(config1.IsUpToDate(logger, true)) - project1.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project1.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config1.IsUpToDate(logger, true)) let output1 = Path.Combine(project1.ProjectFolder, "bin\\debug", project1.OutputFileName) @@ -197,7 +197,7 @@ type UpToDate() = let startTime = DateTime.UtcNow Assert.IsFalse(config2.IsUpToDate(logger, true)) - project2.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project2.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config2.IsUpToDate(logger, true)) // reference is updated @@ -241,7 +241,7 @@ type UpToDate() = File.AppendAllText(appConfigPath, """""") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) let startTime = DateTime.UtcNow @@ -290,25 +290,25 @@ type UpToDate() = Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameDebugx86, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebugx86, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameReleasex86, output, "Build") |> AssertBuildSuccessful + project.Build(configNameReleasex86, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameDebugAnyCPU, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebugAnyCPU, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameReleaseAnyCPU, output, "Build") |> AssertBuildSuccessful + project.Build(configNameReleaseAnyCPU, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(debugConfigAnyCPU.IsUpToDate(logger, true)) diff --git a/vsintegration/tests/unittests/ProjectDiagnosticAnalyzerTests.fs b/vsintegration/tests/UnitTests/ProjectDiagnosticAnalyzerTests.fs similarity index 100% rename from vsintegration/tests/unittests/ProjectDiagnosticAnalyzerTests.fs rename to vsintegration/tests/UnitTests/ProjectDiagnosticAnalyzerTests.fs diff --git a/vsintegration/tests/unittests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/QuickInfoProviderTests.fs rename to vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index 2487604ce25..f7879bb17e2 100644 --- a/vsintegration/tests/unittests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/Resources/TestTypeProvider.Negative1.fsx b/vsintegration/tests/UnitTests/Resources/TestTypeProvider.Negative1.fsx similarity index 100% rename from vsintegration/tests/unittests/Resources/TestTypeProvider.Negative1.fsx rename to vsintegration/tests/UnitTests/Resources/TestTypeProvider.Negative1.fsx diff --git a/vsintegration/tests/unittests/Resources/TestTypeProvider.Positive1.fsx b/vsintegration/tests/UnitTests/Resources/TestTypeProvider.Positive1.fsx similarity index 100% rename from vsintegration/tests/unittests/Resources/TestTypeProvider.Positive1.fsx rename to vsintegration/tests/UnitTests/Resources/TestTypeProvider.Positive1.fsx diff --git a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/SignatureHelpProviderTests.fs rename to vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs index 089f31e5b3a..661dcd14582 100644 --- a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs @@ -12,7 +12,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\SignatureHelpProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\SignatureHelpProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.LanguageService.fs rename to vsintegration/tests/UnitTests/TestLib.LanguageService.fs diff --git a/vsintegration/tests/unittests/TestLib.ProjectSystem.fs b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs similarity index 99% rename from vsintegration/tests/unittests/TestLib.ProjectSystem.fs rename to vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs index b353e548f72..d8f31256b87 100644 --- a/vsintegration/tests/unittests/TestLib.ProjectSystem.fs +++ b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs @@ -18,6 +18,7 @@ open Microsoft.Win32 open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.ProjectSystem +open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.Shell.Interop open Microsoft.Build.Execution @@ -366,10 +367,10 @@ type TheTests() = () member internal this.EnsureCausesNotification(project, code) = - let ipsf = project :> Microsoft.VisualStudio.FSharp.LanguageService.IProvideProjectSite + let ipsf = project :> IProvideProjectSite let ips = ipsf.GetProjectSite() let changed = ref false - let handle = ips.AdviseProjectSiteChanges("EnsureCausesNotificationTest", new Microsoft.VisualStudio.FSharp.LanguageService.AdviseProjectSiteChanges(fun () -> changed := true)) + let handle = ips.AdviseProjectSiteChanges("EnsureCausesNotificationTest", new AdviseProjectSiteChanges(fun () -> changed := true)) code() AssertEqual true (!changed) static member MsBuildCompileItems(project : Microsoft.Build.Evaluation.Project) = @@ -656,7 +657,7 @@ module LanguageServiceExtension = failwith "tried to build not-yet-created project" else let target = if target <> null then target else "Build" - projInfo.Project.BuildToOutput(target,vsOutputWindowPane) |> ignore // force build through project system for code coverage + projInfo.Project.BuildToOutput(target,vsOutputWindowPane, null) |> ignore // force build through project system for code coverage hooks.BuildHook(projFileName, target, vsOutputWindowPane) // use MSBuild to build and also return MainAssembly value member x.GetMainOutputAssemblyHook baseName = hooks.GetMainOutputAssemblyHook baseName diff --git a/vsintegration/tests/unittests/TestLib.Salsa.fs b/vsintegration/tests/UnitTests/TestLib.Salsa.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.Salsa.fs rename to vsintegration/tests/UnitTests/TestLib.Salsa.fs diff --git a/vsintegration/tests/unittests/TestLib.Utils.fs b/vsintegration/tests/UnitTests/TestLib.Utils.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.Utils.fs rename to vsintegration/tests/UnitTests/TestLib.Utils.fs diff --git a/vsintegration/tests/unittests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Build.fs rename to vsintegration/tests/UnitTests/Tests.Build.fs diff --git a/vsintegration/tests/unittests/Tests.InternalCollections.fs b/vsintegration/tests/UnitTests/Tests.InternalCollections.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.InternalCollections.fs rename to vsintegration/tests/UnitTests/Tests.InternalCollections.fs diff --git a/vsintegration/tests/unittests/Tests.Powerpack.fs b/vsintegration/tests/UnitTests/Tests.Powerpack.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Powerpack.fs rename to vsintegration/tests/UnitTests/Tests.Powerpack.fs diff --git a/vsintegration/tests/unittests/Tests.TaskReporter.fs b/vsintegration/tests/UnitTests/Tests.TaskReporter.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.TaskReporter.fs rename to vsintegration/tests/UnitTests/Tests.TaskReporter.fs diff --git a/vsintegration/tests/unittests/Tests.Watson.fs b/vsintegration/tests/UnitTests/Tests.Watson.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Watson.fs rename to vsintegration/tests/UnitTests/Tests.Watson.fs diff --git a/vsintegration/tests/unittests/Tests.XmlDocComments.fs b/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.XmlDocComments.fs rename to vsintegration/tests/UnitTests/Tests.XmlDocComments.fs diff --git a/vsintegration/tests/unittests/UnusedOpensTests.fs b/vsintegration/tests/UnitTests/UnusedOpensTests.fs similarity index 100% rename from vsintegration/tests/unittests/UnusedOpensTests.fs rename to vsintegration/tests/UnitTests/UnusedOpensTests.fs diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config similarity index 93% rename from vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config rename to vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config index 4bd17f79c66..d028aea63c6 100644 --- a/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config @@ -20,11 +20,11 @@ - + - + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj new file mode 100644 index 00000000000..1ff54bf76bc --- /dev/null +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -0,0 +1,198 @@ + + + + + + net46 + Library + $(NoWarn);58;75 + NO_PROJECTCRACKER;$(DefineConstants) + true + true + false + + + + + Internal.Utilities.Collections.fsi + + + Internal.Utilities.Collections.fs + + + Internal.Utilities.CompilerLocationUtils.fs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CompilerService\FsUnit.fs + + + CompilerService\Common.fs + + + CompilerService\Symbols.fs + + + CompilerService\EditorTests.fs + + + CompilerService\FileSystemTests.fs + + + CompilerService\ProjectAnalysisTests.fs + + + CompilerService\MultiProjectAnalysisTests.fs + + + CompilerService\PerfTests.fs + + + CompilerService\InteractiveCheckerTests.fs + + + CompilerService\ExprTests.fs + + + CompilerService\CSharpProjectAnalysis.fs + + + CompilerService\ProjectOptionsTests.fs + + + CompilerService\StructureTests.fs + + + CompilerService\AssemblyContentProviderTests.fs + + + CompilerService\ServiceUntypedParseTests.fs + + + CompilerService\UnusedOpensTests.fs + + + Roslyn\ColorizationServiceTests.fs + + + Roslyn\BraceMatchingServiceTests.fs + + + Roslyn\HelpContextServiceTests.fs + + + Roslyn\EditorFormattingServiceTests.fs + + + Roslyn\IndentationServiceTests.fs + + + Roslyn\BreakpointResolutionService.fs + + + Roslyn\LanguageDebugInfoServiceTests.fs + + + Roslyn\DocumentDiagnosticAnalyzerTests.fs + + + Roslyn\ProjectDiagnosticAnalyzerTests.fs + + + Roslyn\CompletionProviderTests.fs + + + Roslyn\SignatureHelpProviderTests.fs + + + Roslyn\GoToDefinitionServiceTests.fs + + + Roslyn\QuickInfoProviderTests.fs + + + Roslyn\DocumentHighlightsServiceTests.fs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/unittests/app.runsettings b/vsintegration/tests/UnitTests/app.runsettings similarity index 100% rename from vsintegration/src/unittests/app.runsettings rename to vsintegration/tests/UnitTests/app.runsettings diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj deleted file mode 100644 index a032bef62f4..00000000000 --- a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj +++ /dev/null @@ -1,419 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - VisualFSharp.UnitTests - - - - Debug - 2.0 - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F} - Library - VisualFSharp.UnitTests - LIBRARY - 58;75 - x86 - v4.6 - NO_PROJECTCRACKER;$(DefineConstants) - - - - Internal.Utilities.Collections.fsi - - - Internal.Utilities.Collections.fs - - - Internal.Utilities.CompilerLocationUtils.fs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CompilerService\FsUnit.fs - - - CompilerService\Common.fs - - - CompilerService\Symbols.fs - - - CompilerService\EditorTests.fs - - - CompilerService\FileSystemTests.fs - - - CompilerService\ProjectAnalysisTests.fs - - - CompilerService\MultiProjectAnalysisTests.fs - - - CompilerService\PerfTests.fs - - - CompilerService\InteractiveCheckerTests.fs - - - CompilerService\ExprTests.fs - - - CompilerService\CSharpProjectAnalysis.fs - - - CompilerService\ProjectOptionsTests.fs - - - CompilerService\StructureTests.fs - - - CompilerService\AssemblyContentProviderTests.fs - - - CompilerService\ServiceUntypedParseTests.fs - - - CompilerService\UnusedOpensTests.fs - - - Roslyn\ColorizationServiceTests.fs - - - Roslyn\BraceMatchingServiceTests.fs - - - Roslyn\HelpContextServiceTests.fs - - - Roslyn\EditorFormattingServiceTests.fs - - - Roslyn\IndentationServiceTests.fs - - - Roslyn\BreakpointResolutionService.fs - - - Roslyn\LanguageDebugInfoServiceTests.fs - - - Roslyn\DocumentDiagnosticAnalyzerTests.fs - - - Roslyn\ProjectDiagnosticAnalyzerTests.fs - - - Roslyn\CompletionProviderTests.fs - - - Roslyn\SignatureHelpProviderTests.fs - - - Roslyn\GoToDefinitionServiceTests.fs - - - Roslyn\QuickInfoProviderTests.fs - - - Roslyn\DocumentHighlightsServiceTests.fs - - - VisualFSharp.UnitTests.dll.config - {VisualStudioVersion} - $(VisualStudioVersion) - {FinalDir} - $([System.IO.Path]::GetFullPath('$(OutputPath)'))\ - - - - - - - - - - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Validation.$(MicrosoftVisualStudioValidationVersion)\lib\net45\Microsoft.VisualStudio.Validation.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - True - - - $(FSharpSourcesRoot)\..\packages\RoslynDependencies.Microsoft.VisualStudio.Text.Internal.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Internal.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.Intellisense.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.Intellisense.dll - True - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Telemetry.15.0.777-rtm6FAA2C78\lib\net45\Microsoft.VisualStudio.Telemetry.dll - - - True - $(NUnitLibDir)\nunit.framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Wpf.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Threading.Tasks.Dataflow.4.5.24\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Dataflow.dll - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.Build - {702a7979-bcf9-4c41-853e-3adfc9897890} - True - - - CSharp_Analysis - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - VisualFSharp.Salsa - {fbd4b354-dc6e-4032-8ec7-c81d8dfb1af7} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - - - FSharp.ProjectSystem.FSharp - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - True - - - FSharp.Editor - {65e0e82a-eace-4787-8994-888674c2fe87} - True - - - - - diff --git a/vsintegration/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index 943abc8f63a..7ae78630c39 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -20,7 +20,7 @@ @rem * Installation of F# FSC compiler and FSI are done in the SHARED SDK directory. Henceforth @rem each installation of Visual Studio 2017 will use the updated FSC.exe and the commandline @rem FSI.exe. The in-product VS FSI plugin, syntax highlighting and IntelliSense must be -@rem installed through VSIXInstaller.exe debug\net40\bin\VisualFSharpOpenSource.vsix +@rem installed through VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix @rem @rem This procedure needs to be changed once F# supports multiple side-by-side installations @rem at which point everything will go through VSIXInstaller.exe @@ -117,12 +117,12 @@ echo. echo For Release builds: echo. echo ^> VSIXInstaller.exe /u:"VisualFSharp" -echo ^> VSIXInstaller.exe release\net40\bin\VisualFSharpOpenSource.vsix +echo ^> VSIXInstaller.exe release\net40\bin\VisualFSharpFull.vsix echo. echo For Debug builds: echo. echo ^> VSIXInstaller.exe /u:"VisualFSharp" -echo ^> VSIXInstaller.exe debug\net40\bin\VisualFSharpOpenSource.vsix +echo ^> VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix echo. exit /b 1 @@ -226,6 +226,7 @@ if "!BIN_AVAILABLE!" == "true" ( CALL :backupAndOrCopy Microsoft.Portable.FSharp.Targets "%COMPILERSDKPATH%" CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.props "%COMPILERSDKPATH%" CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.targets "%COMPILERSDKPATH%" + CALL :backupAndOrCopy Microsoft.FSharp.Overrides.NetSdk.targets "%COMPILERSDKPATH%" rem Special casing for SupportedRuntimes.xml, it has a different source directory, it's always there set SOURCEDIR="%TOPDIR%\vsintegration\src\SupportedRuntimes" @@ -250,68 +251,6 @@ if "!BIN_AVAILABLE!" == "true" ( ) -rem Deploying for .NET Core 3.7 - -echo. -CALL :colorEcho 02 "[!ACTION!] Processing files for profile_7" & echo. - -set SOURCEDIR=%BINDIR%\..\..\portable7\bin -set RESTOREDIR=!RESTOREBASE!\profile_7 -CALL :checkAvailability profile_7 -if "!BIN_AVAILABLE!" == "true" ( - CALL :backupAndOrCopy FSharp.Core.dll "%COMPILER7ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.optdata "%COMPILER7ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.sigdata "%COMPILER7ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.xml "%COMPILER7ASSEMBLIESPATH%" -) - - -rem Deploying for .NET Core 3.78 - -echo. -CALL :colorEcho 02 "[!ACTION!] Processing files for profile_78" & echo. - -set SOURCEDIR=%BINDIR%\..\..\portable78\bin -set RESTOREDIR=!RESTOREBASE!\profile_78 -CALL :checkAvailability profile_78 -if "!BIN_AVAILABLE!" == "true" ( - CALL :backupAndOrCopy FSharp.Core.dll "%COMPILER78ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.optdata "%COMPILER78ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.sigdata "%COMPILER78ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.xml "%COMPILER78ASSEMBLIESPATH%" -) - - -rem Deploying for .NET Core 3.259 - -echo. -CALL :colorEcho 02 "[!ACTION!] Processing files for profile_259" & echo. - -set SOURCEDIR=%BINDIR%\..\..\portable259\bin -set RESTOREDIR=!RESTOREBASE!\profile_259 -CALL :checkAvailability profile_259 -if "!BIN_AVAILABLE!" == "true" ( - CALL :backupAndOrCopy FSharp.Core.dll "%COMPILER259ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.optdata "%COMPILER259ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.sigdata "%COMPILER259ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.xml "%COMPILER259ASSEMBLIESPATH%" -) - - -rem Deploying for .NET Portable 3.47 - -echo. -CALL :colorEcho 02 "[!ACTION!] Processing files for profile_47" & echo. - -set SOURCEDIR=%BINDIR%\..\..\portable47\bin -set RESTOREDIR=!RESTOREBASE!\profile_47 -CALL :checkAvailability profile_47 -if "!BIN_AVAILABLE!" == "true" ( - CALL :backupAndOrCopy FSharp.Core.dll "%COMPILER47ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.optdata "%COMPILER47ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.sigdata "%COMPILER47ASSEMBLIESPATH%" - CALL :backupAndOrCopy FSharp.Core.xml "%COMPILER47ASSEMBLIESPATH%" -) REM TODO: this was already here (2017-09-28) and was already commented out, I think (AB) that these redirects aren't necessary anymore and can be permanently removed REM echo ^^^^^ ^^^^^ > "%X86_PROGRAMFILES%\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.%FSHARPVERSION%.0\pub.config" diff --git a/vsintegration/vsintegration.targets b/vsintegration/vsintegration.targets deleted file mode 100644 index 8e545af1f30..00000000000 --- a/vsintegration/vsintegration.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -