diff --git a/build-everything.proj b/build-everything.proj index 0d0cdea76c2..c4e264d41b4 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -40,7 +40,11 @@ - + + + + + @@ -86,6 +90,14 @@ + + + + + + + + @@ -124,3 +136,4 @@ + diff --git a/build.cmd b/build.cmd index 2737ba5b5d7..97a98a8bfa5 100644 --- a/build.cmd +++ b/build.cmd @@ -74,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= @@ -115,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 @@ -235,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 @@ -262,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 @@ -334,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" ( @@ -378,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 @@ -418,6 +443,23 @@ 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 +) + + echo Build/Tests configuration: echo. echo BUILD_PROTO=%BUILD_PROTO% @@ -437,6 +479,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% @@ -559,10 +602,12 @@ set _nugetexe="%~dp0.nuget\NuGet.exe" set _nugetconfig="%~dp0.nuget\NuGet.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% @@ -602,10 +647,21 @@ 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% + +if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( + :: 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 package restore, starting dependency uptake check ------------- @@ -628,11 +684,6 @@ 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 @@ -655,9 +706,6 @@ 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 @@ -687,8 +735,9 @@ if "%BUILD_PROTO%" == "1" ( echo ---------------- Done with proto, 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% @@ -780,7 +829,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 @@ -814,7 +863,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" ( @@ -842,6 +891,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% 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 4209f18d85b..4a919e3bbda 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,92 +1,52 @@ - - - + $(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.ToLower())\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 Service/MSBuildReferenceResolver.fs - - - - - - - - + + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + false + - $(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 + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll false - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll - false - - - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + - - + \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj index 97b39740657..96a0923814d 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,36 @@ - - + $(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.ToLower())\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.4.1.20\lib\profiles\net40\FSharp.Core.dll - false - - ProjectCrackerOptions.fs + + + - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + false + + - \ 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 f849f20a956..555ac872bc2 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,17 @@ - - + $(MSBuildProjectDirectory)\..\..\src - Debug - AnyCPU - $(MSBuildProjectDirectory)\..\..\..\ - 2.0 - b1bdd96d-47e1-4e65-8107-fbae23a06db4 Exe - ..\..\$(Configuration.ToLower())\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 @@ -47,84 +20,29 @@ - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll false + + $(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.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/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 351868c2a82..1f109c29ee7 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.ToLower())\fcs\net45\ - true - 3 - true + net46;netcoreapp2.0 + + $(NoWarn);44; + true + true + true + ..\..\$(Configuration.ToLower())\fcs - - true - full - false - AnyCPU - true - - - pdbonly - true - AnyCPU - true + + $(DefineConstants);FX_NO_RUNTIMEENVIRONMENT + $(DefineConstants);NO_PROJECTCRACKER + + ReshapedReflection.fs + FsUnit.fs @@ -76,18 +59,25 @@ StructureTests.fs - - FSharp.Core.optdata - PreserveNewest - - - FSharp.Core.sigdata - PreserveNewest - + + TokenizerTests.fs + + + Program.fs + - + + + + + + + + + + @@ -101,98 +91,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/AssemblyInfo.fs b/fcs/FSharp.Compiler.Service/AssemblyInfo.fs index 445698afde2..356edd74d4e 100644 --- a/fcs/FSharp.Compiler.Service/AssemblyInfo.fs +++ b/fcs/FSharp.Compiler.Service/AssemblyInfo.fs @@ -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 290d489e899..16f6efe9450 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.ToLower())\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,13 +630,19 @@ Service/fsi.fs - - - - - - + + + + + + + + + + + + $(FSharpSourcesRoot)\..\packages\Microsoft.DiaSymReader.PortablePdb.1.2.0\lib\portable-net45+win8\Microsoft.DiaSymReader.PortablePdb.dll @@ -647,15 +659,8 @@ $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll - false - - - - - + + + \ 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 172c37c5397..e8b30392ef5 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,43 +54,37 @@ 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 else assemblyVersion +// Skipping build of FCS on Jenkins Mono for now until we knoow how to get an updated version of Mono installed +let skipBuild = isJenkinsBuild && isMono + Target "Clean" (fun _ -> + if not skipBuild then CleanDir releaseDir ) Target "Restore" (fun _ -> + if not skipBuild then + runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj -v n" + runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj -v n" + runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj -v n" + runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj -v n" for p in (!! "./../**/packages.config") do let result = ExecProcess (fun info -> @@ -95,97 +92,49 @@ Target "Restore" (fun _ -> 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" ) Target "BuildVersion" (fun _ -> + if not skipBuild then 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 -) - - - -// -------------------------------------------------------------------------------------- -// .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 "Build" (fun _ -> + if skipBuild then + try Directory.CreateDirectory("../Release/") |> ignore with _ -> () + File.WriteAllText("../Release/nichts.txt", "nothing to see here, build was skipped until we knoow how to get an updated version of Mono installed on Jenkins") + else + runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release /maxcpucount:1" ) - -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") +Target "Test" (fun _ -> + if not skipBuild then + 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" + runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release /maxcpucount:1" ) -//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 _ -> + if not skipBuild then + runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj -v n -c Release /maxcpucount:1" + runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj -v n -c Release /maxcpucount:1" + runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj -v n -c Release /maxcpucount:1" + runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj -v n -c Release /maxcpucount:1" ) - -// -------------------------------------------------------------------------------------- -// Generate the documentation - Target "GenerateDocsEn" (fun _ -> + if not skipBuild then executeFSIWithArgs "docsrc/tools" "generate.fsx" [] [] |> ignore ) Target "GenerateDocsJa" (fun _ -> + if not skipBuild then executeFSIWithArgs "docsrc/tools" "generate.ja.fsx" [] [] |> ignore ) -// -------------------------------------------------------------------------------------- -// Release Scripts - Target "PublishNuGet" (fun _ -> + if not skipBuild then Paket.Push (fun p -> let apikey = match getBuildParam "nuget-apikey" with @@ -200,46 +149,26 @@ Target "PublishNuGet" (fun _ -> // Run all targets by default. Invoke 'build ' to override Target "Release" DoNothing -Target "NuGet" DoNothing -Target "Build" DoNothing Target "GenerateDocs" DoNothing Target "TestAndNuGet" DoNothing "Clean" =?> ("BuildVersion", isAppVeyorBuild) ==> "Restore" - ==> "Build.NetStd" - -"Clean" - =?> ("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 index bcf12d66c83..f1d5a70c64f 100755 --- a/fcs/cibuild.sh +++ b/fcs/cibuild.sh @@ -2,4 +2,4 @@ # note: expects to run from top directory #./mono/latest-mono-stable.sh -./build.sh NuGet \ No newline at end of file +./build.sh NuGet 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/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/fcs.props b/fcs/fcs.props index 3c813b2b341..eee47b6040e 100644 --- a/fcs/fcs.props +++ b/fcs/fcs.props @@ -3,13 +3,17 @@ - 19.0.1 + 21.0.1 $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools fsi.exe - 1.3.1 + + $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools + fsc.exe + $(FscToolPath)\$(FsiToolExe) + {HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} 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/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index e232d6c5eff..1f684a07fdf 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -60,5 +60,5 @@ True - + \ No newline at end of file diff --git a/fcs/samples/FscExe/FscExe.fsproj b/fcs/samples/FscExe/FscExe.fsproj index 946034ec67c..4434ddb30a7 100644 --- a/fcs/samples/FscExe/FscExe.fsproj +++ b/fcs/samples/FscExe/FscExe.fsproj @@ -15,7 +15,6 @@ $(NoWarn);62;44 FscExe FscExe - COMPILER;$(DefineConstants) FX_RESIDENT_COMPILER;$(DefineConstants) true $(OtherFlags) --warnon:1182 @@ -72,5 +71,5 @@ True - + \ No newline at end of file diff --git a/fcs/samples/FsiExe/FsiExe.fsproj b/fcs/samples/FsiExe/FsiExe.fsproj index ef52e8ee777..1e13ce613b6 100644 --- a/fcs/samples/FsiExe/FsiExe.fsproj +++ b/fcs/samples/FsiExe/FsiExe.fsproj @@ -71,5 +71,5 @@ True - + \ No newline at end of file diff --git a/fcs/samples/InteractiveService/InteractiveService.fsproj b/fcs/samples/InteractiveService/InteractiveService.fsproj index 4efd2a56b12..91f16cf41fc 100644 --- a/fcs/samples/InteractiveService/InteractiveService.fsproj +++ b/fcs/samples/InteractiveService/InteractiveService.fsproj @@ -64,5 +64,5 @@ True - + \ No newline at end of file diff --git a/fcs/samples/Tokenizer/Tokenizer.fsproj b/fcs/samples/Tokenizer/Tokenizer.fsproj index a58aaf190f4..72f0cba2961 100644 --- a/fcs/samples/Tokenizer/Tokenizer.fsproj +++ b/fcs/samples/Tokenizer/Tokenizer.fsproj @@ -67,5 +67,5 @@ 11 - + \ No newline at end of file diff --git a/fcs/samples/UntypedTree/UntypedTree.fsproj b/fcs/samples/UntypedTree/UntypedTree.fsproj index e8818931cdd..c9faade7af0 100644 --- a/fcs/samples/UntypedTree/UntypedTree.fsproj +++ b/fcs/samples/UntypedTree/UntypedTree.fsproj @@ -67,5 +67,5 @@ 11 - + \ No newline at end of file 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/netci.groovy b/netci.groovy index f958bf6c8dc..c4e743a7d7b 100644 --- a/netci.groovy +++ b/netci.groovy @@ -14,7 +14,7 @@ def static getBuildJobName(def configuration, def os) { osList.each { os -> def configurations = []; if (os == 'Windows_NT') { - configurations = ['Debug_default', '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 { @@ -75,6 +75,10 @@ def static getBuildJobName(def configuration, def os) { 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" diff --git a/src/FSharpSource.Profiles.targets b/src/FSharpSource.Profiles.targets index 8bcc8aa5f24..9069ebdb955 100644 --- a/src/FSharpSource.Profiles.targets +++ b/src/FSharpSource.Profiles.targets @@ -13,7 +13,6 @@ - $(DefineConstants);FX_PORTABLE_OR_NETSTANDARD $(DefineConstants);NETSTANDARD1_6 $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_ARRAY_LONG_LENGTH @@ -22,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 @@ -45,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 9813587ef50..2343e2ee977 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -75,7 +75,6 @@ true true - false 2.3.0-beta2-61719-01 15.0 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.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 406efaf8a03..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 diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index a5de6a28552..ac222406a21 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 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 655cfa81140..15ca88bacb5 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -616,7 +616,6 @@ Misc/LegacyHostedCompilerForTesting.fs - diff --git a/src/buildfromsource/FSharp.Core/AssemblyInfo.fs b/src/buildfromsource/FSharp.Core/AssemblyInfo.fs index bf2f1cc257b..aa4d142f5ce 100644 --- a/src/buildfromsource/FSharp.Core/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Core/AssemblyInfo.fs @@ -9,9 +9,7 @@ open System.Runtime.InteropServices [] [] [] -#if !FSCORE_PORTABLE_OLD [] -#endif #if PORTABLE [] 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/Fsc.fsproj b/src/buildfromsource/Fsc/Fsc.fsproj index 58b44242fd4..cfe3031f564 100644 --- a/src/buildfromsource/Fsc/Fsc.fsproj +++ b/src/buildfromsource/Fsc/Fsc.fsproj @@ -9,7 +9,6 @@ fsc $(NoWarn);45;55;62;75;1204 true - $(DefineConstants);COMPILER $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 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 986d4a285fc..7224d157409 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2627,7 +2627,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 +2793,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 @@ -2955,7 +2956,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() diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj index 8ab9e33c93f..f442957d72f 100644 --- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj +++ b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj @@ -11,7 +11,6 @@ Library FSharp.Build-proto true - BUILDING_WITH_LKG;$(DefineConstants) LKG {D8BC791F-C1A9-49DC-9432-0F3090537555} diff --git a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs index 3746f94adc8..e5c77a365e6 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 diff --git a/src/fsharp/FSharp.Core/FSharp.Core.fsproj b/src/fsharp/FSharp.Core/FSharp.Core.fsproj index 32c5f015302..9ae918e37cf 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 diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index dfcc0a9def2..0a3300855ef 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -1247,7 +1247,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 @@ -1357,4 +1356,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 d101533cfe9..401556a4b72 100644 --- a/src/fsharp/FSharp.Core/array.fsi +++ b/src/fsharp/FSharp.Core/array.fsi @@ -1102,7 +1102,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 = @@ -1198,4 +1197,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 a614813e4ba..8ab187632e8 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 @@ -1222,24 +1195,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) @@ -1285,7 +1240,6 @@ namespace Microsoft.FSharp.Control | _ -> aux.econt edi ) -#endif static member AwaitWaitHandle(waitHandle:WaitHandle,?millisecondsTimeout:int) = let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite @@ -1591,7 +1545,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 diff --git a/src/fsharp/FSharp.Core/math/z.fs b/src/fsharp/FSharp.Core/math/z.fs index 587c5280a49..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) = @@ -402,49 +401,6 @@ namespace Microsoft.FSharp.Core if ok then res else -#if FSCORE_PORTABLE_OLD - // SL5 (and therefore Portable Profile47) does not have Parse, so make our own simple implementation - let parse(s : string) = - // ws* sign? digits+ ws* - let mutable i = 0 - // leading whitespace - while i < s.Length && System.Char.IsWhiteSpace(s.[i]) do - i <- i + 1 - if i = s.Length then - raise <| new System.ArgumentException() - // optional sign - let mutable isNegative = false - if s.[i] = '+' then - i <- i + 1 - elif s.[i] = '-' then - isNegative <- true - i <- i + 1 - if i = s.Length then - raise <| new System.ArgumentException() - // digits - let startDigits = i - while i < s.Length && System.Char.IsDigit(s.[i]) do - i <- i + 1 - let endDigits = i - let len = endDigits - startDigits - if len = 0 then - raise <| new System.ArgumentException() - // trailing whitespace - while i < s.Length && System.Char.IsWhiteSpace(s.[i]) do - i <- i + 1 - if i <> s.Length then - raise <| new System.ArgumentException() - // text is now valid, parse it - let mutable r = new System.Numerics.BigInteger(int(s.[startDigits]) - int('0')) - let ten = new System.Numerics.BigInteger(10) - for j in startDigits+1 .. endDigits-1 do - r <- r * ten - r <- r + new System.Numerics.BigInteger(int(s.[j]) - int('0')) - if isNegative then - r <- new System.Numerics.BigInteger(0) - r - r - let v = parse s -#else let v = #if FX_NO_BIGINT BigInteger.Parse s @@ -453,7 +409,6 @@ namespace Microsoft.FSharp.Core BigInteger.Parse (s.[2..],NumberStyles.AllowHexSpecifier,CultureInfo.InvariantCulture) else BigInteger.Parse (s,NumberStyles.AllowLeadingSign,CultureInfo.InvariantCulture) -#endif #endif res <- v tabParse.[s] <- res diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 36ae18b7ae0..4d77b8d81bb 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -3035,9 +3035,7 @@ namespace Microsoft.FSharp.Collections interface System.Collections.Generic.IEnumerable<'T> interface System.Collections.IEnumerable -#if !FSCORE_PORTABLE_OLD interface System.Collections.Generic.IReadOnlyCollection<'T> -#endif and 'T list = List<'T> @@ -3221,10 +3219,8 @@ namespace Microsoft.FSharp.Collections interface System.Collections.IEnumerable with member l.GetEnumerator() = (PrivateListHelpers.mkListEnumerator l :> System.Collections.IEnumerator) -#if !FSCORE_PORTABLE_OLD interface IReadOnlyCollection<'T> with member l.Count = l.Length -#endif type seq<'T> = IEnumerable<'T> diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 9d3eabf7f70..2cb6f46a30f 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1702,10 +1702,7 @@ namespace Microsoft.FSharp.Collections interface System.Collections.Generic.IEnumerable<'T> interface System.Collections.IEnumerable - -#if !FSCORE_PORTABLE_OLD interface System.Collections.Generic.IReadOnlyCollection<'T> -#endif /// An abbreviation for the type of immutable singly-linked lists. /// 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..48a1b838dd2 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 @@ -492,7 +488,7 @@ module internal Impl = let ctor = if typ.IsValueType then let fields = typ.GetFields(bindingFlags) |> orderTupleFields -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION ignore bindingFlags typ.GetConstructor(fields |> Array.map (fun fi -> fi.FieldType)) #else @@ -500,7 +496,7 @@ module internal Impl = #endif else let props = typ.GetProperties() |> orderTupleProperties -#if FX_PORTABLE_OR_NETSTANDARD +#if FX_RESHAPED_REFLECTION ignore bindingFlags typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType)) #else @@ -514,7 +510,7 @@ module internal Impl = let getTupleCtor(typ:Type,bindingFlags) = let ctor = getTupleConstructorMethod(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)) @@ -626,7 +622,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 +635,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/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index 8c49f5fcf6a..bddf355527a 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -12,8 +12,6 @@ $(NoWarn);62 fsc-proto NO_EXTENSIONTYPING;$(DefineConstants) - BUILDING_PROTO;$(DefineConstants) - BUILDING_WITH_LKG;$(DefineConstants) COMPILER;$(DefineConstants) $(NoWarn);35;44;62;9;60;86;47;1203 LKG diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj index 589dddf52bf..b21378c9d3c 100644 --- a/src/fsharp/Fsc/Fsc.fsproj +++ b/src/fsharp/Fsc/Fsc.fsproj @@ -18,7 +18,6 @@ Exe $(NoWarn);62 fsc - COMPILER;$(DefineConstants) true $(OtherFlags) --warnon:1182 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/Optimizer.fs b/src/fsharp/Optimizer.fs index 88784272d39..d107cd1a78b 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 = 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/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj index 465cf5980ac..977d74326b6 100644 --- a/src/fsharp/fsi/Fsi.fsproj +++ b/src/fsharp/fsi/Fsi.fsproj @@ -18,7 +18,6 @@ $(NoWarn);62 fsi 0x0A000000 - COMPILER;$(DefineConstants) FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) FSI_SERVER;$(DefineConstants) true diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index b79e6924506..8f0fbc9c814 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 @@ -2421,7 +2421,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let timeReporter = FsiTimeReporter(outWriter) -#if !FX_RESHAPED_CONSOLE +#if !FX_REDUCED_CONSOLE //---------------------------------------------------------------------------- // Console coloring //---------------------------------------------------------------------------- @@ -2450,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 @@ -2460,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 diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj index 374ceb90560..d05b6856b4e 100644 --- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj +++ b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj @@ -13,7 +13,6 @@ $(NoWarn);62 fsiAnyCpu 0x0A000000 - COMPILER;$(DefineConstants) FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) FSI_SERVER;$(DefineConstants) true 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/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/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/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 be2ad1f6a57..6887bac66e1 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 @@ -83,7 +83,6 @@ type ListType() = Assert.AreEqual(false, enum.MoveNext()) CheckThrowsInvalidOperationExn(fun () -> enum.Current |> ignore) - #if !FSCORE_PORTABLE_OLD [] member this.IReadOnlyCollection_T() = @@ -100,8 +99,7 @@ type ListType() = let c = [] :> IReadOnlyCollection Assert.AreEqual(c.Count, 0) -#endif - + // 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 252fa2913f0..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_OLD || 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_OLD || 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. @@ -417,7 +412,7 @@ type AsyncModule() = Assert.Fail("TimeoutException expected") with :? System.TimeoutException -> () -#if !FSCORE_PORTABLE_OLD + [] member this.``RunSynchronously.NoThreadJumpsAndTimeout.DifferentSyncContexts``() = let run syncContext = @@ -434,7 +429,6 @@ type AsyncModule() = if !failed then Assert.Fail("TimeoutException expected") run null run (System.Threading.SynchronizationContext()) -#endif [] member this.``RaceBetweenCancellationAndError.AwaitWaitHandle``() = @@ -447,7 +441,7 @@ type AsyncModule() = member this.``RaceBetweenCancellationAndError.Sleep``() = testErrorAndCancelRace (Async.Sleep (-5)) -#if !(FSCORE_PORTABLE_OLD || FSCORE_PORTABLE_NEW || coreclr) +#if !coreclr [] // takes 3 minutes! member this.``Async.Choice specification test``() = ThreadPool.SetMinThreads(100,100) |> ignore @@ -499,7 +493,6 @@ type AsyncModule() = } Async.RunSynchronously(test) -#if !FSCORE_PORTABLE_NEW [] member this.``FromContinuationsCanTailCallCurrentThread``() = let cnt = ref 0 @@ -520,7 +513,6 @@ type AsyncModule() = f 5000 |> Async.StartImmediate Assert.AreEqual(origTid, !finalTid) Assert.AreEqual(5000, !cnt) -#endif [] member this.``AwaitWaitHandle With Cancellation``() = @@ -573,7 +565,6 @@ type AsyncModule() = Assert.AreEqual("boom", !r) -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW [] member this.``SleepContinuations``() = let okCount = ref 0 @@ -600,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``() = 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 04f1d1a7ff2..59bf31e1de6 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 = @@ -279,7 +274,7 @@ type AsyncType() = [] member this.TaskAsyncValue () = let s = "Test" -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -319,7 +314,7 @@ type AsyncType() = [] member this.TaskAsyncValueException () = -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -338,7 +333,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= @@ -357,7 +352,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValue () = let hasBeenCalled = ref false -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -372,7 +367,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValueException () = -#if FSCORE_PORTABLE_NEW || coreclr +#if NETSTANDARD1_6 let t = #else use t = @@ -391,7 +386,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 = @@ -407,4 +402,3 @@ type AsyncType() = cts.Cancel() ewh.WaitOne(10000) |> ignore -#endif 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 89fe5ffdc78..ee601aabaa9 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) @@ -198,7 +197,6 @@ type BigIntType() = Assert.AreEqual(BigInteger.One,1I) () -#if !FSCORE_PORTABLE_OLD [] member this.Parse() = Assert.AreEqual(BigInteger.Parse("12345678901234567890"), @@ -220,7 +218,6 @@ type BigIntType() = CheckThrowsArgumentNullException(fun() -> BigInteger.Parse(null) |> ignore) () -#endif [] member this.Pow() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 43bbf53c89a..78efc6a2edb 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 [] 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/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/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/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/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/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/tests.fs b/tests/fsharp/tests.fs index 4a4d35de55b..3c2d9c2d792 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2297,7 +2297,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/service/CSharpProjectAnalysis.fs b/tests/service/CSharpProjectAnalysis.fs index 16a72c34821..11b77cb3c87 100644 --- a/tests/service/CSharpProjectAnalysis.fs +++ b/tests/service/CSharpProjectAnalysis.fs @@ -61,6 +61,9 @@ let internal getProjectReferences (content, dllFiles, libDirs, otherFlags) = results, assemblies [] +#if NETCOREAPP2_0 +[] +#endif let ``Test that csharp references are recognized as such`` () = let csharpAssembly = PathRelativeToTestAssembly "CSharp_Analysis.dll" let _, table = getProjectReferences("""module M""", [csharpAssembly], None, None) @@ -96,6 +99,9 @@ let ``Test that csharp references are recognized as such`` () = members.["InterfaceEvent"].XmlDocSig |> shouldEqual "E:FSharp.Compiler.Service.Tests.CSharpClass.InterfaceEvent" [] +#if NETCOREAPP2_0 +[] +#endif let ``Test that symbols of csharp inner classes/enums are reported`` () = let csharpAssembly = PathRelativeToTestAssembly "CSharp_Analysis.dll" let content = """ @@ -116,6 +122,9 @@ let _ = CSharpOuterClass.InnerClass.StaticMember() "member StaticMember"; "NestedEnumClass"|] [] +#if NETCOREAPP2_0 +[] +#endif let ``Ctor test`` () = let csharpAssembly = PathRelativeToTestAssembly "CSharp_Analysis.dll" let content = """ diff --git a/tests/service/Common.fs b/tests/service/Common.fs index b00ab51e5db..f174908114a 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -9,7 +9,7 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open ReflectionAdapters #endif -#if DOTNETCORE +#if NETCOREAPP2_0 let readRefs (folder : string) (projectFile: string) = let runProcess (workingDir: string) (exePath: string) (args: string) = let psi = System.Diagnostics.ProcessStartInfo() @@ -67,7 +67,7 @@ let getBackgroundCheckResultsForScriptText (input) = let sysLib nm = -#if !FX_ATLEAST_PORTABLE +#if !NETCOREAPP2_0 if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows let programFilesx86Folder = System.Environment.GetEnvironmentVariable("PROGRAMFILES(X86)") programFilesx86Folder + @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\" + nm + ".dll" @@ -90,18 +90,8 @@ module Helpers = let fsCoreDefaultReference() = PathRelativeToTestAssembly "FSharp.Core.dll" -(* -#if !FX_ATLEAST_PORTABLE - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows - let programFilesx86Folder = System.Environment.GetEnvironmentVariable("PROGRAMFILES(X86)") - programFilesx86Folder + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0\FSharp.Core.dll" - else -#endif - sysLib "FSharp.Core" -*) - let mkStandardProjectReferences () = -#if DOTNETCORE +#if NETCOREAPP2_0 let file = "Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj" let projDir = Path.Combine(__SOURCE_DIRECTORY__, "../projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0") readRefs projDir file @@ -118,7 +108,7 @@ let mkProjectCommandLineArgsSilent (dllName, fileNames) = yield "--noframework" yield "--debug:full" yield "--define:DEBUG" -#if NETCOREAPP1_0 +#if NETCOREAPP2_0 yield "--targetprofile:netcore" #endif yield "--optimize-" @@ -141,15 +131,13 @@ let mkProjectCommandLineArgs (dllName, fileNames) = printfn "dllName = %A, args = %A" dllName args args -#if DOTNETCORE +#if NETCOREAPP2_0 let mkProjectCommandLineArgsForScript (dllName, fileNames) = [| yield "--simpleresolution" yield "--noframework" yield "--debug:full" yield "--define:DEBUG" -#if NETCOREAPP1_0 yield "--targetprofile:netcore" -#endif yield "--optimize-" yield "--out:" + dllName yield "--doc:test.xml" @@ -184,7 +172,7 @@ let parseAndCheckFile fileName source options = let parseAndCheckScript (file, input) = -#if DOTNETCORE +#if NETCOREAPP2_0 let dllName = Path.ChangeExtension(file, ".dll") let projName = Path.ChangeExtension(file, ".fsproj") let args = mkProjectCommandLineArgsForScript (dllName, [file]) @@ -316,7 +304,7 @@ let rec allSymbolsInEntities compGen (entities: IList) = let coreLibAssemblyName = -#if DOTNETCORE +#if NETCOREAPP2_0 "System.Runtime" #else "mscorlib" diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index 878917245c6..d588bde3ee1 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -97,13 +97,14 @@ let ``Intro test`` () = ("Concat", ["str0: string"; "str1: string"]); ("Concat", ["arg0: obj"; "arg1: obj"; "arg2: obj"]); ("Concat", ["str0: string"; "str1: string"; "str2: string"]); -#if !DOTNETCORE +#if !NETCOREAPP2_0 // TODO: check why this is needed for .NET Core testing of FSharp.Compiler.Service ("Concat", ["arg0: obj"; "arg1: obj"; "arg2: obj"; "arg3: obj"]); #endif ("Concat", ["str0: string"; "str1: string"; "str2: string"; "str3: string"])] -#if !INTERACTIVE && !DOTNETCORE // InternalsVisibleTo on IncrementalBuild.LocallyInjectCancellationFault not working for some reason? +// TODO: check if this can be enabled in .NET Core testing of FSharp.Compiler.Service +#if !INTERACTIVE && !NETCOREAPP2_0 // InternalsVisibleTo on IncrementalBuild.LocallyInjectCancellationFault not working for some reason? [] let ``Basic cancellation test`` () = try @@ -155,7 +156,7 @@ let ``GetMethodsAsSymbols should return all overloads of a method as FSharpSymbo ("Concat", [("str0", "string"); ("str1", "string")]); ("Concat", [("arg0", "obj"); ("arg1", "obj"); ("arg2", "obj")]); ("Concat", [("str0", "string"); ("str1", "string"); ("str2", "string")]); -#if !DOTNETCORE +#if !NETCOREAPP2_0 // TODO: check why this is needed for .NET Core testing of FSharp.Compiler.Service ("Concat", [("arg0", "obj"); ("arg1", "obj"); ("arg2", "obj"); ("arg3", "obj")]); #endif ("Concat", [("str0", "string"); ("str1", "string"); ("str2", "string"); ("str3", "string")])] @@ -285,7 +286,7 @@ let ``Expression typing test`` () = // the incomplete member: // member x.Test = -[] +[] let ``Find function from member 1`` () = let input = """ @@ -335,7 +336,7 @@ type Test() = let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 4, inputLines.[3], PartialLongName.Empty(14), (fun _ -> []), fun _ -> false)|> Async.RunSynchronously decls.Items |> Seq.exists (fun d -> d.Name = "abc") |> shouldEqual true -[] +[] let ``Symbol based find function from member 1`` () = let input = """ diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 03301aa029e..2770265abff 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -343,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 @@ -387,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 @@ -397,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 @@ -673,7 +673,7 @@ let ``Test Unoptimized Declarations Project1`` () = "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 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)"; @@ -693,14 +693,14 @@ let ``Test Unoptimized Declarations Project1`` () = "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)"; + //"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 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)"; @@ -765,6 +765,9 @@ let ``Test Unoptimized Declarations Project1`` () = [] +//#if NETCOREAPP2_0 +//[] +//#endif let ``Test Optimized Declarations Project1`` () = let wholeProjectResults = exprChecker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously @@ -812,11 +815,11 @@ let ``Test Optimized Declarations Project1`` () = "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 +//#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)"; @@ -836,23 +839,23 @@ let ``Test Optimized Declarations Project1`` () = "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 +//#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 +//#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)"; @@ -917,7 +920,6 @@ let ``Test Optimized Declarations Project1`` () = () - let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimized = let basePath = Path.GetTempFileName() let fileName = Path.ChangeExtension(basePath, ".fs") @@ -2887,7 +2889,7 @@ let ``Test expressions of optimized declarations stress big expressions`` () = #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 60d933048a2..16a0bdcc266 100644 --- a/tests/service/FileSystemTests.fs +++ b/tests/service/FileSystemTests.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 a6843a4bf45..82914dbdbae 100644 --- a/tests/service/FscTests.fs +++ b/tests/service/FscTests.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 c1606e896c2..23bf52b33e3 100644 --- a/tests/service/FsiTests.fs +++ b/tests/service/FsiTests.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/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 08819ccc9db..cc8fb64e802 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.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/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index c5163ce146b..34822b99fe1 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.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) diff --git a/tests/service/ProjectOptionsTests.fs b/tests/service/ProjectOptionsTests.fs index 64277397e86..07bf18f86ca 100644 --- a/tests/service/ProjectOptionsTests.fs +++ b/tests/service/ProjectOptionsTests.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") diff --git a/tests/service/StructureTests.fs b/tests/service/StructureTests.fs index 377fbbd8acf..f24948890fe 100644 --- a/tests/service/StructureTests.fs +++ b/tests/service/StructureTests.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/TokenizerTests.fs b/tests/service/TokenizerTests.fs index 6070567ef63..4973d398f29 100644 --- a/tests/service/TokenizerTests.fs +++ b/tests/service/TokenizerTests.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 c63d10731da..80d24e3016a 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 0ee82b31cbf..9829d82d7d0 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 95b10fad1bb..112e838d343 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 e12ade0ff46..83d72695895 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 38bb936cab8..dde1269460d 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 ec67bc97427..7969a2232e0 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 6cb171ba604..1d9d553ceb2 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 96ff7ac180f..771f3389e2e 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 31c2d33c565..23c503e99bb 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 dde260ce99f..1326f0d5154 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 6b50e360a01..c448b858234 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 baa89f49b39..051ed38545e 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 54448fef5c3..1305ff34437 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 00ef54f6521..a4e651df575 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 93cc75f0024..f51fa849231 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/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/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index ad7168a198c..1b2985828f5 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -250,68 +250,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"