From 04ddfad51cdb5b8076b01333a300201c7e3564f8 Mon Sep 17 00:00:00 2001 From: Rustam Date: Mon, 11 Mar 2024 20:57:07 +0300 Subject: [PATCH 1/6] Add missing files to Docs (#16848) --- FSharp.sln | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) 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} From 4fde5da13a191d68c10ad7d92b445c0221de672c Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 11 Mar 2024 19:51:02 +0100 Subject: [PATCH 2/6] Type abbreviation mismatch extended data (#16811) --- .../.FSharp.Compiler.Service/8.0.300.md | 1 + src/Compiler/Checking/SignatureConformance.fs | 11 ++++-- .../Checking/SignatureConformance.fsi | 8 +++++ src/Compiler/Driver/CompilerDiagnostics.fs | 21 +++++++++-- src/Compiler/FSComp.txt | 1 - src/Compiler/FSStrings.resx | 3 ++ src/Compiler/Symbols/FSharpDiagnostic.fs | 10 ++++++ src/Compiler/Symbols/FSharpDiagnostic.fsi | 8 +++++ src/Compiler/xlf/FSComp.txt.cs.xlf | 5 --- src/Compiler/xlf/FSComp.txt.de.xlf | 5 --- src/Compiler/xlf/FSComp.txt.es.xlf | 5 --- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 --- src/Compiler/xlf/FSComp.txt.it.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 --- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 --- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 --- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 --- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 --- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 --- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 --- src/Compiler/xlf/FSStrings.cs.xlf | 5 +++ src/Compiler/xlf/FSStrings.de.xlf | 5 +++ src/Compiler/xlf/FSStrings.es.xlf | 5 +++ src/Compiler/xlf/FSStrings.fr.xlf | 5 +++ src/Compiler/xlf/FSStrings.it.xlf | 5 +++ src/Compiler/xlf/FSStrings.ja.xlf | 5 +++ src/Compiler/xlf/FSStrings.ko.xlf | 5 +++ src/Compiler/xlf/FSStrings.pl.xlf | 5 +++ src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 +++ src/Compiler/xlf/FSStrings.ru.xlf | 5 +++ src/Compiler/xlf/FSStrings.tr.xlf | 5 +++ src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 +++ src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 +++ .../ExtendedDiagnosticDataTests.fs | 36 +++++++++++++++++++ ...ervice.SurfaceArea.netstandard20.debug.bsl | 5 +++ ...vice.SurfaceArea.netstandard20.release.bsl | 5 +++ tests/fsharp/typeProviders/negTests/neg2h.bsl | 5 ++- 38 files changed, 173 insertions(+), 71 deletions(-) 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..f14715ddf7c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -26,6 +26,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/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..838ead87857 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" 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/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/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 66205091123..8d023b7157f 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -2277,11 +2277,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..a64e570f7b9 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -2277,11 +2277,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..77d35305506 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -2277,11 +2277,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..03ce9378c00 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -2277,11 +2277,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..2344a13f7a1 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -2277,11 +2277,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..53c737bbfcf 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -2277,11 +2277,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..5ff6910f893 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -2277,11 +2277,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..266d64c82cd 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -2277,11 +2277,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..345fd834ac0 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -2277,11 +2277,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..8daa89725d2 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -2277,11 +2277,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..b062ac01ce4 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -2277,11 +2277,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..b8a8910a995 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -2277,11 +2277,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..bbf312f436b 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -2277,11 +2277,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/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.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 3c4b22f76c1..cdbdb81bda0 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 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..cdbdb81bda0 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 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> From 73e331ab166b1bfd1c4822260f166e40039df3fe Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:32:08 +0100 Subject: [PATCH 3/6] deflake GetAllUsesOfAllSymbols test (#16858) --- .../FSharpChecker/CommonWorkflows.fs | 3 +-- tests/FSharp.Test.Utilities/ProjectGeneration.fs | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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.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, From be658c56fe5436b6b3dd8ac291ef118f8f9cc4eb Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 12 Mar 2024 11:01:25 +0100 Subject: [PATCH 4/6] Completion: don't prevent getting items after record definition (#16813) * Completion: don't prevent getting items after record definition * Release notes * Fantomas * Add test --------- Co-authored-by: Vlad Zarytovskii --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 1 + src/Compiler/Service/ServiceParsedInputOps.fs | 8 ++++++-- tests/service/CompletionTests.fs | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) 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 f14715ddf7c..29d414d88f4 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,7 @@ * 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)) +* Fix broken code completion after a record type declaration ([PR #16813]([Title](https://github.com/dotnet/fsharp/pull/16813))) ### Added 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/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) """ From 9669913821972b3d278b76f8b0006ba194827140 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 12 Mar 2024 14:16:39 +0100 Subject: [PATCH 5/6] Parser: fix pattern range for idents with trivia (#16824) * Parser: fix pattern range for idents with trivia * Release notes * Surface area --------- Co-authored-by: Petr Co-authored-by: Vlad Zarytovskii --- .../.FSharp.Compiler.Service/8.0.300.md | 3 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 14 +++++++++- src/Compiler/SyntaxTree/SyntaxTree.fsi | 5 +++- src/Compiler/pars.fsy | 3 +- ...ervice.SurfaceArea.netstandard20.debug.bsl | 2 ++ ...vice.SurfaceArea.netstandard20.release.bsl | 2 ++ .../data/SyntaxTree/ModuleMember/Let 05.fs | 3 ++ .../SyntaxTree/ModuleMember/Let 05.fs.bsl | 28 +++++++++++++++++++ ...ePatternDefinitionWithoutParameters.fs.bsl | 4 +-- 9 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 tests/service/data/SyntaxTree/ModuleMember/Let 05.fs create mode 100644 tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl 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 29d414d88f4..460e58b0fdc 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -16,7 +16,8 @@ * 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)) -* Fix broken code completion after a record type declaration ([PR #16813]([Title](https://github.com/dotnet/fsharp/pull/16813))) +* 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 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/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 cdbdb81bda0..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 @@ -7534,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 cdbdb81bda0..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 @@ -7534,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/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))], From 3c5605cddaff84c29d982a78ad286a51b476562d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 18 Mar 2024 15:33:10 +0100 Subject: [PATCH 6/6] il tests reflecting visibility change --- .../Nullness/AnonRecords.fs.il.net472.bsl | 105 +++++++++--------- .../Nullness/AnonRecords.fs.il.netcore.bsl | 90 +++++++-------- .../Nullness/CustomType.fs.il.net472.bsl | 96 +++++++++------- .../Nullness/CustomType.fs.il.netcore.bsl | 87 +++++++++------ .../ModuleLevelBindings.fs.il.net472.bsl | 57 +++++----- .../ModuleLevelBindings.fs.il.netcore.bsl | 48 ++++---- 6 files changed, 257 insertions(+), 226 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.net472.bsl index 46a2abb57c3..ed1c23fb398 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.net472.bsl @@ -27,8 +27,10 @@ { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .method public specialname static int32 - get_justInt() cil managed + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 maybeListOfMaybeString@5 + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int32 get_justInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -38,8 +40,7 @@ IL_0002: ret } - .method public specialname static string - get_maybeString() cil managed + .method public specialname static string get_maybeString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -49,17 +50,15 @@ IL_0001: ret } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_maybeListOfMaybeString() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_maybeListOfMaybeString() cil managed { .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$MyTestModule::maybeListOfMaybeString@5 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 MyTestModule::maybeListOfMaybeString@5 IL_0005: ret } - .method public static class '<>f__AnonymousType2430756162`3',int32> - giveMeA() cil managed + .method public static class '<>f__AnonymousType2430756162`3',int32> giveMeA() cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 04 00 00 00 01 02 02 02 00 00 ) @@ -74,8 +73,7 @@ IL_0014: ret } - .method public static class '<>f__AnonymousType2430756162`3' - giveMeB() cil managed + .method public static class '<>f__AnonymousType2430756162`3' giveMeB() cil managed { .maxstack 8 @@ -88,8 +86,7 @@ IL_0014: ret } - .method public static class '<>f__AnonymousType2430756162`3' - giveMeC() cil managed + .method public static class '<>f__AnonymousType2430756162`3' giveMeC() cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 04 00 00 00 01 02 02 02 00 00 ) @@ -104,6 +101,29 @@ IL_0014: ret } + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$MyTestModule::init@ + IL_0006: ldsfld int32 ''.$MyTestModule::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call string MyTestModule::get_maybeString() + IL_0005: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_000f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 MyTestModule::maybeListOfMaybeString@5 + IL_0014: ret + } + .property int32 justInt() { .get int32 MyTestModule::get_justInt() @@ -126,24 +146,16 @@ extends [runtime]System.Object { .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field static assembly initonly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 maybeListOfMaybeString@5 - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field static assembly int32 init@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: call string MyTestModule::get_maybeString() - IL_0005: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$MyTestModule::maybeListOfMaybeString@5 - IL_0014: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } } @@ -193,8 +205,7 @@ IL_001b: ret } - .method public hidebysig specialname instance !'j__TPar' - get_A() cil managed + .method public hidebysig specialname instance !'j__TPar' get_A() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -205,8 +216,7 @@ IL_0006: ret } - .method public hidebysig specialname instance !'j__TPar' - get_B() cil managed + .method public hidebysig specialname instance !'j__TPar' get_B() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -217,8 +227,7 @@ IL_0006: ret } - .method public hidebysig specialname instance !'j__TPar' - get_C() cil managed + .method public hidebysig specialname instance !'j__TPar' get_C() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -229,8 +238,7 @@ IL_0006: ret } - .method public strict virtual instance string - ToString() cil managed + .method public strict virtual instance string ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -243,8 +251,7 @@ IL_0015: ret } - .method public hidebysig virtual final - instance int32 CompareTo(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed + .method public hidebysig virtual final instance int32 CompareTo(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -327,8 +334,7 @@ IL_006d: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed + .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -435,8 +441,7 @@ IL_0074: ret } - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig virtual final instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -502,8 +507,7 @@ IL_0059: ret } - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed + .method public hidebysig virtual final instance int32 GetHashCode() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -583,8 +587,7 @@ IL_0059: ret } - .method public hidebysig virtual final - instance bool Equals(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed + .method public hidebysig virtual final instance bool Equals(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -637,8 +640,7 @@ IL_004d: ret } - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed + .method public hidebysig virtual final instance bool Equals(object obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -734,8 +736,7 @@ IL_0014: ret } - .method public hidebysig specialname instance class [runtime]System.Type - get_Type() cil managed + .method public hidebysig specialname instance class [runtime]System.Type get_Type() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -746,8 +747,7 @@ IL_0006: ret } - .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes - get_MemberType() cil managed + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes get_MemberType() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -781,8 +781,7 @@ .field public uint8[] NullableFlags .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 scalarByteValue) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 scalarByteValue) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -801,8 +800,7 @@ IL_0016: ret } - .method public specialname rtspecialname - instance void .ctor(uint8[] NullableFlags) cil managed + .method public specialname rtspecialname instance void .ctor(uint8[] NullableFlags) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -825,8 +823,7 @@ .field public uint8 Flag .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 Flag) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 Flag) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.netcore.bsl index 4fef0ae7baf..c5181276c5b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/AnonRecords.fs.il.netcore.bsl @@ -27,8 +27,10 @@ { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .method public specialname static int32 - get_justInt() cil managed + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 maybeListOfMaybeString@5 + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int32 get_justInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -38,8 +40,7 @@ IL_0002: ret } - .method public specialname static string - get_maybeString() cil managed + .method public specialname static string get_maybeString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -49,17 +50,15 @@ IL_0001: ret } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_maybeListOfMaybeString() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_maybeListOfMaybeString() cil managed { .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$MyTestModule::maybeListOfMaybeString@5 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 MyTestModule::maybeListOfMaybeString@5 IL_0005: ret } - .method public static class '<>f__AnonymousType2430756162`3',int32> - giveMeA() cil managed + .method public static class '<>f__AnonymousType2430756162`3',int32> giveMeA() cil managed { .param [0] .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 04 00 00 00 01 02 02 02 00 00 ) @@ -74,8 +73,7 @@ IL_0014: ret } - .method public static class '<>f__AnonymousType2430756162`3' - giveMeB() cil managed + .method public static class '<>f__AnonymousType2430756162`3' giveMeB() cil managed { .maxstack 8 @@ -88,8 +86,7 @@ IL_0014: ret } - .method public static class '<>f__AnonymousType2430756162`3' - giveMeC() cil managed + .method public static class '<>f__AnonymousType2430756162`3' giveMeC() cil managed { .param [0] .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 04 00 00 00 01 02 02 02 00 00 ) @@ -104,6 +101,29 @@ IL_0014: ret } + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$MyTestModule::init@ + IL_0006: ldsfld int32 ''.$MyTestModule::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call string MyTestModule::get_maybeString() + IL_0005: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_000f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 MyTestModule::maybeListOfMaybeString@5 + IL_0014: ret + } + .property int32 justInt() { .get int32 MyTestModule::get_justInt() @@ -126,24 +146,16 @@ extends [runtime]System.Object { .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field static assembly initonly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 maybeListOfMaybeString@5 - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field static assembly int32 init@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: call string MyTestModule::get_maybeString() - IL_0005: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$MyTestModule::maybeListOfMaybeString@5 - IL_0014: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } } @@ -193,8 +205,7 @@ IL_001b: ret } - .method public hidebysig specialname instance !'j__TPar' - get_A() cil managed + .method public hidebysig specialname instance !'j__TPar' get_A() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -205,8 +216,7 @@ IL_0006: ret } - .method public hidebysig specialname instance !'j__TPar' - get_B() cil managed + .method public hidebysig specialname instance !'j__TPar' get_B() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -217,8 +227,7 @@ IL_0006: ret } - .method public hidebysig specialname instance !'j__TPar' - get_C() cil managed + .method public hidebysig specialname instance !'j__TPar' get_C() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -229,8 +238,7 @@ IL_0006: ret } - .method public strict virtual instance string - ToString() cil managed + .method public strict virtual instance string ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -243,8 +251,7 @@ IL_0015: ret } - .method public hidebysig virtual final - instance int32 CompareTo(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed + .method public hidebysig virtual final instance int32 CompareTo(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -327,8 +334,7 @@ IL_006d: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed + .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -435,8 +441,7 @@ IL_0074: ret } - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig virtual final instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -502,8 +507,7 @@ IL_0059: ret } - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed + .method public hidebysig virtual final instance int32 GetHashCode() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -583,8 +587,7 @@ IL_0059: ret } - .method public hidebysig virtual final - instance bool Equals(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed + .method public hidebysig virtual final instance bool Equals(class '<>f__AnonymousType2430756162`3'j__TPar',!'j__TPar',!'j__TPar'> obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -637,8 +640,7 @@ IL_004d: ret } - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed + .method public hidebysig virtual final instance bool Equals(object obj) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.net472.bsl index e7727e1c38b..1437ae540da 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.net472.bsl @@ -26,6 +26,7 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) .class auto ansi serializable nested public Myassembly extends [runtime]System.Object { @@ -66,8 +67,7 @@ IL_001e: ret } - .method public hidebysig specialname - instance string get_Nullable() cil managed + .method public hidebysig specialname instance string get_Nullable() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -80,8 +80,7 @@ IL_0006: ret } - .method public hidebysig specialname - instance string get_NonNullable() cil managed + .method public hidebysig specialname instance string get_NonNullable() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -92,8 +91,7 @@ IL_0006: ret } - .method public hidebysig specialname - instance int32 get_JustSomeInt() cil managed + .method public hidebysig specialname instance int32 get_JustSomeInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -122,16 +120,14 @@ IL_0005: ret } - .method public hidebysig instance void - UnitFunc() cil managed + .method public hidebysig instance void UnitFunc() cil managed { .maxstack 8 IL_0000: ret } - .method public hidebysig instance class MyTestModule/Myassembly - GetThis() cil managed + .method public hidebysig instance class MyTestModule/Myassembly GetThis() cil managed { .maxstack 8 @@ -139,8 +135,7 @@ IL_0001: ret } - .method public hidebysig instance class MyTestModule/Myassembly - GetThisOrNull() cil managed + .method public hidebysig instance class MyTestModule/Myassembly GetThisOrNull() cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -150,8 +145,7 @@ IL_0001: ret } - .method public hidebysig specialname - instance string get_Item(string index) cil managed + .method public hidebysig specialname instance string get_Item(string index) cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -209,8 +203,7 @@ IL_0033: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 @@ -221,6 +214,28 @@ IL_000c: ret } + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldstr "" + IL_0005: stsfld string MyTestModule/Myassembly::uglyGlobalMutableString + IL_000a: ldc.i4.2 + IL_000b: volatile. + IL_000d: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0012: ldnull + IL_0013: stsfld string MyTestModule/Myassembly::uglyGlobalMutableNullableString + IL_0018: ldc.i4.3 + IL_0019: volatile. + IL_001b: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::Empty() + IL_0025: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 MyTestModule/Myassembly::dict + IL_002a: ldc.i4.4 + IL_002b: volatile. + IL_002d: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0032: ret + } + .property instance string Nullable() { .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -243,6 +258,25 @@ } } + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$MyTestModule::init@ + IL_0006: ldsfld int32 ''.$MyTestModule::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call void MyTestModule/Myassembly::staticInitialization@() + IL_0005: ret + } + } .class private abstract auto ansi sealed ''.$MyTestModule @@ -253,27 +287,12 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: ldstr "" - IL_0005: stsfld string MyTestModule/Myassembly::uglyGlobalMutableString - IL_000a: ldc.i4.2 - IL_000b: volatile. - IL_000d: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0012: ldnull - IL_0013: stsfld string MyTestModule/Myassembly::uglyGlobalMutableNullableString - IL_0018: ldc.i4.3 - IL_0019: volatile. - IL_001b: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::Empty() - IL_0025: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 MyTestModule/Myassembly::dict - IL_002a: ldc.i4.4 - IL_002b: volatile. - IL_002d: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0032: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } } @@ -285,8 +304,7 @@ .field public uint8[] NullableFlags .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 scalarByteValue) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 scalarByteValue) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -305,8 +323,7 @@ IL_0016: ret } - .method public specialname rtspecialname - instance void .ctor(uint8[] NullableFlags) cil managed + .method public specialname rtspecialname instance void .ctor(uint8[] NullableFlags) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -329,8 +346,7 @@ .field public uint8 Flag .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 Flag) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 Flag) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.netcore.bsl index 8918c6939f0..234a052c5e9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/CustomType.fs.il.netcore.bsl @@ -26,6 +26,7 @@ extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) .class auto ansi serializable nested public Myassembly extends [runtime]System.Object { @@ -66,8 +67,7 @@ IL_001e: ret } - .method public hidebysig specialname - instance string get_Nullable() cil managed + .method public hidebysig specialname instance string get_Nullable() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -80,8 +80,7 @@ IL_0006: ret } - .method public hidebysig specialname - instance string get_NonNullable() cil managed + .method public hidebysig specialname instance string get_NonNullable() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -92,8 +91,7 @@ IL_0006: ret } - .method public hidebysig specialname - instance int32 get_JustSomeInt() cil managed + .method public hidebysig specialname instance int32 get_JustSomeInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -122,16 +120,14 @@ IL_0005: ret } - .method public hidebysig instance void - UnitFunc() cil managed + .method public hidebysig instance void UnitFunc() cil managed { .maxstack 8 IL_0000: ret } - .method public hidebysig instance class MyTestModule/Myassembly - GetThis() cil managed + .method public hidebysig instance class MyTestModule/Myassembly GetThis() cil managed { .maxstack 8 @@ -139,8 +135,7 @@ IL_0001: ret } - .method public hidebysig instance class MyTestModule/Myassembly - GetThisOrNull() cil managed + .method public hidebysig instance class MyTestModule/Myassembly GetThisOrNull() cil managed { .param [0] .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -150,8 +145,7 @@ IL_0001: ret } - .method public hidebysig specialname - instance string get_Item(string index) cil managed + .method public hidebysig specialname instance string get_Item(string index) cil managed { .param [0] .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -209,8 +203,7 @@ IL_0033: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 @@ -221,6 +214,28 @@ IL_000c: ret } + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldstr "" + IL_0005: stsfld string MyTestModule/Myassembly::uglyGlobalMutableString + IL_000a: ldc.i4.2 + IL_000b: volatile. + IL_000d: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0012: ldnull + IL_0013: stsfld string MyTestModule/Myassembly::uglyGlobalMutableNullableString + IL_0018: ldc.i4.3 + IL_0019: volatile. + IL_001b: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::Empty() + IL_0025: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 MyTestModule/Myassembly::dict + IL_002a: ldc.i4.4 + IL_002b: volatile. + IL_002d: stsfld int32 MyTestModule/Myassembly::init@6 + IL_0032: ret + } + .property instance string Nullable() { .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) @@ -243,6 +258,25 @@ } } + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$MyTestModule::init@ + IL_0006: ldsfld int32 ''.$MyTestModule::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call void MyTestModule/Myassembly::staticInitialization@() + IL_0005: ret + } + } .class private abstract auto ansi sealed ''.$MyTestModule @@ -253,27 +287,12 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: ldstr "" - IL_0005: stsfld string MyTestModule/Myassembly::uglyGlobalMutableString - IL_000a: ldc.i4.2 - IL_000b: volatile. - IL_000d: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0012: ldnull - IL_0013: stsfld string MyTestModule/Myassembly::uglyGlobalMutableNullableString - IL_0018: ldc.i4.3 - IL_0019: volatile. - IL_001b: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::Empty() - IL_0025: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 MyTestModule/Myassembly::dict - IL_002a: ldc.i4.4 - IL_002b: volatile. - IL_002d: stsfld int32 MyTestModule/Myassembly::init@6 - IL_0032: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.net472.bsl index b2e69c91ff5..da49015055d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.net472.bsl @@ -31,8 +31,10 @@ .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public specialname static string - get_notNullStringField() cil managed + .field static assembly string nullableMutableStringField@6 + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static string get_notNullStringField() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -42,8 +44,7 @@ IL_0005: ret } - .method public specialname static string - get_nullableStringField() cil managed + .method public specialname static string get_nullableStringField() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -53,27 +54,24 @@ IL_0001: ret } - .method public specialname static string - get_nullableMutableStringField() cil managed + .method public specialname static string get_nullableMutableStringField() cil managed { .maxstack 8 - IL_0000: ldsfld string ''.$MyTestModule::nullableMutableStringField@6 + IL_0000: ldsfld string MyTestModule::nullableMutableStringField@6 IL_0005: ret } - .method public specialname static void - set_nullableMutableStringField(string 'value') cil managed + .method public specialname static void set_nullableMutableStringField(string 'value') cil managed { .maxstack 8 IL_0000: ldarg.0 - IL_0001: stsfld string ''.$MyTestModule::nullableMutableStringField@6 + IL_0001: stsfld string MyTestModule::nullableMutableStringField@6 IL_0006: ret } - .method public specialname static valuetype [runtime]System.Nullable`1 - get_nullableInt() cil managed + .method public specialname static valuetype [runtime]System.Nullable`1 get_nullableInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -84,8 +82,7 @@ IL_0001: ret } - .method public specialname static int32 - get_regularInt() cil managed + .method public specialname static int32 get_regularInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -95,8 +92,7 @@ IL_0002: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 @@ -107,6 +103,15 @@ IL_000c: ret } + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: stsfld string MyTestModule::nullableMutableStringField@6 + IL_0006: ret + } + .property string notNullStringField() { .get string MyTestModule::get_notNullStringField() @@ -138,21 +143,16 @@ extends [runtime]System.Object { .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field static assembly string nullableMutableStringField@6 - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field static assembly int32 init@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: ldnull - IL_0001: stsfld string ''.$MyTestModule::nullableMutableStringField@6 - IL_0006: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } } @@ -164,8 +164,7 @@ .field public uint8[] NullableFlags .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 scalarByteValue) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 scalarByteValue) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -184,8 +183,7 @@ IL_0016: ret } - .method public specialname rtspecialname - instance void .ctor(uint8[] NullableFlags) cil managed + .method public specialname rtspecialname instance void .ctor(uint8[] NullableFlags) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -208,8 +206,7 @@ .field public uint8 Flag .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(uint8 Flag) cil managed + .method public specialname rtspecialname instance void .ctor(uint8 Flag) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.netcore.bsl index 3878ca14c07..16f1a590042 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ModuleLevelBindings.fs.il.netcore.bsl @@ -31,8 +31,10 @@ .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public specialname static string - get_notNullStringField() cil managed + .field static assembly string nullableMutableStringField@6 + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static string get_notNullStringField() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -42,8 +44,7 @@ IL_0005: ret } - .method public specialname static string - get_nullableStringField() cil managed + .method public specialname static string get_nullableStringField() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -53,27 +54,24 @@ IL_0001: ret } - .method public specialname static string - get_nullableMutableStringField() cil managed + .method public specialname static string get_nullableMutableStringField() cil managed { .maxstack 8 - IL_0000: ldsfld string ''.$MyTestModule::nullableMutableStringField@6 + IL_0000: ldsfld string MyTestModule::nullableMutableStringField@6 IL_0005: ret } - .method public specialname static void - set_nullableMutableStringField(string 'value') cil managed + .method public specialname static void set_nullableMutableStringField(string 'value') cil managed { .maxstack 8 IL_0000: ldarg.0 - IL_0001: stsfld string ''.$MyTestModule::nullableMutableStringField@6 + IL_0001: stsfld string MyTestModule::nullableMutableStringField@6 IL_0006: ret } - .method public specialname static valuetype [runtime]System.Nullable`1 - get_nullableInt() cil managed + .method public specialname static valuetype [runtime]System.Nullable`1 get_nullableInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -84,8 +82,7 @@ IL_0001: ret } - .method public specialname static int32 - get_regularInt() cil managed + .method public specialname static int32 get_regularInt() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -95,8 +92,7 @@ IL_0002: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 @@ -107,6 +103,15 @@ IL_000c: ret } + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: stsfld string MyTestModule::nullableMutableStringField@6 + IL_0006: ret + } + .property string notNullStringField() { .get string MyTestModule::get_notNullStringField() @@ -138,21 +143,16 @@ extends [runtime]System.Object { .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field static assembly string nullableMutableStringField@6 - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field static assembly int32 init@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 - IL_0000: ldnull - IL_0001: stsfld string ''.$MyTestModule::nullableMutableStringField@6 - IL_0006: ret + IL_0000: call void MyTestModule::staticInitialization@() + IL_0005: ret } }