From 970e95c72a52e4c1a4d314118c2324783149235b Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 25 Nov 2016 10:23:36 +0100 Subject: [PATCH 1/3] Add type info to error - references #1574 --- src/fsharp/FSComp.txt | 4 ++-- src/fsharp/SignatureConformance.fs | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 5139a90eae0..fa241085731 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -135,9 +135,9 @@ ValueNotContainedMutabilityInstanceButStatic,"Module '%s' contains\n %s \n 307,DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind,"The %s definitions in the signature and implementation are not compatible because the types are of different kinds" 308,DefinitionsInSigAndImplNotCompatibleILDiffer,"The %s definitions in the signature and implementation are not compatible because the IL representations differ" 309,DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer,"The %s definitions in the signature and implementation are not compatible because the representations differ" -311,DefinitionsInSigAndImplNotCompatibleFieldWasPresent,"The %s definitions in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature" +311,DefinitionsInSigAndImplNotCompatibleFieldWasPresent,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature" 312,DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer,"The %s definitions in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation" -313,DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified,"The %s definitions in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation" +313,DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation" 314,DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig,"The %s definitions in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'." 315,DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl,"The %s definitions 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 in the signature and implementation are not compatible because the abstract member '%s' was present in the implementation but not in the signature" diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 55a573d1e9a..f54679349ef 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -385,13 +385,18 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = // sig for err then checkRecordFieldsForExn. // ------------------------------------------------------------------------------- - and checkRecordFields _g _amap _denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = + and checkRecordFields _g _amap denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = let implFields = implFields.TrueFieldsAsList let sigFields = sigFields.TrueFieldsAsList let m1 = implFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) let m2 = sigFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) - NameMap.suball2 (fun s _ -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, s))); false) (checkField aenv) m1 m2 && - NameMap.suball2 (fun s _ -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldWasPresent(x, s))); false) (fun x y -> checkField aenv y x) m2 m1 && + NameMap.suball2 + (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (checkField aenv) m1 m2 && + NameMap.suball2 + (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldWasPresent(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (fun x y -> checkField aenv y x) m2 m1 && + // This check is required because constructors etc. are externally visible // and thus compiled representations do pick up dependencies on the field order (if List.forall2 (checkField aenv) implFields sigFields @@ -417,12 +422,14 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = (m1,m2) ||> NameMap.suball2 (fun _s vref -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl(x, NicePrint.stringValOrMember denv vref.Deref))); false) (fun _x _y -> true) && (m2,m1) ||> NameMap.suball2 (fun _s vref -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig(x, NicePrint.stringValOrMember denv vref.Deref))); false) (fun _x _y -> true) - and checkClassFields isStruct _g _amap _denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = + and checkClassFields isStruct _g _amap denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = let implFields = implFields.TrueFieldsAsList let sigFields = sigFields.TrueFieldsAsList let m1 = implFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) let m2 = sigFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) - NameMap.suball2 (fun s _ -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, s))); false) (checkField aenv) m1 m2 && + NameMap.suball2 + (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (checkField aenv) m1 m2 && (if isStruct then NameMap.suball2 (fun s _ -> warning(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(x, s))); true) (fun x y -> checkField aenv y x) m2 m1 else From 7dc5696941141c3f19887650aaea30dc53b144d5 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 25 Nov 2016 10:39:46 +0100 Subject: [PATCH 2/3] Add type info to FS0314 --- src/fsharp/FSComp.txt | 2 +- src/fsharp/SignatureConformance.fs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index fa241085731..45ae8a7289f 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -138,7 +138,7 @@ ValueNotContainedMutabilityInstanceButStatic,"Module '%s' contains\n %s \n 311,DefinitionsInSigAndImplNotCompatibleFieldWasPresent,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature" 312,DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer,"The %s definitions in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation" 313,DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation" -314,DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig,"The %s definitions in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'." +314,DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'." 315,DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl,"The %s definitions 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 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 in the signature and implementation are not compatible because the signature declares a %s while the implementation declares a %s" diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index f54679349ef..4cb4d237541 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -431,7 +431,9 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) (checkField aenv) m1 m2 && (if isStruct then - NameMap.suball2 (fun s _ -> warning(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(x, s))); true) (fun x y -> checkField aenv y x) m2 m1 + NameMap.suball2 + (fun fieldName (field:RecdField) -> warning(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); true) + (fun x y -> checkField aenv y x) m2 m1 else true) From fd85c96f6e25c12b7551ae6d42f1816dc0d04ffb Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 25 Nov 2016 13:51:17 +0100 Subject: [PATCH 3/3] Add type info to more SignatureConformance errors --- src/fsharp/FSComp.txt | 58 +++++------ src/fsharp/SignatureConformance.fs | 99 ++++++++++--------- tests/fsharp/typeProviders/negTests/neg2h.bsl | 2 +- tests/fsharp/typecheck/sigs/neg17.bsl | 2 +- tests/fsharp/typecheck/sigs/neg43.bsl | 2 +- tests/fsharp/typecheck/sigs/neg57.bsl | 2 +- tests/fsharp/typecheck/sigs/neg58.bsl | 2 +- .../E_ConsiderAddingSealedAttribute01.fsi | 2 +- 8 files changed, 85 insertions(+), 84 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 45ae8a7289f..812702a3108 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -113,38 +113,38 @@ ValueNotContainedMutabilityOverridesDiffer,"Module '%s' contains\n %s \nbu ValueNotContainedMutabilityOneIsConstructor,"Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a constructor/property and the other is not" ValueNotContainedMutabilityStaticButInstance,"Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member" ValueNotContainedMutabilityInstanceButStatic,"Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member" -290,DefinitionsInSigAndImplNotCompatibleNamesDiffer,"The %s definitions in the signature and implementation are not compatible because the names differ" -291,DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer,"The %s definitions in the signature and implementation are not compatible because the respective type parameter counts differ" -292,DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer,"The %s definitions in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation" -293,DefinitionsInSigAndImplNotCompatibleMissingInterface,"The %s definitions in the signature and implementation are not compatible because the signature requires that the type supports the interface %s but the interface has not been implemented" -294,DefinitionsInSigAndImplNotCompatibleImplementationSaysNull,"The %s definitions in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not" -294,DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2,"The %s definitions in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not" -295,DefinitionsInSigAndImplNotCompatibleSignatureSaysNull,"The %s definitions in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not" -295,DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2,"The %s definitions in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not" -296,DefinitionsInSigAndImplNotCompatibleImplementationSealed,"The %s definitions in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [] attribute to the signature." -297,DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed,"The %s definitions in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [] attribute to the implementation." -298,DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract,"The %s definitions in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [] attribute to the signature." -299,DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract,"The %s definitions in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [] attribute to the implementation." -300,DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes,"The %s definitions in the signature and implementation are not compatible because the types have different base types" -301,DefinitionsInSigAndImplNotCompatibleNumbersDiffer,"The %s definitions in the signature and implementation are not compatible because the number of %ss differ" -302,DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot,"The %s definitions in the signature and implementation are not compatible because the signature defines the %s '%s' but the implementation does not (or does, but not in the same order)" -303,DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot,"The %s definitions in the signature and implementation are not compatible because the implementation defines the %s '%s' but the signature does not (or does, but not in the same order)" -304,DefinitionsInSigAndImplNotCompatibleImplDefinesStruct,"The %s definitions in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation" -305,DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden,"The %s definitions in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature" -306,DefinitionsInSigAndImplNotCompatibleTypeIsHidden,"The %s definitions in the signature and implementation are not compatible because a type representation is being hidden by a signature" -307,DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind,"The %s definitions in the signature and implementation are not compatible because the types are of different kinds" -308,DefinitionsInSigAndImplNotCompatibleILDiffer,"The %s definitions in the signature and implementation are not compatible because the IL representations differ" -309,DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer,"The %s definitions in the signature and implementation are not compatible because the representations differ" +290,DefinitionsInSigAndImplNotCompatibleNamesDiffer,"The %s definitions in the signature and implementation are not compatible because the names differ. The type is called '%s' in the signature file but '%s' in implementation." +291,DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the respective type parameter counts differ" +292,DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation" +293,DefinitionsInSigAndImplNotCompatibleMissingInterface,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature requires that the type supports the interface %s but the interface has not been implemented" +294,DefinitionsInSigAndImplNotCompatibleImplementationSaysNull,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not" +294,DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not" +295,DefinitionsInSigAndImplNotCompatibleSignatureSaysNull,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not" +295,DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not" +296,DefinitionsInSigAndImplNotCompatibleImplementationSealed,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [] attribute to the signature." +297,DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [] attribute to the implementation." +298,DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [] attribute to the signature." +299,DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [] attribute to the implementation." +300,DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes,"The %s definitions for type '%s' in the signature and implementation are not compatible because the types have different base types" +301,DefinitionsInSigAndImplNotCompatibleNumbersDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the number of %ss differ" +302,DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot,"The %s definitions for type '%s' in the signature and implementation are not compatible because the signature defines the %s '%s' but the implementation does not (or does, but not in the same order)" +303,DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines the %s '%s' but the signature does not (or does, but not in the same order)" +304,DefinitionsInSigAndImplNotCompatibleImplDefinesStruct,"The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation" +305,DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden,"The %s definitions for type '%s' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature" +306,DefinitionsInSigAndImplNotCompatibleTypeIsHidden,"The %s definitions for type '%s' in the signature and implementation are not compatible because a type representation is being hidden by a signature" +307,DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind,"The %s definitions for type '%s' in the signature and implementation are not compatible because the types are of different kinds" +308,DefinitionsInSigAndImplNotCompatibleILDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the IL representations differ" +309,DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the representations differ" 311,DefinitionsInSigAndImplNotCompatibleFieldWasPresent,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature" -312,DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer,"The %s definitions in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation" +312,DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer,"The %s definitions for type '%s' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation" 313,DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation" 314,DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig,"The %s definitions for type '%s' in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'." -315,DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl,"The %s definitions 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 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 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 in the signature and implementation are not compatible because the abbreviations differ: %s versus %s" -319,DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig,"The %s definitions 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 in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not" +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" ModuleContainsConstructorButDataFieldsDiffer,"The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe respective number of data fields differ" ModuleContainsConstructorButTypesOfFieldsDiffer,"The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe types of the fields differ" diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 4cb4d237541..823285ef7c6 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -165,17 +165,16 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = // Propagate defn location information from implementation to signature . sigTycon.SetOtherRange (implTycon.Range, true) implTycon.SetOtherRange (sigTycon.Range, false) - let err f = Error(f(implTycon.TypeOrMeasureKind.ToString()), m) - if implTycon.LogicalName <> sigTycon.LogicalName then (errorR (err (FSComp.SR.DefinitionsInSigAndImplNotCompatibleNamesDiffer)); false) else - if implTycon.CompiledName <> sigTycon.CompiledName then (errorR (err (FSComp.SR.DefinitionsInSigAndImplNotCompatibleNamesDiffer)); false) else + if implTycon.LogicalName <> sigTycon.LogicalName then (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleNamesDiffer(implTycon.TypeOrMeasureKind.ToString(),sigTycon.LogicalName,implTycon.LogicalName),m)); false) else + if implTycon.CompiledName <> sigTycon.CompiledName then (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleNamesDiffer(implTycon.TypeOrMeasureKind.ToString(),sigTycon.CompiledName,implTycon.CompiledName),m)); false) else checkExnInfo (fun f -> ExnconstrNotContained(denv,implTycon,sigTycon,f)) aenv implTycon.ExceptionInfo sigTycon.ExceptionInfo && let implTypars = implTycon.Typars m let sigTypars = sigTycon.Typars m if implTypars.Length <> sigTypars.Length then - errorR (err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer)) + errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) false elif isLessAccessible implTycon.Accessibility sigTycon.Accessibility then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) false else let aenv = aenv.BindEquivTypars implTypars sigTypars @@ -193,45 +192,45 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = let fintfs = flatten fintfs let unimpl = ListSet.subtract (fun fity aity -> typeAEquiv g aenv aity fity) fintfs aintfs - (unimpl |> List.forall (fun ity -> errorR (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(x, NicePrint.minimalStringOfType denv ity))); false)) && + (unimpl |> List.forall (fun ity -> errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName, NicePrint.minimalStringOfType denv ity),m)); false)) && let hidden = ListSet.subtract (typeAEquiv g aenv) aintfsUser fintfs hidden |> List.iter (fun ity -> (if implTycon.IsFSharpInterfaceTycon then error else warning) (InterfaceNotRevealed(denv,ity,implTycon.Range))) let aNull = IsUnionTypeWithNullAsTrueValue g implTycon let fNull = IsUnionTypeWithNullAsTrueValue g sigTycon if aNull && not fNull then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) elif fNull && not aNull then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) let aNull2 = TypeNullIsExtraValue g m (generalizedTyconRef (mkLocalTyconRef implTycon)) let fNull2 = TypeNullIsExtraValue g m (generalizedTyconRef (mkLocalTyconRef implTycon)) if aNull2 && not fNull2 then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) elif fNull2 && not aNull2 then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) let aSealed = isSealedTy g (generalizedTyconRef (mkLocalTyconRef implTycon)) let fSealed = isSealedTy g (generalizedTyconRef (mkLocalTyconRef sigTycon)) if aSealed && not fSealed then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSealed)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) if not aSealed && fSealed then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) let aPartial = isAbstractTycon implTycon let fPartial = isAbstractTycon sigTycon if aPartial && not fPartial then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) if not aPartial && fPartial then - errorR(err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) if not (typeAEquiv g aenv (superOfTycon g implTycon) (superOfTycon g sigTycon)) then - errorR (err(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes)) + errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) checkTypars m aenv implTypars sigTypars && - checkTypeRepr err aenv implTycon.TypeReprInfo sigTycon.TypeReprInfo && - checkTypeAbbrev err aenv implTycon.TypeOrMeasureKind sigTycon.TypeOrMeasureKind implTycon.TypeAbbrev sigTycon.TypeAbbrev && + checkTypeRepr m aenv implTycon sigTycon.TypeReprInfo && + checkTypeAbbrev m aenv implTycon sigTycon && checkAttribs aenv implTycon.Attribs sigTycon.Attribs (fun attribs -> implTycon.Data.entity_attribs <- attribs) && checkModuleOrNamespaceContents implTycon.Range aenv (mkLocalEntityRef implTycon) sigTycon.ModuleOrNamespaceType @@ -385,23 +384,23 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = // sig for err then checkRecordFieldsForExn. // ------------------------------------------------------------------------------- - and checkRecordFields _g _amap denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = + and checkRecordFields m aenv (implTycon:Tycon) (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = let implFields = implFields.TrueFieldsAsList let sigFields = sigFields.TrueFieldsAsList let m1 = implFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) let m2 = sigFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) NameMap.suball2 - (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (fun fieldName _ -> errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, fieldName),m)); false) (checkField aenv) m1 m2 && NameMap.suball2 - (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldWasPresent(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (fun fieldName _ -> errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldWasPresent(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, fieldName),m)); false) (fun x y -> checkField aenv y x) m2 m1 && // This check is required because constructors etc. are externally visible // and thus compiled representations do pick up dependencies on the field order (if List.forall2 (checkField aenv) implFields sigFields then true - else (errorR(err (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer)); false)) + else (errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)); false)) and checkRecordFieldsForExn _g _denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = let implFields = implFields.TrueFieldsAsList @@ -416,40 +415,40 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = then true else (errorR(err (FSComp.SR.ExceptionDefsNotCompatibleFieldOrderDiffers)); false)) - and checkVirtualSlots _g denv err _aenv implAbstractSlots sigAbstractSlots = + and checkVirtualSlots denv m (implTycon:Tycon) implAbstractSlots sigAbstractSlots = let m1 = NameMap.ofKeyedList (fun (v:ValRef) -> v.DisplayName) implAbstractSlots let m2 = NameMap.ofKeyedList (fun (v:ValRef) -> v.DisplayName) sigAbstractSlots - (m1,m2) ||> NameMap.suball2 (fun _s vref -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl(x, NicePrint.stringValOrMember denv vref.Deref))); false) (fun _x _y -> true) && - (m2,m1) ||> NameMap.suball2 (fun _s vref -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig(x, NicePrint.stringValOrMember denv vref.Deref))); false) (fun _x _y -> true) + (m1,m2) ||> NameMap.suball2 (fun _s vref -> errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, NicePrint.stringValOrMember denv vref.Deref),m)); false) (fun _x _y -> true) && + (m2,m1) ||> NameMap.suball2 (fun _s vref -> errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, NicePrint.stringValOrMember denv vref.Deref),m)); false) (fun _x _y -> true) - and checkClassFields isStruct _g _amap denv err aenv (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = + and checkClassFields isStruct m aenv (implTycon:Tycon) (implFields:TyconRecdFields) (sigFields:TyconRecdFields) = let implFields = implFields.TrueFieldsAsList let sigFields = sigFields.TrueFieldsAsList let m1 = implFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) let m2 = sigFields |> NameMap.ofKeyedList (fun rfld -> rfld.Name) NameMap.suball2 - (fun fieldName (field:RecdField) -> errorR(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); false) + (fun fieldName _ -> errorR(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, fieldName),m)); false) (checkField aenv) m1 m2 && (if isStruct then NameMap.suball2 - (fun fieldName (field:RecdField) -> warning(err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(x, NicePrint.prettyStringOfTy denv field.rfield_type, fieldName))); true) + (fun fieldName _ -> warning(Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, fieldName),m)); true) (fun x y -> checkField aenv y x) m2 m1 else true) - and checkTypeRepr err aenv implTypeRepr sigTypeRepr = + and checkTypeRepr m aenv (implTycon:Tycon) sigTypeRepr = let reportNiceError k s1 s2 = let aset = NameSet.ofList s1 let fset = NameSet.ofList s2 match Zset.elements (Zset.diff aset fset) with | [] -> match Zset.elements (Zset.diff fset aset) with - | [] -> (errorR (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleNumbersDiffer(x, k))); false) - | l -> (errorR (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot(x, k, String.concat ";" l))); false) - | l -> (errorR (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot(x, k, String.concat ";" l))); false) + | [] -> (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleNumbersDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, k),m)); false) + | l -> (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, k, String.concat ";" l),m)); false) + | l -> (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, k, String.concat ";" l),m)); false) - match implTypeRepr,sigTypeRepr with + match implTycon.TypeReprInfo,sigTypeRepr with | (TRecdRepr _ | TUnionRepr _ | TILObjectRepr _ @@ -461,13 +460,13 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = | (TFSharpObjectRepr r), TNoRepr -> match r.fsobjmodel_kind with | TTyconStruct | TTyconEnum -> - (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplDefinesStruct); false) + (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplDefinesStruct(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) | _ -> true | (TAsmRepr _), TNoRepr -> - (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden); false) + (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) | (TMeasureableRepr _), TNoRepr -> - (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypeIsHidden); false) + (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypeIsHidden(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) | (TUnionRepr r1), (TUnionRepr r2) -> let ucases1 = r1.UnionCasesAsList let ucases2 = r2.UnionCasesAsList @@ -476,7 +475,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = reportNiceError "union case" (names ucases1) (names ucases2) else List.forall2 (checkUnionCase aenv) ucases1 ucases2 | (TRecdRepr implFields), (TRecdRepr sigFields) -> - checkRecordFields g amap denv err aenv implFields sigFields + checkRecordFields m aenv implTycon implFields sigFields | (TFSharpObjectRepr r1), (TFSharpObjectRepr r2) -> if not (match r1.fsobjmodel_kind,r2.fsobjmodel_kind with | TTyconClass,TTyconClass -> true @@ -495,15 +494,15 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = ((ps1,ps2) ||> List.lengthsEqAndForall2 (List.lengthsEqAndForall2 (fun p1 p2 -> typeAEquiv g aenv p1.Type p2.Type))) && (returnTypesAEquiv g aenv rty1 rty2))) | _,_ -> false) then - (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind); false) + (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) else let isStruct = (match r1.fsobjmodel_kind with TTyconStruct -> true | _ -> false) - checkClassFields isStruct g amap denv err aenv r1.fsobjmodel_rfields r2.fsobjmodel_rfields && - checkVirtualSlots g denv err aenv r1.fsobjmodel_vslots r2.fsobjmodel_vslots + checkClassFields isStruct m aenv implTycon r1.fsobjmodel_rfields r2.fsobjmodel_rfields && + checkVirtualSlots denv m implTycon r1.fsobjmodel_vslots r2.fsobjmodel_vslots | (TAsmRepr tcr1), (TAsmRepr tcr2) -> - if tcr1 <> tcr2 then (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleILDiffer); false) else true + if tcr1 <> tcr2 then (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleILDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) else true | (TMeasureableRepr ty1), (TMeasureableRepr ty2) -> - if typeAEquiv g aenv ty1 ty2 then true else (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer); false) + if typeAEquiv g aenv ty1 ty2 then true else (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) | TNoRepr, TNoRepr -> true #if EXTENSIONTYPING | TProvidedTypeExtensionPoint info1 , TProvidedTypeExtensionPoint info2 -> @@ -512,23 +511,25 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = System.Diagnostics.Debug.Assert(false, "unreachable: TProvidedNamespaceExtensionPoint only on namespaces, not types" ) true #endif - | TNoRepr, _ -> (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer); false) - | _, _ -> (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer); false) + | TNoRepr, _ -> (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) + | _, _ -> (errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) - and checkTypeAbbrev err aenv kind1 kind2 implTypeAbbrev sigTypeAbbrev = - if kind1 <> kind2 then (errorR (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer(x, kind2.ToString(), kind1.ToString()))); false) + and checkTypeAbbrev m aenv (implTycon:Tycon) (sigTycon:Tycon) = + let kind1 = implTycon.TypeOrMeasureKind + let kind2 = sigTycon.TypeOrMeasureKind + if kind1 <> kind2 then (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, kind2.ToString(), kind1.ToString()),m)); false) else - match implTypeAbbrev,sigTypeAbbrev with + 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 (err (fun x -> FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(x, s1, s2))) + errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, s1, s2),m)) false else true | None,None -> true - | Some _, None -> (errorR (err (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig)); false) - | None, Some _ -> (errorR (err FSComp.SR.DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation); false) + | Some _, None -> (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) + | None, Some _ -> (errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName),m)); false) and checkModuleOrNamespaceContents m aenv (implModRef:ModuleOrNamespaceRef) (signModType:ModuleOrNamespaceType) = let implModType = implModRef.ModuleOrNamespaceType diff --git a/tests/fsharp/typeProviders/negTests/neg2h.bsl b/tests/fsharp/typeProviders/negTests/neg2h.bsl index afd5527170e..cd6f4a2a1fc 100644 --- a/tests/fsharp/typeProviders/negTests/neg2h.bsl +++ b/tests/fsharp/typeProviders/negTests/neg2h.bsl @@ -1,2 +1,2 @@ -neg2h.fs(4,6,4,7): typecheck error FS0318: The type definitions in the signature and implementation are not compatible because the abbreviations differ: FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<2> versus FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<1> +neg2h.fs(4,6,4,7): typecheck error FS0318: The type definitions for type 'A' in the signature and implementation are not compatible because the abbreviations differ: FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<2> versus FSharp.HelloWorld.HelloWorldTypeWithStaticInt32Parameter<1> diff --git a/tests/fsharp/typecheck/sigs/neg17.bsl b/tests/fsharp/typecheck/sigs/neg17.bsl index 2b55f59a8f3..b0445c12b29 100644 --- a/tests/fsharp/typecheck/sigs/neg17.bsl +++ b/tests/fsharp/typecheck/sigs/neg17.bsl @@ -1,5 +1,5 @@ -neg17.fs(84,17,84,33): typecheck error FS0292: The type definitions in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation +neg17.fs(84,17,84,33): typecheck error FS0292: The type definitions for type 'PrivateUnionType' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation neg17b.fs(7,17,7,31): typecheck error FS1094: The value 'privateValue' is not accessible from this code location diff --git a/tests/fsharp/typecheck/sigs/neg43.bsl b/tests/fsharp/typecheck/sigs/neg43.bsl index e6e2e81c1f4..ca7562608e2 100644 --- a/tests/fsharp/typecheck/sigs/neg43.bsl +++ b/tests/fsharp/typecheck/sigs/neg43.bsl @@ -1,2 +1,2 @@ -neg43.fs(11,6,11,8): typecheck error FS0294: The type definitions in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not +neg43.fs(11,6,11,8): typecheck error FS0294: The type definitions for type 'DU' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not diff --git a/tests/fsharp/typecheck/sigs/neg57.bsl b/tests/fsharp/typecheck/sigs/neg57.bsl index 44e64462a9e..aff6f93a03f 100644 --- a/tests/fsharp/typecheck/sigs/neg57.bsl +++ b/tests/fsharp/typecheck/sigs/neg57.bsl @@ -1,4 +1,4 @@ -neg57.fs(4,6,4,9): typecheck error FS0314: The type definitions in the signature and implementation are not compatible because the field 'offset' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. +neg57.fs(4,6,4,9): typecheck error FS0314: The type definitions for type 'Foo' in the signature and implementation are not compatible because the field 'offset' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. neg57.fs(1,8,1,9): typecheck error FS0193: Module 'M' requires a value 'new : unit -> Foo<'T>' diff --git a/tests/fsharp/typecheck/sigs/neg58.bsl b/tests/fsharp/typecheck/sigs/neg58.bsl index dfb2125acfe..8d1acf45492 100644 --- a/tests/fsharp/typecheck/sigs/neg58.bsl +++ b/tests/fsharp/typecheck/sigs/neg58.bsl @@ -1,5 +1,5 @@ -neg58.fs(5,6,5,9): typecheck error FS0314: The type definitions in the signature and implementation are not compatible because the field 'offset' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. +neg58.fs(5,6,5,9): typecheck error FS0314: The type definitions for type 'Foo' in the signature and implementation are not compatible because the field 'offset' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. neg58.fs(9,17,9,30): typecheck error FS0034: Module 'FooBarSoftware' contains override Foo.GetEnumerator : unit -> IEnumerator<'T> diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_ConsiderAddingSealedAttribute01.fsi b/tests/fsharpqa/Source/Diagnostics/General/E_ConsiderAddingSealedAttribute01.fsi index f6361a8e223..a8a004c51fd 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_ConsiderAddingSealedAttribute01.fsi +++ b/tests/fsharpqa/Source/Diagnostics/General/E_ConsiderAddingSealedAttribute01.fsi @@ -1,5 +1,5 @@ // #Regression #Diagnostics -//The type definitions in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is\. Consider adding the \[\] attribute to the implementation\.$ +//The type definitions for type 'T' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is\. Consider adding the \[\] attribute to the implementation\.$ module M [] type T =