diff --git a/.github/workflows/repository_lockdown_check.yml b/.github/workflows/repository_lockdown_check.yml new file mode 100644 index 00000000000..95671a1a338 --- /dev/null +++ b/.github/workflows/repository_lockdown_check.yml @@ -0,0 +1,78 @@ +name: Repository lockdown check +on: + pull_request_target: + types: [opened, synchronize, reopened] + branches: + - 'main' + - 'release/*' +permissions: + issues: write + pull-requests: write +jobs: + repository_lockdown: + permissions: + issues: write + pull-requests: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + - name: Check if lockdown is in place + run: | + set -e + if [[ ${{ vars.LOCKDOWN }} == "true" ]]; then + exit 1 + fi + # Did bot already comment the PR? + - name: Find Comment + if: (success() || failure()) + uses: peter-evans/find-comment@v2.4.0 + id: fc + with: + issue-number: ${{github.event.pull_request.number}} + comment-author: 'github-actions[bot]' + body-includes: '' + # If not, create a new comment + - name: Create comment + if: steps.fc.outputs.comment-id == '' && failure() + uses: actions/github-script@v6 + with: + github-token: ${{ github.token }} + script: | + let body = "\n\n> [!CAUTION]\n>Repository is on lockdown for maintenance, all merges are on hold." + const comment = await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }); + return comment.data.id; + # If yes, update the comment + - name: Update comment + if: steps.fc.outputs.comment-id != '' && failure() + uses: actions/github-script@v6 + with: + github-token: ${{ github.token }} + script: | + let body = "\n\n> [!CAUTION]\n>Repository is on lockdown for maintenance, all merges are on hold." + const comment = await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{steps.fc.outputs.comment-id}}, + body: body + }); + return comment.data.id; + # If comment exists, but we are no longer in maintenance mode, delete the comment. + - name: Delete comment + if: steps.fc.outputs.comment-id != '' && success() + uses: actions/github-script@v6 + with: + github-token: ${{ github.token }} + script: | + let body = "\n\n> [!CAUTION]\n>Repository is on lockdown for maintenance, all merges are on hold." + const comment = await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{steps.fc.outputs.comment-id}} + }); + return 0; diff --git a/FSharp.sln b/FSharp.sln index 8846c08339a..a8a5374a585 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -62,6 +62,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{4E4F41D9-8 docs\optimizations.md = docs\optimizations.md docs\optimizations-equality.md = docs\optimizations-equality.md docs\overview.md = docs\overview.md + docs\builder-caches.md = docs\builder-caches.md + docs\changing-the-ast.md = docs\changing-the-ast.md + docs\names.md = docs\names.md + docs\perf-discussions-archive.md = docs\perf-discussions-archive.md + docs\project-builds.md = docs\project-builds.md + docs\representations.md = docs\representations.md + docs\running-documentation-locally.md = docs\running-documentation-locally.md + docs\tooling-features.md = docs\tooling-features.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fcs", "fcs", "{B86EBFF1-E03E-4FAE-89BF-60A4CAE2BC78}" @@ -79,6 +87,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fcs", "fcs", "{B86EBFF1-E03 docs\fcs\tokenizer.fsx = docs\fcs\tokenizer.fsx docs\fcs\typedtree.fsx = docs\fcs\typedtree.fsx docs\fcs\untypedtree.fsx = docs\fcs\untypedtree.fsx + docs\fcs\untypedtree-apis.fsx = docs\fcs\untypedtree-apis.fsx EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsc", "src\fsc\fscProject\fsc.fsproj", "{10D15DBB-EFF0-428C-BA83-41600A93EEC4}" @@ -105,6 +114,56 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Benchmarks.Common", "tests\benchmarks\FSharp.Benchmarks.Common\FSharp.Benchmarks.Common.fsproj", "{7D482560-DF6F-46A5-B50C-20ECF7C38759}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{10F0D468-FD52-4658-811E-7ED6A8318449}" + ProjectSection(SolutionItems) = preProject + docs\content\fsdocs-theme.css = docs\content\fsdocs-theme.css + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{99773BD6-F1D7-48E2-AD72-AC48DA6BB293}" + ProjectSection(SolutionItems) = preProject + docs\img\favicon.ico = docs\img\favicon.ico + docs\img\logo.png = docs\img\logo.png + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "release-notes", "release-notes", "{C28ABF2D-6B43-4B0F-A12B-38570C5D9A81}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\About.md = docs\release-notes\About.md + docs\release-notes\FSharp.Compiler.Service.fsx = docs\release-notes\FSharp.Compiler.Service.fsx + docs\release-notes\FSharp.Core.fsx = docs\release-notes\FSharp.Core.fsx + docs\release-notes\Language.fsx = docs\release-notes\Language.fsx + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".aux", ".aux", "{F1DADFB8-F320-40B6-B430-0ED5C37D3BAC}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\.aux\Common.fsx = docs\release-notes\.aux\Common.fsx + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".FSharp.Compiler.Service", ".FSharp.Compiler.Service", "{01C43145-5289-47BF-A19B-B9F0FB66254D}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\.FSharp.Compiler.Service\8.0.100.md = docs\release-notes\.FSharp.Compiler.Service\8.0.100.md + docs\release-notes\.FSharp.Compiler.Service\8.0.200.md = docs\release-notes\.FSharp.Compiler.Service\8.0.200.md + docs\release-notes\.FSharp.Compiler.Service\8.0.202.md = docs\release-notes\.FSharp.Compiler.Service\8.0.202.md + docs\release-notes\.FSharp.Compiler.Service\8.0.300.md = docs\release-notes\.FSharp.Compiler.Service\8.0.300.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".FSharp.Core", ".FSharp.Core", "{23798638-A1E9-4DAE-9C9C-F5D87499ADD6}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\.FSharp.Core\8.0.200.md = docs\release-notes\.FSharp.Core\8.0.200.md + docs\release-notes\.FSharp.Core\8.0.300.md = docs\release-notes\.FSharp.Core\8.0.300.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Language", ".Language", "{1478B841-73BD-4E68-8F23-413ABB0B991F}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\.Language\8.0.md = docs\release-notes\.Language\8.0.md + docs\release-notes\.Language\preview.md = docs\release-notes\.Language\preview.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".VisualStudio", ".VisualStudio", "{AF70EC5A-8E7C-4FDA-857D-AF08082CFC64}" + ProjectSection(SolutionItems) = preProject + docs\release-notes\.VisualStudio\17.9.md = docs\release-notes\.VisualStudio\17.9.md + docs\release-notes\.VisualStudio\17.10.md = docs\release-notes\.VisualStudio\17.10.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -433,6 +492,14 @@ Global {BEC6E796-7E53-4888-AAFC-B8FD55C425DF} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} {7D482560-DF6F-46A5-B50C-20ECF7C38759} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} + {10F0D468-FD52-4658-811E-7ED6A8318449} = {4E4F41D9-86A7-4F5D-B735-1A0744AB68AC} + {99773BD6-F1D7-48E2-AD72-AC48DA6BB293} = {4E4F41D9-86A7-4F5D-B735-1A0744AB68AC} + {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} = {4E4F41D9-86A7-4F5D-B735-1A0744AB68AC} + {F1DADFB8-F320-40B6-B430-0ED5C37D3BAC} = {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} + {01C43145-5289-47BF-A19B-B9F0FB66254D} = {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} + {23798638-A1E9-4DAE-9C9C-F5D87499ADD6} = {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} + {1478B841-73BD-4E68-8F23-413ABB0B991F} = {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} + {AF70EC5A-8E7C-4FDA-857D-AF08082CFC64} = {C28ABF2D-6B43-4B0F-A12B-38570C5D9A81} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 148f3734185..83b2c864908 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -16,6 +16,9 @@ * Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692)) * Enforce AttributeTargets on union case declarations. ([PR #16764](https://github.com/dotnet/fsharp/pull/16764)) * Disallow using base to invoke an abstract base method. ([Issue #13926](https://github.com/dotnet/fsharp/issues/13926), [PR #16773](https://github.com/dotnet/fsharp/pull/16773)) +* Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) +* Parser: fix pattern range for idents with trivia ([PR #16824](https://github.com/dotnet/fsharp/pull/16824)) +* Fix broken code completion after a record type declaration ([PR #16813](https://github.com/dotnet/fsharp/pull/16813)) ### Added @@ -26,6 +29,7 @@ * Add switch to generate types and members with IL visibility that accurately represents their F# visibility. ([PR #15484](https://github.com/dotnet/fsharp/pull/15484) * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) * Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470)) +* Add extended data for `DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer` (FS0318). ([PR #16811](https://github.com/dotnet/fsharp/pull/16811))) ### Changed diff --git a/docs/release-notes/.FSharp.Core/8.0.300.md b/docs/release-notes/.FSharp.Core/8.0.300.md index 7c3911ae98f..60b25705745 100644 --- a/docs/release-notes/.FSharp.Core/8.0.300.md +++ b/docs/release-notes/.FSharp.Core/8.0.300.md @@ -6,3 +6,4 @@ ### Fixed * Preserve original stack traces in resumable state machines generated code if available. ([PR #16568](https://github.com/dotnet/fsharp/pull/16568)) +* Enforce AttributeTargets on structs and classes. Also update `RequireQualifiedAccessAttribute` and `AutoOpenAttribute` to use `AttributeTargets.Struct` ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) \ No newline at end of file diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index eb7ddd08e54..4a6122e29dd 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -11,6 +11,7 @@ * Allow extension methods without type attribute work for types from imported assemblies. ([PR #16368](https://github.com/dotnet/fsharp/pull/16368)) * Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692)) * Enforce AttributeTargets on union case declarations. ([PR #16764](https://github.com/dotnet/fsharp/pull/16764)) +* Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) ### Changed diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 41c7f6365b1..2663ee62f5b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,9 +30,9 @@ - + https://github.com/dotnet/arcade - cbb61c3a9a42e7c3cce17ee453ff5ecdc7f69282 + 5c3fdd3b5aaaa32b24383ec12a60b37ebff13079 diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index 6c65e81925f..efa2fd72bfa 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -35,7 +35,7 @@ Set-StrictMode -Version 2.0 . $PSScriptRoot\tools.ps1 # Add source entry to PackageSources -function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) { +function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") if ($packageSource -eq $null) @@ -48,12 +48,11 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Usern else { Write-Host "Package source $SourceName already present." } - - AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password + AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd } # Add a credential node for the specified source -function AddCredential($creds, $source, $username, $password) { +function AddCredential($creds, $source, $username, $pwd) { # Looks for credential configuration for the given SourceName. Create it if none is found. $sourceElement = $creds.SelectSingleNode($Source) if ($sourceElement -eq $null) @@ -82,17 +81,18 @@ function AddCredential($creds, $source, $username, $password) { $passwordElement.SetAttribute("key", "ClearTextPassword") $sourceElement.AppendChild($passwordElement) | Out-Null } - $passwordElement.SetAttribute("value", $Password) + + $passwordElement.SetAttribute("value", $pwd) } -function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Password) { +function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." ForEach ($PackageSource in $maestroPrivateSources) { Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key - AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password + AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd } } @@ -144,13 +144,13 @@ if ($disabledSources -ne $null) { $userName = "dn-bot" # Insert credential nodes for Maestro's private feeds -InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -Password $Password +InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password # 3.1 uses a different feed url format so it's handled differently here $dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") if ($dotnet31Source -ne $null) { - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } $dotnetVersions = @('5','6','7','8') @@ -159,9 +159,9 @@ foreach ($dotnetVersion in $dotnetVersions) { $feedPrefix = "dotnet" + $dotnetVersion; $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") if ($dotnetSource -ne $null) { - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } } -$doc.Save($filename) +$doc.Save($filename) \ No newline at end of file diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 9e7bebe9af8..647e3f92e5f 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -15,6 +15,7 @@ parameters: timeoutInMinutes: '' variables: [] workspace: '' + templateContext: '' # Job base template specific parameters # See schema documentation - https://github.com/dotnet/arcade/blob/master/Documentation/AzureDevOps/TemplateSchema.md @@ -68,6 +69,9 @@ jobs: ${{ if ne(parameters.timeoutInMinutes, '') }}: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + ${{ if ne(parameters.templateContext, '') }}: + templateContext: ${{ parameters.templateContext }} + variables: - ${{ if ne(parameters.enableTelemetry, 'false') }}: - name: DOTNET_CLI_TELEMETRY_PROFILE diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index e24ca2f46f9..8ec5c4f2d9f 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -15,6 +15,7 @@ parameters: timeoutInMinutes: '' variables: [] workspace: '' + templateContext: '' # Job base template specific parameters # See schema documentation - https://github.com/dotnet/arcade/blob/master/Documentation/AzureDevOps/TemplateSchema.md @@ -68,6 +69,9 @@ jobs: ${{ if ne(parameters.timeoutInMinutes, '') }}: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + ${{ if ne(parameters.templateContext, '') }}: + templateContext: ${{ parameters.templateContext }} + variables: - ${{ if ne(parameters.enableTelemetry, 'false') }}: - name: DOTNET_CLI_TELEMETRY_PROFILE diff --git a/global.json b/global.json index 599589eadff..ca474949fc3 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.0.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24151.4", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24161.1", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 457a3489576..88c8c7b5a72 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -2926,10 +2926,16 @@ module EstablishTypeDefinitionCores = | _ -> let kind = match kind with - | SynTypeDefnKind.Class -> TFSharpClass + | SynTypeDefnKind.Class -> + if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargetsOnStructAndClasses) then + TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Class synAttrs |> ignore + TFSharpClass | SynTypeDefnKind.Interface -> TFSharpInterface | SynTypeDefnKind.Delegate _ -> TFSharpDelegate (MakeSlotSig("Invoke", g.unit_ty, [], [], [], None)) - | SynTypeDefnKind.Struct -> TFSharpStruct + | SynTypeDefnKind.Struct -> + if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargetsOnStructAndClasses) then + TcAttributesWithPossibleTargets false cenv envinner AttributeTargets.Struct synAttrs |> ignore + TFSharpStruct | _ -> error(InternalError("should have inferred tycon kind", m)) TFSharpTyconRepr (Construct.NewEmptyFSharpTyconData kind) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 68b333b52d9..76a89601b9c 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -573,62 +573,40 @@ let GetTyconRefForExtensionMembers minfo (deref: Entity) amap m g = /// Get the info for all the .NET-style extension members listed as static members in the type. let private GetCSharpStyleIndexedExtensionMembersForTyconRef (amap: Import.ImportMap) m (tcrefOfStaticClass: TyconRef) = let g = amap.g - let pri = NextExtensionMethodPriority() - - if g.langVersion.SupportsFeature(LanguageFeature.CSharpExtensionAttributeNotRequired) then - let csharpStyleExtensionMembers = - if IsTyconRefUsedForCSharpStyleExtensionMembers g m tcrefOfStaticClass || (tcrefOfStaticClass.IsLocalRef && not tcrefOfStaticClass.IsTypeAbbrev) then - protectAssemblyExploration [] (fun () -> - let ty = generalizedTyconRef g tcrefOfStaticClass - GetImmediateIntrinsicMethInfosOfType (None, AccessorDomain.AccessibleFromSomeFSharpCode) g amap m ty - |> List.filter (IsMethInfoPlainCSharpStyleExtensionMember g m true)) - else - [] - if not csharpStyleExtensionMembers.IsEmpty then - [ for minfo in csharpStyleExtensionMembers do - let ilExtMem = ILExtMem (tcrefOfStaticClass, minfo, pri) + let isApplicable = + IsTyconRefUsedForCSharpStyleExtensionMembers g m tcrefOfStaticClass || - // The results are indexed by the TyconRef of the first 'this' argument, if any. - // So we need to go and crack the type of the 'this' argument. - // - // This is convoluted because we only need the ILTypeRef of the first argument, and we don't - // want to read any other metadata as it can trigger missing-assembly errors. It turns out ImportILTypeRef - // is less eager in reading metadata than GetParamTypes. - // - // We don't use the index for the IL extension method for tuple of F# function types (e.g. if extension - // methods for tuple occur in C# code) - let thisTyconRef = GetTyconRefForExtensionMembers minfo tcrefOfStaticClass.Deref amap m g - match thisTyconRef with - | None -> () - | Some (Some tcref) -> yield Choice1Of2(tcref, ilExtMem) - | Some None -> yield Choice2Of2 ilExtMem ] - else - [] - else - if IsTyconRefUsedForCSharpStyleExtensionMembers g m tcrefOfStaticClass then - let ty = generalizedTyconRef g tcrefOfStaticClass - let minfos = GetImmediateIntrinsicMethInfosOfType (None, AccessorDomain.AccessibleFromSomeFSharpCode) g amap m ty - - [ for minfo in minfos do - if IsMethInfoPlainCSharpStyleExtensionMember g m true minfo then - let ilExtMem = ILExtMem (tcrefOfStaticClass, minfo, pri) - // The results are indexed by the TyconRef of the first 'this' argument, if any. - // So we need to go and crack the type of the 'this' argument. - // - // This is convoluted because we only need the ILTypeRef of the first argument, and we don't - // want to read any other metadata as it can trigger missing-assembly errors. It turns out ImportILTypeRef - // is less eager in reading metadata than GetParamTypes. - // - // We don't use the index for the IL extension method for tuple of F# function types (e.g. if extension - // methods for tuple occur in C# code) - let thisTyconRef = GetTyconRefForExtensionMembers minfo tcrefOfStaticClass.Deref amap m g - match thisTyconRef with - | None -> () - | Some (Some tcref) -> yield Choice1Of2(tcref, ilExtMem) - | Some None -> yield Choice2Of2 ilExtMem ] - else - [] + g.langVersion.SupportsFeature(LanguageFeature.CSharpExtensionAttributeNotRequired) && + tcrefOfStaticClass.IsLocalRef && + not tcrefOfStaticClass.IsTypeAbbrev + + if not isApplicable then [] else + + let ty = generalizedTyconRef g tcrefOfStaticClass + let pri = NextExtensionMethodPriority() + + let methods = + protectAssemblyExploration [] + (fun () -> GetImmediateIntrinsicMethInfosOfType (None, AccessorDomain.AccessibleFromSomeFSharpCode) g amap m ty) + + [ for minfo in methods do + if IsMethInfoPlainCSharpStyleExtensionMember g m true minfo then + let ilExtMem = ILExtMem (tcrefOfStaticClass, minfo, pri) + // The results are indexed by the TyconRef of the first 'this' argument, if any. + // So we need to go and crack the type of the 'this' argument. + // + // This is convoluted because we only need the ILTypeRef of the first argument, and we don't + // want to read any other metadata as it can trigger missing-assembly errors. It turns out ImportILTypeRef + // is less eager in reading metadata than GetParamTypes. + // + // We don't use the index for the IL extension method for tuple of F# function types (e.g. if extension + // methods for tuple occur in C# code) + let thisTyconRef = GetTyconRefForExtensionMembers minfo tcrefOfStaticClass.Deref amap m g + match thisTyconRef with + | None -> () + | Some (Some tcref) -> yield Choice1Of2(tcref, ilExtMem) + | Some None -> yield Choice2Of2 ilExtMem ] /// Query the declared properties of a type (including inherited properties) let IntrinsicPropInfosOfTypeInScope (infoReader: InfoReader) optFilter ad findFlag m ty = diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index a058182c1a9..08a3be709b4 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -39,6 +39,14 @@ exception InterfaceNotRevealed of DisplayEnv * TType * range exception ArgumentsInSigAndImplMismatch of sigArg: Ident * implArg: Ident +exception DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer of + denv: DisplayEnv * + implTycon:Tycon * + sigTycon:Tycon * + implTypeAbbrev:TType * + sigTypeAbbrev:TType * + range: range + // Use a type to capture the constant, common parameters type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = @@ -589,8 +597,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = match implTycon.TypeAbbrev, sigTycon.TypeAbbrev with | Some ty1, Some ty2 -> if not (typeAEquiv g aenv ty1 ty2) then - let s1, s2, _ = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, s1, s2), m)) + errorR (DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(denv, implTycon, sigTycon, ty1, ty2, m)) false else true diff --git a/src/Compiler/Checking/SignatureConformance.fsi b/src/Compiler/Checking/SignatureConformance.fsi index c0939f92b35..1b137968945 100644 --- a/src/Compiler/Checking/SignatureConformance.fsi +++ b/src/Compiler/Checking/SignatureConformance.fsi @@ -40,6 +40,14 @@ exception InterfaceNotRevealed of DisplayEnv * TType * range exception ArgumentsInSigAndImplMismatch of sigArg: Ident * implArg: Ident +exception DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer of + denv: DisplayEnv * + implTycon: Tycon * + sigTycon: Tycon * + implTypeAbbrev: TType * + sigTypeAbbrev: TType * + range: range + type Checker = new: diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 3327aa0a635..596ea9f085d 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -79,6 +79,7 @@ type Exception with member exn.DiagnosticRange = match exn with + | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(range = m) -> Some m | ArgumentsInSigAndImplMismatch(_, implArg) -> Some implArg.idRange | ErrorFromAddingConstraint(_, exn2, _) -> exn2.DiagnosticRange #if !NO_TYPEPROVIDERS @@ -320,7 +321,7 @@ type Exception with | BadEventTransformation _ -> 91 | HashLoadedScriptConsideredSource _ -> 92 | UnresolvedConversionOperator _ -> 93 - | ArgumentsInSigAndImplMismatch _ -> 3218 + // avoid 94-100 for safety | ObsoleteError _ -> 101 #if !NO_TYPEPROVIDERS @@ -328,6 +329,9 @@ type Exception with | TypeProviders.ProvidedTypeResolution _ -> 103 #endif | PatternMatchCompilation.EnumMatchIncomplete _ -> 104 + | Failure _ -> 192 + | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer _ -> 318 + | ArgumentsInSigAndImplMismatch _ -> 3218 // Strip TargetInvocationException wrappers | :? TargetInvocationException as e -> e.InnerException.DiagnosticNumber @@ -335,7 +339,6 @@ type Exception with | DiagnosticWithText(n, _, _) -> n | DiagnosticWithSuggestions(n, _, _, _, _) -> n | DiagnosticEnabledWithLanguageFeature(n, _, _, _) -> n - | Failure _ -> 192 | IllegalFileNameChar(fileName, invalidChar) -> fst (FSComp.SR.buildUnexpectedFileNameCharacter (fileName, string invalidChar)) #if !NO_TYPEPROVIDERS | :? TypeProviderError as e -> e.Number @@ -606,6 +609,9 @@ module OldStyleMessages = let TargetInvocationExceptionWrapperE () = Message("TargetInvocationExceptionWrapper", "%s") let ArgumentsInSigAndImplMismatchE () = Message("ArgumentsInSigAndImplMismatch", "%s%s") + let DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferE () = + Message("DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer", "%s%s%s%s") + #if DEBUG let mutable showParserStackOnParseError = false #endif @@ -1857,6 +1863,17 @@ type Exception with | ArgumentsInSigAndImplMismatch(sigArg, implArg) -> os.AppendString(ArgumentsInSigAndImplMismatchE().Format sigArg.idText implArg.idText) + | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(denv, implTycon, _sigTycon, implTypeAbbrev, sigTypeAbbrev, _m) -> + let s1, s2, _ = NicePrint.minimalStringsOfTwoTypes denv implTypeAbbrev sigTypeAbbrev + + os.AppendString( + DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferE().Format + (implTycon.TypeOrMeasureKind.ToString()) + implTycon.DisplayName + s1 + s2 + ) + // Strip TargetInvocationException wrappers | :? TargetInvocationException as exn -> exn.InnerException.Output(os, suggestNames) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 5846712049b..eda76095bb2 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -155,7 +155,6 @@ ValueNotContainedMutabilityInstanceButStatic,"Module '%s' contains\n %s \n 315,DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl,"The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was required by the signature but was not specified by the implementation" 316,DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig,"The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was present in the implementation but not in the signature" 317,DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature declares a %s while the implementation declares a %s" -318,DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the abbreviations differ: %s versus %s" 319,DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig,"The %s definitions for type '%s' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature." 320,DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not" ModuleContainsConstructorButNamesDiffer,"The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe names differ" @@ -1597,6 +1596,7 @@ featureBooleanReturningAndReturnTypeDirectedPartialActivePattern,"Boolean-return featureEnforceAttributeTargetsOnFunctions,"Enforce AttributeTargets on functions" featureEnforceAttributeTargetsUnionCaseDeclarations,"Enforce AttributeTargets on union case declarations" featureLowerInterpolatedStringToConcat,"Optimizes interpolated strings in certain cases, by lowering to concatenation" +featureEnforceAttributeTargetsOnStructAndClasses,"Enforce AttributeTargets on structs and classes" featureLowerIntegralRangesToFastLoops,"Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops." 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index e24b4737742..d5e19724c80 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1113,6 +1113,9 @@ The argument names in the signature '{0}' and implementation '{1}' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + keyword 'while!' diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 3103d8b159e..ac48fc40b91 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -88,6 +88,7 @@ type LanguageFeature = | EnforceAttributeTargetsOnFunctions | EnforceAttributeTargetsUnionCaseDeclarations | LowerInterpolatedStringToConcat + | EnforceAttributeTargetsOnStructAndClasses | LowerIntegralRangesToFastLoops /// LanguageVersion management @@ -204,6 +205,7 @@ type LanguageVersion(versionText) = LanguageFeature.EnforceAttributeTargetsOnFunctions, previewVersion LanguageFeature.EnforceAttributeTargetsUnionCaseDeclarations, previewVersion LanguageFeature.LowerInterpolatedStringToConcat, previewVersion + LanguageFeature.EnforceAttributeTargetsOnStructAndClasses, previewVersion LanguageFeature.LowerIntegralRangesToFastLoops, previewVersion ] @@ -351,6 +353,7 @@ type LanguageVersion(versionText) = | LanguageFeature.EnforceAttributeTargetsOnFunctions -> FSComp.SR.featureEnforceAttributeTargetsOnFunctions () | LanguageFeature.EnforceAttributeTargetsUnionCaseDeclarations -> FSComp.SR.featureEnforceAttributeTargetsUnionCaseDeclarations () | LanguageFeature.LowerInterpolatedStringToConcat -> FSComp.SR.featureLowerInterpolatedStringToConcat () + | LanguageFeature.EnforceAttributeTargetsOnStructAndClasses -> FSComp.SR.featureEnforceAttributeTargetsOnStructAndClasses () | LanguageFeature.LowerIntegralRangesToFastLoops -> FSComp.SR.featureLowerIntegralRangesToFastLoops () /// Get a version string associated with the given feature. diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 4f0fe835ffa..80a41c8ce54 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -79,6 +79,7 @@ type LanguageFeature = | EnforceAttributeTargetsOnFunctions | EnforceAttributeTargetsUnionCaseDeclarations | LowerInterpolatedStringToConcat + | EnforceAttributeTargetsOnStructAndClasses | LowerIntegralRangesToFastLoops /// LanguageVersion management diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index f1a8d3e9737..90062e81c68 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -1644,7 +1644,7 @@ module ParsedInput = | SynType.LongIdent _ when rangeContainsPos ty.Range pos -> Some CompletionContext.Type | _ -> defaultTraverse ty - member _.VisitRecordDefn(_, fields, _) = + member _.VisitRecordDefn(_, fields, range) = fields |> List.tryPick (fun (SynField(idOpt = idOpt; range = fieldRange)) -> match idOpt with @@ -1653,7 +1653,11 @@ module ParsedInput = | _ when rangeContainsPos fieldRange pos -> Some(CompletionContext.RecordField(RecordContext.Declaration false)) | _ -> None) // No completions in a record outside of all fields, except in attributes, which is established earlier in VisitAttributeApplication - |> Option.orElse (Some CompletionContext.Invalid) + |> Option.orElseWith (fun _ -> + if rangeContainsPos range pos then + Some CompletionContext.Invalid + else + None) member _.VisitUnionDefn(_, cases, _) = cases diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index 2c27e7e2ff3..46566d61bbf 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -106,6 +106,13 @@ module ExtendedData = member x.ImplementationName = implArg.idText member x.SignatureRange = sigArg.idRange member x.ImplementationRange = implArg.idRange + + [] + type DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData + internal(signatureType: Tycon, implementationType: Tycon) = + interface IFSharpDiagnosticExtendedData + member x.SignatureRange: range = signatureType.Range + member x.ImplementationRange: range = implementationType.Range open ExtendedData @@ -191,6 +198,9 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str | ArgumentsInSigAndImplMismatch(sigArg, implArg) -> Some(ArgumentsInSigAndImplMismatchExtendedData(sigArg, implArg)) + | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(implTycon = implTycon; sigTycon = sigTycon) -> + Some(DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData(sigTycon, implTycon)) + | _ -> None let msg = diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi index 252a15a33c1..6c941bdd84d 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fsi +++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi @@ -101,6 +101,14 @@ module public ExtendedData = /// Argument identifier range within implementation file member ImplementationRange: range + [] + type DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData = + interface IFSharpDiagnosticExtendedData + /// Range of the signature type identifier. + member SignatureRange: range + /// Range of the implementation type identifier. + member ImplementationRange: range + open ExtendedData /// Represents a diagnostic produced by the F# compiler diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8b034740be4..a97976bee5c 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -16,7 +16,19 @@ type Ident(text: string, range: range) = member _.idRange = range override _.ToString() = text -type SynIdent = SynIdent of ident: Ident * trivia: IdentTrivia option +type SynIdent = + | SynIdent of ident: Ident * trivia: IdentTrivia option + + member this.Range = + match this with + | SynIdent(ident, trivia) -> + match trivia with + | Some value -> + match value with + | IdentTrivia.OriginalNotationWithParen(leftParen, _, rightParen) + | IdentTrivia.HasParenthesis(leftParen, rightParen) -> unionRanges leftParen rightParen + | _ -> ident.idRange + | None -> ident.idRange type LongIdent = Ident list diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 3d9ef06dcad..fa88b48004d 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -16,7 +16,10 @@ type Ident = member idRange: range /// Represents an identifier with potentially additional trivia information. -type SynIdent = SynIdent of ident: Ident * trivia: IdentTrivia option +type SynIdent = + | SynIdent of ident: Ident * trivia: IdentTrivia option + + member Range: range /// Represents a long identifier e.g. 'A.B.C' type LongIdent = Ident list diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 4080fc7ec8b..b33d55722a5 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -3627,8 +3627,7 @@ atomicPattern: mkSynPatMaybeVar lidwd vis (lhs parseState) else let synIdent = List.head lidwd.IdentsWithTrivia - let (SynIdent(id, _)) = synIdent - SynPat.Named(synIdent, false, vis, id.idRange) } + SynPat.Named(synIdent, false, vis, synIdent.Range) } | constant { SynPat.Const(fst $1, snd $1) } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 66205091123..29a83a20d98 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Definice {0} pro typ {1} v signatuře a implementaci nejsou kompatibilní, protože signatura deklaruje {2}, ale implementace deklaruje {3}. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Definice {0} pro typ {1} v signatuře a implementaci nejsou kompatibilní, protože se liší zkratky: {2} oproti {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Definice {0} pro typ {1} v signatuře a implementaci nejsou kompatibilní, protože signatura skrývá zkratku. Zkratka musí být viditelná pro ostatní jazyky CLI. Zvažte zviditelnění zkratky v signatuře. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index f72b6948a76..e28b1177ea9 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Die {0} Definitionen für den Typ "{1}" in der Signatur und Implementierung sind nicht kompatibel, weil in der Signatur "{2}", in der Implementierung hingegen "{3}" deklariert wird. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Die {0} Definitionen für den Typ "{1}" in der Signatur und in der Implementierung sind aufgrund unterschiedlicher Abkürzungen nicht kompatibel: {2} und {3}. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Die {0} Definitionen für den Typ "{1}" in der Signatur und in der Implementierung sind nicht kompatibel, weil eine Abkürzung von einer Signatur verdeckt wird. Die Abkürzung muss für andere CLI-Sprachen sichtbar sein. Sorgen Sie dafür, dass die Abkürzung in der Signatur sichtbar ist. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 12f4457f73e..d86bb178a0d 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Las definiciones de {0} para el tipo "{1}" en la signatura y la implementación no son compatibles porque la signatura declara un {2} mientras la implementación declara un {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Las definiciones de {0} para el tipo "{1}" de la signatura y la implementación no son compatibles porque las abreviaciones difieren: {2} frente a {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Las definiciones de {0} para el tipo "{1}" de la signatura y la implementación no son compatibles porque una signatura oculta una abreviación. La abreviación debe estar visible para otros lenguajes CLI. Considere hacer que la abreviación esté visible en la signatura. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 9477b8b7680..e9cefd5803b 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Les {0} définitions pour le type '{1}' dans la signature et l'implémentation ne sont pas compatibles, car la signature déclare {2} alors que l'implémentation déclare {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Les {0} définitions pour le type '{1}' dans la signature et l'implémentation ne sont pas compatibles, car les abréviations sont différentes : {2} par opposition à {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Les {0} définitions pour le type '{1}' dans la signature et l'implémentation ne sont pas compatibles, car une abréviation est masquée par une signature. L'abréviation doit être visible par les autres langages CLI. Rendez l'abréviation visible dans la signature. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index b17ab37848d..539502d9670 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Le definizioni di {0} per il tipo '{1}' nella firma e nell'implementazione non sono compatibili perché la firma dichiara {2} mentre l'implementazione dichiara {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Le definizioni di {0} per il tipo '{1}' nella firma e nell'implementazione non sono compatibili perché le abbreviazioni sono diverse: {2} invece di {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Le definizioni di {0} per il tipo '{1}' nella firma e nell'implementazione non sono compatibili perché un'abbreviazione è nascosta da una firma. L'abbreviazione deve essere visibile ad altri linguaggi CLI. Provare a rendere visibile l'abbreviazione nella firma. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index fa6fb18bda6..a364c7953d6 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ シグネチャは {2} を宣言していますが、実装では {3} を宣言しているため、シグネチャおよび実装内の型 '{1}' の {0} 定義は互換性がありません - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - シグネチャおよび実装内の型 '{1}' の {0} 定義は、省略形が異なるため ({2} と {3})、互換性がありません - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. 省略形がシグネチャによって隠ぺいされているため、シグネチャおよび実装の型 '{1}' の {0} 定義に互換性がありません。省略形は他の CLI 言語から参照できるようにする必要があります。シグネチャ内の省略形を参照できるようにしてください。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 1cf38ecd52e..96768306e24 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ 시그니처가 {2}을(를) 선언하지만 구현은 {3}을(를) 선언하므로 시그니처 및 구현의 '{1}' 형식에 대한 {0} 정의가 호환되지 않습니다. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - 약어가 {2}과(와) {3}(으)로 서로 다르므로 시그니처 및 구현의 '{1}' 형식에 대한 {0} 정의가 호환되지 않습니다. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. 시그니처에 의해 약어가 숨겨져 있으므로 시그니처 및 구현의 '{1}' 형식에 대한 {0} 정의가 호환되지 않습니다. 약어는 다른 CLI 언어에 표시되어야 합니다. 시그니처에서 약어를 표시하세요. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index a36f1d7cb51..22210fdee9c 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Definicje {0} dla typu „{1}” w sygnaturze i implementacji są niezgodne, ponieważ sygnatura deklaruje element {2}, natomiast implementacja deklaruje element {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Definicje {0} dla typu „{1}” w sygnaturze i implementacji są niezgodne, ponieważ skróty są różne: {2} i {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Definicje {0} dla typu „{1}” w sygnaturze i implementacji są niezgodne, ponieważ skrót jest ukrywany przez sygnaturę. Skrót musi być widoczny dla innych języków infrastruktury CLI. Rozważ zapewnienie widoczności skrótu w sygnaturze. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 129e7cb792e..8449413e457 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ As definições {0} para o tipo '{1}' na assinatura e implementação não são compatíveis, pois a assinatura declara um {2} enquanto a implementação declara um {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - As definições {0} para o tipo '{1}' na assinatura e implementação não são compatíveis, pois as abreviações são diferentes: {2} versus {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. As definições {0} para o tipo '{1}' na assinatura e implementação não são compatíveis, pois uma abreviação está sendo ocultada por uma assinatura. A abreviação deve estar visível a outras linguagens CLIs. Considere deixar a abreviação visível na assinatura. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index d0acf9ef585..41129014c1b 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ Определения {0} для типа "{1}" в сигнатуре и реализации несовместимы, так как сигнатура объявляет {2}, а реализация — {3}. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Определения {0} для типа "{1}" в сигнатуре и реализации несовместимы, так как сокращения различаются: {2} в сравнении с {3}. - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Определения {0} для типа "{1}" в сигнатуре и реализации несовместимы, так как сокращение скрывается сигнатурой. Сокращение должно быть видимым для других языков CLI. Попробуйте сделать сокращение видимым в сигнатуре. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 555f737153e..659004ddc36 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ İmzada {2} bildirilirken uygulamada {3} bildirildiğinden, imza ve uygulamadaki '{1}' türü için {0} tanımları uyumlu değil - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - Kısaltmalar farklı olduğundan ({2} ve {3}), imza ve uygulamadaki '{1}' türü için {0} tanımları uyumlu değil - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. Bir kısaltma imza ile gizlendiğinden, imza ve uygulamadaki '{1}' türü için {0} tanımları uyumlu değil. Kısaltmanın diğer CLI dilleri tarafından görünebilir olması gerekir. Kısaltmayı imzada görünür yapmayı düşünün. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 72e2ea8f447..1b8716f794d 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ 签名和实现中类型“{1}”的 {0} 定义不兼容,因为签名声明的是 {2},而实现声明的是 {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - 签名和实现中类型“{1}”的 {0} 定义不兼容,因为缩写不同: {2} 与 {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. 签名和实现中类型“{1}”的 {0} 定义不兼容,因为签名将隐藏缩写。缩写必须对其他 CLI 语言可见。请考虑使缩写在签名中可见。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 817e803623b..43da50f6960 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -297,6 +297,11 @@ Enforce AttributeTargets on functions + + Enforce AttributeTargets on structs and classes + Enforce AttributeTargets on structs and classes + + Enforce AttributeTargets on union case declarations Enforce AttributeTargets on union case declarations @@ -2277,11 +2282,6 @@ 簽章與實作中類型 '{1}' 的 {0} 定義不相容,因為簽章宣告 {2},而實作則宣告 {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - 簽章與實作中類型 '{1}' 的 {0} 定義不相容,因為縮寫不同: {2} 與 {3} - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. 簽章與實作中類型 '{1}' 的 {0} 定義不相容,因為簽章隱藏了某縮寫。其他 CLI 語言必須可看見該縮寫。請考慮使縮寫在簽章中可見。 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index a3412bfc48c..6a3e83c532a 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -7,6 +7,11 @@ Názvy argumentů v signatuře {0} a implementaci {1} si neodpovídají. Použije se název argumentu ze souboru signatury. To může způsobit problémy při ladění nebo profilování. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Neshoda typů Očekává se řazená kolekce členů o délce {0} typu\n {1} \nale odevzdala se řazená kolekce členů o délce {2} typu\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index d1028719674..8777c4ab388 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -7,6 +7,11 @@ Die Argumentnamen in Signatur "{0}" und Implementierung "{1}" stimmen nicht überein. Der Argumentname aus der Signaturdatei wird verwendet. Dadurch können Probleme beim Debuggen oder bei der Profilerstellung auftreten. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Typenkonflikt. Es wurde ein Tupel der Länge {0} des Typs\n {1} \nerwartet, aber ein Tupel der Länge {2} des Typs\n {3}{4}\n angegeben. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 213872bb8d7..6484fb847fb 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -7,6 +7,11 @@ Los nombres de argumento en la firma "{0}" y la implementación "{1}" no coinciden. Se utilizará el nombre del argumento desde el archivo de firma. Esto puede causar problemas durante la depuración o la generación de perfiles. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Error de coincidencia de tipos. Se espera una tupla de longitud {0} de tipo\n {1} \nperero se ha proporcionado una tupla de longitud {2} de tipo\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7539cba3a7b..3b15aaca563 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -7,6 +7,11 @@ Les noms d'arguments dans la signature '{0}' et l'implémentation '{1}' ne correspondent pas. Le nom d'argument du fichier de signature va être utilisé. Cela peut entraîner des problèmes durant le débogage ou le profilage. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Incompatibilité de type. Tuple de longueur attendu {0} de type\n {1} \nmais tuple de longueur {2} de type\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index b4e6abe8be9..304025244e0 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -7,6 +7,11 @@ I nomi degli argomenti nella firma '{0}' e nell'implementazione '{1}' non corrispondono. Verrà usato il nome dell'argomento del file di firma. Questa situazione potrebbe causare problemi durante il debug o la profilatura. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Tipo non corrispondente. È prevista una tupla di lunghezza {0} di tipo\n {1} \n, ma è stata specificata una tupla di lunghezza {2} di tipo\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index d465315dfa1..31ba40fcb3d 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -7,6 +7,11 @@ シグネチャ '{0}' と実装 '{1}' の引数の名前が一致しません。シグネチャ ファイルの引数の名前が使用されます。デバッグまたはプロファイルするときに問題が生じる原因となる可能性があります。 + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n 型が一致しません。型の長さ {0} のタプルが必要です\n {1} \nただし、型の長さ {2} のタプルが指定された場合\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 1e4bb958ae6..f0bbe7c8aae 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -7,6 +7,11 @@ 시그니처 '{0}'과(와) 구현 '{1}'의 인수 이름이 일치하지 않습니다. 시그니처 파일의 인수 이름이 사용됩니다. 이로 인해 디버깅 또는 프로파일링 시 문제가 발생할 수 있습니다. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n 유형 불일치. 형식이 \n {1}이고 길이가 {0}인 튜플이 필요합니다. \n그러나 형식이 \n {3}이고 길이가 {2}인 튜플이 제공되었습니다.{4}\n diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index c7087e22b98..3020002ce7c 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -7,6 +7,11 @@ Nazwy argumentów w podpisie „{0}” i implementacji „{1}” nie są zgodne. Używana będzie nazwa argumentu z pliku podpisu. Może to spowodować problemy podczas debugowania lub profilowania. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Niezgodność. Oczekiwano krotki o długości {0} typu\n {1} \nale otrzymano krotkę o długości {2} typu\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index ba29b433934..b5647b8d0eb 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -7,6 +7,11 @@ Os nomes de argumento na assinatura '{0}' e na implementação '{1}' não coincidem. O nome do argumento do arquivo da assinatura será usado. Isso pode causar problemas durante a depuração ou a criação de perfil. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Tipo incompatível. Esperando uma tupla de comprimento {0} do tipo\n {1} \nmas recebeu uma tupla de comprimento {2} do tipo\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index ecd597b4349..b47eb92bdc3 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -7,6 +7,11 @@ Имена аргументов в сигнатуре "{0}" и реализации "{1}" не совпадают. Будет использоваться имя аргумента из файла сигнатуры. Это может вызвать проблемы при отладке или профилировании. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Несоответствие типов. Ожидается кортеж длиной {0} типа\n {1}, \nно предоставлен кортеж длиной {2} типа\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index e0b5f943f15..2fc08de7f13 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -7,6 +7,11 @@ {0}' imzası ve '{1}' uygulaması içindeki bağımsız değişken adları eşleşmiyor. İmza dosyasındaki bağımsız değişken adı kullanılacak. Bu, hata ayıklama veya profil oluşturma sırasında sorunlara neden olabilir. + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n Tür uyuşmazlığı. {0} uzunluğunda türü\n {1} \nolan bir demet bekleniyordu ancak {2} uzunluğunda türü\n {3}{4}\nolan bir demet verildi diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 9525488aa9b..f81bb2b61c7 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -7,6 +7,11 @@ 签名“{0}”和实现“{1}”中的参数名称不匹配。将使用签名文件中的参数名称。在进行调试或分析时这可能会导致问题。 + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n 类型不匹配。应为长度为 {0} 的类型的元组\n {1} \n但提供了长度为 {2} 的类型的元组\n {3}{4}\n diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index c2181e3f317..d0de30dc7ff 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -7,6 +7,11 @@ 特徵標記 '{0}' 和實作 '{1}' 中的引數名稱不相符。將會使用特徵標記檔案中的引數名稱。這可能會在偵錯或分析時造成問題。 + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ:\n {2}\nversus\n {3} + + Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n 類型不符。必須是類型為\n {1} \n 的元組長度 {0},但提供的是類型為\n {3}{4}\n 的元組長度 {2} diff --git a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props index a3c9ee3e2da..8cc3ba76eb9 100644 --- a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -31,7 +31,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and false - false diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index b62d5b16eb8..b5cf5dee3af 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -363,7 +363,7 @@ type MeasureOne = class end -[] +[] type TypeProviderAttribute() = inherit System.Attribute() diff --git a/src/FSharp.Core/fslib-extra-pervasives.fsi b/src/FSharp.Core/fslib-extra-pervasives.fsi index ffd6f6f6a00..97120245f87 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fsi +++ b/src/FSharp.Core/fslib-extra-pervasives.fsi @@ -385,7 +385,7 @@ namespace Microsoft.FSharp.Core.CompilerServices type MeasureOne /// Place on a class that implements ITypeProvider to extend the compiler - [] + [] type TypeProviderAttribute = inherit System.Attribute diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 346c1a64e0e..777a31b8e15 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -104,7 +104,7 @@ namespace Microsoft.FSharp.Core type CLIMutableAttribute() = inherit Attribute() - [] + [] [] type AutoSerializableAttribute(value:bool) = inherit Attribute() @@ -127,19 +127,19 @@ namespace Microsoft.FSharp.Core type ReferenceEqualityAttribute() = inherit Attribute() - [] + [] [] type StructuralComparisonAttribute() = inherit Attribute() - [] + [] [] type StructuralEqualityAttribute() = inherit Attribute() [] + AttributeTargets.Enum, AllowMultiple=false)>] [] type NoEqualityAttribute() = inherit Attribute() @@ -161,9 +161,9 @@ namespace Microsoft.FSharp.Core type NoComparisonAttribute() = inherit Attribute() - [] + [] [] type ReflectedDefinitionAttribute(includeValue: bool) = inherit Attribute() @@ -350,12 +350,12 @@ namespace Microsoft.FSharp.Core type RequiresExplicitTypeArgumentsAttribute() = inherit Attribute() - [] + [] [] type RequireQualifiedAccessAttribute() = inherit Attribute() - [] + [] [] type AutoOpenAttribute(path:string) = inherit Attribute() diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index dc4b9cc22dd..fc2b4d756a9 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -129,7 +129,7 @@ namespace Microsoft.FSharp.Core /// for use at runtime. /// /// Attributes - [] + [] [] type ReflectedDefinitionAttribute = inherit Attribute @@ -385,7 +385,7 @@ namespace Microsoft.FSharp.Core /// 'System.Object.GetHashCode()' for the type. /// /// Attributes - [] + [] [] type StructuralEqualityAttribute = inherit Attribute @@ -398,7 +398,7 @@ namespace Microsoft.FSharp.Core /// automatic generation of implementations for 'System.IComparable' for the type. /// /// Attributes - [] + [] [] type StructuralComparisonAttribute = inherit Attribute @@ -604,7 +604,7 @@ namespace Microsoft.FSharp.Core /// type Serializable by default. /// /// Attributes - [] + [] [] type AutoSerializableAttribute = inherit Attribute @@ -898,7 +898,7 @@ namespace Microsoft.FSharp.Core /// type require explicit qualified access. /// /// Attributes - [] + [] [] type RequireQualifiedAccessAttribute = inherit Attribute @@ -920,7 +920,7 @@ namespace Microsoft.FSharp.Core /// /// /// Attributes - [] + [] [] type AutoOpenAttribute = inherit Attribute diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsClass.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsClass.fs new file mode 100644 index 00000000000..8f587dcf099 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsClass.fs @@ -0,0 +1,26 @@ +open System + +[] +type CustomClassAttribute() = + inherit Attribute() + +[] +type Class(x: int) = class end + +[] +[] +type Class2 = class end + +[] +type Class3() = class end + +[] +type SemanticClassificationItem = + val Range: int + val Type: string + new((range, ty)) = { Range = range; Type = ty } + +[] +type ILTableName(idx: int) = + member __.Index = idx + static member FromIndex n = ILTableName n diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsStruct.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsStruct.fs new file mode 100644 index 00000000000..9b64c7cb33f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsStruct.fs @@ -0,0 +1,23 @@ +open System + +[] +type CustomStructAttribute() = + inherit Attribute() + +[] +type Class(x: int) = struct end + +[] +[] +type Class2 = struct end + +[] +type SemanticClassificationItem = + val Range: int + val Type: string + new((range, ty)) = { Range = range; Type = ty } + +[] +type ILTableName(idx: int) = + member __.Index = idx + static member FromIndex n = ILTableName n diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index 0bdc9306cb7..652755fd5cd 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -259,6 +259,18 @@ module CustomAttributes_AttributeUsage = (Error 842, Line 52, Col 6, Line 52, Col 16, "This attribute is not valid for use on this language element") ] + // SOURCE=E_AttributeTargetIsMethod04.fs # E_AttributeTargetIsMethod04.fs + [] + let ``E_AttributeTargetIsMethod04_fs`` compilation = + compilation + |> withOptions ["--nowarn:25"] + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 842, Line 10, Col 3, Line 10, Col 15, "This attribute is not valid for use on this language element") + (Error 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") + ] + // SOURCE=E_ConditionalAttribute.fs SCFLAGS="--test:ErrorRanges" # E_ConditionalAttribute.fs [] let ``E_ConditionalAttribute_fs`` compilation = @@ -300,6 +312,77 @@ module CustomAttributes_AttributeUsage = |> withDiagnostics [ (Error 842, Line 12, Col 3, Line 12, Col 6, "This attribute is not valid for use on this language element") ] + + // SOURCE=AttributeTargetIsStruct.fs # AttributeTargetIsStruct.fs + [] + let ``AttributeTargetIsStruct_fs`` compilation = + compilation + |> verifyCompile + |> shouldSucceed + + // SOURCE=AttributeTargetIsStruct.fs # AttributeTargetIsStruct.fs + [] + let ``AttributeTargetIsStruct_fs preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldSucceed + + // SOURCE=AttributeTargetIsClass.fs # AttributeTargetIsClass.fs + [] + let ``AttributeTargetIsClass_fs`` compilation = + compilation + |> verifyCompile + |> shouldSucceed + + // SOURCE=AttributeTargetIsClass.fs # AttributeTargetIsClass.fs + [] + let ``AttributeTargetIsClass_fs preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldSucceed + + // SOURCE=E_AttributeTargetIsStruct.fs # E_AttributeTargetIsStruct.fs + [] + let ``E_AttributeTargetIsStruct_fs`` compilation = + compilation + |> verifyCompile + |> shouldSucceed + + // SOURCE=E_AttributeTargetIsStruct.fs # E_AttributeTargetIsStruct.fs + [] + let ``E_AttributeTargetIsStruct_fs preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 842, Line 13, Col 3, Line 13, Col 14, "This attribute is not valid for use on this language element") + (Error 842, Line 19, Col 3, Line 19, Col 14, "This attribute is not valid for use on this language element") + (Error 842, Line 22, Col 11, Line 22, Col 22, "This attribute is not valid for use on this language element") + (Error 842, Line 25, Col 3, Line 25, Col 14, "This attribute is not valid for use on this language element") + ] + + // SOURCE=E_AttributeTargetIsClass.fs # E_AttributeTargetIsClass.fs + [] + let ``E_AttributeTargetIsClass_fs`` compilation = + compilation + |> verifyCompile + |> shouldSucceed + + // SOURCE=E_AttributeTargetIsClass.fs # E_AttributeTargetIsClass.fs + [] + let ``E_AttributeTargetIsClass_fs preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") + (Error 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") + (Error 842, Line 22, Col 10, Line 22, Col 22, "This attribute is not valid for use on this language element") + ] // SOURCE=MarshalAsAttribute.fs # MarshalAsAttribute.fs [] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsClass.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsClass.fs new file mode 100644 index 00000000000..845b7d1762f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsClass.fs @@ -0,0 +1,23 @@ +// This tests that AttributeTargets.Struct is not allowed on a class, and that AttributeTargets.Class is not allowed on a struct. + +open System + +[] +type CustomStructAttribute() = + inherit Attribute() + +[] +type CustomClassAttribute() = + inherit Attribute() + +[] +type Class(x: int) = class end + +[] +type Class2(x: int) = class end + +[] +type Class3(x: int) = class end + +[] +type Class4 = class end \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod04.fs new file mode 100644 index 00000000000..bd78c8fd5d5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsMethod04.fs @@ -0,0 +1,15 @@ +// This tests that AttributeTargets.Method is not allowed in class and struct types. + +open System +open System.Diagnostics + +[] +type CustomMethodAttribute() = + inherit Attribute() + +[] +type Class() = class end + +[] +type Struct(x: int) = struct end + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsStruct.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsStruct.fs new file mode 100644 index 00000000000..ace0b6a5c39 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/E_AttributeTargetIsStruct.fs @@ -0,0 +1,27 @@ +// This tests that AttributeTargets.Class is not allowed on a struct, and that AttributeTargets.Struct is not allowed on a class. + +open System + +[] +type CustomStructAttribute() = + inherit Attribute() + +[] +type CustomClassAttribute() = + inherit Attribute() + +[] +type Struct(x: int) = struct end + +[] +type Struct1(x: int) = struct end + +[] +type Struct2(x: int) = struct end + +[] +type Struct4 = struct end + +[] +[] +type Struct5 = struct end \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs index eec3ce03dcd..65a1cceb43d 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs @@ -1,6 +1,7 @@ module ErrorMessages.ExtendedDiagnosticData #nowarn "57" +open FSharp.Compiler.Text open FSharp.Compiler.Diagnostics open FSharp.Compiler.Diagnostics.ExtendedData open FSharp.Test @@ -205,3 +206,38 @@ id (193, "This expression is a function value, i.e. is missing arguments. Its type is 'a -> 'a.") (fun (wrongType: ExpressionIsAFunctionExtendedData) -> Assert.Equal("type 'a -> 'a", wrongType.ActualType.ToString())) + +let private assertRange + (expectedStartLine: int, expectedStartColumn: int) + (expectedEndLine: int, expectedEndColumn: int) + (actualRange: range) + : unit = + Assert.Equal(Position.mkPos expectedStartLine expectedStartColumn, actualRange.Start) + Assert.Equal(Position.mkPos expectedEndLine expectedEndColumn, actualRange.End) + +[] +[] +[] +let ``DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData 01`` useTransparentCompiler = + let signature = + Fsi """ +namespace Project + +type Foo = {| bar: int |} + """ + + let implementation = + FsSource """ +namespace Project + +type Foo = {| bar: int; x: int |} + """ + + signature + |> withAdditionalSourceFile implementation + |> typecheckProject true useTransparentCompiler + |> checkDiagnostic + (318, "The type definitions for type 'Foo' in the signature and implementation are not compatible because the abbreviations differ:\n {| bar: int; x: int |}\nversus\n {| bar: int |}") + (fun (fieldsData: DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData) -> + assertRange (4,5) (4,8) fieldsData.SignatureRange + assertRange (4,6) (4,9) fieldsData.ImplementationRange) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs index 735e7828b89..bcdc3517394 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs @@ -155,14 +155,13 @@ let GetAllUsesOfAllSymbols() = let result = async { let project = makeTestProject() - let checker = ProjectWorkflowBuilder(project, useGetSource=true, useChangeNotifications = true).Checker + let checker = ProjectWorkflowBuilder(project, useGetSource=true, useChangeNotifications = true, enablePartialTypeChecking = false).Checker do! saveProject project false checker let options = project.GetProjectOptions checker let! checkProjectResults = checker.ParseAndCheckProject(options) return checkProjectResults.GetAllUsesOfAllSymbols() } |> Async.RunSynchronously - traceProvider.ForceFlush() |> ignore traceProvider.Dispose() diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index 5dc3dedb548..7e78cda1704 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -28,7 +28,7 @@ open OpenTelemetry.Trace #nowarn "57" -[] +[] let ``Use Transparent Compiler`` () = let size = 20 @@ -58,7 +58,7 @@ let ``Use Transparent Compiler`` () = checkFile last expectSignatureChanged } -[] +[] let ``Parallel processing`` () = let project = SyntheticProject.Create( @@ -76,7 +76,7 @@ let ``Parallel processing`` () = checkFile "E" expectSignatureChanged } -[] +[] let ``Parallel processing with signatures`` () = let project = SyntheticProject.Create( @@ -111,7 +111,7 @@ let makeTestProject () = let testWorkflow () = ProjectWorkflowBuilder(makeTestProject(), useTransparentCompiler = true) -[] +[] let ``Edit file, check it, then check dependent file`` () = testWorkflow() { updateFile "First" breakDependentFiles @@ -119,21 +119,21 @@ let ``Edit file, check it, then check dependent file`` () = checkFile "Second" expectErrors } -[] +[] let ``Edit file, don't check it, check dependent file`` () = testWorkflow() { updateFile "First" breakDependentFiles checkFile "Second" expectErrors } -[] +[] let ``Check transitive dependency`` () = testWorkflow() { updateFile "First" breakDependentFiles checkFile "Last" expectSignatureChanged } -[] +[] let ``Change multiple files at once`` () = testWorkflow() { updateFile "First" (setPublicVersion 2) @@ -142,7 +142,7 @@ let ``Change multiple files at once`` () = checkFile "Last" (expectSignatureContains "val f: x: 'a -> (ModuleFirst.TFirstV_2<'a> * ModuleSecond.TSecondV_2<'a>) * (ModuleFirst.TFirstV_2<'a> * ModuleThird.TThirdV_2<'a>) * TLastV_1<'a>") } -[] +[] let ``Files depend on signature file if present`` () = let project = makeTestProject() |> updateFile "First" addSignatureFile @@ -152,7 +152,7 @@ let ``Files depend on signature file if present`` () = checkFile "Second" expectNoChanges } -[] +[] let ``Project with signatures`` () = let project = SyntheticProject.Create( @@ -167,7 +167,7 @@ let ``Project with signatures`` () = checkFile "Second" expectOk } -[] +[] let ``Signature update`` () = let project = SyntheticProject.Create( @@ -183,7 +183,7 @@ let ``Signature update`` () = checkFile "Second" expectSignatureChanged } -[] +[] let ``Adding a file`` () = testWorkflow() { addFileAbove "Second" (sourceFile "New" []) @@ -191,14 +191,14 @@ let ``Adding a file`` () = checkFile "Last" (expectSignatureContains "val f: x: 'a -> (ModuleFirst.TFirstV_1<'a> * ModuleNew.TNewV_1<'a> * ModuleSecond.TSecondV_1<'a>) * (ModuleFirst.TFirstV_1<'a> * ModuleThird.TThirdV_1<'a>) * TLastV_1<'a>") } -[] +[] let ``Removing a file`` () = testWorkflow() { removeFile "Second" checkFile "Last" expectErrors } -[] +[] let ``Changes in a referenced project`` () = let library = SyntheticProject.Create("library", sourceFile "Library" []) @@ -217,7 +217,7 @@ let ``Changes in a referenced project`` () = } -[] +[] let ``File is not checked twice`` () = let cacheEvents = ConcurrentQueue() @@ -241,7 +241,7 @@ let ``File is not checked twice`` () = Assert.Equal([Weakened; Requested; Started; Finished], intermediateTypeChecks["FileFirst.fs"]) Assert.Equal([Weakened; Requested; Started; Finished], intermediateTypeChecks["FileThird.fs"]) -[] +[] let ``If a file is checked as a dependency it's not re-checked later`` () = let cacheEvents = ConcurrentQueue() @@ -265,7 +265,7 @@ let ``If a file is checked as a dependency it's not re-checked later`` () = Assert.Equal([Weakened; Requested; Started; Finished; Requested], intermediateTypeChecks["FileThird.fs"]) -// [] TODO: differentiate complete and minimal checking requests +// [] TODO: differentiate complete and minimal checking requests let ``We don't check files that are not depended on`` () = let project = SyntheticProject.Create( sourceFile "First" [], @@ -295,7 +295,7 @@ let ``We don't check files that are not depended on`` () = Assert.Equal([Started; Finished], intermediateTypeChecks["FileThird.fs"]) Assert.False (intermediateTypeChecks.ContainsKey "FileSecond.fs") -// [] TODO: differentiate complete and minimal checking requests +// [] TODO: differentiate complete and minimal checking requests let ``Files that are not depended on don't invalidate cache`` () = let project = SyntheticProject.Create( sourceFile "First" [], @@ -336,7 +336,7 @@ let ``Files that are not depended on don't invalidate cache`` () = Assert.Equal([], intermediateTypeChecks |> Map.toList) -// [] TODO: differentiate complete and minimal checking requests +// [] TODO: differentiate complete and minimal checking requests let ``Files that are not depended on don't invalidate cache part 2`` () = let project = SyntheticProject.Create( sourceFile "A" [], @@ -376,7 +376,7 @@ let ``Files that are not depended on don't invalidate cache part 2`` () = Assert.Equal(["FileE.fs", [Started; Finished]], graphConstructions) Assert.Equal(["FileE.fs", [Started; Finished]], intermediateTypeChecks) -[] +[] let ``Changing impl files doesn't invalidate cache when they have signatures`` () = let project = SyntheticProject.Create( { sourceFile "A" [] with SignatureFile = AutoGenerated }, @@ -405,7 +405,7 @@ let ``Changing impl files doesn't invalidate cache when they have signatures`` ( Assert.Equal([], intermediateTypeChecks) -[] +[] let ``Changing impl file doesn't invalidate an in-memory referenced project`` () = let library = SyntheticProject.Create("library", { sourceFile "A" [] with SignatureFile = AutoGenerated }) @@ -789,7 +789,7 @@ module Stuff = let fileName, snapshot, checker = singleFileChecker source checker.ParseFile(fileName, snapshot) |> Async.RunSynchronously - //[] + //[] let ``Hash stays the same when whitespace changes`` () = //let parseResult = getParseResult source @@ -845,7 +845,7 @@ let ``TypeCheck last file in project with transparent compiler`` useTransparentC checkFile lastFile expectOk } -[] +[] let ``LoadClosure for script is computed once`` () = let project = SyntheticProject.CreateForScript( sourceFile "First" []) @@ -870,7 +870,7 @@ let ``LoadClosure for script is computed once`` () = Assert.Empty(closureComputations) -[] +[] let ``LoadClosure for script is recomputed after changes`` () = let project = SyntheticProject.CreateForScript( sourceFile "First" []) @@ -899,7 +899,7 @@ let ``LoadClosure for script is recomputed after changes`` () = Assert.Equal([Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished], closureComputations["FileFirst.fs"]) -[] +[] let ``TryGetRecentCheckResultsForFile returns None before first call to ParseAndCheckFileInProject`` () = let project = SyntheticProject.Create( sourceFile "First" []) @@ -909,7 +909,7 @@ let ``TryGetRecentCheckResultsForFile returns None before first call to ParseAnd tryGetRecentCheckResults "First" expectNone } |> ignore -[] +[] let ``TryGetRecentCheckResultsForFile returns result after first call to ParseAndCheckFileInProject`` () = let project = SyntheticProject.Create( sourceFile "First" [] ) @@ -918,7 +918,7 @@ let ``TryGetRecentCheckResultsForFile returns result after first call to ParseAn tryGetRecentCheckResults "First" expectSome } |> ignore -[] +[] let ``TryGetRecentCheckResultsForFile returns no result after edit`` () = let project = SyntheticProject.Create( sourceFile "First" []) @@ -931,7 +931,7 @@ let ``TryGetRecentCheckResultsForFile returns no result after edit`` () = tryGetRecentCheckResults "First" expectSome } |> ignore -[] +[] let ``TryGetRecentCheckResultsForFile returns result after edit of other file`` () = let project = SyntheticProject.Create( sourceFile "First" [], @@ -945,7 +945,7 @@ let ``TryGetRecentCheckResultsForFile returns result after edit of other file`` tryGetRecentCheckResults "Second" expectSome // file didn't change so we still want to get the recent result } |> ignore -[] +[] let ``Background compiler and Transparent compiler return the same options`` () = async { let backgroundChecker = FSharpChecker.Create(useTransparentCompiler = false) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 3c4b22f76c1..9dda7f12180 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2514,6 +2514,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedDa FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String SignatureName FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String get_ImplementationName() FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String get_SignatureName() +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range ImplementationRange +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range SignatureRange +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range get_ImplementationRange() +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range get_SignatureRange() FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 CollectionElement FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 DowncastUsedInsteadOfUpcast FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 ElseBranchResult @@ -2615,6 +2619,7 @@ FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue get_ImplementationValue() FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue get_SignatureValue() FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData @@ -7529,6 +7534,8 @@ FSharp.Compiler.Syntax.SynField: System.String ToString() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident get_ident() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.SynIdent NewSynIdent(FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]) +FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynIdent: Int32 Tag FSharp.Compiler.Syntax.SynIdent: Int32 get_Tag() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] get_trivia() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 3c4b22f76c1..9dda7f12180 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2514,6 +2514,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedDa FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String SignatureName FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String get_ImplementationName() FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData: System.String get_SignatureName() +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range ImplementationRange +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range SignatureRange +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range get_ImplementationRange() +FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData: FSharp.Compiler.Text.Range get_SignatureRange() FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 CollectionElement FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 DowncastUsedInsteadOfUpcast FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo+Tags: Int32 ElseBranchResult @@ -2615,6 +2619,7 @@ FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue get_ImplementationValue() FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue get_SignatureValue() FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData @@ -7529,6 +7534,8 @@ FSharp.Compiler.Syntax.SynField: System.String ToString() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident get_ident() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.SynIdent NewSynIdent(FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]) +FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynIdent: Int32 Tag FSharp.Compiler.Syntax.SynIdent: Int32 get_Tag() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] get_trivia() diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index 998f2bd201d..ad3660747fe 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -934,7 +934,8 @@ type ProjectWorkflowBuilder ?useTransparentCompiler, ?runTimeout, ?autoStart, - ?isExistingProject + ?isExistingProject, + ?enablePartialTypeChecking ) = let useTransparentCompiler = defaultArg useTransparentCompiler CompilerAssertHelpers.UseTransparentCompiler @@ -955,7 +956,7 @@ type ProjectWorkflowBuilder (FSharpChecker.Create( keepAllBackgroundSymbolUses = true, enableBackgroundItemKeyStoreAndSemanticClassification = true, - enablePartialTypeChecking = true, + enablePartialTypeChecking = defaultArg enablePartialTypeChecking true, captureIdentifiersWhenParsing = true, documentSource = (if useGetSource then DocumentSource.Custom getSource else DocumentSource.FileSystem), useSyntaxTreeCache = defaultArg useSyntaxTreeCache false, diff --git a/tests/fsharp/typeProviders/negTests/neg2h.bsl b/tests/fsharp/typeProviders/negTests/neg2h.bsl index cd6f4a2a1fc..c710ffaa959 100644 --- a/tests/fsharp/typeProviders/negTests/neg2h.bsl +++ b/tests/fsharp/typeProviders/negTests/neg2h.bsl @@ -1,2 +1,5 @@ -neg2h.fs(4,6,4,7): typecheck error FS0318: The type definitions for type 'A' in the signature and implementation are not compatible because the abbreviations differ: FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<2> versus FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<1> +neg2h.fs(4,6,4,7): typecheck error FS0318: The type definitions for type 'A' in the signature and implementation are not compatible because the abbreviations differ: + FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<2> +versus + FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<1> diff --git a/tests/service/CompletionTests.fs b/tests/service/CompletionTests.fs index 349647e0fa3..f973c434377 100644 --- a/tests/service/CompletionTests.fs +++ b/tests/service/CompletionTests.fs @@ -17,6 +17,15 @@ let assertHasItemWithNames names (completionInfo: DeclarationListInfo) = for name in names do Assert.That(Set.contains name itemNames, $"{name} not found in {itemNames}") +[] +let ``Expr - After record decl`` () = + let info = getCompletionInfo "{ Fi }" (4, 0) """ +type Record = { Field: int } + + +""" + assertHasItemWithNames ["ignore"] info + [] let ``Expr - record - field 01 - anon module`` () = let info = getCompletionInfo "{ Fi }" (4, 3) """ diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index b5324d5611b..5b8da7c30a3 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -2360,8 +2360,10 @@ let ``Test Project14 all symbols`` () = |> Array.map (fun su -> su.Symbol.ToString(), su.Symbol.DisplayName, Project14.cleanFileName su.FileName, tups su.Range, attribsOfSymbolUse su) allUsesOfAllSymbols |> shouldEqual - [|("StructAttribute", "StructAttribute", "file1", ((4, 2), (4, 8)), - ["attribute"]); + [| + ("StructAttribute", "StructAttribute", "file1", ((4, 2), (4, 8)), ["attribute"]); + ("member .ctor", "StructAttribute", "file1", ((4, 2), (4, 8)), []) + ("StructAttribute", "StructAttribute", "file1", ((4, 2), (4, 8)), ["attribute"]); ("member .ctor", "StructAttribute", "file1", ((4, 2), (4, 8)), []); ("int", "int", "file1", ((5, 9), (5, 12)), ["type"]); ("int", "int", "file1", ((5, 9), (5, 12)), ["type"]); @@ -2514,14 +2516,14 @@ let ``Test Project16 all symbols`` () = |> Array.map (fun su -> su.Symbol.ToString(), su.Symbol.DisplayName, Project16.cleanFileName su.FileName, tups su.Range, attribsOfSymbolUse su, attribsOfSymbol su.Symbol) allUsesOfAllSymbols |> shouldEqual - [|("ClassAttribute", "ClassAttribute", "sig1", ((8, 6), (8, 11)), - ["attribute"], ["class"]); - ("member .ctor", "ClassAttribute", "sig1", ((8, 6), (8, 11)), [], - ["member"]); - ("ClassAttribute", "ClassAttribute", "sig1", ((12, 6), (12, 11)), - ["attribute"], ["class"]); - ("member .ctor", "ClassAttribute", "sig1", ((12, 6), (12, 11)), [], - ["member"]); + [|("ClassAttribute", "ClassAttribute", "sig1", ((8, 6), (8, 11)), ["attribute"], ["class"]); + ("member .ctor", "ClassAttribute", "sig1", ((8, 6), (8, 11)), [], ["member"]); + ("ClassAttribute", "ClassAttribute", "sig1", ((8, 6), (8, 11)), ["attribute"], ["class"]); + ("member .ctor", "ClassAttribute", "sig1", ((8, 6), (8, 11)), [], ["member"]); + ("ClassAttribute", "ClassAttribute", "sig1", ((12, 6), (12, 11)), ["attribute"], ["class"]); + ("member .ctor", "ClassAttribute", "sig1", ((12, 6), (12, 11)), [], ["member"]); + ("ClassAttribute", "ClassAttribute", "sig1", ((12, 6), (12, 11)), ["attribute"], ["class"]); + ("member .ctor", "ClassAttribute", "sig1", ((12, 6), (12, 11)), [], ["member"]); ("int", "int", "sig1", ((16, 19), (16, 22)), ["type"], ["abbrev"]); ("int", "int", "sig1", ((16, 33), (16, 36)), ["type"], ["abbrev"]); ("int", "int", "sig1", ((17, 25), (17, 28)), ["type"], ["abbrev"]); diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs new file mode 100644 index 00000000000..3d306418d47 --- /dev/null +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs @@ -0,0 +1,3 @@ +let (|AP|) + +() diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl new file mode 100644 index 00000000000..684cfa3cfb0 --- /dev/null +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl @@ -0,0 +1,28 @@ +ImplFile + (ParsedImplFileInput + ("/root/ModuleMember/Let 05.fs", false, QualifiedNameOfFile Let 05, [], [], + [SynModuleOrNamespace + ([Let 05], false, AnonModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent + (|AP|, Some (HasParenthesis ((1,4--1,5), (1,9--1,10)))), + false, None, (1,4--1,10)), None, + ArbitraryAfterError ("localBinding2", (1,10--1,10)), + (1,4--1,10), Yes (1,0--1,10), + { LeadingKeyword = Let (1,0--1,3) + InlineKeyword = None + EqualsRange = None })], (1,0--1,10)); + Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], + None, (1,0--3,2), { LeadingKeyword = None })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) + +(3,0)-(3,1) parse error Incomplete structured construct at or before this point in binding. Expected '=' or other token. +(1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Let 05' based on the file name 'Let 05.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl index d3f6d9d59f8..be0b81e8577 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl @@ -16,12 +16,12 @@ ImplFile (SynIdent (|Boolean|_|, Some (HasParenthesis ((2,4--2,5), (2,16--2,17)))), false, - None, (2,5--2,16)), None, + None, (2,4--2,17)), None, LongIdent (false, SynLongIdent ([Boolean; parse], [(2,27--2,28)], [None; None]), None, - (2,20--2,33)), (2,5--2,16), Yes (2,0--2,33), + (2,20--2,33)), (2,4--2,17), Yes (2,0--2,33), { LeadingKeyword = Let (2,0--2,3) InlineKeyword = None EqualsRange = Some (2,18--2,19) })], (2,0--2,33))], diff --git a/tests/service/data/TestTP/ProvidedTypes.fs b/tests/service/data/TestTP/ProvidedTypes.fs index 828235a0b9d..9cd4c0dc0a2 100644 --- a/tests/service/data/TestTP/ProvidedTypes.fs +++ b/tests/service/data/TestTP/ProvidedTypes.fs @@ -3221,7 +3221,6 @@ module internal AssemblyReader = override __.ToString() = "" [] - [] type ILTableName(idx: int) = member __.Index = idx diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs index ae593e9961a..e787194a7b6 100644 --- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs @@ -2961,7 +2961,6 @@ namespace ProviderImplementation.ProvidedTypes.AssemblyReader override _.ToString() = "" [] - [] type ILTableName(idx: int) = member _.Index = idx diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 5510d3dcb9c..56f95a12ba0 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -10,6 +10,7 @@ true true true + false false nunit true