From 8117bda32cd75de480fbccab6ae32b38640e3d8e Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 14:22:52 +0100 Subject: [PATCH 1/8] Initial DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData --- src/Compiler/Checking/SignatureConformance.fs | 11 +++++++++-- src/Compiler/Checking/SignatureConformance.fsi | 8 ++++++++ src/Compiler/Driver/CompilerDiagnostics.fs | 16 ++++++++++++++++ src/Compiler/FSComp.txt | 1 - src/Compiler/FSStrings.resx | 3 +++ src/Compiler/Symbols/FSharpDiagnostic.fs | 12 ++++++++++++ src/Compiler/Symbols/FSharpDiagnostic.fsi | 8 ++++++++ 7 files changed, 56 insertions(+), 3 deletions(-) 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..6c7a710a1fc 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,6 +321,7 @@ type Exception with | BadEventTransformation _ -> 91 | HashLoadedScriptConsideredSource _ -> 92 | UnresolvedConversionOperator _ -> 93 + | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer _ -> 318 | ArgumentsInSigAndImplMismatch _ -> 3218 // avoid 94-100 for safety | ObsoleteError _ -> 101 @@ -606,6 +608,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 +1862,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 52a5a184823..98863c9ee4c 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..c6bf9cc8ecf 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: {2} versus {3} + keyword 'while!' diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index 2c27e7e2ff3..8f8e65aae5d 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -106,6 +106,15 @@ 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 + /// Range of the entire signature type abbreviation. + member x.SignatureTypeRange: range = signatureType.Range + /// Range of the entire implementation type abbreviation. + member x.ImplementationRange: range = implementationType.Range open ExtendedData @@ -191,6 +200,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..5c805c8464d 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 entire signature type abbreviation. + member SignatureTypeRange: range + /// Range of the entire implementation type abbreviation. + member ImplementationRange: range + open ExtendedData /// Represents a diagnostic produced by the F# compiler From aabaeabc45309fc0037bff21467fe6793dcb0cb8 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 14:46:01 +0100 Subject: [PATCH 2/8] Add unit test --- src/Compiler/Symbols/FSharpDiagnostic.fs | 2 +- src/Compiler/Symbols/FSharpDiagnostic.fsi | 6 ++-- 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 +++ 31 files changed, 115 insertions(+), 69 deletions(-) diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index 8f8e65aae5d..fd43b3ed3fe 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -112,7 +112,7 @@ module ExtendedData = internal(signatureType: Tycon, implementationType: Tycon) = interface IFSharpDiagnosticExtendedData /// Range of the entire signature type abbreviation. - member x.SignatureTypeRange: range = signatureType.Range + member x.SignatureRange: range = signatureType.Range /// Range of the entire implementation type abbreviation. member x.ImplementationRange: range = implementationType.Range diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi index 5c805c8464d..6c941bdd84d 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fsi +++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi @@ -104,9 +104,9 @@ module public ExtendedData = [] type DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData = interface IFSharpDiagnosticExtendedData - /// Range of the entire signature type abbreviation. - member SignatureTypeRange: range - /// Range of the entire implementation type abbreviation. + /// Range of the signature type identifier. + member SignatureRange: range + /// Range of the implementation type identifier. member ImplementationRange: range open ExtendedData diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index c46e652979d..1be68953c67 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -2272,11 +2272,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 56f7493d1d1..1ce9078b59b 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -2272,11 +2272,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 a35a6bce598..91bda9e731e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -2272,11 +2272,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 aeeb53ac93d..06728a9fb05 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -2272,11 +2272,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 390160ee95e..a7945d9c061 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -2272,11 +2272,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 e57dac6f312..bfa88bbfeab 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -2272,11 +2272,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 2d6a4e5e22b..75cb9bdb14a 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -2272,11 +2272,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 db56cd3ba49..95765264f01 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -2272,11 +2272,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 7566fb49ae1..dc9f909668b 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -2272,11 +2272,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 90c39f565ee..59eb4736ff4 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -2272,11 +2272,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 496bc35ef95..c2fc343d3d2 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -2272,11 +2272,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 94bd2ea062c..40edf3bb6b6 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -2272,11 +2272,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 9334199ba0f..9efe1c99169 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -2272,11 +2272,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..61e0710b4a8 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..575869727fa 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..342c763db06 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..28dae0118b2 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..2274fecd4ac 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..213ae426ee2 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..e3e84d4bdbd 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..2bd3d69de44 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..ef48d9f15ca 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..a33c017f20f 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..67ef889000d 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..b55f2ee0955 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..83e68caeb06 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: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {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..cde40678790 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: {| bar: int; x: int |} versus {| 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 From 7b27b8937704f2836b4af7ff3978680f0ad30a12 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 14:53:23 +0100 Subject: [PATCH 3/8] Add release note --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 1 + 1 file changed, 1 insertion(+) 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 35cb6319ddc..dbfd8ad316e 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 From a4d9afc633becdae3d5593bae6f40bc244fe82f5 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 18:19:35 +0100 Subject: [PATCH 4/8] Only keep comments on signature file. --- src/Compiler/Symbols/FSharpDiagnostic.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index fd43b3ed3fe..46566d61bbf 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -111,9 +111,7 @@ module ExtendedData = type DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData internal(signatureType: Tycon, implementationType: Tycon) = interface IFSharpDiagnosticExtendedData - /// Range of the entire signature type abbreviation. member x.SignatureRange: range = signatureType.Range - /// Range of the entire implementation type abbreviation. member x.ImplementationRange: range = implementationType.Range open ExtendedData From ea21b498c7f1597fd549adc0787bd8d9d6d4c8f5 Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 18:21:59 +0100 Subject: [PATCH 5/8] Add newlines to diagnostic message. --- src/Compiler/FSStrings.resx | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 4 ++-- src/Compiler/xlf/FSStrings.de.xlf | 4 ++-- src/Compiler/xlf/FSStrings.es.xlf | 4 ++-- src/Compiler/xlf/FSStrings.fr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.it.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ja.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ko.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pl.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ru.xlf | 4 ++-- src/Compiler/xlf/FSStrings.tr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 4 ++-- .../ErrorMessages/ExtendedDiagnosticDataTests.fs | 2 +- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index c6bf9cc8ecf..d5e19724c80 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1114,7 +1114,7 @@ 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: {2} versus {3} + 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/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 61e0710b4a8..6a3e83c532a 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 575869727fa..8777c4ab388 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 342c763db06..6484fb847fb 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 28dae0118b2..3b15aaca563 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 2274fecd4ac..304025244e0 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 213ae426ee2..31ba40fcb3d 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index e3e84d4bdbd..f0bbe7c8aae 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 2bd3d69de44..3020002ce7c 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index ef48d9f15ca..b5647b8d0eb 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index a33c017f20f..b47eb92bdc3 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 67ef889000d..2fc08de7f13 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index b55f2ee0955..f81bb2b61c7 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 83e68caeb06..d0de30dc7ff 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -8,8 +8,8 @@ - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + 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} diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs index cde40678790..65a1cceb43d 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs @@ -237,7 +237,7 @@ type Foo = {| bar: int; x: int |} |> 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: {| bar: int; x: int |} versus {| bar: int |}") + (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) From 2d75e0d40a6c21cdb53821c5a434c720549c1a0a Mon Sep 17 00:00:00 2001 From: nojaf Date: Tue, 5 Mar 2024 19:44:21 +0100 Subject: [PATCH 6/8] Update bsl test --- tests/fsharp/typeProviders/negTests/neg2h.bsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/fsharp/typeProviders/negTests/neg2h.bsl b/tests/fsharp/typeProviders/negTests/neg2h.bsl index cd6f4a2a1fc..5b2e5434a42 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 aed8a8dd1b9f4bec2aef0f6217ced8df66cbfee0 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 6 Mar 2024 13:58:49 +0100 Subject: [PATCH 7/8] =?UTF-8?q?Ah=20yes,=20that=20additional=20space=20?= =?UTF-8?q?=F0=9F=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fsharp/typeProviders/negTests/neg2h.bsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharp/typeProviders/negTests/neg2h.bsl b/tests/fsharp/typeProviders/negTests/neg2h.bsl index 5b2e5434a42..c710ffaa959 100644 --- a/tests/fsharp/typeProviders/negTests/neg2h.bsl +++ b/tests/fsharp/typeProviders/negTests/neg2h.bsl @@ -1,5 +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> + FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<2> versus FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<1> From e9cc80828602c3d8368de800d0f9a00dddb0fcd5 Mon Sep 17 00:00:00 2001 From: nojaf Date: Fri, 8 Mar 2024 20:15:09 +0100 Subject: [PATCH 8/8] Sort numbers --- src/Compiler/Driver/CompilerDiagnostics.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 6c7a710a1fc..596ea9f085d 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -321,8 +321,7 @@ type Exception with | BadEventTransformation _ -> 91 | HashLoadedScriptConsideredSource _ -> 92 | UnresolvedConversionOperator _ -> 93 - | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer _ -> 318 - | ArgumentsInSigAndImplMismatch _ -> 3218 + // avoid 94-100 for safety | ObsoleteError _ -> 101 #if !NO_TYPEPROVIDERS @@ -330,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 @@ -337,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