You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Allow inheritance of types that have multiple interface instantiations
closesdotnet#18commit b4460b501112836f0ed9c10abb2ab267cea5769fAuthor: latkin <latkin@microsoft.com>Date: Mon Jan 19 10:54:36 2015 -0800 Reverting change to test.lst filecommit 29ea1b495070913ba7c723ba10d487cfc645e297Merge:0b209163f7d322Author: latkin <latkin@microsoft.com>Date: Fri Jan 16 18:12:11 2015 -0800 Merge branch 'multi-intf' ofhttps://github.com/dsyme/visualfsharp into dsyme-multi-intfcommit3f7d322Author: Don Syme <dsyme@microsoft.com>Date: Fri Jan 16 11:15:13 2015 +0000 adjust for more thorough fsharpqa test runs for multiple interfacescommit6d90572Merge:e532a14481890dAuthor: Don Syme <dsyme@microsoft.com>Date: Fri Jan 16 09:02:43 2015 +0000 Merge branch 'fsharp4' ofhttp://github.com/Microsoft/visualfsharp into multi-intfcommite532a14Author: Don Syme <dsyme@microsoft.com>Date: Thu Jan 15 15:09:07 2015 +0000 fix bug exposed by tests (2)commit12ea9f8Author: Don Syme <dsyme@microsoft.com>Date: Thu Jan 15 15:07:31 2015 +0000 fix bug exposed by testscommit1d9928dMerge:e65539551d7b62Author: Don Syme <dsyme@microsoft.com>Date: Thu Jan 15 14:54:25 2015 +0000 Merge branch 'fsharp4' ofhttps://git01.codeplex.com/visualfsharp into multi-intfcommite655395Author: Don Syme <dsyme@microsoft.com>Date: Wed Sep 17 16:54:04 2014 +0100 update tests for multiple instantiations of interfacescommit4adb2ddAuthor: Don Syme <dsyme@microsoft.com>Date: Tue Sep 16 17:45:21 2014 +0100 Allow inheritance of types that have multiple interface instantiations
Copy file name to clipboardExpand all lines: src/fsharp/FSComp.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -290,7 +290,7 @@ chkUnionCaseDefaultAugmentation,"default augmentation of the union case"
290
290
441,chkDuplicatePropertyWithSuffix,"Duplicate property. The property '%s' has the same name and signature as another property in this type once tuples, functions, units of measure and/or provided types are erased."
291
291
442,chkDuplicateMethodInheritedType,"Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type."
292
292
442,chkDuplicateMethodInheritedTypeWithSuffix,"Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased."
293
-
443,chkMultipleGenericInterfaceInstantiations,"This type implementsor inheritsthe same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#."
293
+
443,chkMultipleGenericInterfaceInstantiations,"This type implements the same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#."
294
294
444,chkValueWithDefaultValueMustHaveDefaultValue,"The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check"
295
295
445,chkNoByrefInTypeAbbrev,"The type abbreviation contains byrefs. This is not permitted by F#."
@@ -243,11 +243,11 @@ let HasHeadType g tcref ty2 =
243
243
244
244
/// Check if a type exists somewhere in the hierarchy which has the same head type as the given type (note, the given type need not have a head type at all)
245
245
letExistsSameHeadTypeInHierarchy g amap m typeToSearchFrom typeToLookFor=
246
-
ExistsInEntireHierarchyOfType(HaveSameHeadType g typeToLookFor) g amap m AllowMultiIntfInstantiations.No typeToSearchFrom
246
+
ExistsInEntireHierarchyOfType(HaveSameHeadType g typeToLookFor) g amap m AllowMultiIntfInstantiations.Yes typeToSearchFrom
247
247
248
248
/// Check if a type exists somewhere in the hierarchy which has the given head type.
249
249
letExistsHeadTypeInEntireHierarchy g amap m typeToSearchFrom tcrefToLookFor=
250
-
ExistsInEntireHierarchyOfType(HasHeadType g tcrefToLookFor) g amap m AllowMultiIntfInstantiations.No typeToSearchFrom
250
+
ExistsInEntireHierarchyOfType(HasHeadType g tcrefToLookFor) g amap m AllowMultiIntfInstantiations.Yes typeToSearchFrom
251
251
252
252
253
253
/// Read an Abstract IL type from metadata and convert to an F# type.
@@ -3127,13 +3127,13 @@ type InfoReader(g:TcGlobals, amap:Import.ImportMap) =
3127
3127
FoldPrimaryHierarchyOfType(fun typ acc-> GetImmediateIntrinsicPropInfosOfType(optFilter,ad) g amap m typ:: acc) g amap m allowMultiIntfInst typ[]
FoldPrimaryHierarchyOfType(fun typ acc-> GetImmediateIntrinsicRecdOrClassFieldsOfType(optFilter,ad) m typ@ acc) g amap m AllowMultiIntfInstantiations.No typ[]
3136
+
FoldPrimaryHierarchyOfType(fun typ acc-> GetImmediateIntrinsicRecdOrClassFieldsOfType(optFilter,ad) m typ@ acc) g amap m AllowMultiIntfInstantiations.Yes typ[]
FoldEntireHierarchyOfType(fun typ acc-> typ:: acc) g amap m allowMultiIntfInst typ[]
@@ -3164,7 +3164,7 @@ type InfoReader(g:TcGlobals, amap:Import.ImportMap) =
3164
3164
|_-> failwith"Unexpected multiple fields with the same name"// Because an explicit name (i.e., nm) was supplied, there will be only one element at most.
3165
3165
|_-> acc)
3166
3166
g amap m
3167
-
AllowMultiIntfInstantiations.No
3167
+
AllowMultiIntfInstantiations.Yes
3168
3168
typ
3169
3169
None
3170
3170
@@ -3506,12 +3506,12 @@ let TryFindIntrinsicNamedItemOfType (infoReader:InfoReader) (nm,ad) findFlag m t
3506
3506
/// -- getting the Dispose method when resolving the 'use' construct
3507
3507
/// -- getting the various methods used to desugar the computation expression syntax
3508
3508
letTryFindIntrinsicMethInfo infoReader m ad nm ty=
3509
-
GetIntrinsicMethInfosOfType infoReader(Some nm,ad,AllowMultiIntfInstantiations.No) IgnoreOverrides m ty
3509
+
GetIntrinsicMethInfosOfType infoReader(Some nm,ad,AllowMultiIntfInstantiations.Yes) IgnoreOverrides m ty
3510
3510
3511
3511
/// Try to find a particular named property on a type. Only used to ensure that local 'let' definitions and property names
3512
3512
/// are distinct, a somewhat adhoc check in tc.fs.
3513
3513
letTryFindPropInfo infoReader m ad nm ty=
3514
-
GetIntrinsicPropInfosOfType infoReader(Some nm,ad,AllowMultiIntfInstantiations.No) IgnoreOverrides m ty
3514
+
GetIntrinsicPropInfosOfType infoReader(Some nm,ad,AllowMultiIntfInstantiations.Yes) IgnoreOverrides m ty
Copy file name to clipboardExpand all lines: src/fsharp/tc.fs
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ let IsSecurityAttribute g amap (casmap : Dictionary<Stamp,bool>) (Attrib(tcref,_
121
121
if casmap.ContainsKey(tcs) then
122
122
casmap.[tcs]
123
123
else
124
-
let exists = ExistsInEntireHierarchyOfType (fun t -> typeEquiv g t (mkAppTy attr.TyconRef [])) g amap m AllowMultiIntfInstantiations.No (mkAppTy tcref [])
124
+
let exists = ExistsInEntireHierarchyOfType (fun t -> typeEquiv g t (mkAppTy attr.TyconRef [])) g amap m AllowMultiIntfInstantiations.Yes (mkAppTy tcref [])
@@ -14225,7 +14225,7 @@ module EstablishTypeDefinitionCores = begin
14225
14225
// validate ConditionalAttribute, should it be applied (it's only valid on a type if the type is an attribute type)
14226
14226
match attrs |> List.tryFind (IsMatchingFSharpAttribute cenv.g cenv.g.attrib_ConditionalAttribute) with
14227
14227
| Some _ ->
14228
-
if not(ExistsInEntireHierarchyOfType (fun t -> typeEquiv cenv.g t (mkAppTy cenv.g.tcref_System_Attribute [])) cenv.g cenv.amap m AllowMultiIntfInstantiations.No thisTy) then
14228
+
if not(ExistsInEntireHierarchyOfType (fun t -> typeEquiv cenv.g t (mkAppTy cenv.g.tcref_System_Attribute [])) cenv.g cenv.amap m AllowMultiIntfInstantiations.Yes thisTy) then
Copy file name to clipboardExpand all lines: tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Attributes/New/Test06.fs
//<Expects status="error" span="(9,8-9,9)">This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' attributes$</Expects>
2
+
//<Expects status="error" span="(9,8-9,9)">This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison'$</Expects>
3
3
//<Expects status="error" span="(9,8-9,9)" id="FS0385">A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System\.IComparable' or 'System\.Collections\.IStructuralComparable'$</Expects>