From 6452dbaf1d2a05081babe2dd642221ec9408eb2d Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 13:20:35 +0000 Subject: [PATCH 01/82] extension witness implementation --- src/fsharp/AccessibilityLogic.fs | 3 + src/fsharp/CheckFormatStrings.fs | 2 +- src/fsharp/CompileOptions.fs | 1 - src/fsharp/ConstraintSolver.fs | 352 +++++++++++------- src/fsharp/ConstraintSolver.fsi | 23 +- src/fsharp/FSComp.txt | 2 +- src/fsharp/FindUnsolved.fs | 2 +- src/fsharp/MethodCalls.fs | 12 +- src/fsharp/NameResolution.fs | 35 +- src/fsharp/NameResolution.fsi | 15 +- src/fsharp/NicePrint.fs | 16 +- src/fsharp/PostInferenceChecks.fs | 4 +- src/fsharp/TastOps.fs | 125 +++++-- src/fsharp/TastOps.fsi | 18 +- src/fsharp/TastPickle.fs | 9 +- src/fsharp/TypeChecker.fs | 136 +++---- src/fsharp/infos.fs | 50 ++- src/fsharp/symbols/Exprs.fs | 2 +- src/fsharp/symbols/Symbols.fs | 5 +- src/fsharp/tast.fs | 31 +- .../core/members/basics-hw-mutrec/test.fs | 6 +- tests/fsharp/core/members/basics-hw/test.fsx | 6 +- tests/fsharp/core/members/basics/test.fs | 6 +- tests/fsharp/core/members/ops-mutrec/test.fs | 4 +- tests/fsharp/core/subtype/test.fsx | 2 - tests/fsharp/tests.fs | 23 ++ tests/fsharp/typecheck/sigs/neg45.bsl | 2 +- tests/fsharp/typecheck/sigs/neg99.bsl | 2 +- tests/fsharp/typecheck/sigs/neg99.fs | 2 +- .../basic/E_ExtensionOperator01.fs | 20 +- .../E_MemberConstraint02.fs | 2 +- 31 files changed, 609 insertions(+), 309 deletions(-) diff --git a/src/fsharp/AccessibilityLogic.fs b/src/fsharp/AccessibilityLogic.fs index 4070ea9b402..0f1f2b67e30 100644 --- a/src/fsharp/AccessibilityLogic.fs +++ b/src/fsharp/AccessibilityLogic.fs @@ -37,6 +37,8 @@ type AccessorDomain = /// An AccessorDomain which returns all items | AccessibleFromSomewhere + interface TraitAccessorDomain + // Hashing and comparison is used for the memoization tables keyed by an accessor domain. // It is dependent on a TcGlobals because of the TyconRef in the data structure static member CustomGetHashCode(ad:AccessorDomain) = @@ -45,6 +47,7 @@ type AccessorDomain = | AccessibleFromEverywhere -> 2 | AccessibleFromSomeFSharpCode -> 3 | AccessibleFromSomewhere -> 4 + static member CustomEquals(g:TcGlobals, ad1:AccessorDomain, ad2:AccessorDomain) = match ad1, ad2 with | AccessibleFrom(cs1, tc1), AccessibleFrom(cs2, tc2) -> (cs1 = cs2) && (match tc1, tc2 with None, None -> true | Some tc1, Some tc2 -> tyconRefEq g tc1 tc2 | _ -> false) diff --git a/src/fsharp/CheckFormatStrings.fs b/src/fsharp/CheckFormatStrings.fs index 1622a61351c..eb78165819e 100644 --- a/src/fsharp/CheckFormatStrings.fs +++ b/src/fsharp/CheckFormatStrings.fs @@ -15,7 +15,7 @@ open FSharp.Compiler.NameResolution type FormatItem = Simple of TType | FuncAndVal let copyAndFixupFormatTypar m tp = - let _,_,tinst = FreshenAndFixupTypars m TyparRigidity.Flexible [] [] [tp] + let _,_,tinst = FreshenAndFixupTypars None m TyparRigidity.Flexible [] [] [tp] List.head tinst let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 65107906686..c949cfc6988 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1716,7 +1716,6 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM let optSettings = tcConfig.optSettings let optSettings = { optSettings with abstractBigTargets = tcConfig.doTLR } let optSettings = { optSettings with reportingPhase = true } - let results, (optEnvFirstLoop, _, _, _) = ((optEnv0, optEnv0, optEnv0, SignatureHidingInfo.Empty), implFiles) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 0360d253dd1..3e032d8f983 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -42,6 +42,7 @@ open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Infos open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking +open FSharp.Compiler.NameResolution open FSharp.Compiler.Lib open FSharp.Compiler.MethodCalls open FSharp.Compiler.PrettyNaming @@ -92,30 +93,35 @@ let NewByRefKindInferenceType (g: TcGlobals) m = let NewInferenceTypes l = l |> List.map (fun _ -> NewInferenceType ()) +/// Freshen a trait for use at a particular location +type TraitFreshener = (TraitConstraintInfo -> TraitPossibleExtensionMemberSolutions * TraitAccessorDomain) + // QUERY: should 'rigid' ever really be 'true'? We set this when we know // we are going to have to generalize a typar, e.g. when implementing a // abstract generic method slot. But we later check the generalization // condition anyway, so we could get away with a non-rigid typar. This // would sort of be cleaner, though give errors later. -let FreshenAndFixupTypars m rigid fctps tinst tpsorig = +let FreshenAndFixupTypars (traitFreshner: TraitFreshener option) m rigid fctps tinst tpsorig = let copy_tyvar (tp: Typar) = NewCompGenTypar (tp.Kind, rigid, tp.StaticReq, (if rigid=TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No), false) let tps = tpsorig |> List.map copy_tyvar - let renaming, tinst = FixupNewTypars m fctps tinst tpsorig tps + let renaming, tinst = FixupNewTypars traitFreshner m fctps tinst tpsorig tps tps, renaming, tinst -let FreshenTypeInst m tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible [] [] tpsorig +let FreshenTypeInst traitFreshner m tpsorig = + FreshenAndFixupTypars traitFreshner m TyparRigidity.Flexible [] [] tpsorig -let FreshMethInst m fctps tinst tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible fctps tinst tpsorig +let FreshenMethInst traitFreshner m fctps tinst tpsorig = + FreshenAndFixupTypars traitFreshner m TyparRigidity.Flexible fctps tinst tpsorig -let FreshenTypars m tpsorig = +let FreshenTypars traitFreshner m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tptys = FreshenTypeInst m tpsorig + let _, _, tptys = FreshenTypeInst traitFreshner m tpsorig tptys -let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tptys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars +let FreshenMethInfo traitFreshner m (minfo: MethInfo) = + let _, _, tptys = FreshenMethInst traitFreshner m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tptys @@ -241,7 +247,6 @@ type ConstraintSolverEnv = m: range EquivEnv: TypeEquivEnv - DisplayEnv: DisplayEnv } @@ -334,6 +339,22 @@ let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty +/// Some additional solutions are forced prior to generalization (permitWeakResolution=true). These are, roughly speaking, rules +/// for binary-operand constraints arising from constructs such as "1.0 + x" where "x" is an unknown type. THe constraint here +/// involves two type parameters - one for the left, and one for the right. The left is already known to be Double. +/// In this situation (and in the absence of other evidence prior to generalization), constraint solving forces an assumption that +/// the right is also Double - this is "weak" because there is only weak evidence for it. +/// +/// permitWeakResolution also applies to resolutions of multi-type-variable constraints via method overloads. Method overloading gets applied even if +/// only one of the two type variables is known. +/// +/// During code gen we run with permitWeakResolution on, but we only apply it where one of the argument types for the built-in constraint resolution is +/// a variable type. +type PermitWeakResolution = + | Yes of codegen: bool + | No + member x.Permit = match x with Yes _ -> true | No -> false + // Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> let GetMeasureOfType g ty = match ty with @@ -343,6 +364,78 @@ let GetMeasureOfType g ty = | _ -> None | _ -> None +let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty + +let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) + +let IsBitwiseOpType g ty = isIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) + +// For weak resolution, require a relevant primitive on one side +// For strong resolution +// - if there are relevant methods require an exact primitive on the other side. +// - if there are no relevant methods just require a non-variable type on the other side. +let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = + p1 ty1 && + + match permitWeakResolution with + // During regular inference we apply a builtin resolution if either there are no relevant methods to solve traits (and the type is nominal), or if + // there are relevant methods we check that the type is precisely correct + | PermitWeakResolution.No -> + if isNil minfos then + // compat path + not (isTyparTy g ty2) + else + // normal path + p2 ty2 + + // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we + // ignore the possibility that method overloads may resolve the constraint + | PermitWeakResolution.Yes false -> true + + // During codegen we only apply a builtin resolution if both the types are correct + | PermitWeakResolution.Yes true -> p2 ty2 + +let IsSymmetricBinaryOpArgTypePair p permitWeakResolution minfos g ty1 ty2 = + IsBinaryOpArgTypePair p p permitWeakResolution minfos g ty1 ty2 || + IsBinaryOpArgTypePair p p permitWeakResolution minfos g ty2 ty1 + +/// Checks if the knowledge we have of the argument types is enough to commit to a path that simulates that a +/// type supports the op_Addition, op_Subtraction or op_Modulus static members +let IsAddSubModTypePair nm permitWeakResolution minfos g ty1 ty2 = + IsSymmetricBinaryOpArgTypePair (IsAddSubModType nm g) permitWeakResolution minfos g ty1 ty2 + +/// Checks if the knowledge we have of the argument types is enough to commit to a path that simulates that +/// a type supports the op_LessThan, op_LessThanOrEqual, op_GreaterThan, op_GreaterThanOrEqual, op_Equality or op_Inequality static members +let IsRelationalOpArgTypePair permitWeakResolution minfos g ty1 ty2 = + IsSymmetricBinaryOpArgTypePair (IsRelationalType g) permitWeakResolution minfos g ty1 ty2 + +/// Checks if the knowledge we have of the argument types is enough to commit to a path that simulates that +/// a type supports the op_BitwiseAnd, op_BitwiseOr or op_ExclusiveOr static members +let IsBitwiseOpArgTypePair permitWeakResolution minfos g ty1 ty2 = + IsSymmetricBinaryOpArgTypePair (IsBitwiseOpType g) permitWeakResolution minfos g ty1 ty2 + +let IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty1 ty2 = + IsBinaryOpArgTypePair + (IsNumericOrIntegralEnumType g) + // This next condition checks that either + // - Neither type contributes any methods OR + // - We have the special case "decimal<_> * decimal". In this case we have some + // possibly-relevant methods from "decimal" but we ignore them in this case. + (fun ty2 -> IsNumericOrIntegralEnumType g ty2 || (Option.isSome (GetMeasureOfType g ty1) && isDecimalTy g ty2)) + permitWeakResolution + minfos + g + ty1 ty2 + +let IsMulDivTypeArgPair permitWeakResolution minfos g ty1 ty2 = + IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty1 ty2 || + IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty2 ty1 + +/// Checks if the knowledge we have of the argument types is enough to commit to a path that simulates that +/// a type supports the get_Sign instance member +let IsSignType g ty = + isSignedIntegerTy g ty || isFpTy g ty || isDecimalTy g ty + type TraitConstraintSolution = | TTraitUnsolved | TTraitBuiltIn @@ -778,10 +871,12 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio // Only solve constraints if this is not an error var if r.IsFromError then () else + // Check to see if this type variable is relevant to any trait constraints. // If so, re-solve the relevant constraints. if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then - do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep false trace r) + do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep PermitWeakResolution.No trace r) + // Re-solve the other constraints associated with this type variable return! solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r @@ -826,7 +921,7 @@ and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty | TyparConstraint.SimpleChoice(tys, m2) -> SolveTypeChoice csenv ndeep m2 trace ty tys | TyparConstraint.CoercesTo(ty2, m2) -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m2 trace None ty2 ty | TyparConstraint.MayResolveMember(traitInfo, m2) -> - SolveMemberConstraint csenv false false ndeep m2 trace traitInfo |> OperationResult.ignore + SolveMemberConstraint csenv false PermitWeakResolution.No ndeep m2 trace traitInfo |> OperationResult.ignore } @@ -1093,16 +1188,9 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// don't. The type-directed static optimization rules in the library code that makes use of this /// will deal with the problem. /// -/// 2. Some additional solutions are forced prior to generalization (permitWeakResolution=true). These are, roughly speaking, rules -/// for binary-operand constraints arising from constructs such as "1.0 + x" where "x" is an unknown type. THe constraint here -/// involves two type parameters - one for the left, and one for the right. The left is already known to be Double. -/// In this situation (and in the absence of other evidence prior to generalization), constraint solving forces an assumption that -/// the right is also Double - this is "weak" because there is only weak evidence for it. -/// -/// permitWeakResolution also applies to resolutions of multi-type-variable constraints via method overloads. Method overloading gets applied even if -/// only one of the two type variables is known -/// -and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace (TTrait(tys, nm, memFlags, argtys, rty, sln)): OperationResult = trackErrors { +/// 2. Some additional solutions are forced prior to generalization (permitWeakResolution= Yes or YesDuringCodeGen). See above +and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload (permitWeakResolution: PermitWeakResolution) ndeep m2 trace traitInfo : OperationResult = trackErrors { + let (TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, extSlns, traitAD)) = traitInfo // Do not re-solve if already solved if sln.Value.IsSome then return true else let g = csenv.g @@ -1115,66 +1203,31 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // Remove duplicates from the set of types in the support let tys = ListSet.setify (typeAEquiv g aenv) tys + // Rebuild the trait info after removing duplicates - let traitInfo = TTrait(tys, nm, memFlags, argtys, rty, sln) + let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, extSlns, traitAD) let rty = GetFSharpViewOfReturnType g rty + let traitAD = match traitAD with None -> AccessibilityLogic.AccessibleFromEverywhere | Some ad -> (ad :?> AccessorDomain) // Assert the object type if the constraint is for an instance member if memFlags.IsInstance then - match tys, argtys with + match tys, traitObjAndArgTys with | [ty], (h :: _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) + // Trait calls are only supported on pseudo type (variables) for e in tys do do! SolveTypStaticReq csenv trace HeadTypeStaticReq e - let argtys = if memFlags.IsInstance then List.tail argtys else argtys - + let argtys = if memFlags.IsInstance then List.tail traitObjAndArgTys else traitObjAndArgTys let minfos = GetRelevantMethodsForTrait csenv permitWeakResolution nm traitInfo let! res = trackErrors { - match minfos, tys, memFlags.IsInstance, nm, argtys with - | _, _, false, ("op_Division" | "op_Multiply"), [argty1;argty2] + match tys, memFlags.IsInstance, nm, argtys with + | _, false, ("op_Division" | "op_Multiply"), [argty1;argty2] when - // This simulates the existence of - // float * float -> float - // float32 * float32 -> float32 - // float<'u> * float<'v> -> float<'u 'v> - // float32<'u> * float32<'v> -> float32<'u 'v> - // decimal<'u> * decimal<'v> -> decimal<'u 'v> - // decimal<'u> * decimal -> decimal<'u> - // float32<'u> * float32<'v> -> float32<'u 'v> - // int * int -> int - // int64 * int64 -> int64 - // - // The rule is triggered by these sorts of inputs when permitWeakResolution=false - // float * float - // float * float32 // will give error - // decimal * decimal - // decimal * decimal <-- Note this one triggers even though "decimal" has some possibly-relevant methods - // float * Matrix // the rule doesn't trigger for this one since Matrix has overloads we can use and we prefer those instead - // float * Matrix // the rule doesn't trigger for this one since Matrix has overloads we can use and we prefer those instead - // - // The rule is triggered by these sorts of inputs when permitWeakResolution=true - // float * 'a - // 'a * float - // decimal<'u> * 'a - (let checkRuleAppliesInPreferenceToMethods argty1 argty2 = - // Check that at least one of the argument types is numeric - (IsNumericOrIntegralEnumType g argty1) && - // Check that the support of type variables is empty. That is, - // if we're canonicalizing, then having one of the types nominal is sufficient. - // If not, then both must be nominal (i.e. not a type variable). - (permitWeakResolution || not (isTyparTy g argty2)) && - // This next condition checks that either - // - Neither type contributes any methods OR - // - We have the special case "decimal<_> * decimal". In this case we have some - // possibly-relevant methods from "decimal" but we ignore them in this case. - (isNil minfos || (Option.isSome (GetMeasureOfType g argty1) && isDecimalTy g argty2)) in - - checkRuleAppliesInPreferenceToMethods argty1 argty2 || - checkRuleAppliesInPreferenceToMethods argty2 argty1) -> + IsMulDivTypeArgPair permitWeakResolution minfos g argty1 argty2 -> match GetMeasureOfType g argty1 with | Some (tcref, ms1) -> @@ -1198,52 +1251,48 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn - | _, _, false, ("op_Addition" | "op_Subtraction" | "op_Modulus"), [argty1;argty2] - when // Ignore any explicit +/- overloads from any basic integral types - (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && - ( (IsNumericOrIntegralEnumType g argty1 || (nm = "op_Addition" && (isCharTy g argty1 || isStringTy g argty1))) && (permitWeakResolution || not (isTyparTy g argty2)) - || (IsNumericOrIntegralEnumType g argty2 || (nm = "op_Addition" && (isCharTy g argty2 || isStringTy g argty2))) && (permitWeakResolution || not (isTyparTy g argty1)))) -> + | _, false, ("op_Addition" | "op_Subtraction" | "op_Modulus"), [argty1;argty2] + when IsAddSubModTypePair nm permitWeakResolution minfos g argty1 argty2 -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn - | _, _, false, ("op_LessThan" | "op_LessThanOrEqual" | "op_GreaterThan" | "op_GreaterThanOrEqual" | "op_Equality" | "op_Inequality" ), [argty1;argty2] - when // Ignore any explicit overloads from any basic integral types - (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && - ( (IsRelationalType g argty1 && (permitWeakResolution || not (isTyparTy g argty2))) - || (IsRelationalType g argty2 && (permitWeakResolution || not (isTyparTy g argty1))))) -> + | _, false, ("op_LessThan" | "op_LessThanOrEqual" | "op_GreaterThan" | "op_GreaterThanOrEqual" | "op_Equality" | "op_Inequality" ), [argty1;argty2] + when IsRelationalOpArgTypePair permitWeakResolution minfos g argty1 argty2 -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.bool_ty return TTraitBuiltIn // We pretend for uniformity that the numeric types have a static property called Zero and One // As with constants, only zero is polymorphic in its units - | [], [ty], false, "get_Zero", [] + | [ty], false, "get_Zero", [] when IsNumericType g ty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty return TTraitBuiltIn - | [], [ty], false, "get_One", [] + | [ty], false, "get_One", [] when IsNumericType g ty || isCharTy g ty -> do! SolveDimensionlessNumericType csenv ndeep m2 trace ty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty return TTraitBuiltIn - | [], _, false, ("DivideByInt"), [argty1;argty2] + | _, false, "DivideByInt", [argty1;argty2] when isFpTy g argty1 || isDecimalTy g argty1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn // We pretend for uniformity that the 'string' and 'array' types have an indexer property called 'Item' - | [], [ty], true, ("get_Item"), [argty1] + | [ty], true, "get_Item", [argty1] when isStringTy g ty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 g.int_ty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.char_ty return TTraitBuiltIn - | [], [ty], true, ("get_Item"), argtys + | [ty], true, "get_Item", argtys when isArrayTy g ty -> if rankOfArrayTy g ty <> argtys.Length then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), argtys.Length), m, m2)) @@ -1253,7 +1302,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ety return TTraitBuiltIn - | [], [ty], true, ("set_Item"), argtys + | [ty], true, "set_Item", argtys when isArrayTy g ty -> if rankOfArrayTy g ty <> argtys.Length - 1 then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), (argtys.Length - 1)), m, m2)) @@ -1264,55 +1313,54 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys return TTraitBuiltIn - | [], _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argty1;argty2] - when (isIntegerOrIntegerEnumTy g argty1 || (isEnumTy g argty1)) && (permitWeakResolution || not (isTyparTy g argty2)) - || (isIntegerOrIntegerEnumTy g argty2 || (isEnumTy g argty2)) && (permitWeakResolution || not (isTyparTy g argty1)) -> + | _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argty1;argty2] + when IsBitwiseOpArgTypePair permitWeakResolution minfos g argty1 argty2 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 return TTraitBuiltIn - | [], _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] - when isIntegerOrIntegerEnumTy g argty1 -> + | _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] + when isIntegerOrIntegerEnumTy g argty1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 return TTraitBuiltIn - | _, _, false, ("op_UnaryPlus"), [argty] + | _, false, "op_UnaryPlus", [argty] when IsNumericOrIntegralEnumType g argty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty return TTraitBuiltIn - | _, _, false, ("op_UnaryNegation"), [argty] + | _, false, "op_UnaryNegation", [argty] when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty return TTraitBuiltIn - | _, _, true, ("get_Sign"), [] + | _, true, "get_Sign", [] when (let argty = tys.Head in isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.int32_ty return TTraitBuiltIn - | _, _, false, ("op_LogicalNot" | "op_OnesComplement"), [argty] + | _, false, ("op_LogicalNot" | "op_OnesComplement"), [argty] when isIntegerOrIntegerEnumTy g argty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty do! SolveDimensionlessNumericType csenv ndeep m2 trace argty return TTraitBuiltIn - | _, _, false, ("Abs"), [argty] + | _, false, "Abs", [argty] when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty return TTraitBuiltIn - | _, _, false, "Sqrt", [argty1] + | _, false, "Sqrt", [argty1] when isFpTy g argty1 -> match GetMeasureOfType g argty1 with | Some (tcref, _) -> @@ -1324,14 +1372,15 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn - | _, _, false, ("Sin" | "Cos" | "Tan" | "Sinh" | "Cosh" | "Tanh" | "Atan" | "Acos" | "Asin" | "Exp" | "Ceiling" | "Floor" | "Round" | "Truncate" | "Log10" | "Log" | "Sqrt"), [argty] + | _, false, ("Sin" | "Cos" | "Tan" | "Sinh" | "Cosh" | "Tanh" | "Atan" | "Acos" | "Asin" | "Exp" | "Ceiling" | "Floor" | "Round" | "Truncate" | "Log10" | "Log" | "Sqrt"), [argty] when isFpTy g argty -> do! SolveDimensionlessNumericType csenv ndeep m2 trace argty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty return TTraitBuiltIn - | _, _, false, ("op_Explicit"), [argty] + // Simulate solutions to op_Implicit and op_Explicit + | _, false, "op_Explicit", [argty] when (// The input type. (IsNonDecimalNumericOrIntegralEnumType g argty || isStringTy g argty || isCharTy g argty) && // The output type @@ -1344,7 +1393,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn - | _, _, false, ("op_Explicit"), [argty] + | _, false, "op_Explicit", [argty] when (// The input type. (IsNumericOrIntegralEnumType g argty || isStringTy g argty) && // The output type @@ -1352,16 +1401,17 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn - | [], _, false, "Pow", [argty1; argty2] + | _, false, "Pow", [argty1; argty2] when isFpTy g argty1 -> do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn - | _, _, false, ("Atan2"), [argty1; argty2] + | _, false, "Atan2", [argty1; argty2] when isFpTy g argty1 -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 match GetMeasureOfType g argty1 with | None -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 @@ -1380,11 +1430,11 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let propName = nm.[4..] let props = tys |> List.choose (fun ty -> - match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, AccessibleFromEverywhere) FindMemberFlag.IgnoreOverrides m ty with + match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, traitAD) FindMemberFlag.IgnoreOverrides m ty with | Some (RecdFieldItem rfinfo) when (isGetProp || rfinfo.RecdField.IsMutable) && (rfinfo.IsStatic = not memFlags.IsInstance) && - IsRecdFieldAccessible amap m AccessibleFromEverywhere rfinfo.RecdFieldRef && + IsRecdFieldAccessible amap m traitAD rfinfo.RecdFieldRef && not rfinfo.LiteralValue.IsSome && not rfinfo.RecdField.IsCompilerGenerated -> Some (rfinfo, isSetProp) @@ -1446,12 +1496,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload |> List.choose (fun minfo -> if minfo.IsCurried then None else let callerArgs = argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr)) - let minst = FreshenMethInfo m minfo - let objtys = minfo.GetObjArgTypes(amap, m, minst) - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, [(callerArgs, [])], false, false, None))) + let minst = FreshenMethInfo None m minfo + let callerObjTys = if memFlags.IsInstance then [ List.head traitObjAndArgTys ] else [] + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo None, m, traitAD, minfo, minst, minst, None, callerObjTys, [(callerArgs, [])], false, false, None))) let methOverloadResult, errors = - trace.CollectThenUndoOrCommit (fun (a, _) -> Option.isSome a) (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) (0, 0) AccessibleFromEverywhere calledMethGroup false (Some rty)) + trace.CollectThenUndoOrCommit (fun (a, _) -> Option.isSome a) (fun trace -> + ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) (0, 0) traitAD calledMethGroup false (Some rty)) match anonRecdPropSearch, recdPropSearch, methOverloadResult with | Some (anonInfo, tinst, i), None, None -> @@ -1489,7 +1540,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // If there's nothing left to learn then raise the errors. // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability // reasons we use the more restrictive isNil frees. - if (permitWeakResolution && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors // Otherwise re-record the trait waiting for canonicalization else @@ -1546,6 +1597,7 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = FSMethSln(ty, vref, minst) | MethInfo.DefaultStructCtor _ -> error(InternalError("the default struct constructor was the unexpected solution to a trait constraint", m)) + #if !NO_EXTENSIONTYPING | ProvidedMeth(amap, mi, _, m) -> let g = amap.g @@ -1576,11 +1628,21 @@ and TransactMemberConstraintSolution traitInfo (trace: OptionalTrace) sln = let prev = traitInfo.Solution trace.Exec (fun () -> traitInfo.Solution <- Some sln) (fun () -> traitInfo.Solution <- prev) +and GetRelevantExtensionMethodsForTrait m (amap: Import.ImportMap) (traitInfo: TraitConstraintInfo) = + + // TODO: check the use of 'allPairs' - not all these extensions apply to each type variable. + (traitInfo.SupportTypes, traitInfo.PossibleExtensionSolutions) + ||> List.allPairs + |> List.choose (fun (traitSupportTy,extMem) -> + match (extMem :?> ExtensionMember) with + | FSExtMem (vref, pri) -> Some (FSMeth(amap.g, traitSupportTy, vref, Some pri) ) + | ILExtMem (actualParent, minfo, pri) -> TrySelectExtensionMethInfoOfILExtMem m amap traitSupportTy (actualParent, minfo, pri)) + /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads -and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) permitWeakResolution nm (TTrait(tys, _, memFlags, argtys, rty, soln) as traitInfo): MethInfo list = +and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, extSlns, ad) as traitInfo) : MethInfo list = let results = - if permitWeakResolution || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then + if permitWeakResolution.Permit || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m let minfos = match memFlags.MemberKind with @@ -1593,6 +1655,17 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) permitWeakResolution // We merge based on whether minfos use identical metadata or not. let minfos = List.reduce (ListSet.unionFavourLeft MethInfo.MethInfosUseIdenticalDefinitions) minfos + // Get the extension method that may be relevant to solving the constraint as MethInfo objects. + // Extension members are not used when canonicalizing prior to generalization (permitWeakResolution=true) + let extMInfos = + if MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then + GetRelevantExtensionMethodsForTrait csenv.m csenv.amap traitInfo + else [] + + let extMInfos = extMInfos |> ListSet.setify MethInfo.MethInfosUseIdenticalDefinitions + + let minfos = minfos @ extMInfos + /// Check that the available members aren't hiding a member from the parent (depth 1 only) let relevantMinfos = minfos |> List.filter(fun minfo -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) minfos @@ -1602,19 +1675,20 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) permitWeakResolution |> List.exists (fun minfo2 -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) else [] + // The trait name "op_Explicit" also covers "op_Implicit", so look for that one too. if nm = "op_Explicit" then - results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" (TTrait(tys, "op_Implicit", memFlags, argtys, rty, soln)) + results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" (TTrait(tys, "op_Implicit", memFlags, argtys, rty, soln, extSlns, ad)) else results /// The nominal support of the member constraint -and GetSupportOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _)) = +and GetSupportOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _, _)) = tys |> List.choose (tryAnyParTyOption csenv.g) /// Check if the support is fully solved. -and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _)) = +and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _, _)) = tys |> List.forall (isAnyParTy csenv.g >> not) // This may be relevant to future bug fixes, see https://github.com/Microsoft/visualfsharp/issues/3814 @@ -1623,7 +1697,7 @@ and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait( // tys |> List.exists (isAnyParTy csenv.g >> not) /// Get all the unsolved typars (statically resolved or not) relevant to the member constraint -and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, argtys, rty, _)) = +and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, argtys, rty, _, _, _)) = freeInTypesLeftToRightSkippingConstraints csenv.g (tys@argtys@ Option.toList rty) and MemberConstraintIsReadyForWeakResolution csenv traitInfo = @@ -1651,7 +1725,13 @@ and SolveRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep permitWeak | ValueNone -> ResultD false)) -and SolveRelevantMemberConstraintsForTypar (csenv: ConstraintSolverEnv) ndeep permitWeakResolution (trace: OptionalTrace) tp = +and GetTraitFreshner (ad: AccessorDomain) (nenv: NameResolutionEnv) (traitInfo: TraitConstraintInfo) = + let slns = + NameMultiMap.find traitInfo.MemberName nenv.eExtensionMembersByName + |> List.map (fun extMem -> (extMem :> TraitPossibleExtensionMemberSolution)) + slns, (ad :> TraitAccessorDomain) + +and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (permitWeakResolution: PermitWeakResolution) (trace:OptionalTrace) tp = let cxst = csenv.SolverState.ExtraCxs let tpn = tp.Stamp let cxs = cxst.FindAll tpn @@ -1666,9 +1746,9 @@ and SolveRelevantMemberConstraintsForTypar (csenv: ConstraintSolverEnv) ndeep pe SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps = - SolveRelevantMemberConstraints csenv ndeep true trace tps + SolveRelevantMemberConstraints csenv ndeep (PermitWeakResolution.Yes false) trace tps -and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace traitInfo support frees = +and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) traitInfo support (frees: Typar list) = let g = csenv.g let aenv = csenv.EquivEnv let cxst = csenv.SolverState.ExtraCxs @@ -1683,7 +1763,7 @@ and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace traitInfo su let cxs = cxst.FindAll tpn // check the constraint is not already listed for this type variable - if not (cxs |> List.exists (fun (traitInfo2, _) -> traitsAEquiv g aenv traitInfo traitInfo2)) then + if not (cxs |> List.exists (fun (traitInfo2, _valRefs) -> traitsAEquiv g aenv traitInfo traitInfo2)) then trace.Exec (fun () -> csenv.SolverState.ExtraCxs.Add (tpn, (traitInfo, m2))) (fun () -> csenv.SolverState.ExtraCxs.Remove tpn) ) @@ -1710,8 +1790,8 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint // may require type annotations. See FSharp 1.0 bug 6477. let consistent tpc1 tpc2 = match tpc1, tpc2 with - | (TyparConstraint.MayResolveMember(TTrait(tys1, nm1, memFlags1, argtys1, rty1, _), _), - TyparConstraint.MayResolveMember(TTrait(tys2, nm2, memFlags2, argtys2, rty2, _), _)) + | (TyparConstraint.MayResolveMember(TTrait(tys1, nm1, memFlags1, argtys1, rty1, _, _, _), _), + TyparConstraint.MayResolveMember(TTrait(tys2, nm2, memFlags2, argtys2, rty2, _, _, _), _)) when (memFlags1 = memFlags2 && nm1 = nm2 && // Multiple op_Explicit and op_Implicit constraints can exist for the same type variable. @@ -2795,7 +2875,7 @@ let AddCxMethodConstraint denv css m trace traitInfo = TryD (fun () -> trackErrors { do! - SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true false 0 m trace traitInfo + SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true PermitWeakResolution.No 0 m trace traitInfo |> OperationResult.ignore }) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) @@ -2855,31 +2935,45 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let! _res = SolveMemberConstraint csenv true true 0 m NoTrace traitInfo + let! _res = SolveMemberConstraint csenv true (PermitWeakResolution.Yes true) 0 m NoTrace traitInfo let sln = match traitInfo.Solution with | None -> Choice5Of5() | Some sln -> + + // Given the solution information, reconstruct the MethInfo for the solution match sln with - | ILMethSln(origTy, extOpt, mref, minst) -> - let metadataTy = convertToTypeWithMetadataIfPossible g origTy - let tcref = tcrefOfAppTy g metadataTy - let mdef = IL.resolveILMethodRef tcref.ILTyconRawMetadata mref + | ILMethSln(apparentTy, extOpt, mref, minst) -> + + let metadataTy = convertToTypeWithMetadataIfPossible g apparentTy + + // Find the actual type containing the solution + let actualTyconRef = + match extOpt with + | None -> tcrefOfAppTy g metadataTy + | Some ilActualTypeRef -> Import.ImportILTypeRef amap m ilActualTypeRef + + let mdef = IL.resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref + let ilMethInfo = match extOpt with - | None -> MethInfo.CreateILMeth(amap, m, origTy, mdef) - | Some ilActualTypeRef -> - let actualTyconRef = Import.ImportILTypeRef amap m ilActualTypeRef - MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef) + | None -> MethInfo.CreateILMeth(amap, m, apparentTy, mdef) + | Some _ -> MethInfo.CreateILExtensionMeth(amap, m, apparentTy, actualTyconRef, None, mdef) + Choice1Of5 (ilMethInfo, minst) + | FSMethSln(ty, vref, minst) -> Choice1Of5 (FSMeth(g, ty, vref, None), minst) + | FSRecdFieldSln(tinst, rfref, isSetProp) -> Choice2Of5 (tinst, rfref, isSetProp) + | FSAnonRecdFieldSln(anonInfo, tinst, i) -> Choice3Of5 (anonInfo, tinst, i) + | BuiltInSln -> Choice5Of5 () + | ClosedExprSln expr -> Choice4Of5 expr return! @@ -2894,6 +2988,7 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra let argTypes = minfo.GetParamTypes(amap, m, methArgTys) |> List.concat + // do not apply coercion to the 'receiver' argument let receiverArgOpt, argExprs = if minfo.IsInstance then @@ -2901,6 +2996,7 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra | h :: t -> Some h, t | argExprs -> None, argExprs else None, argExprs + let convertedArgs = (argExprs, argTypes) ||> List.map2 (fun expr expectedTy -> mkCoerceIfNeeded g expectedTy (tyOfExpr g expr) expr) match receiverArgOpt with | Some r -> r :: convertedArgs @@ -2986,7 +3082,7 @@ let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = ExtraCxs = HashMultiMap(10, HashIdentity.Structural) InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let minst = FreshenMethInfo m minfo + let minst = FreshenMethInfo None m minfo match minfo.GetObjArgTypes(amap, m, minst) with | [reqdObjTy] -> let reqdObjTy = if isByrefTy g reqdObjTy then destByrefTy g reqdObjTy else reqdObjTy // This is to support byref extension methods. diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 6aa40c6ea96..5608c8070cc 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -7,6 +7,7 @@ open FSharp.Compiler open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.Ast open FSharp.Compiler.ErrorLogger +open FSharp.Compiler.NameResolution open FSharp.Compiler.Tast open FSharp.Compiler.Range open FSharp.Compiler.Import @@ -34,18 +35,27 @@ val NewErrorMeasure : unit -> Measure /// Create a list of inference type variables, one for each element in the input list val NewInferenceTypes : 'a list -> TType list +/// Freshen a trait for use at a particular location +type TraitFreshener = (TraitConstraintInfo -> TraitPossibleExtensionMemberSolutions * TraitAccessorDomain) + /// Given a set of formal type parameters and their constraints, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted to refer to these. -val FreshenAndFixupTypars : range -> TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInst * TType list +val FreshenAndFixupTypars : TraitFreshener option -> range -> TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInst * TType list + +/// Make new type inference variables for the use of a generic construct at a particular location +val FreshenTypeInst : TraitFreshener option -> range -> Typars -> Typars * TyparInst * TType list -val FreshenTypeInst : range -> Typars -> Typars * TyparInst * TType list +/// Make new type inference variables for the use of a generic construct at a particular location +val FreshenTypars : TraitFreshener option -> range -> Typars -> TType list -val FreshenTypars : range -> Typars -> TType list +/// Make new type inference variables for the use of a method at a particular location +val FreshenMethInfo : TraitFreshener option -> range -> MethInfo -> TType list -val FreshenMethInfo : range -> MethInfo -> TType list +/// Get the trait freshener for a particular location +val GetTraitFreshner : AccessorDomain -> NameResolutionEnv -> TraitFreshener [] -/// Information about the context of a type equation. +/// Information about the context of a type equation, for better error reporting type ContextInfo = /// No context was given. @@ -163,4 +173,7 @@ val CodegenWitnessThatTypeSupportsTraitConstraint : TcValF -> TcGlobals -> Impor val ChooseTyparSolutionAndSolve : ConstraintSolverState -> DisplayEnv -> Typar -> unit +/// Get the type variables that may help provide solutions to a statically resolved member trait constraint +val GetSupportOfMemberConstraint : ConstraintSolverEnv -> TraitConstraintInfo -> Typar list + val IsApplicableMethApprox : TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index de26c9b349a..465a4c7995f 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1080,7 +1080,7 @@ lexIndentOffForML,"Consider using a file with extension '.ml' or '.mli' instead" 1212,tcOptionalArgsMustComeAfterNonOptionalArgs,"Optional arguments must come at the end of the argument list, after any non-optional arguments" 1213,tcConditionalAttributeUsage,"Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes" #1214,monoRegistryBugWorkaround,"Could not determine highest installed .NET framework version from Registry keys, using version 2.0" -1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." +#1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." 1216,ilwriteMDBFileNameCannotBeChangedWarning,"The name of the MDB file must be .mdb. The --pdb option will be ignored." 1217,ilwriteMDBMemberMissing,"MDB generation failed. Could not find compatible member %s" 1218,ilwriteErrorCreatingMdb,"Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly." diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs index d11a1284176..02c5e56b151 100644 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -135,7 +135,7 @@ and accOp cenv env (op, tyargs, args, _m) = accTypeInst cenv env enclTypeArgs accTypeInst cenv env methTypeArgs accTypeInst cenv env tys - | TOp.TraitCall (TTrait(tys, _nm, _, argtys, rty, _sln)) -> + | TOp.TraitCall (TTrait(tys, _nm, _, argtys, rty, _sln, _extSlns, _ad)) -> argtys |> accTypeInst cenv env rty |> Option.iter (accTy cenv env) tys |> List.iter (accTy cenv env) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 9b657f6f8b9..c604b0f2c04 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -1037,12 +1037,12 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = retTy /// Build a call to an F# method. -let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = +let BuildFSharpMethodCall g m (vref: ValRef) valUseFlags declaringTypeInst minst args = let vexp = Expr.Val (vref, valUseFlags, m) let vexpty = vref.Type - let tpsorig, tau = vref.TypeScheme - let vtinst = argsOfAppTy g ty @ minst - if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected List.length mismatch", m)) + let tpsorig,tau = vref.TypeScheme + let vtinst = declaringTypeInst @ minst + if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected typar length mismatch",m)) let expr = mkTyAppExpr m (vexp, vexpty) vtinst let exprty = instType (mkTyparInst tpsorig vtinst) tau BuildFSharpMethodApp g m vref expr exprty args @@ -1060,8 +1060,8 @@ let MakeMethInfoCall amap m minfo minst args = let isProp = false // not necessarily correct, but this is only used post-creflect where this flag is irrelevant BuildILMethInfoCall g amap m isProp ilminfo valUseFlags minst direct args |> fst - | FSMeth(g, ty, vref, _) -> - BuildFSharpMethodCall g m (ty, vref) valUseFlags minst args |> fst + | FSMeth(g, _, vref, _) -> + BuildFSharpMethodCall g m vref valUseFlags minfo.DeclaringTypeInst minst args |> fst | DefaultStructCtor(_, ty) -> mkDefault (m, ty) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 10e330f2070..08a8d5a7ee5 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -284,6 +284,8 @@ type ExtensionMember = /// IL-style extension member, backed by some kind of method with an [] attribute | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority + interface TraitPossibleExtensionMemberSolution + /// Check if two extension members refer to the same definition static member Equality g e1 e2 = match e1, e2 with @@ -309,7 +311,12 @@ type ExtensionMember = | FSExtMem (_, pri) -> pri | ILExtMem (_, _, pri) -> pri -type FullyQualifiedFlag = + member x.LogicalName = + match x with + | FSExtMem (vref, _) -> vref.LogicalName + | ILExtMem (_, minfo, _) -> minfo.LogicalName + +type FullyQualifiedFlag = /// Only resolve full paths | FullyQualified /// Resolve any paths accessible via 'open' @@ -369,6 +376,9 @@ type NameResolutionEnv = /// Extension members by type and name eIndexedExtensionMembers: TyconRefMultiMap + /// Extension members by name + eExtensionMembersByName: NameMultiMap + /// Other extension members unindexed by type eUnindexedExtensionMembers: ExtensionMember list @@ -391,6 +401,7 @@ type NameResolutionEnv = eFullyQualifiedTyconsByAccessNames = LayeredMultiMap.Empty eFullyQualifiedTyconsByDemangledNameAndArity = LayeredMap.Empty eIndexedExtensionMembers = TyconRefMultiMap<_>.Empty + eExtensionMembersByName = NameMultiMap<_>.Empty eUnindexedExtensionMembers = [] eTypars = Map.empty } @@ -658,6 +669,17 @@ let AddValRefToExtensionMembers pri (eIndexedExtensionMembers: TyconRefMultiMap< else eIndexedExtensionMembers +/// Add an F# value to the table of available extension members, if necessary, as an FSharp-style extension member +let AddValRefToExtensionMembersByNameTable logicalName (eExtensionMembersByName: NameMultiMap<_>) extMemInfo = + NameMultiMap.add logicalName extMemInfo eExtensionMembersByName + +/// Add an F# value to the table of available extension members, if necessary, as an FSharp-style extension member +let AddValRefToExtensionMembersByName pri (eExtensionMembersByName: NameMultiMap<_>) (vref:ValRef) = + if vref.IsMember && vref.IsExtensionMember then + AddValRefToExtensionMembersByNameTable vref.LogicalName eExtensionMembersByName (FSExtMem (vref,pri)) + else + eExtensionMembersByName + /// This entry point is used to add some extra items to the environment for Visual Studio, e.g. static members let AddFakeNamedValRefToNameEnv nm nenv vref = @@ -688,6 +710,7 @@ let AddValRefsToNameEnvWithPriority bulkAddMode pri nenv (vrefs: ValRef []) = { nenv with eUnqualifiedItems = AddValRefsToItems bulkAddMode nenv.eUnqualifiedItems vrefs eIndexedExtensionMembers = (nenv.eIndexedExtensionMembers, vrefs) ||> Array.fold (AddValRefToExtensionMembers pri) + eExtensionMembersByName = (nenv.eExtensionMembersByName, vrefs) ||> Array.fold (AddValRefToExtensionMembersByName pri) ePatItems = (nenv.ePatItems, vrefs) ||> Array.fold AddValRefsToActivePatternsNameEnv } /// Add a single F# value to the environment. @@ -700,6 +723,7 @@ let AddValRefToNameEnv nenv (vref: ValRef) = else nenv.eUnqualifiedItems eIndexedExtensionMembers = AddValRefToExtensionMembers pri nenv.eIndexedExtensionMembers vref + eExtensionMembersByName = AddValRefToExtensionMembersByName pri nenv.eExtensionMembersByName vref ePatItems = AddValRefsToActivePatternsNameEnv nenv.ePatItems vref } @@ -808,12 +832,12 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g: TcGlobals) let ucrefs = if isIL then [] else tcref.UnionCasesAsList |> List.map tcref.MakeNestedUnionCaseRef let flds = if isIL then [| |] else tcref.AllFieldsArray - let eIndexedExtensionMembers, eUnindexedExtensionMembers = + let eIndexedExtensionMembers, eExtensionMembersByName, eUnindexedExtensionMembers = let ilStyleExtensionMeths = GetCSharpStyleIndexedExtensionMembersForTyconRef amap m tcref - ((nenv.eIndexedExtensionMembers, nenv.eUnindexedExtensionMembers), ilStyleExtensionMeths) ||> List.fold (fun (tab1, tab2) extMemInfo -> + ((nenv.eIndexedExtensionMembers, nenv.eExtensionMembersByName, nenv.eUnindexedExtensionMembers),ilStyleExtensionMeths) ||> List.fold (fun (tab1,tab2,tab3) extMemInfo -> match extMemInfo with - | Choice1Of2 (tcref, extMemInfo) -> tab1.Add (tcref, extMemInfo), tab2 - | Choice2Of2 extMemInfo -> tab1, extMemInfo :: tab2) + | Choice1Of2 (tcref, extMemInfo) -> tab1.Add (tcref, extMemInfo), AddValRefToExtensionMembersByNameTable extMemInfo.LogicalName tab2 extMemInfo, tab3 + | Choice2Of2 extMemInfo -> tab1, AddValRefToExtensionMembersByNameTable extMemInfo.LogicalName tab2 extMemInfo, extMemInfo :: tab3) let isILOrRequiredQualifiedAccess = isIL || (not ownDefinition && HasFSharpAttribute g g.attrib_RequireQualifiedAccessAttribute tcref.Attribs) let eFieldLabels = @@ -871,6 +895,7 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g: TcGlobals) eUnqualifiedItems = eUnqualifiedItems ePatItems = ePatItems eIndexedExtensionMembers = eIndexedExtensionMembers + eExtensionMembersByName = eExtensionMembersByName eUnindexedExtensionMembers = eUnindexedExtensionMembers } let nenv = diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index c0121ce153e..be426bf5823 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -150,6 +150,11 @@ type ExtensionMember = /// IL-style extension member, backed by some kind of method with an [] attribute | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority + interface TraitPossibleExtensionMemberSolution + + /// The logical name, e.g. for constraint solving + member LogicalName : string + /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced /// later through 'open' get priority in overload resolution. member Priority : ExtensionMethodPriority @@ -169,8 +174,9 @@ type NameResolutionEnv = /// Modules accessible via "." notation. Note this is a multi-map. /// Adding a module abbreviation adds it a local entry to this List.map. /// Likewise adding a ccu or opening a path adds entries to this List.map. + eModulesAndNamespaces: NameMultiMap - + /// Fully qualified modules and namespaces. 'open' does not change this. eFullyQualifiedModulesAndNamespaces: NameMultiMap @@ -195,6 +201,9 @@ type NameResolutionEnv = /// Extension members by type and name eIndexedExtensionMembers: TyconRefMultiMap + /// Extension members by name + eExtensionMembersByName: NameMultiMap + /// Other extension members unindexed by type eUnindexedExtensionMembers: ExtensionMember list @@ -589,5 +598,5 @@ val GetVisibleNamespacesAndModulesAtPoint : NameResolver -> NameResolutionEnv -> val IsItemResolvable : NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> Item -> bool -val TrySelectExtensionMethInfoOfILExtMem : range -> ImportMap -> TType -> TyconRef * MethInfo * ExtensionMethodPriority -> MethInfo option - \ No newline at end of file +val TrySelectExtensionMethInfoOfILExtMem : range -> ImportMap -> TType -> TyconRef * MethInfo * ExtensionMethodPriority -> MethInfo option + diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 6479d6c6729..598a963341b 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -864,7 +864,7 @@ module private PrintTypes = WordL.arrow ^^ (layoutTyparRefWithInfo denv env tp)) |> longConstraintPrefix] - and private layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argtys, rty, _)) = + and private layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argtys, rty, _, _, _)) = let nm = DemangleOperatorName nm if denv.shortConstraints then WordL.keywordMember ^^ wordL (tagMember nm) @@ -876,9 +876,19 @@ module private PrintTypes = match tys with | [ty] -> layoutTypeWithInfo denv env ty | tys -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) tys) - tysL ^^ wordL (tagPunctuation ":") --- + + let argtys = + if memFlags.IsInstance then + match argtys with + | [] | [_] -> [denv.g.unit_ty] + | _ :: rest -> rest + else argtys + + let argtysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argtys + + tysL ^^ wordL (tagPunctuation ":") --- bracketL (stat ++ wordL (tagMember nm) ^^ wordL (tagPunctuation ":") --- - ((layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argtys --- wordL (tagPunctuation "->")) --- (layoutTypeWithInfo denv env rty))) + ((argtysL --- wordL (tagPunctuation "->")) --- (layoutTypeWithInfo denv env rty))) /// Layout a unit expression diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index aedf7252d9c..fc29a6d2607 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -325,7 +325,7 @@ let rec CheckTypeDeep (cenv: cenv) ((visitTy, visitTyconRefOpt, visitAppTyOpt, v | TType_var tp when tp.Solution.IsSome -> for cx in tp.Constraints do match cx with - | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln)), _) -> + | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln, _, _)), _) -> match visitTraitSolutionOpt, !soln with | Some visitTraitSolution, Some sln -> visitTraitSolution sln | _ -> () @@ -402,7 +402,7 @@ and CheckTypeConstraintDeep cenv f g env x = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> () -and CheckTraitInfoDeep cenv ((_, _, _, visitTraitSolutionOpt, _) as f) g env (TTrait(tys, _, _, argtys, rty, soln)) = +and CheckTraitInfoDeep cenv ((_, _, _, visitTraitSolutionOpt, _) as f) g env (TTrait(tys, _, _, argtys, rty, soln, _extSlns, _ad)) = CheckTypesDeep cenv f g env tys CheckTypesDeep cenv f g env argtys Option.iter (CheckTypeDeep cenv f g env true ) rty diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 3d474dadbcc..53b818df190 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -62,7 +62,7 @@ type TyconRefMap<'T>(imap: StampMap<'T>) = member m.Add (v: TyconRef) x = TyconRefMap (imap.Add (v.Stamp, x)) member m.Remove (v: TyconRef) = TyconRefMap (imap.Remove v.Stamp) member m.IsEmpty = imap.IsEmpty - + member m.Contents = imap static member Empty: TyconRefMap<'T> = TyconRefMap Map.empty static member OfList vs = (vs, TyconRefMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) @@ -103,13 +103,17 @@ type Remap = tyconRefRemap: TyconRefRemap /// Remove existing trait solutions? - removeTraitSolutions: bool } + removeTraitSolutions: bool + + /// A map indicating how to fill in extSlns for traits as we copy an expression. Indexed by the member name of the trait + extSlnsMap: Map } let emptyRemap = { tpinst = emptyTyparInst tyconRefRemap = emptyTyconRefRemap valRemap = ValMap.Empty - removeTraitSolutions = false } + removeTraitSolutions = false + extSlnsMap = Map.empty } type Remap with static member Empty = emptyRemap @@ -244,25 +248,25 @@ and remapTypesAux tyenv types = List.mapq (remapTypeAux tyenv) types and remapTyparConstraintsAux tyenv cs = cs |> List.choose (fun x -> match x with - | TyparConstraint.CoercesTo(ty, m) -> - Some(TyparConstraint.CoercesTo (remapTypeAux tyenv ty, m)) + | TyparConstraint.CoercesTo(ty,m) -> + Some(TyparConstraint.CoercesTo (remapTypeAux tyenv ty,m)) | TyparConstraint.MayResolveMember(traitInfo, m) -> - Some(TyparConstraint.MayResolveMember (remapTraitAux tyenv traitInfo, m)) - | TyparConstraint.DefaultsTo(priority, ty, m) -> Some(TyparConstraint.DefaultsTo(priority, remapTypeAux tyenv ty, m)) - | TyparConstraint.IsEnum(uty, m) -> - Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty, m)) - | TyparConstraint.IsDelegate(uty1, uty2, m) -> - Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1, remapTypeAux tyenv uty2, m)) - | TyparConstraint.SimpleChoice(tys, m) -> Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys, m)) - | TyparConstraint.SupportsComparison _ - | TyparConstraint.SupportsEquality _ + Some(TyparConstraint.MayResolveMember (remapTraitAux tyenv traitInfo,m)) + | TyparConstraint.DefaultsTo(priority,ty,m) -> Some(TyparConstraint.DefaultsTo(priority,remapTypeAux tyenv ty,m)) + | TyparConstraint.IsEnum(uty,m) -> + Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty,m)) + | TyparConstraint.IsDelegate(uty1,uty2,m) -> + Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1,remapTypeAux tyenv uty2,m)) + | TyparConstraint.SimpleChoice(tys,m) -> Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys,m)) + | TyparConstraint.SupportsComparison _ + | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ | TyparConstraint.IsUnmanaged _ | TyparConstraint.IsNonNullableStruct _ | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> Some x) -and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell)) = +and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, extSlns, ad)) = let slnCell = match !slnCell with | None -> None @@ -283,7 +287,14 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell)) = | ClosedExprSln e -> ClosedExprSln e // no need to remap because it is a closed expression, referring only to external types Some sln - // Note: we reallocate a new solution cell on every traversal of a trait constraint + + let extSlnsNew = + if tyenv.extSlnsMap.ContainsKey nm then + tyenv.extSlnsMap.[nm] + else + extSlns // TODO: do we need to remap here??? + + // Note: we reallocate a new solution cell (though keep existing solutions unless 'removeTraitSolutions'=true) on every traversal of a trait constraint // This feels incorrect for trait constraints that are quantified: it seems we should have // formal binders for trait constraints when they are quantified, just as // we have formal binders for type variables. @@ -291,7 +302,7 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell)) = // The danger here is that a solution for one syntactic occurrence of a trait constraint won't // be propagated to other, "linked" solutions. However trait constraints don't appear in any algebra // in the same way as types - TTrait(remapTypesAux tyenv tys, nm, mf, remapTypesAux tyenv argtys, Option.map (remapTypeAux tyenv) rty, ref slnCell) + TTrait(remapTypesAux tyenv tys, nm, mf, remapTypesAux tyenv argtys, Option.map (remapTypeAux tyenv) rty, ref slnCell, extSlnsNew, ad) and bindTypars tps tyargs tpinst = match tps with @@ -384,12 +395,14 @@ let mkInstRemap tpinst = { tyconRefRemap = emptyTyconRefRemap tpinst = tpinst valRemap = ValMap.Empty - removeTraitSolutions = false } + removeTraitSolutions = false + extSlnsMap = Map.empty } // entry points for "typar -> TType" instantiation -let instType tpinst x = if isNil tpinst then x else remapTypeAux (mkInstRemap tpinst) x -let instTypes tpinst x = if isNil tpinst then x else remapTypesAux (mkInstRemap tpinst) x -let instTrait tpinst x = if isNil tpinst then x else remapTraitAux (mkInstRemap tpinst) x +let instType tpinst x = if isNil tpinst then x else remapTypeAux (mkInstRemap tpinst) x +let instTypes tpinst x = if isNil tpinst then x else remapTypesAux (mkInstRemap tpinst) x +let instTrait tpinst x = if isNil tpinst then x else remapTraitAux (mkInstRemap tpinst) x +let instValRef tpinst x = if isNil tpinst then x else remapValRef (mkInstRemap tpinst) x let instTyparConstraints tpinst x = if isNil tpinst then x else remapTyparConstraintsAux (mkInstRemap tpinst) x let instSlotSig tpinst ss = remapSlotSig (fun _ -> []) (mkInstRemap tpinst) ss let copySlotSig ss = remapSlotSig (fun _ -> []) Remap.Empty ss @@ -896,8 +909,8 @@ type TypeEquivEnv with TypeEquivEnv.Empty.BindEquivTypars tps1 tps2 let rec traitsAEquivAux erasureFlag g aenv traitInfo1 traitInfo2 = - let (TTrait(tys1, nm, mf1, argtys, rty, _)) = traitInfo1 - let (TTrait(tys2, nm2, mf2, argtys2, rty2, _)) = traitInfo2 + let (TTrait(tys1, nm, mf1, argtys, rty, _, _extSlnsNew, _ad)) = traitInfo1 + let (TTrait(tys2, nm2, mf2, argtys2, rty2, _, _extSlnsNew2, _ad2)) = traitInfo2 mf1 = mf2 && nm = nm2 && ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 && @@ -1418,6 +1431,7 @@ type TyconRefMultiMap<'T>(contents: TyconRefMap<'T list>) = | _ -> [] member m.Add (v, x) = TyconRefMultiMap<'T>(contents.Add v (x :: m.Find v)) + member m.Contents = contents static member Empty = TyconRefMultiMap<'T>(TyconRefMap<_>.Empty) static member OfList vs = (vs, TyconRefMultiMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add (x, y)) @@ -2033,7 +2047,7 @@ and accFreeInTyparConstraint opts tpc acc = | TyparConstraint.IsUnmanaged _ | TyparConstraint.RequiresDefaultConstructor _ -> acc -and accFreeInTrait opts (TTrait(tys, _, _, argtys, rty, sln)) acc = +and accFreeInTrait opts (TTrait(tys, _, _, argtys, rty, sln, _, _ad)) acc = Option.foldBack (accFreeInTraitSln opts) sln.Value (accFreeInTypes opts tys (accFreeInTypes opts argtys @@ -2153,10 +2167,11 @@ and accFreeInTyparConstraintLeftToRight g cxFlag thruFlag acc tpc = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> acc -and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argtys, rty, _)) = +and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argtys, rty, _, _extSlns, _ad)) = let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc tys let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc argtys let acc = Option.fold (accFreeInTypeLeftToRight g cxFlag thruFlag) acc rty + // Note, the _extSlns are _not_ considered free. acc and accFreeTyparRefLeftToRight g cxFlag thruFlag acc (tp: Typar) = @@ -2215,6 +2230,52 @@ let valOfBind (b: Binding) = b.Var let valsOfBinds (binds: Bindings) = binds |> List.map (fun b -> b.Var) +//-------------------------------------------------------------------------- +// Collect extSlns. This is done prior to beta reduction of type parameters when inlining. We take the (solved) +// type arguments and strip them for extSlns, and record those extSlns in the remapped/copied/instantiated body +// of the implementation. +//-------------------------------------------------------------------------- + +let rec accExtSlnsInTyparConstraints acc cxs = + List.fold accExtSlnsInTyparConstraint acc cxs + +and accExtSlnsInTyparConstraint acc tpc = + match tpc with + | TyparConstraint.MayResolveMember (traitInfo, _) -> accExtSlnsInTrait acc traitInfo + | _ -> acc + +and accExtSlnsInTrait acc (TTrait(_typs, nm, _, _argtys, _rty, _, extSlns, _ad)) = + // We don't traverse the contents of traits, that wouldn't terminate and is not necessary since the type variables individiaull contain the extSlns we need + //let acc = accExtSlnsInTypes g acc typs + //let acc = accExtSlnsInTypes g acc argtys + //let acc = Option.fold (accExtSlnsInType g) acc rty + // Only record the extSlns if they have been solved in a useful way + if isNil extSlns then acc else + Map.add nm extSlns acc + +and accExtSlnsTyparRef acc (tp:Typar) = + let acc = accExtSlnsInTyparConstraints acc tp.Constraints + match tp.Solution with + | None -> acc + | Some sln -> accExtSlnsInType acc sln + +and accExtSlnsInType acc ty = + // NOTE: Unlike almost everywhere else, we do NOT strip ANY equations here. + // We _must_ traverse the solved typar containing the new extSlns for the grounded typar constraint, that's the whole point + match ty with + | TType_tuple (_, tys) + | TType_anon (_, tys) + | TType_app (_, tys) + | TType_ucase (_, tys) -> accExtSlnsInTypes acc tys + | TType_fun (d, r) -> accExtSlnsInType (accExtSlnsInType acc d) r + | TType_var r -> accExtSlnsTyparRef acc r + | TType_forall (_tps, r) -> accExtSlnsInType acc r + | TType_measure unt -> List.foldBack (fun (tp, _) acc -> accExtSlnsTyparRef acc tp) (ListMeasureVarOccsWithNonZeroExponents unt) acc + +and accExtSlnsInTypes acc tys = (acc, tys) ||> List.fold accExtSlnsInType + +let extSlnsInTypes tys = accExtSlnsInTypes Map.empty tys + //-------------------------------------------------------------------------- // Values representing member functions on F# types //-------------------------------------------------------------------------- @@ -3411,7 +3472,7 @@ module DebugPrint = and auxTraitL env (ttrait: TraitConstraintInfo) = #if DEBUG - let (TTrait(tys, nm, memFlags, argtys, rty, _)) = ttrait + let (TTrait(tys, nm, memFlags, argtys, rty, _, _extSlns, _ad)) = ttrait match global_g with | None -> wordL (tagText "") | Some g -> @@ -4008,7 +4069,8 @@ let mkRepackageRemapping mrpi = { valRemap = ValMap.OfList (mrpi.RepackagedVals |> List.map (fun (vref, x) -> vref.Deref, x)) tpinst = emptyTyparInst tyconRefRemap = TyconRefMap.OfList mrpi.RepackagedEntities - removeTraitSolutions = false } + removeTraitSolutions = false + extSlnsMap = Map.empty } //-------------------------------------------------------------------------- // Compute instances of the above for mty -> mty @@ -4243,7 +4305,7 @@ let IsHidden setF accessF remapF = check rest (remapF rpi x)) fun mrmi x -> check mrmi x - + let IsHiddenTycon mrmi x = IsHidden (fun mhi -> mhi.HiddenTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) mrmi x let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) mrmi x @@ -4641,7 +4703,7 @@ and accFreeInOp opts op acc = | TOp.Reraise -> accUsesRethrow true acc - | TOp.TraitCall (TTrait(tys, _, _, argtys, rty, sln)) -> + | TOp.TraitCall (TTrait (tys, _, _, argtys, rty, sln, _extSlns, _ad)) -> Option.foldBack (accFreeVarsInTraitSln opts) sln.Value (accFreeVarsInTys opts tys (accFreeVarsInTys opts argtys @@ -5507,7 +5569,10 @@ let copyExpr g compgen e = remapExpr g compgen Remap.Empty e let copyImplFile g compgen e = remapImplFile g compgen Remap.Empty e |> fst -let instExpr g tpinst e = remapExpr g CloneAll (mkInstRemap tpinst) e +/// Copy an expression applying a type instantiation. +let instExpr g tpinst e = + let extSlnsMap = extSlnsInTypes (List.map snd tpinst) + remapExpr g CloneAll { mkInstRemap tpinst with extSlnsMap = extSlnsMap } e //-------------------------------------------------------------------------- // Replace Marks - adjust debugging marks when a lambda gets diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 176f64df72c..ea358d68725 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -488,6 +488,8 @@ type TyconRefMultiMap<'T> = /// Make a new map, containing a new entry for the given type definition member Add : TyconRef * 'T -> TyconRefMultiMap<'T> + member Contents : TyconRefMap<'T list> + /// The empty map static member Empty : TyconRefMultiMap<'T> @@ -529,9 +531,18 @@ type ValRemap = ValMap [] type Remap = { tpinst : TyparInst + + /// Values to remap valRemap: ValRemap + + /// TyconRefs to remap tyconRefRemap : TyconRefRemap - removeTraitSolutions: bool } + + /// Remove existing trait solutions? + removeTraitSolutions: bool + + /// A map indicating how to fill in extSlns for traits as we copy an expression. Indexed by the member name of the trait + extSlnsMap: Map } static member Empty : Remap @@ -552,6 +563,7 @@ val instTypes : TyparInst -> TypeInst -> TypeInst val instTyparConstraints : TyparInst -> TyparConstraint list -> TyparConstraint list val instTrait : TyparInst -> TraitConstraintInfo -> TraitConstraintInfo +val instValRef : TyparInst -> ValRef -> ValRef //------------------------------------------------------------------------- // From typars to types @@ -1454,6 +1466,10 @@ type TypeDefMetadata = /// Extract metadata from a type definition val metadataOfTycon : Tycon -> TypeDefMetadata +#if EXTENSIONTYPING +val extensionInfoOfTy : TcGlobals -> TType -> TyconRepresentation +#endif + /// Extract metadata from a type val metadataOfTy : TcGlobals -> TType -> TypeDefMetadata diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index ffdf31efbdf..5ce2a657c51 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1504,7 +1504,8 @@ let p_trait_sln sln st = p_byte 5 st; p_tup3 p_anonInfo p_tys p_int (a, b, c) st -let p_trait (TTrait(a, b, c, d, e, f)) st = +let p_trait (TTrait(a, b, c, d, e, f, _extSlns, _ad)) st = + // The _extSlns do not get pickled. We are assuming this is a generic or solved constraint p_tup6 p_tys p_string p_MemberFlags p_tys (p_option p_ty) (p_option p_trait_sln) (a, b, c, d, e, !f) st let u_anonInfo_data st = @@ -1536,10 +1537,10 @@ let u_trait_sln st = FSAnonRecdFieldSln(a, b, c) | _ -> ufailwith st "u_trait_sln" -let u_trait st = +let u_trait st = let a, b, c, d, e, f = u_tup6 u_tys u_string u_MemberFlags u_tys (u_option u_ty) (u_option u_trait_sln) st - TTrait (a, b, c, d, e, ref f) - + // extSlns starts empty. TODO: check the ramifications of this when inlining solved trait calls from other assemblies + TTrait (a, b, c, d, e, ref f, [], None) let p_rational q st = p_int32 (GetNumerator q) st; p_int32 (GetDenominator q) st diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 6609d5ad959..8b6174ad598 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -219,6 +219,8 @@ type TcEnv = member tenv.AccessRights = tenv.eAccessRights + member tenv.TraitFreshner = Some (GetTraitFreshner tenv.AccessRights tenv.NameEnv) + override tenv.ToString() = "TcEnv(...)" /// Compute the value of this computed, cached field @@ -309,6 +311,8 @@ let addInternalsAccessibility env (ccu: CcuThunk) = eAccessRights = computeAccessRights env.eAccessPath eInternalsVisibleCompPaths env.eFamilyType // update this computed field eInternalsVisibleCompPaths = compPath :: env.eInternalsVisibleCompPaths } +let ModifyNameResEnv f env = { env with eNameResEnv = f env.NameEnv } + /// Add a local value to TcEnv let AddLocalValPrimitive (v: Val) env = { env with @@ -368,7 +372,7 @@ let AddLocalTycons g amap m (tycons: Tycon list) env = /// Add a list of type definitions to TcEnv and report them to the sink let AddLocalTyconsAndReport tcSink scopem g amap m tycons env = let env = AddLocalTycons g amap m tycons env - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) env /// Adjust the TcEnv to account for opening the set of modules, namespaces or static classes implied by an `open` declaration @@ -444,7 +448,7 @@ let AddLocalSubModule g amap m env (modul: ModuleOrNamespace) = /// Add a "module X = ..." definition to the TcEnv and report it to the sink let AddLocalSubModuleAndReport tcSink scopem g amap m env (modul: ModuleOrNamespace) = let env = AddLocalSubModule g amap m env modul - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) env /// Add a set of explicitly declared type parameters as being available in the TcEnv @@ -514,7 +518,7 @@ type cenv = /// Create a new compilation environment static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring) = let infoReader = new InfoReader(g, amap) - let instantiationGenerator m tpsorig = ConstraintSolver.FreshenTypars m tpsorig + let instantiationGenerator m tpsorig = ConstraintSolver.FreshenTypars None m tpsorig // TODO: check 'None' here for env.TraitFreshner let nameResolver = new NameResolver(g, amap, infoReader, instantiationGenerator) { g = g amap = amap @@ -537,8 +541,8 @@ type cenv = override __.ToString() = "" -let CopyAndFixupTypars m rigid tpsorig = - ConstraintSolver.FreshenAndFixupTypars m rigid [] [] tpsorig +let CopyAndFixupTypars traitFreshner m rigid tpsorig = + ConstraintSolver.FreshenAndFixupTypars traitFreshner m rigid [] [] tpsorig let UnifyTypes cenv (env: TcEnv) m actualTy expectedTy = ConstraintSolver.AddCxTypeEqualsType env.eContextInfo env.DisplayEnv cenv.css m (tryNormalizeMeasureInType cenv.g actualTy) (tryNormalizeMeasureInType cenv.g expectedTy) @@ -1066,9 +1070,6 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, optIm if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(name, n), m)) if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments name, m)) - if isExtrinsic && IsMangledOpName id.idText then - warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) - ValMemberInfoTransient(memberInfo, logicalName, compiledName) type OverridesOK = @@ -1912,33 +1913,33 @@ let MakeAndPublishSimpleVals cenv env m names mergeNamesInOneNameresEnv = // to C<_> occurs then generate C for a fresh type inference variable ?ty. //------------------------------------------------------------------------- -let FreshenTyconRef m rigid (tcref: TyconRef) declaredTyconTypars = +let FreshenTyconRef traitFreshner m rigid (tcref: TyconRef) declaredTyconTypars = let tpsorig = declaredTyconTypars let tps = copyTypars tpsorig if rigid <> TyparRigidity.Rigid then tps |> List.iter (fun tp -> tp.SetRigidity rigid) - let renaming, tinst = FixupNewTypars m [] [] tpsorig tps + let renaming, tinst = FixupNewTypars traitFreshner m [] [] tpsorig tps (TType_app(tcref, List.map mkTyparTy tpsorig), tps, renaming, TType_app(tcref, tinst)) -let FreshenPossibleForallTy g m rigid ty = +let FreshenPossibleForallTy traitFreshner g m rigid ty = let tpsorig, tau = tryDestForallTy g ty if isNil tpsorig then [], [], [], tau else // tps may be have been equated to other tps in equi-recursive type inference and units-of-measure type inference. Normalize them here let tpsorig = NormalizeDeclaredTyparsForEquiRecursiveInference g tpsorig - let tps, renaming, tinst = CopyAndFixupTypars m rigid tpsorig + let tps, renaming, tinst = CopyAndFixupTypars traitFreshner m rigid tpsorig tpsorig, tps, tinst, instType renaming tau -let FreshenTyconRef2 m (tcref: TyconRef) = - let tps, renaming, tinst = FreshenTypeInst m (tcref.Typars m) +let FreshenTyconRef2 traitFreshner m (tcref: TyconRef) = + let tps, renaming, tinst = FreshenTypeInst traitFreshner m (tcref.Typars m) tps, renaming, tinst, TType_app (tcref, tinst) /// Given a abstract method, which may be a generic method, freshen the type in preparation /// to apply it as a constraint to the method that implements the abstract slot -let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = +let FreshenAbstractSlot traitFreshner g amap m synTyparDecls absMethInfo = // Work out if an explicit instantiation has been given. If so then the explicit type // parameters will be made rigid and checked for generalization. If not then auto-generalize @@ -1960,7 +1961,7 @@ let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = let ttps = absMethInfo.GetFormalTyparsOfDeclaringType m let ttinst = argsOfAppTy g absMethInfo.ApparentEnclosingType let rigid = if typarsFromAbsSlotAreRigid then TyparRigidity.Rigid else TyparRigidity.Flexible - ConstraintSolver.FreshenAndFixupTypars m rigid ttps ttinst fmtps + ConstraintSolver.FreshenAndFixupTypars traitFreshner m rigid ttps ttinst fmtps // Work out the required type of the member let argTysFromAbsSlot = argTys |> List.mapSquared (instType typarInstFromAbsSlot) @@ -2012,7 +2013,7 @@ let BuildFieldMap cenv env isPartial ty flds m = // Record the precise resolution of the field for intellisense let item = FreshenRecdFieldRef cenv.nameResolver m fref2 - CallNameResolutionSink cenv.tcSink ((snd fld).idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) + CallNameResolutionSink cenv.tcSink ((snd fld).idRange, env.eNameResEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) CheckRecdFieldAccessible cenv.amap m env.eAccessRights fref2 |> ignore CheckFSharpAttributes cenv.g fref2.PropertyAttribs m |> CommitOperationResult @@ -2677,11 +2678,11 @@ module EventDeclarationNormalization = /// Make a copy of the "this" type for a generic object type, e.g. List<'T> --> List<'?> for a fresh inference variable. /// Also adjust the "this" type to take into account whether the type is a struct. -let FreshenObjectArgType cenv m rigid tcref isExtrinsic declaredTyconTypars = +let FreshenObjectArgType cenv traitFreshner m rigid tcref isExtrinsic declaredTyconTypars = #if EXTENDED_EXTENSION_MEMBERS // indicates if extension members can add additional constraints to type parameters let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy = FreshenTyconRef m (if isExtrinsic then TyparRigidity.Flexible else rigid) tcref declaredTyconTypars #else - let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy = FreshenTyconRef m rigid tcref declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy = FreshenTyconRef traitFreshner m rigid tcref declaredTyconTypars #endif // Struct members have a byref 'this' type (unless they are extrinsic extension members) let thisTy = @@ -2748,10 +2749,10 @@ let TcValEarlyGeneralizationConsistencyCheck cenv (env: TcEnv) (v: Val, vrec, ti /// F# object model member, in which case the optInst is the type instantiation /// inferred by member overload resolution, and vrefFlags indicate if the /// member is being used in a special way, i.e. may be one of: -/// | CtorValUsedAsSuperInit "inherit Panel()" -/// | CtorValUsedAsSelfInit "new() = new OwnType(3)" -/// | VSlotDirectCall "base.OnClick(eventArgs)" -let TcVal checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResolution m = +/// | CtorValUsedAsSuperInit "inherit Panel()" +/// | CtorValUsedAsSelfInit "new() = new OwnType(3)" +/// | VSlotDirectCall "base.OnClick(eventArgs)" +let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResolution m = let (tpsorig, _, _, _, tinst, _) as res = let v = vref.Deref let vrec = v.RecursiveValInfo @@ -2772,7 +2773,7 @@ let TcVal checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResoluti // The value may still be generic, e.g. // [] // let Null = null - let tpsorig, _, tinst, tau = FreshenPossibleForallTy cenv.g m TyparRigidity.Flexible vty + let tpsorig, _, tinst, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty tpsorig, Expr.Const (c, m, tau), isSpecial, tau, tinst, tpenv | None -> @@ -2802,8 +2803,8 @@ let TcVal checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResoluti tpsorig, NormalValUse, tinst, tau, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, _, tinst, tau = FreshenPossibleForallTy cenv.g m TyparRigidity.Flexible vty - tpsorig, NormalValUse, tinst, tau, tpenv + let tpsorig, _, tptys, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty + tpsorig, NormalValUse, tptys, tau, tpenv // If we have got an explicit instantiation then use that | Some(vrefFlags, checkTys) -> @@ -2823,7 +2824,7 @@ let TcVal checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResoluti tpsorig, vrefFlags, tinst, tau2, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, tps, tptys, tau = FreshenPossibleForallTy cenv.g m TyparRigidity.Flexible vty + let tpsorig, tps, tptys, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty //dprintfn "After Freshen: tau = %s" (Layout.showL (typeL tau)) let (tinst: TypeInst), tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) checkInst tinst @@ -2833,7 +2834,7 @@ let TcVal checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResoluti TcValEarlyGeneralizationConsistencyCheck cenv env (v, vrec, tinst, vty, tau, m) //dprintfn "After Unify: tau = %s" (Layout.showL (typeL tau)) - tpsorig, vrefFlags, tinst, tau, tpenv + tpsorig, vrefFlags, tptys, tau, tpenv let exprForVal = Expr.Val (vref, vrefFlags, m) let exprForVal = mkTyAppExpr m (exprForVal, vty) tinst @@ -2862,13 +2863,13 @@ let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTy else match v.LiteralValue with | Some c -> - let _, _, _, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vty + let _, _, _, tau = FreshenPossibleForallTy None g m TyparRigidity.Flexible vty Expr.Const (c, m, tau), tau | None -> // Instantiate the value let tau = // If we have got an explicit instantiation then use that - let _, tps, tptys, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vty + let _, tps, tptys, tau = FreshenPossibleForallTy None g m TyparRigidity.Flexible vty if tptys.Length <> vrefTypeInst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tps.Length, vrefTypeInst.Length), m)) instType (mkTyparInst tps vrefTypeInst) tau @@ -3045,7 +3046,7 @@ let BuildPossiblyConditionalMethodCall cenv env isMutable m isProp minfo valUseF | _ -> #endif let tcVal valref valUse ttypes m = - let _, a, _, b, _, _ = TcVal true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m + let _, a, _, b, _, _ = TcVal env.TraitFreshner true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m a, b BuildMethodCall tcVal cenv.g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args @@ -3301,7 +3302,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result getEnumerator_minfo -> - let getEnumerator_minst = FreshenMethInfo m getEnumerator_minfo + let getEnumerator_minst = FreshenMethInfo env.TraitFreshner m getEnumerator_minfo let retTypeOfGetEnumerator = getEnumerator_minfo.GetFSharpReturnTy(cenv.amap, m, getEnumerator_minst) if hasArgs getEnumerator_minfo getEnumerator_minst then err true tyToSearchForGetEnumeratorAndItem else @@ -3309,7 +3310,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result moveNext_minfo -> - let moveNext_minst = FreshenMethInfo m moveNext_minfo + let moveNext_minst = FreshenMethInfo env.TraitFreshner m moveNext_minfo let retTypeOfMoveNext = moveNext_minfo.GetFSharpReturnTy(cenv.amap, m, moveNext_minst) if not (typeEquiv cenv.g cenv.g.bool_ty retTypeOfMoveNext) then err false retTypeOfGetEnumerator else if hasArgs moveNext_minfo moveNext_minst then err false retTypeOfGetEnumerator else @@ -3318,7 +3319,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result get_Current_minfo -> - let get_Current_minst = FreshenMethInfo m get_Current_minfo + let get_Current_minst = FreshenMethInfo env.TraitFreshner m get_Current_minfo if hasArgs get_Current_minfo get_Current_minst then err false retTypeOfGetEnumerator else let enumElemTy = get_Current_minfo.GetFSharpReturnTy(cenv.amap, m, get_Current_minst) @@ -4385,7 +4386,7 @@ let rec TcTyparConstraint ridx cenv newOk checkCxs occ (env: TcEnv) tpenv c = | WhereTyparSupportsMember(tps, memSpfn, m) -> let traitInfo, tpenv = TcPseudoMemberSpec cenv newOk env tps tpenv memSpfn m match traitInfo with - | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _) when memberFlags.MemberKind = MemberKind.Constructor -> + | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _, _, _) when memberFlags.MemberKind = MemberKind.Constructor -> match objtys, argTys with | [ty], [] when typeEquiv cenv.g ty (GetFSharpViewOfReturnType cenv.g returnTy) -> AddCxTypeMustSupportDefaultCtor env.DisplayEnv cenv.css m NoTrace ty @@ -4421,8 +4422,12 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv memSpfn m = let item = Item.ArgName (id, memberConstraintTy, None) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) - TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None), tpenv + // extSlns starts off empty because the trait has some support + // ad starts off as None because the trait has some support + TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None, [], None), tpenv + | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) + | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) @@ -4435,7 +4440,7 @@ and TcValSpec cenv env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv match tcrefContainerInfo with | Some(MemberOrValContainerInfo(tcref, _, _, _, declaredTyconTypars)) -> let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let _, enclosingDeclaredTypars, _, _, thisTy = FreshenObjectArgType cenv m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars + let _, enclosingDeclaredTypars, _, _, thisTy = FreshenObjectArgType cenv env.TraitFreshner m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars // An implemented interface type is in terms of the type's type parameters. // We need a signature in terms of the values' type parameters. // let optIntfSlotTy = Option.map (instType renaming) optIntfSlotTy in @@ -4582,7 +4587,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a let item = Item.TypeVar(id.idText, res) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) // record the ' as well for tokenization - // CallNameResolutionSink cenv.tcSink (tp.Range.StartRange, env.NameEnv, item, item, ItemOccurence.UseInType, env.DisplayEnv, env.eAccessRights) + // CallNameResolutionSink cenv.tcSink (tp.Range.StartRange, env.NameEnv, item, item, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) res, tpenv let key = id.idText match env.eNameResEnv.eTypars.TryGetValue key with @@ -4593,7 +4598,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a | None -> if newOk = NoNewTypars then let suggestTypeParameters (addToBuffer: string -> unit) = - for p in env.eNameResEnv.eTypars do + for p in env.NameEnv.eTypars do addToBuffer ("'" + p.Key) match tpenv with @@ -4627,7 +4632,7 @@ and TcTyparDecl cenv env (TyparDecl(Attributes synAttrs, (Typar(id, _, _) as stp | None -> () let item = Item.TypeVar(id.idText, tp) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) tp @@ -5069,7 +5074,7 @@ and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys: if tcref.Deref.IsProvided then TcProvidedTypeApp cenv env tpenv tcref synArgTys m else #endif - let tps, _, tinst, _ = FreshenTyconRef2 m tcref + let tps, _, tinst, _ = FreshenTyconRef2 env.TraitFreshner m tcref // If we're not checking constraints, i.e. when we first assert the super/interfaces of a type definition, then just // clear the constraint lists of the freshly generated type variables. A little ugly but fairly localized. @@ -5364,7 +5369,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | Item.ActivePatternCase(APElemRef(apinfo, vref, idx)) as item -> let args = match args with SynConstructorArgs.Pats args -> args | _ -> error(Error(FSComp.SR.tcNamedActivePattern(apinfo.ActiveTags.[idx]), m)) // TOTAL/PARTIAL ACTIVE PATTERNS - let _, vexp, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m + let _, vexp, _, _, tinst, _ = TcVal env.TraitFreshner true cenv env tpenv vref None None m let vexp = MakeApplicableExprWithFlex cenv env vexp let vexpty = vexp.Type @@ -5530,7 +5535,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) | Some lit -> - let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None m + let _, _, _, vexpty, _, _ = TcVal env.TraitFreshner true cenv env tpenv vref None None m CheckValAccessible m env.AccessRights vref CheckFSharpAttributes cenv.g vref.Attribs m |> CommitOperationResult checkNoArgsForLiteral() @@ -5563,7 +5568,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | SynPat.Record (flds, m) -> let tcref, fldsmap, _fldsList = BuildFieldMap cenv env true ty flds m // REVIEW: use _fldsList to type check pattern in code order not field defn order - let _, inst, tinst, gtyp = FreshenTyconRef2 m tcref + let _, inst, tinst, gtyp = FreshenTyconRef2 env.TraitFreshner m tcref UnifyTypes cenv env m ty gtyp let fields = tcref.TrueInstanceFieldsAsList let ftys = fields |> List.map (fun fsp -> actualTyOfRecdField inst fsp, fsp) @@ -5970,7 +5975,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = TcNewExpr cenv env tpenv objTy (Some synObjTy.Range) superInit arg mNewExpr | SynExpr.ObjExpr (objTy, argopt, binds, extraImpls, mNewExpr, m) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) TcObjectExpr cenv overallTy env tpenv (objTy, argopt, binds, extraImpls, mNewExpr, m) | SynExpr.Record (inherits, optOrigExpr, flds, mWholeExpr) -> @@ -6623,7 +6628,7 @@ and TcRecordConstruction cenv overallTy env tpenv optOrigExprInfo objTy fldsList // Check accessibility: this is also done in BuildFieldMap, but also need to check // for fields in { new R with a=1 and b=2 } constructions and { r with a=1 } copy-and-update expressions rfrefs |> List.iter (fun rfref -> - CheckRecdFieldAccessible cenv.amap m env.eAccessRights rfref |> ignore + CheckRecdFieldAccessible cenv.amap m env.AccessRights rfref |> ignore CheckFSharpAttributes cenv.g rfref.PropertyAttribs m |> CommitOperationResult) let args = List.map snd fldsList @@ -6720,8 +6725,7 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implty: TType) virtNameAndArit | [(_, absSlot)] -> - let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot - = FreshenAbstractSlot cenv.g cenv.amap mBinding synTyparDecls absSlot + let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = FreshenAbstractSlot env.TraitFreshner cenv.g cenv.amap mBinding synTyparDecls absSlot // Work out the required type of the member let bindingTy = implty --> (mkMethodTy cenv.g argTysFromAbsSlot retTyFromAbsSlot) @@ -7134,7 +7138,7 @@ and TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr | [] -> [] | _ -> let tcref, _, fldsList = BuildFieldMap cenv env hasOrigExpr overallTy flds mWholeExpr - let _, _, _, gtyp = FreshenTyconRef2 mWholeExpr tcref + let _, _, _, gtyp = FreshenTyconRef2 env.TraitFreshner mWholeExpr tcref UnifyTypes cenv env mWholeExpr overallTy gtyp [ for n, v in fldsList do @@ -9047,8 +9051,8 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let mkConstrApp _mArgs = function [arg] -> arg | _ -> error(InternalError("ApplyUnionCaseOrExn", mItem)) mkConstrApp, [ucaseAppTy], [ for (s, m) in apinfo.ActiveTagsWithRanges -> mkSynId m s ] | _ -> - let ucref = mkChoiceCaseRef g mItem aparity n - let _, _, tinst, _ = FreshenTyconRef2 mItem ucref.TyconRef + let ucref = mkChoiceCaseRef cenv.g mItem aparity n + let _, _, tinst, _ = FreshenTyconRef2 env.TraitFreshner mItem ucref.TyconRef let ucinfo = UnionCaseInfo (tinst, ucref) ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) | _ -> @@ -9330,7 +9334,9 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let memberFlags = StaticMemberFlags MemberKind.Member let logicalCompiledName = ComputeLogicalName id memberFlags - let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, sln) + + let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, sln, [], None) + let traitInfo = FreshenTrait env.TraitFreshner traitInfo let expr = Expr.Op (TOp.TraitCall traitInfo, [], ves, mItem) let expr = mkLambdas mItem [] vs (expr, retTy) @@ -9475,7 +9481,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // - it isn't a CtorValUsedAsSelfInit // - it isn't a VSlotDirectCall (uses of base values do not take type arguments let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem + let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitFreshner true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here @@ -9483,7 +9489,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Value get | _ -> - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem + let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitFreshner true cenv env tpenv vref None (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed @@ -10074,12 +10080,12 @@ and TcMethodApplication let callerArgs = List.zip unnamedCurriedCallerArgs namedCurriedCallerArgs let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = - let minst = FreshenMethInfo mItem minfo + let minst = FreshenMethInfo env.TraitFreshner mItem minfo let callerTyArgs = match tyargsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitFreshner, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) let preArgumentTypeCheckingCalledMethGroup = [ for (minfo, pinfoOpt) in candidateMethsAndProps do @@ -10179,7 +10185,7 @@ and TcMethodApplication match tyargsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitFreshner, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) let callerArgCounts = (unnamedCurriedCallerArgs.Length, namedCurriedCallerArgs.Length) let csenv = MakeConstraintSolverEnv ContextInfo.NoContext cenv.css mMethExpr denv @@ -11385,7 +11391,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot None cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth let declaredTypars = (if typarsFromAbsSlotAreRigid then typarsFromAbsSlot else declaredTypars) @@ -11442,7 +11448,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let _, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot None cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth if not (isNil typarsFromAbsSlot) then errorR(InternalError("Unexpected generic property", memberId.idRange)) @@ -11519,7 +11525,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl error(Error(FSComp.SR.tcConstructorsDisallowedInExceptionAugmentation(), id.idRange)) let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv None mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic @@ -11589,7 +11595,7 @@ and AnalyzeRecursiveInstanceMemberDecl // The type being augmented tells us the type of 'this' let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv None mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner @@ -12074,7 +12080,7 @@ and TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv (pgr let maxInferredTypars = freeInTypeLeftToRight cenv.g false tau let canGeneralizeConstrained = GeneralizationHelpers.CanGeneralizeConstrainedTyparsForDecl rbinfo.DeclKind - let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars, tau, isCtor) + let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars,tau,isCtor) generalizedTypars /// Compute the type variables which may have member constraints that need to be canonicalized prior to generalization @@ -12316,7 +12322,7 @@ let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind, memF let flex = ExplicitTyparInfo(declaredTypars, declaredTypars, synCanInferTypars) - let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars(cenv, denv, id.idRange, emptyFreeTypars, canInferTypars, CanGeneralizeConstrainedTypars, inlineFlag, None, allDeclaredTypars, freeInType, ty, false) + let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars(cenv, denv, id.idRange, emptyFreeTypars, canInferTypars, CanGeneralizeConstrainedTypars, inlineFlag, None, allDeclaredTypars,freeInType, ty, false) let valscheme1 = PrelimValScheme1(id, flex, ty, Some partialValReprInfo, memberInfoOpt, mutableFlag, inlineFlag, NormalVal, noArgOrRetAttribs, vis, false) @@ -13540,7 +13546,7 @@ module MutRecBindingChecking = AddLocalTyconRefs true g cenv.amap tcref.Range [tcref] initialEnvForTycon // Make fresh version of the class type for type checking the members and lets * - let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv None tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars // The basic iteration over the declarations in a single type definition @@ -14270,7 +14276,7 @@ module MutRecBindingChecking = for tp in unsolvedTyparsForRecursiveBlockInvolvingGeneralizedVariables do //printfn "solving unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" tp.DisplayName tp.Stamp if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then - ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denv tp + ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denv tp // Now that we know what we've generalized we can adjust the recursive references let defnsCs = TcMutRecBindings_Phase2C_FixupRecursiveReferences cenv (denv, defnsBs, generalizedTyparsForRecursiveBlock, generalizedRecBinds, scopem) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 1db4e36b356..bb9f47e04c1 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -297,6 +297,23 @@ let ImportReturnTypeFromMetadata amap m ilty cattrs scoref tinst minst = | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst retTy cattrs) + +/// Search for the relevant extension values again if a name resolution environment is provided +/// Basically, if you use a generic thing, then the extension members in scope at the point of _use_ +/// are the ones available to solve the constraint +let FreshenTrait traitFreshner traitInfo = + let (TTrait(typs, nm, mf, argtys, rty, slnCell, extSlns, ad)) = traitInfo + + // Call the trait freshner if it is provided + let extSlns2, ad2 = + match traitFreshner with + | None -> extSlns, ad + | Some f -> + let extSlns2, ad2 = f traitInfo + extSlns2, Some ad2 + + TTrait(typs, nm, mf, argtys, rty, slnCell, extSlns2, ad2) + /// Copy constraints. If the constraint comes from a type parameter associated /// with a type constructor then we are simply renaming type variables. If it comes /// from a generic method in a generic class (e.g. ty.M<_>) then we may be both substituting the @@ -305,15 +322,15 @@ let ImportReturnTypeFromMetadata amap m ilty cattrs scoref tinst minst = /// /// Note: this now looks identical to constraint instantiation. -let CopyTyparConstraints m tprefInst (tporig: Typar) = - tporig.Constraints - |> List.map (fun tpc -> - match tpc with - | TyparConstraint.CoercesTo(ty, _) -> +let CopyTyparConstraints traitFreshner m tprefInst (tporig: Typar) = + tporig.Constraints + |> List.map (fun tpc -> + match tpc with + | TyparConstraint.CoercesTo(ty, _) -> TyparConstraint.CoercesTo (instType tprefInst ty, m) - | TyparConstraint.DefaultsTo(priority, ty, _) -> + | TyparConstraint.DefaultsTo(priority, ty, _) -> TyparConstraint.DefaultsTo (priority, instType tprefInst ty, m) - | TyparConstraint.SupportsNull _ -> + | TyparConstraint.SupportsNull _ -> TyparConstraint.SupportsNull m | TyparConstraint.IsEnum (uty, _) -> TyparConstraint.IsEnum (instType tprefInst uty, m) @@ -333,12 +350,13 @@ let CopyTyparConstraints m tprefInst (tporig: Typar) = TyparConstraint.SimpleChoice (List.map (instType tprefInst) tys, m) | TyparConstraint.RequiresDefaultConstructor _ -> TyparConstraint.RequiresDefaultConstructor m - | TyparConstraint.MayResolveMember(traitInfo, _) -> - TyparConstraint.MayResolveMember (instTrait tprefInst traitInfo, m)) + | TyparConstraint.MayResolveMember(traitInfo, _) -> + let traitInfo2 = FreshenTrait traitFreshner traitInfo + TyparConstraint.MayResolveMember (instTrait tprefInst traitInfo2, m)) -/// The constraints for each typar copied from another typar can only be fixed up once -/// we have generated all the new constraints, e.g. f List, B :> List> ... -let FixupNewTypars m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = +/// The constraints for each typar copied from another typar can only be fixed up once +/// we have generated all the new constraints, e.g. f List, B :> List> ... +let FixupNewTypars traitFreshner m (formalEnclosingTypars:Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = // Checks.. These are defensive programming against early reported errors. let n0 = formalEnclosingTypars.Length let n1 = tinst.Length @@ -350,7 +368,7 @@ let FixupNewTypars m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsori // The real code.. let renaming, tptys = mkTyparToTyparRenaming tpsorig tps let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitFreshner m tprefInst tporig)) renaming, tptys @@ -1526,10 +1544,10 @@ type MethInfo = let tcref = tcrefOfAppTy g x.ApparentEnclosingAppType let formalEnclosingTyparsOrig = tcref.Typars m let formalEnclosingTypars = copyTypars formalEnclosingTyparsOrig - let _, formalEnclosingTyparTys = FixupNewTypars m [] [] formalEnclosingTyparsOrig formalEnclosingTypars + let _, formalEnclosingTyparTys = FixupNewTypars None m [] [] formalEnclosingTyparsOrig formalEnclosingTypars let formalMethTypars = copyTypars x.FormalMethodTypars - let _, formalMethTyparTys = FixupNewTypars m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars - let formalRetTy, formalParams = + let _, formalMethTyparTys = FixupNewTypars None m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars + let formalRetTy, formalParams = match x with | ILMeth(_, ilminfo, _) -> let ftinfo = ILTypeInfo.FromType g (TType_app(tcref, formalEnclosingTyparTys)) diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index 16ada4ec575..ec0a3cf1f6c 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -827,7 +827,7 @@ module FSharpExprConvert = let typR = ConvType cenv (mkAppTy tycr tyargs) E.UnionCaseTag(ConvExpr cenv env arg1, typR) - | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution)), _, _ -> + | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution, _extSlns, _ad)), _, _ -> let tysR = ConvTypes cenv tys let tyargsR = ConvTypes cenv tyargs let argtysR = ConvTypes cenv argtys diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 295e42b02cb..a287ab97f8a 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1219,7 +1219,8 @@ and FSharpAbstractSignature(cenv, info: SlotSig) = member __.DeclaringType = FSharpType(cenv, info.ImplementedType) and FSharpGenericParameterMemberConstraint(cenv, info: TraitConstraintInfo) = - let (TTrait(tys, nm, flags, atys, rty, _)) = info + let (TTrait(tys, nm, flags, atys, rty, _, _extSlns, _ad)) = info + member __.MemberSources = tys |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection @@ -1277,7 +1278,7 @@ and FSharpGenericParameterConstraint(cenv, cx: TyparConstraint) = member __.MemberConstraintData = match cx with - | TyparConstraint.MayResolveMember(info, _) -> FSharpGenericParameterMemberConstraint(cenv, info) + | TyparConstraint.MayResolveMember(info, _) -> FSharpGenericParameterMemberConstraint(cenv, info) | _ -> invalidOp "not a member constraint" member __.IsNonNullableValueTypeConstraint = diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 27caa7b6008..4a91d212c2b 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2344,6 +2344,14 @@ and override x.ToString() = x.Name +and TraitPossibleExtensionMemberSolutions = TraitPossibleExtensionMemberSolution list + +/// Only satisfied by type 'ExtensionMember'. Not stored in TastPickle. +and TraitPossibleExtensionMemberSolution = interface end + +/// Only satisfied by 'AccessorDomain'. Not stored in TastPickle. +and TraitAccessorDomain = interface end + and [] TyparConstraint = @@ -2399,25 +2407,34 @@ and [] TraitConstraintInfo = - /// TTrait(tys, nm, memFlags, argtys, rty, solution) + /// TTrait(tys, nm, memFlags, argtys, rty, solutionCell, extSlns, ad) /// /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of TTypes * string * MemberFlags * TTypes * TType option * TraitConstraintSln option ref + | TTrait of TTypes * string * MemberFlags * TTypes * TType option * TraitConstraintSln option ref * extSlns: TraitPossibleExtensionMemberSolutions * ad: TraitAccessorDomain option + + /// Get the support types that can help provide members to solve the constraint + member x.SupportTypes= (let (TTrait(tys,_,_,_,_,_,_,_)) = x in tys) /// Get the member name associated with the member constraint. - member x.MemberName = (let (TTrait(_, nm, _, _, _, _)) = x in nm) + member x.MemberName = (let (TTrait(_, nm, _, _, _, _, _, _)) = x in nm) /// Get the argument types required of a member in order to solve the constraint - member x.ArgumentTypes = (let (TTrait(_, _, _, argtys, _, _)) = x in argtys) + member x.ArgumentTypes = (let (TTrait(_, _, _, argtys, _, _, _, _)) = x in argtys) /// Get the return type recorded in the member constraint. - member x.ReturnType = (let (TTrait(_, _, _, _, ty, _)) = x in ty) + member x.ReturnType = (let (TTrait(_, _, _, _, rty, _, _, _)) = x in rty) /// Get or set the solution of the member constraint during inference member x.Solution - with get() = (let (TTrait(_, _, _, _, _, sln)) = x in sln.Value) - and set v = (let (TTrait(_, _, _, _, _, sln)) = x in sln.Value <- v) + with get() = (let (TTrait(_, _, _, _, _, sln, _, _)) = x in sln.Value) + and set v = (let (TTrait(_, _, _, _, _, sln, _, _)) = x in sln.Value <- v) + + /// Get possible extension member solutions available for a use of a trait at a particular location + member x.PossibleExtensionSolutions = (let (TTrait(_, _, _, _, _, _, extSlns, _)) = x in extSlns) + + /// Get access rights for a use of a trait at a particular location + member x.AccessorDomain = (let (TTrait(_, _, _, _, _, _, _, ad)) = x in ad) [] member x.DebugText = x.ToString() diff --git a/tests/fsharp/core/members/basics-hw-mutrec/test.fs b/tests/fsharp/core/members/basics-hw-mutrec/test.fs index 7a1fb2a049a..7b3e1256a76 100644 --- a/tests/fsharp/core/members/basics-hw-mutrec/test.fs +++ b/tests/fsharp/core/members/basics-hw-mutrec/test.fs @@ -1606,9 +1606,9 @@ module MultipleOverloadedOperatorTests = begin let f1 (x:DateTime) (y:TimeSpan) : DateTime = x - y let g1 (x:DateTime) (y:DateTime) : TimeSpan = x - y - // Return type is also sufficient: - let f2 (x:DateTime) y : DateTime = x - y - let g2 (x:DateTime) y : TimeSpan = x - y + // // Return type is not sufficient: + // let f2 (x:DateTime) y : DateTime = x - y + // let g2 (x:DateTime) y : TimeSpan = x - y // Just argument types are also sufficient: let f3 (x:DateTime) (y:TimeSpan) = x - y let g3 (x:DateTime) (y:DateTime) = x - y diff --git a/tests/fsharp/core/members/basics-hw/test.fsx b/tests/fsharp/core/members/basics-hw/test.fsx index 58420e78210..5d4eb41e2eb 100644 --- a/tests/fsharp/core/members/basics-hw/test.fsx +++ b/tests/fsharp/core/members/basics-hw/test.fsx @@ -1621,9 +1621,9 @@ module MultipleOverloadedOperatorTests = begin let f1 (x:DateTime) (y:TimeSpan) : DateTime = x - y let g1 (x:DateTime) (y:DateTime) : TimeSpan = x - y - // Return type is also sufficient: - let f2 (x:DateTime) y : DateTime = x - y - let g2 (x:DateTime) y : TimeSpan = x - y + // // Return type is not sufficient: + // let f2 (x:DateTime) y : DateTime = x - y + // let g2 (x:DateTime) y : TimeSpan = x - y // Just argument types are also sufficient: let f3 (x:DateTime) (y:TimeSpan) = x - y let g3 (x:DateTime) (y:DateTime) = x - y diff --git a/tests/fsharp/core/members/basics/test.fs b/tests/fsharp/core/members/basics/test.fs index a5da244c0a6..b9f8392e018 100644 --- a/tests/fsharp/core/members/basics/test.fs +++ b/tests/fsharp/core/members/basics/test.fs @@ -1910,9 +1910,9 @@ module MultipleOverloadedOperatorTests = begin let f1 (x:DateTime) (y:TimeSpan) : DateTime = x - y let g1 (x:DateTime) (y:DateTime) : TimeSpan = x - y - // Return type is also sufficient: - let f2 (x:DateTime) y : DateTime = x - y - let g2 (x:DateTime) y : TimeSpan = x - y + // Return type is not sufficient: + //let f2 (x:DateTime) y : DateTime = x - y + //let g2 (x:DateTime) y : TimeSpan = x - y // Just argument types are also sufficient: let f3 (x:DateTime) (y:TimeSpan) = x - y let g3 (x:DateTime) (y:DateTime) = x - y diff --git a/tests/fsharp/core/members/ops-mutrec/test.fs b/tests/fsharp/core/members/ops-mutrec/test.fs index 8b816fa7def..211f3940a51 100644 --- a/tests/fsharp/core/members/ops-mutrec/test.fs +++ b/tests/fsharp/core/members/ops-mutrec/test.fs @@ -214,8 +214,8 @@ module BasicOverloadTests = // This gets type int -> int let f5 x = 1 - x - // This gets type DateTime -> DateTime -> TimeSpan, through non-conservative resolution. - let f6 x1 (x2:System.DateTime) = x1 - x2 + // // This gets type DateTime -> DateTime -> TimeSpan, through non-conservative resolution. + // let f6 x1 (x2:System.DateTime) = x1 - x2 // This gets type TimeSpan -> TimeSpan -> TimeSpan, through default type propagation let f7 x1 (x2:System.TimeSpan) = x1 - x2 diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index 9751d03e6e3..cb4995e2a70 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1778,8 +1778,6 @@ module MethodOverloadingForTraitConstraintsIsNotDeterminedUntilSignatureIsKnnown let inline Test2< ^t> a = Test a - // NOTE, this is seen to be a bug, see https://github.com/Microsoft/visualfsharp/issues/3814 - // The result should be 2. // This test has been added to pin down current behaviour pending a future bug fix. check "slvde0vver90u1" (Test2 0) 1 check "slvde0vver90u2" (Test2 0L) 1 diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 2247c318f6a..08130fe71d2 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -526,6 +526,29 @@ module CoreTests = exec cfg ("." ++ "testcs.exe") "" + [] + let extconstraint () = + let cfg = testConfig "core/extconstraint" + + fsc cfg "%s" cfg.fsc_flags ["test.fsx"] + + peverify cfg "test.exe" + + begin + use testOkFile = fileguard cfg "test.ok" + + exec cfg ("." ++ "test.exe") "" + + testOkFile.CheckExists() + end + + begin + use testOkFile = fileguard cfg "test.ok" + + fsi cfg "" ["test.fsx"] + + testOkFile.CheckExists() + end // // Shadowcopy does not work for public signed assemblies diff --git a/tests/fsharp/typecheck/sigs/neg45.bsl b/tests/fsharp/typecheck/sigs/neg45.bsl index 466a998514d..aa1cc2435e6 100644 --- a/tests/fsharp/typecheck/sigs/neg45.bsl +++ b/tests/fsharp/typecheck/sigs/neg45.bsl @@ -77,6 +77,6 @@ neg45.fs(144,13,144,23): typecheck error FS0001: The type 'A1' does not support neg45.fs(145,13,145,23): typecheck error FS0001: The type 'A2' does not support the operator 'get_Name' -neg45.fs(146,13,146,23): typecheck error FS0001: The type 'B' has a method 'get_Name' (full name 'get_Name'), but the method is not static +neg45.fs(146,13,146,23): typecheck error FS0001: get_Name is not a static method neg45.fs(147,15,147,25): typecheck error FS0001: The type 'StaticMutableClassExplicit' does not support the operator 'get_Name' diff --git a/tests/fsharp/typecheck/sigs/neg99.bsl b/tests/fsharp/typecheck/sigs/neg99.bsl index 9f6010f249d..1d050dfedd9 100644 --- a/tests/fsharp/typecheck/sigs/neg99.bsl +++ b/tests/fsharp/typecheck/sigs/neg99.bsl @@ -3,4 +3,4 @@ neg99.fs(19,16,19,64): typecheck error FS0077: Member constraints with the name neg99.fs(22,18,22,64): typecheck error FS0077: Member constraints with the name 'op_Explicit' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may result in runtime failures if you attempt to invoke the member constraint from your own code. -neg99.fs(25,39,25,43): typecheck error FS0043: The type 'CrashFSC.OhOh.MyByte' does not support a conversion to the type 'CrashFSC.OhOh.MyByte' +neg99.fs(25,39,25,43): typecheck error FS0043: The type 'MyByte' does not support a conversion to the type ''a' diff --git a/tests/fsharp/typecheck/sigs/neg99.fs b/tests/fsharp/typecheck/sigs/neg99.fs index 6c3007c74ab..b7d248f13ab 100644 --- a/tests/fsharp/typecheck/sigs/neg99.fs +++ b/tests/fsharp/typecheck/sigs/neg99.fs @@ -12,7 +12,7 @@ module OhOh = static member inline op_Explicit (x: int64): MyByte = MyByte (byte x) static member inline op_Explicit (x: float): MyByte = MyByte (byte x) - static member inline op_Explicit (MyByte x): 'a = failwith "cannot convert" + //static member inline op_Explicit (MyByte x): 'a = failwith "cannot convert" /// testing testing let inline ( !>>> ) (a: ^a) min: ^b option = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs index e038022643b..a2d10e07e4a 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs @@ -1,26 +1,26 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression for FSHARP1.0:3592 // Can't use extension methods to define operators -//Extension members cannot provide operator overloads\. Consider defining the operator as part of the type definition instead\. -//Extension members cannot provide operator overloads\. Consider defining the operator as part of the type definition instead\. //The type 'Exception' does not support the operator '\+'$ //The type 'Exception' does not support the operator '\+'$ //The type 'MyType' does not support the operator '\+'$ //The type 'MyType' does not support the operator '\+'$ + + open System type MyType() = member this.X = 1 -module TestExtensions = - type MyType with - static member (+) (e1: MyType, e2: MyType) = - new MyType() - - type System.Exception with - static member (+) (e1: Exception, e2: Exception) = - new Exception(e1.Message + " " + e2.Message) +//module TestExtensions = +// type MyType with +// static member (+) (e1: MyType, e2: MyType) = +// new MyType() +// +// type System.Exception with +// static member (+) (e1: Exception, e2: Exception) = +// new Exception(e1.Message + " " + e2.Message) let e1 = Exception() let e2 = Exception() diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_MemberConstraint02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_MemberConstraint02.fs index 023f7c8a06a..6d2edd7c4fb 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_MemberConstraint02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_MemberConstraint02.fs @@ -1,5 +1,5 @@ // #Conformance #TypeConstraints #Diagnostics -//The type 'Foo' has a method 'someFunc' \(full name 'someFunc'\), but the method is not static$ +//someFunc is not a static method$ let inline testFunc (a : ^x) = (^x : (static member someFunc : unit -> ^x) ()) From f1d268a1703422a0302009b1a6ef2b236581cc80 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 13:21:24 +0000 Subject: [PATCH 02/82] extension witness test --- tests/fsharp/core/extconstraint/test.fsx | 555 +++++++++++++++++++++++ 1 file changed, 555 insertions(+) create mode 100644 tests/fsharp/core/extconstraint/test.fsx diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx new file mode 100644 index 00000000000..8bb8830c1bd --- /dev/null +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -0,0 +1,555 @@ +#if TESTS_AS_APP +module Core_extconstraint +#endif + + +let failures = ref [] + +let reportFailure (s : string) = + stderr.Write" NO: " + stderr.WriteLine s + failures := !failures @ [s] + + +let check s e r = + if r = e then stdout.WriteLine (s + ": YES") + else (stdout.WriteLine ("\n***** " + s + ": FAIL\n"); reportFailure s) + +let test s b = + if b then () + else (stderr.WriteLine ("failure: " + s); + reportFailure s) + + +type MyType = + | MyType of int + +/// Extending a .NET primitive type with new operator +module DotNetPrimtiveWithNewOperator = + type System.Int32 with + static member (++)(a: int, b: int) = a + do check "jfs9dlfdh" 1 (1 ++ 2) + +/// Extending a .NET primitive type with new operator +module DotNetPrimtiveWithAmbiguousNewOperator = + [] + module Extensions = + type System.Int32 with + static member (++)(a: int, b: int) = a + + do check "jfs9dlfdhsx" 1 (1 ++ 2) + + [] + module Extensions2 = + type System.Int32 with + static member (++)(a: int, b: string) = a + + do check "jfs9dlfdhsx1" 1 (1 ++ "2") + + let f (x: string) = 1 ++ x + + do check "jfs9dlfdhsx2" 1 (f "2") + // TODO: this gives an internal error + // let f x = 1 ++ x + +/// Extending a .NET primitive type with new _internal_ operator +module DotNetPrimtiveWithInternalOperator1 = + type System.Int32 with + static member internal (++)(a: int, b: int) = a + + let result = 1 ++ 2 // this is now allowed + check "vgfmjsdokfj" result 1 + + +/// Extending a .NET primitive type with new _private_ operator where that operator is accessible at point-of-use +module DotNetPrimtiveWithAccessibleOperator2 = + type System.Int32 with + static member private (++)(a: int, b: int) = a + + let result = 1 ++ 2 // this is now allowed. + check "vgfmjsdokfjc" result 1 + + + +#if NEGATIVE_TESTS +module DotNetPrimtiveWithInaccessibleOperator = + [] + module Extensions = + type System.Int32 with + static member private (++)(a: int, b: int) = a + + let result = 1 ++ 2 // This should fail to compile because the private member is not accessible from here +#endif + + +/// Locally extending an F# type with a wide range of standard operators +module FSharpTypeWithExtrinsicOperators = + + [] + module Extensions = + type MyType with + static member (+)(MyType x, MyType y) = MyType (x + y) + static member (*)(MyType x, MyType y) = MyType (x * y) + static member (/)(MyType x, MyType y) = MyType (x / y) + static member (-)(MyType x, MyType y) = MyType (x - y) + static member (~-)(MyType x) = MyType (-x) + static member (|||)(MyType x, MyType y) = MyType (x ||| y) + static member (&&&)(MyType x, MyType y) = MyType (x &&& y) + static member (^^^)(MyType x, MyType y) = MyType (x ^^^ y) + static member Zero = MyType 0 + static member One = MyType 1 + member this.Sign = let (MyType x) = this in sign x + static member Abs (MyType x) = MyType (abs x) + static member Sqrt (MyType x) = MyType (int (sqrt (float x))) + static member Sin (MyType x) = MyType (int (sin (float x))) + static member Cos (MyType x) = MyType (int (cos (float x))) + static member Tan (MyType x) = MyType (int (tan (float x))) + static member DivideByInt (MyType x, n: int) = MyType (x / n) + + let v = MyType 3 + let result1 = v + v + do check "fsdnjioa1" (MyType 6) result1 + let result2 = v * v + do check "fsdnjioa2" (MyType 9) result2 + let result3 = v - v + do check "fsdnjioa3" (MyType 0) result3 + let result4 = v / v + do check "fsdnjioa4" (MyType 1) result4 + let result5 = -v + do check "fsdnjioa5" (MyType -3) result5 + let result6 = v ||| v + do check "fsdnjioa6" (MyType 3) result6 + let result7 = v &&& v + do check "fsdnjioa7" (MyType 3) result7 + let result8 = v ^^^ v + do check "fsdnjioa8" (MyType 0) result8 + let result9 = LanguagePrimitives.GenericZero + do check "fsdnjioa9" (MyType 0) result9 + let result10 = LanguagePrimitives.GenericOne + do check "fsdnjioa10" (MyType 1) result10 + let result11 = sign v + do check "fsdnjioa11" 1 result11 + let result12 = abs v + do check "fsdnjioa12" (MyType 3) result12 + let result13 = sqrt v + do check "fsdnjioa13" (MyType 1) result13 + let result14 = sin v + do check "fsdnjioa14" (MyType 0) result14 + let result15 = cos v + do check "fsdnjioa15" (MyType 0) result15 + let result16 = tan v + do check "fsdnjioa16" (MyType 0) result16 + let result17 = LanguagePrimitives.DivideByInt v 4 + do check "fsdnjioa17" (MyType 0) result17 + + +/// Extending two types with the static member 'Add' +module TwoTypesWithExtensionOfSameName = + + [] + module Extensions = + type System.Int32 with + static member Add(a: int, b: int) = a + + type MyType with + static member Add(MyType x, MyType y) = MyType (x + y) + + let inline addGeneric< ^A when ^A : (static member Add : ^A * ^A -> ^A) > (a,b) : ^A = + (^A : (static member Add : ^A * ^A -> ^A) (a,b)) + + let inline (+++) a b = addGeneric(a,b) + + let inline addGeneric2 (a,b) : ^A when ^A : (static member Add : ^A * ^A -> ^A) = + (^A : (static member Add : ^A * ^A -> ^A) (a,b)) + + let inline (++++) a b = addGeneric2(a,b) + + + let f () = + let v1 = addGeneric (MyType(1), MyType(2)) + let v2 = addGeneric (1,1) + () + + let f2 () = + let v1 = MyType(1) +++ MyType(2) + let v2 = 1 +++ 1 + 1 + + let f3 () = + let v1 = addGeneric2 (MyType(1), MyType(2)) + let v2 = addGeneric2 (1,1) + () + + let f4 () = + let v1 = MyType(1) ++++ MyType(2) + let v2 = 1 ++++ 1 + () + + /// The check is that the above code compiles OK + +/// Extending a generic type with a property +module ExtendingGenericTypeWithProperty = + + type List<'T> with + member x.Count = x.Length + + let inline count (a : ^A when ^A : (member Count : int)) = + (^A : (member Count : int) (a)) + + let v0 = [3].Count // sanity check + do check "opcjdkfdf" 1 v0 + + let v3 = count [3] + do check "opcjdkfdfx" 1 v3 + + let v5 = count (ResizeArray [| 3 |]) + do check "opcjdkfdfxa" 1 v5 + +/// Extending a generic type with a property +/// Extending the .NET array type with a property +module ExtendingGenericTypeAndArrayWithProperty = + + type List<'T> with + member x.Count = x.Length + + type ``[]``<'T> with + member x.Count = x.Length + + let inline count (a : ^A when ^A : (member Count : int)) = + (^A : (member Count : int) (a)) + + let v0 = [3].Count // sanity check + do check "fdoiodjjs" 1 v0 + + let v1 = [|3|].Count // sanity check + do check "fdoiodxjxjs" 1 v1 + + let v3 = count [3] + do check "fdoios" 1 v3 + + let v4 = count [| 3 |] + do check "fddxjxjs" 1 v4 + + let v5 = count (dict [| 1,3 |]) + do check "fdoiosdxs" 1 v5 + + let v6 = count (ResizeArray [| 3 |]) // intrinsic from .NET + do check "fdojxxjs" 1 v6 + + + + +/// Solving using LINQ extensions +module LinqExtensionMethodsProvideSolutions_Count = + + open System.Linq + + // Note this looks for a _method_ called `Count` taking a single argument + // It is _not_ considered the same as a property called `Count` + let inline countm (a : ^A when ^A : (member Count : unit -> int)) = + (^A : (member Count : unit -> int) (a)) + + let seqv : seq = Seq.singleton 1 + + let v0 = seqv.Count() // sanity check + do check "fivjijvd" 1 v0 + + let v1 = countm seqv + do check "fivjixjvd" 1 v1 + +(* +/// Not implemented +module MapExample = + let inline map (f: ^T -> ^U) (a : ^A when ^A : (val map : (^T -> ^U) -> ^A -> ^A2)) = + (^A : (val map : (^T -> ^U) -> ^A -> ^A2) (f, a)) + + let v5 = map (fun x -> x + 1) [ 1 .. 100 ] + +*) +module ExtenstionAttributeMembers = + open System.Runtime.CompilerServices + [] + type Ext2() = + [] + static member Bleh(a : string) = a.Length + + let inline bleh s = (^a : (member Bleh : unit -> int) s) + + let v = bleh "a" + do check "cojkicjkc" 1 v + +module ExtendingOnConstraint = + open System + type System.Int32 with + static member inline (+)(a, b) = Array.map2 (+) a b + + let v1 = [|1;2;3|] + [|2;3;4|] //Okay + do check "kldjfdo1" [|3;5;7|] v1 + let v2 = [|TimeSpan(52342L)|] + [|TimeSpan(3213L)|] //Okay + do check "kldjfdo2" ([|TimeSpan(52342L + 3213L)|]) v2 + let v3 = [|1m|] + [|2m|] //Okay + do check "kldjfdo3" ([|3m|]) v3 + let v4 = [|1uy|] + [|2uy|] //Okay + do check "kldjfdo4" ([|3uy|]) v4 + let v5 = [|1L|] + [|2L|] //Okay + do check "kldjfdo5" ([|3L|]) v5 + let v6 = [|1I|] + [|2I|] //Okay + do check "kldjfdo6" ([|3I|]) v6 + let v7 = [| [|1 ; 1|]; [|2|] |] + [| [|2; 2|]; [|3|] |] //Okay + do check "kldjfdo7" [| [|3 ; 3|]; [|5|] |] v7 + let v8 = [| [| [| [|2|] |] |] |] + [| [| [| [|5|] |] |] |] //Okay + do check "kldjfdo8" [| [| [| [|7|] |] |] |] v8 + //Compile Errors: + //let v9 = [|"1"|] + [|"2"|] //error FS0001 + //let v10 = [|1.f|] + [|2.f|] //error FS0001 + //let v11 = [|1.0|] + [|2.0|] //error FS0001 + +module TupleOps = + type System.Int32 with + static member inline (+)(struct(a,b), struct(c,d)) = struct(a + c, b + d) + static member inline (+)((a,b), (c,d)) = (a + c, b + d) + let v1 = (1,2) + (3,4) + do check "fmjkslo1" ((4,6)) v1 + //let v2 = struct(1,2) + struct(3,4) + //do check "fmjkslo2" (struct(4,6)) v2 + //Runtime Errors: + (* --------------------- + Unhandled Exception: System.TypeInitializationException: The type initializer for 'AdditionDynamicImplTable`3' threw an exception. ---> System.NotSupportedException: Dynamic invocation of op_Addition involving coercions is not supported. + at Microsoft.FSharp.Core.LanguagePrimitives.dyn@2578TTT.Invoke(Unit unitVar0) + at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamicImplTable`3..cctor() + --- End of inner exception stack trace --- + at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamicImplTable`3.get_Impl() + at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamic[T1,T2,TResult](T1 x, T2 y) + at .$Test$fsx.main@() + --------------------------*) +(*--------------------------------------------------------------------------- +!* wrap up + *--------------------------------------------------------------------------- *) + +module SystematicTests = + + // 1-arg extensions to each primitive type + // 2-arg extensions to each primitive type + // 2-arg extensions to each primitive type + new sealed type + // 2-arg extensions to each primitive type + new unsealed type + // 2-arg extensions to new sealed type + each primitive type + // 2-arg extensions to new unsealed type + each primitive type + // 2-arg extensions to new sealed type + new unsealed type + let inline CallStaticMethod1 (x: ^T) = ((^T): (static member StaticMethod1: ^T -> ^T) (x)) + let inline CallStaticMethod2 (x: ^T, y: ^T) = ((^T): (static member StaticMethod2: ^T * ^T -> ^T) (x, y)) + let inline CallStaticMethod3 (x: ^T, y: ^U) = ((^T or ^U): (static member StaticMethod3: ^T * ^U -> ^V) (x, y)) + let inline CallOverloadedStaticMethod4 (x: ^T, y: ^U) = ((^T or ^U): (static member OverloadedStaticMethod4: ^T * ^U -> ^V) (x, y)) + let inline CallInstanceMethod1 (x: ^T, y: ^T) = ((^T): (member InstanceMethod1: ^T -> ^T) (x, y)) + let inline CallInstanceProperty1 (x: ^T) = ((^T): (member InstanceProperty1: ^T) (x)) + let inline CallStaticProperty1 () = ((^T): (static member StaticProperty1: ^T) ()) + + module MethodsOnStructType = + + [] + type R = + { F : int } + + static member op_UnaryNegation (x: R) = { F = x.F + 4 } + static member StaticMethod1 (x: R) = { F = x.F + 4 } + static member StaticMethod2 (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Subtraction (x: R, y: R) = { F = x.F + y.F + 5 } + static member op_Division (x: R, y: R) = { F = x.F + y.F + 6 } + static member StaticMethod3 (x: R, y: R) = { F = x.F + y.F + 4 } + static member OverloadedStaticMethod4 (x: R, y: string) = { F = x.F + y.Length + 4 } + static member OverloadedStaticMethod4 (x: R, y: int) = { F = x.F + y + 4 } + member x.InstanceMethod1 (y: R) = { F = x.F + y.F + 5 } + static member StaticProperty1 = { F = 4 } + member x.InstanceProperty1 = { F = x.F + 4 } + + let r3 = { F = 3 } + let r4 = { F = 4 } + check "qvwoiwvoi0" (-r3).F 7 + check "qvwoiwvoi1" (CallStaticMethod1 r3).F 7 + check "qvwoiwvoi2" (CallStaticMethod2 (r3, r4)).F 11 + check "qvwoiwvoi2b" ((+) r3 r4).F 11 + check "qvwoiwvoi2c" ((-) r3 r4).F 12 + check "qvwoiwvoi2c" ((/) r3 r4).F 13 + check "qvwoiwvoi3" (CallStaticMethod3 (r3, r4)).F 11 + check "qvwoiwvoi4" (CallOverloadedStaticMethod4 (r3, 4)).F 11 + check "qvwoiwvoi5" (CallOverloadedStaticMethod4 (r3, "four")).F 11 + check "qvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 + check "qvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 + check "qvwoiwvoi8" (CallStaticProperty1().F : int32) 4 + + module ExtensionsOnStructType = + + [] + type R = + { F : int } + + [] + module Extensions = + type R with + static member op_UnaryNegation (x: R) = { F = x.F + 4 } + static member StaticMethod1 (x: R) = { F = x.F + 4 } + static member StaticMethod2 (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Subtraction (x: R, y: R) = { F = x.F + y.F + 5 } + static member op_Division (x: R, y: R) = { F = x.F + y.F + 6 } + static member StaticMethod3 (x: R, y: R) = { F = x.F + y.F + 4 } + static member OverloadedStaticMethod4 (x: R, y: string) = { F = x.F + y.Length + 4 } + static member OverloadedStaticMethod4 (x: R, y: int) = { F = x.F + y + 4 } + member x.InstanceMethod1 (y: R) = { F = x.F + y.F + 5 } + static member StaticProperty1 = { F = 4 } + member x.InstanceProperty1 = { F = x.F + 4 } + + let r3 = { F = 3 } + let r4 = { F = 4 } + check "qvwoiwvoi0" (-r3).F 7 + check "qvwoiwvoi1" (CallStaticMethod1 r3).F 7 + check "qvwoiwvoi2" (CallStaticMethod2 (r3, r4)).F 11 + check "qvwoiwvoi2b" ((+) r3 r4).F 11 + check "qvwoiwvoi2c" ((-) r3 r4).F 12 + check "qvwoiwvoi2c" ((/) r3 r4).F 13 + check "qvwoiwvoi3" (CallStaticMethod3 (r3, r4)).F 11 + check "qvwoiwvoi4" (CallOverloadedStaticMethod4 (r3, 4)).F 11 + check "qvwoiwvoi5" (CallOverloadedStaticMethod4 (r3, "four")).F 11 + //check "qvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 // TODO - FAILING + //check "qvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 // TODO - FAILING + check "qvwoiwvoi8" (CallStaticProperty1().F : int32) 4 + + + module MixedOverloadedOperatorMethodsOnStructType = + + [] + type R = + { F : int } + + static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Addition (x: R, y: string) = { F = x.F + y.Length + 6 } + static member op_Addition (x: R, y: int) = { F = x.F + y + 6 } + static member op_Addition (x: string, y: R) = { F = x.Length + y.F + 9 } + static member op_Addition (x: int, y: R) = { F = x + y.F + 102 } + + let r3 = { F = 3 } + let r4 = { F = 4 } + check "qvwoiwvoi2b" ((+) r3 r4).F 11 + check "qvwoiwvoi2b" ((+) r3 "four").F 13 + check "qvwoiwvoi2b" ((+) "four" r3).F 16 + check "qvwoiwvoi2b" ((+) r3 4).F 13 + check "qvwoiwvoi2b" ((+) 4 r3).F 109 + // TODO - more operators here + + module MixedOverloadedOperatorExtensionsOnStructType = + + [] + type R = + { F : int } + + [] + module Extensions = + type R with + static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } + static member op_Addition (x: R, y: string) = { F = x.F + y.Length + 6 } + static member op_Addition (x: R, y: int) = { F = x.F + y + 6 } + static member op_Addition (x: string, y: R) = { F = x.Length + y.F + 9 } + static member op_Addition (x: int, y: R) = { F = x + y.F + 102 } + + let r3 = { F = 3 } + let r4 = { F = 4 } + check "qvwoiwvoi2b" ((+) r3 r4).F 11 + check "qvwoiwvoi2b" ((+) r3 "four").F 13 + check "qvwoiwvoi2b" ((+) "four" r3).F 16 + check "qvwoiwvoi2b" ((+) r3 4).F 13 + check "qvwoiwvoi2b" ((+) 4 r3).F 109 + //check "qvwoiwvoi2c" ((-) r3 r4).F 12 + //check "qvwoiwvoi2c" ((/) r3 r4).F 13 + // TODO - more operators here + + + module ExtensionsToPrimitiveType_Int32 = + + [] + module Extensions = + type System.Int32 with + static member StaticMethod1 (x: int32) = x + 4 + static member StaticMethod2 (x: int32, y: int32) = x + y + 4 + static member StaticMethod3 (x: int32, y: int32) = x + y + 4 + static member OverloadedStaticMethod4 (x: int32, y: string) = x + y.Length + 4 + static member OverloadedStaticMethod4 (x: int32, y: int) = x + y + 4 + member x.InstanceMethod1 (y: int32) = x + y + 5 + static member StaticProperty1 = 4 + member x.InstanceProperty1 = x + 4 + + check "vwoiwvoi1" (CallStaticMethod1 3) 7 + check "vwoiwvoi2" (CallStaticMethod2 (3, 4)) 11 + check "vwoiwvoi3" (CallStaticMethod3 (3, 4)) 11 + check "vwoiwvoi4" (CallOverloadedStaticMethod4 (3, 4)) 11 + check "vwoiwvoi5" (CallOverloadedStaticMethod4 (3, "four")) 11 + //check "vwoiwvoi6" (CallInstanceMethod1 (3, 4)) 12 // TODO- BUG - CODEGEN + //check "vwoiwvoi7" (CallInstanceProperty1 (3)) 7 // TODO- BUG - CODEGEN + check "vwoiwvoi8" (CallStaticProperty1 () : int32) 4 + + +module Test1 = + + open System + type Foo = A | B + + module Extensions = + type Foo with + static member (+) (foo1: Foo, foo2: Foo) = B + + open Extensions + + let result = A + A + + type System.String with + member this.Foo (x: string) = this + x + +module Test2 = + + open System + type Foo = A | B + + module Extensions = + type Foo with + static member (+) (foo1: Foo, foo2: Foo) = B + + type Foo with + static member (+) (foo1: Foo, foo2: string) = B + static member (+) (foo1: string, foo2: Foo) = B + + open Extensions + + let result = A + A + let result2 = A + "" + let result3 = "" + A + let result4 : string = "" + "" + + type System.String with + member this.Foo (x: string) = this + x + + type System.String with + member this.Foo2 x = this + x + + type Bar = Bar of String + with + member this.Foo (x: string) = + match this with + | Bar y -> y + x + + let z = "Bar".Foo("foo") + let z0 = (Bar "Bar").Foo("foo") + + +#if TESTS_AS_APP +let RUN() = !failures +#else +let aa = + match !failures with + | [] -> + stdout.WriteLine "Test Passed" + System.IO.File.WriteAllText("test.ok","ok") + exit 0 + | _ -> + stdout.WriteLine "Test Failed" + exit 1 +#endif + From 18f26c8b0d5d3599401b59ddf1fbe88d59048d4e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 13:22:21 +0000 Subject: [PATCH 03/82] smaller diff --- src/fsharp/CompileOptions.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index c949cfc6988..c43c953606c 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1716,6 +1716,7 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM let optSettings = tcConfig.optSettings let optSettings = { optSettings with abstractBigTargets = tcConfig.doTLR } let optSettings = { optSettings with reportingPhase = true } + let results, (optEnvFirstLoop, _, _, _) = ((optEnv0, optEnv0, optEnv0, SignatureHidingInfo.Empty), implFiles) From b729812ec2459b8ad76651c783f7e52d75c34a47 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 13:36:16 +0000 Subject: [PATCH 04/82] smaller diff --- src/fsharp/CompileOptions.fs | 2 +- src/fsharp/ConstraintSolver.fs | 38 +++++++++++++-------------- src/fsharp/ConstraintSolver.fsi | 3 --- src/fsharp/MethodCalls.fs | 2 +- src/fsharp/NameResolution.fsi | 1 - src/fsharp/TastOps.fs | 1 - src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.de.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.es.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.fr.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.it.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.ja.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.ko.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.pl.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.tr.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 ---- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 ---- 19 files changed, 20 insertions(+), 92 deletions(-) diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index c43c953606c..65107906686 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1716,7 +1716,7 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM let optSettings = tcConfig.optSettings let optSettings = { optSettings with abstractBigTargets = tcConfig.doTLR } let optSettings = { optSettings with reportingPhase = true } - + let results, (optEnvFirstLoop, _, _, _) = ((optEnv0, optEnv0, optEnv0, SignatureHidingInfo.Empty), implFiles) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 3e032d8f983..e4f9a8cbfe1 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -247,6 +247,7 @@ type ConstraintSolverEnv = m: range EquivEnv: TypeEquivEnv + DisplayEnv: DisplayEnv } @@ -286,6 +287,22 @@ let rec occursCheck g un ty = // Predicates on types //------------------------------------------------------------------------- +/// Some additional solutions are forced prior to generalization (permitWeakResolution=true). These are, roughly speaking, rules +/// for binary-operand constraints arising from constructs such as "1.0 + x" where "x" is an unknown type. THe constraint here +/// involves two type parameters - one for the left, and one for the right. The left is already known to be Double. +/// In this situation (and in the absence of other evidence prior to generalization), constraint solving forces an assumption that +/// the right is also Double - this is "weak" because there is only weak evidence for it. +/// +/// permitWeakResolution also applies to resolutions of multi-type-variable constraints via method overloads. Method overloading gets applied even if +/// only one of the two type variables is known. +/// +/// During code gen we run with permitWeakResolution on, but we only apply it where one of the argument types for the built-in constraint resolution is +/// a variable type. +type PermitWeakResolution = + | Yes of codegen: bool + | No + member x.Permit = match x with Yes _ -> true | No -> false + let rec isNativeIntegerTy g ty = typeEquivAux EraseMeasures g g.nativeint_ty ty || typeEquivAux EraseMeasures g g.unativeint_ty ty || @@ -339,22 +356,6 @@ let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty -/// Some additional solutions are forced prior to generalization (permitWeakResolution=true). These are, roughly speaking, rules -/// for binary-operand constraints arising from constructs such as "1.0 + x" where "x" is an unknown type. THe constraint here -/// involves two type parameters - one for the left, and one for the right. The left is already known to be Double. -/// In this situation (and in the absence of other evidence prior to generalization), constraint solving forces an assumption that -/// the right is also Double - this is "weak" because there is only weak evidence for it. -/// -/// permitWeakResolution also applies to resolutions of multi-type-variable constraints via method overloads. Method overloading gets applied even if -/// only one of the two type variables is known. -/// -/// During code gen we run with permitWeakResolution on, but we only apply it where one of the argument types for the built-in constraint resolution is -/// a variable type. -type PermitWeakResolution = - | Yes of codegen: bool - | No - member x.Permit = match x with Yes _ -> true | No -> false - // Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> let GetMeasureOfType g ty = match ty with @@ -871,7 +872,6 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio // Only solve constraints if this is not an error var if r.IsFromError then () else - // Check to see if this type variable is relevant to any trait constraints. // If so, re-solve the relevant constraints. if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then @@ -1214,12 +1214,12 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload match tys, traitObjAndArgTys with | [ty], (h :: _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) - // Trait calls are only supported on pseudo type (variables) for e in tys do do! SolveTypStaticReq csenv trace HeadTypeStaticReq e let argtys = if memFlags.IsInstance then List.tail traitObjAndArgTys else traitObjAndArgTys + let minfos = GetRelevantMethodsForTrait csenv permitWeakResolution nm traitInfo let! res = @@ -2988,7 +2988,6 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra let argTypes = minfo.GetParamTypes(amap, m, methArgTys) |> List.concat - // do not apply coercion to the 'receiver' argument let receiverArgOpt, argExprs = if minfo.IsInstance then @@ -2996,7 +2995,6 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra | h :: t -> Some h, t | argExprs -> None, argExprs else None, argExprs - let convertedArgs = (argExprs, argTypes) ||> List.map2 (fun expr expectedTy -> mkCoerceIfNeeded g expectedTy (tyOfExpr g expr) expr) match receiverArgOpt with | Some r -> r :: convertedArgs diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 5608c8070cc..930dbd49e30 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -173,7 +173,4 @@ val CodegenWitnessThatTypeSupportsTraitConstraint : TcValF -> TcGlobals -> Impor val ChooseTyparSolutionAndSolve : ConstraintSolverState -> DisplayEnv -> Typar -> unit -/// Get the type variables that may help provide solutions to a statically resolved member trait constraint -val GetSupportOfMemberConstraint : ConstraintSolverEnv -> TraitConstraintInfo -> Typar list - val IsApplicableMethApprox : TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index c604b0f2c04..4fb8d9182a1 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -1040,7 +1040,7 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = let BuildFSharpMethodCall g m (vref: ValRef) valUseFlags declaringTypeInst minst args = let vexp = Expr.Val (vref, valUseFlags, m) let vexpty = vref.Type - let tpsorig,tau = vref.TypeScheme + let tpsorig, tau = vref.TypeScheme let vtinst = declaringTypeInst @ minst if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected typar length mismatch",m)) let expr = mkTyAppExpr m (vexp, vexpty) vtinst diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index be426bf5823..903a2ef6d62 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -174,7 +174,6 @@ type NameResolutionEnv = /// Modules accessible via "." notation. Note this is a multi-map. /// Adding a module abbreviation adds it a local entry to this List.map. /// Likewise adding a ccu or opening a path adds entries to this List.map. - eModulesAndNamespaces: NameMultiMap /// Fully qualified modules and namespaces. 'open' does not change this. diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 53b818df190..7b36a802a11 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -62,7 +62,6 @@ type TyconRefMap<'T>(imap: StampMap<'T>) = member m.Add (v: TyconRef) x = TyconRefMap (imap.Add (v.Stamp, x)) member m.Remove (v: TyconRef) = TyconRefMap (imap.Remove v.Stamp) member m.IsEmpty = imap.IsEmpty - member m.Contents = imap static member Empty: TyconRefMap<'T> = TyconRefMap Map.empty static member OfList vs = (vs, TyconRefMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index a2e4bf20810..4a879f7d2a0 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -5312,11 +5312,6 @@ Atribut System.Diagnostics.ConditionalAttribute je platný jenom u metod nebo tříd atributů. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Členové rozšíření nemůžou poskytovat přetížení operátorů. Zvažte možnost definovat místo toho operátor v definici typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Název souboru MDB musí být <název-souboru-sestavení>.mdb. Parametr --pdb se bude ignorovat. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index baf48ce914b..abd0a2dfcd8 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -5312,11 +5312,6 @@ Das Attribut "System.Diagnostics.ConditionalAttribute" ist nur bei Methoden oder Attributklassen gültig. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Erweiterungsmember können keine Operatorüberladungen bereitstellen. Definieren Sie den Operator stattdessen als Teil der Typdefinition. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Der Name der MDB-Datei muss "<assembly-file-name>.mdb" lauten. Die Option "--pdb" wird ignoriert. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 1d82a7a42cf..b7792396b5b 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -5312,11 +5312,6 @@ El atributo 'System.Diagnostics.ConditionalAttribute' es válido sólo en métodos o clases de atributos. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Los miembros de extensión no pueden proporcionar sobrecargas de operador. En su lugar, considere definir el operador como parte de la definición de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. El nombre del archivo MDB debe ser <nombre de archivo de ensamblado>.mdb. Se omitirá la opción--pdb. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 54296abddfd..6612ce58604 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -5312,11 +5312,6 @@ L'attribute 'System.Diagnostics.ConditionalAttribute' n'est valide que sur les méthodes ou les classes d'attributs - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Les membres d'extension ne peuvent pas fournir de surcharges d'opérateur. Définissez l'opérateur comme faisant partie de la définition de type. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Le nom du fichier MDB doit être <nom_fichier_assembly>.mdb. L'option --pdb est ignorée. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 850e1233e6a..53fee1ff580 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -5312,11 +5312,6 @@ L'attributo 'System.Diagnostics.ConditionalAttribute' è valido solo in classi di attributi o metodi - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - I membri di estensione non possono fornire overload di operatori. Provare a definire l'operatore come parte della definizione del tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Il nome del file MDB deve essere <nome-file-assembly>.mdb. L'opzione --pdb verrà ignorata. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 9267524fe89..18843055979 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -5312,11 +5312,6 @@ 属性 'System.Diagnostics.ConditionalAttribute' はメソッド クラスまたは属性クラスでのみ有効です - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - 拡張メンバーでは演算子のオーバーロードを実行できません。代わりに型定義の一部として演算子を定義してください。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB ファイルの名前は <assembly-file-name>.mdb でなければなりません、--pdb オプションは無視されます。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 9aab61aa0f9..6c4670f2c51 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -5312,11 +5312,6 @@ 'System.Diagnostics.ConditionalAttribute' 특성은 메서드 또는 특성 클래스에만 사용할 수 있습니다. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - 확장 멤버가 연산자 오버로드를 제공할 수 없습니다. 대신 연산자를 형식 정의의 일부분으로 정의하세요. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 파일의 이름은 <어셈블리 파일 이름>.mdb여야 합니다. --pdb 옵션은 무시됩니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 07c155e3203..d360a1e20a2 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -5312,11 +5312,6 @@ Atrybut „System.Diagnostics.ConditionalAttribute” jest prawidłowy tylko w przypadku metod lub klas atrybutów - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Elementy członkowskie rozszerzeń nie mogą udostępniać przeciążeń operatorów. Zamiast tego rozważ zdefiniowanie operatora jako części definicji typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Plik MDB musi mieć nazwę <nazwa-pliku-zestawu>.mdb. Opcja --pdb zostanie zignorowana. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index d6a95f10f37..7055426dd2a 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -5312,11 +5312,6 @@ O atributo 'System.Diagnostics.ConditionalAttribute' somente é válido em classes de métodos ou atributos - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Membros de extensão não podem fornecer sobrecargas de operadores. Considere definir o operador como parte da definição de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. O nome do arquivo MDB deve ser <assembly-file-name>.mdb. A opção --pdb será ignorada. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index d364e6e039c..efdeb7b3e22 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -5312,11 +5312,6 @@ Атрибут System.Diagnostics.ConditionalAttribute допустим только в методах или классах атрибутов - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Элементы расширения не могут предоставлять перегрузку операторов. Вместо этого рекомендуется определить оператор как часть определения типа. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB-файл должен иметь имя <assembly-file-name>.mdb. Параметр --pdb будет проигнорирован. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 2f05dd2afee..b2e210124d9 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -5312,11 +5312,6 @@ 'System.Diagnostics.ConditionalAttribute' özniteliği yalnızca metotlarda veya öznitelik sınıflarında geçerlidir - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Uzantı üyeleri işleç aşırı yüklemeleri sağlayamaz. Bunun yerine işleci tür tanımının parçası olarak tanımlamayı düşünün. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB dosyasının adı <assembly-file-name>.mdb olmalıdır. --pdb seçeneği yoksayılacak. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 9ee2a500ffe..9452ac7550d 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -5312,11 +5312,6 @@ 特性“System.Diagnostics.ConditionalAttribute”仅对方法或特性类有效 - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - 扩展成员无法提供运算符重载。 请考虑改为将运算符定义为类型定义的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 文件的名称必须是 <程序集文件名称>.mdb。将忽略 --pdb 选项。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index ce66cb1b949..c0f2c837f2c 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -5312,11 +5312,6 @@ 屬性 'System.Diagnostics.ConditionalAttribute' 只有在方法或屬性類別上才有效 - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - 擴充成員無法提供運算子多載。請考慮將運算子改成定義為類型定義的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 檔案的名稱必須是 <組件檔名稱>.mdb。會略過 --pdb 選項。 From 6e4f02f65af521cd8f1c13bf565f83a4a55a5c44 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 14:10:40 +0000 Subject: [PATCH 05/82] add language version checks --- src/fsharp/ConstraintSolver.fs | 15 ++++++++++----- src/fsharp/ConstraintSolver.fsi | 2 +- src/fsharp/FSComp.txt | 2 +- src/fsharp/LanguageFeatures.fs | 2 ++ src/fsharp/LanguageFeatures.fsi | 1 + src/fsharp/TypeChecker.fs | 13 ++++++++++--- src/fsharp/infos.fs | 4 ++-- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index e4f9a8cbfe1..b27a3be795c 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -40,6 +40,7 @@ open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.Ast open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Infos +open FSharp.Compiler.Features open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.NameResolution @@ -1725,11 +1726,15 @@ and SolveRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep permitWeak | ValueNone -> ResultD false)) -and GetTraitFreshner (ad: AccessorDomain) (nenv: NameResolutionEnv) (traitInfo: TraitConstraintInfo) = - let slns = - NameMultiMap.find traitInfo.MemberName nenv.eExtensionMembersByName - |> List.map (fun extMem -> (extMem :> TraitPossibleExtensionMemberSolution)) - slns, (ad :> TraitAccessorDomain) +and GetTraitFreshner (g: TcGlobals) (ad: AccessorDomain) (nenv: NameResolutionEnv) (traitInfo: TraitConstraintInfo) = + + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + let slns = + NameMultiMap.find traitInfo.MemberName nenv.eExtensionMembersByName + |> List.map (fun extMem -> (extMem :> TraitPossibleExtensionMemberSolution)) + slns, (ad :> TraitAccessorDomain) + else + [], (AccessorDomain.AccessibleFromEverywhere :> TraitAccessorDomain) and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (permitWeakResolution: PermitWeakResolution) (trace:OptionalTrace) tp = let cxst = csenv.SolverState.ExtraCxs diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 930dbd49e30..68263930fb9 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -52,7 +52,7 @@ val FreshenTypars : TraitFreshener option -> range -> Typars -> TType list val FreshenMethInfo : TraitFreshener option -> range -> MethInfo -> TType list /// Get the trait freshener for a particular location -val GetTraitFreshner : AccessorDomain -> NameResolutionEnv -> TraitFreshener +val GetTraitFreshner : TcGlobals -> AccessorDomain -> NameResolutionEnv -> TraitFreshener [] /// Information about the context of a type equation, for better error reporting diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 465a4c7995f..de26c9b349a 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1080,7 +1080,7 @@ lexIndentOffForML,"Consider using a file with extension '.ml' or '.mli' instead" 1212,tcOptionalArgsMustComeAfterNonOptionalArgs,"Optional arguments must come at the end of the argument list, after any non-optional arguments" 1213,tcConditionalAttributeUsage,"Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes" #1214,monoRegistryBugWorkaround,"Could not determine highest installed .NET framework version from Registry keys, using version 2.0" -#1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." +1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." 1216,ilwriteMDBFileNameCannotBeChangedWarning,"The name of the MDB file must be .mdb. The --pdb option will be ignored." 1217,ilwriteMDBMemberMissing,"MDB generation failed. Could not find compatible member %s" 1218,ilwriteErrorCreatingMdb,"Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly." diff --git a/src/fsharp/LanguageFeatures.fs b/src/fsharp/LanguageFeatures.fs index eeac561751a..31bda52e528 100644 --- a/src/fsharp/LanguageFeatures.fs +++ b/src/fsharp/LanguageFeatures.fs @@ -28,6 +28,7 @@ type LanguageFeature = | PackageManagement | FromEndSlicing | FixedIndexSlice3d4d + | ExtensionConstraintSolutions /// LanguageVersion management type LanguageVersion (specifiedVersionAsString) = @@ -61,6 +62,7 @@ type LanguageVersion (specifiedVersionAsString) = LanguageFeature.OpenStaticClasses, previewVersion LanguageFeature.DotlessFloat32Literal, languageVersion50 LanguageFeature.PackageManagement, previewVersion + LanguageFeature.ExtensionConstraintSolutions, previewVersion ] let specified = diff --git a/src/fsharp/LanguageFeatures.fsi b/src/fsharp/LanguageFeatures.fsi index 37a58a50b49..cde0b301dce 100644 --- a/src/fsharp/LanguageFeatures.fsi +++ b/src/fsharp/LanguageFeatures.fsi @@ -16,6 +16,7 @@ type LanguageFeature = | PackageManagement | FromEndSlicing | FixedIndexSlice3d4d + | ExtensionConstraintSolutions /// LanguageVersion management diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 8b6174ad598..601632fe53d 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -164,7 +164,9 @@ type UngeneralizableItem(computeFreeTyvars: (unit -> FreeTyvars)) = /// and other information about the scope. [] type TcEnv = - { /// Name resolution information + { g: TcGlobals + + /// Name resolution information eNameResEnv: NameResolutionEnv /// The list of items in the environment that may contain free inference @@ -219,7 +221,7 @@ type TcEnv = member tenv.AccessRights = tenv.eAccessRights - member tenv.TraitFreshner = Some (GetTraitFreshner tenv.AccessRights tenv.NameEnv) + member tenv.TraitFreshner = Some (GetTraitFreshner tenv.g tenv.AccessRights tenv.NameEnv) override tenv.ToString() = "TcEnv(...)" @@ -229,7 +231,8 @@ let computeAccessRights eAccessPath eInternalsVisibleCompPaths eFamilyType = let emptyTcEnv g = let cpath = compPathInternal // allow internal access initially - { eNameResEnv = NameResolutionEnv.Empty g + { g = g + eNameResEnv = NameResolutionEnv.Empty g eUngeneralizableItems = [] ePath = [] eCompPath = cpath // dummy @@ -1070,6 +1073,10 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, optIm if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(name, n), m)) if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments name, m)) + if isExtrinsic && IsMangledOpName id.idText then + if not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) then + warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) + ValMemberInfoTransient(memberInfo, logicalName, compiledName) type OverridesOK = diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index bb9f47e04c1..a41aee05f6c 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -308,8 +308,8 @@ let FreshenTrait traitFreshner traitInfo = let extSlns2, ad2 = match traitFreshner with | None -> extSlns, ad - | Some f -> - let extSlns2, ad2 = f traitInfo + | Some freshner -> + let extSlns2, ad2 = freshner traitInfo extSlns2, Some ad2 TTrait(typs, nm, mf, argtys, rty, slnCell, extSlns2, ad2) From 58e0ca27f330fde015225862d8017a91bcf0340b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 14:28:12 +0000 Subject: [PATCH 06/82] test updates --- src/fsharp/ConstraintSolver.fs | 1 - src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.de.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.es.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.fr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.it.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ja.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ko.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pl.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.tr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ tests/fsharp/core/extconstraint/test.fsx | 46 ++++++++++--------- tests/fsharp/tests.fs | 1 + ...osoft.VisualStudio.Editors.Designer.cs.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.de.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.es.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.fr.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.it.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.ja.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.ko.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.pl.xlf | 3 +- ...ft.VisualStudio.Editors.Designer.pt-BR.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.ru.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.tr.xlf | 3 +- ....VisualStudio.Editors.Designer.zh-Hans.xlf | 3 +- ....VisualStudio.Editors.Designer.zh-Hant.xlf | 3 +- 29 files changed, 116 insertions(+), 36 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index b27a3be795c..a2601e0dbcf 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -1631,7 +1631,6 @@ and TransactMemberConstraintSolution traitInfo (trace: OptionalTrace) sln = and GetRelevantExtensionMethodsForTrait m (amap: Import.ImportMap) (traitInfo: TraitConstraintInfo) = - // TODO: check the use of 'allPairs' - not all these extensions apply to each type variable. (traitInfo.SupportTypes, traitInfo.PossibleExtensionSolutions) ||> List.allPairs |> List.choose (fun (traitSupportTy,extMem) -> diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 4a879f7d2a0..e69f56a3e47 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -77,6 +77,11 @@ Atributy nejde použít pro rozšíření typů. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. Není definovaný obor názvů {0}. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index abd0a2dfcd8..4b627c14bc6 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -77,6 +77,11 @@ Attribute können nicht auf Typerweiterungen angewendet werden. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. Der Namespace "{0}" ist nicht definiert. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index b7792396b5b..c10bfef5ac0 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -77,6 +77,11 @@ Los atributos no se pueden aplicar a las extensiones de tipo. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. El espacio de nombres "{0}" no está definido. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 6612ce58604..ed922547cbd 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -77,6 +77,11 @@ Impossible d'appliquer des attributs aux extensions de type. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. L'espace de noms '{0}' n'est pas défini. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 53fee1ff580..40bb2f64860 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -77,6 +77,11 @@ Gli attributi non possono essere applicati a estensioni di tipo. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. Lo spazio dei nomi '{0}' non è definito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 18843055979..2bdeea26a6c 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -77,6 +77,11 @@ 属性を型拡張に適用することはできません。 + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. 名前空間 '{0}' が定義されていません。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 6c4670f2c51..3ce1c1cdc76 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -77,6 +77,11 @@ 형식 확장에 특성을 적용할 수 없습니다. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. '{0}' 네임스페이스가 정의되지 않았습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index d360a1e20a2..0d5a62ca47b 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -77,6 +77,11 @@ Atrybutów nie można stosować do rozszerzeń typu. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. Nie zdefiniowano przestrzeni nazw „{0}”. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 7055426dd2a..e7cb1471dad 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -77,6 +77,11 @@ Os atributos não podem ser aplicados às extensões de tipo. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. O namespace '{0}' não está definido. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index efdeb7b3e22..86ce683b5ed 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -77,6 +77,11 @@ Атрибуты не могут быть применены к расширениям типа. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. Пространство имен "{0}" не определено. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index b2e210124d9..aa5b39b10eb 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -77,6 +77,11 @@ Öznitelikler tür uzantılarına uygulanamaz. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. '{0}' ad alanı tanımlı değil. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 9452ac7550d..9cf9bfb6515 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -77,6 +77,11 @@ 属性不可应用于类型扩展。 + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. 未定义命名空间“{0}”。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index c0f2c837f2c..0cea779a478 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -77,6 +77,11 @@ 屬性無法套用到類型延伸模組。 + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + + The namespace '{0}' is not defined. 未定義命名空間 '{0}'。 diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index 8bb8830c1bd..ad87412c579 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -13,7 +13,9 @@ let reportFailure (s : string) = let check s e r = if r = e then stdout.WriteLine (s + ": YES") - else (stdout.WriteLine ("\n***** " + s + ": FAIL\n"); reportFailure s) + else + printf "\n***** %s: FAIL, expected %A, got %A\n" s r e + reportFailure s let test s b = if b then () @@ -50,7 +52,7 @@ module DotNetPrimtiveWithAmbiguousNewOperator = do check "jfs9dlfdhsx2" 1 (f "2") // TODO: this gives an internal error - // let f x = 1 ++ x + //let f x = 1 ++ x /// Extending a .NET primitive type with new _internal_ operator module DotNetPrimtiveWithInternalOperator1 = @@ -401,18 +403,18 @@ module SystematicTests = let r3 = { F = 3 } let r4 = { F = 4 } - check "qvwoiwvoi0" (-r3).F 7 - check "qvwoiwvoi1" (CallStaticMethod1 r3).F 7 - check "qvwoiwvoi2" (CallStaticMethod2 (r3, r4)).F 11 - check "qvwoiwvoi2b" ((+) r3 r4).F 11 - check "qvwoiwvoi2c" ((-) r3 r4).F 12 - check "qvwoiwvoi2c" ((/) r3 r4).F 13 - check "qvwoiwvoi3" (CallStaticMethod3 (r3, r4)).F 11 - check "qvwoiwvoi4" (CallOverloadedStaticMethod4 (r3, 4)).F 11 - check "qvwoiwvoi5" (CallOverloadedStaticMethod4 (r3, "four")).F 11 - //check "qvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 // TODO - FAILING - //check "qvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 // TODO - FAILING - check "qvwoiwvoi8" (CallStaticProperty1().F : int32) 4 + check "aqvwoiwvoi0" (-r3).F 7 + check "aqvwoiwvoi1" (CallStaticMethod1 r3).F 7 + check "aqvwoiwvoi2" (CallStaticMethod2 (r3, r4)).F 11 + check "aqvwoiwvoi2b" ((+) r3 r4).F 11 + check "aqvwoiwvoi2c" ((-) r3 r4).F 12 + check "aqvwoiwvoi2c" ((/) r3 r4).F 13 + check "aqvwoiwvoi3" (CallStaticMethod3 (r3, r4)).F 11 + check "aqvwoiwvoi4" (CallOverloadedStaticMethod4 (r3, 4)).F 11 + check "aqvwoiwvoi5" (CallOverloadedStaticMethod4 (r3, "four")).F 11 + //check "aqvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 // TODO - FAILING + //check "aqvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 // TODO - FAILING + check "aqvwoiwvoi8" (CallStaticProperty1().F : int32) 4 module MixedOverloadedOperatorMethodsOnStructType = @@ -477,14 +479,14 @@ module SystematicTests = static member StaticProperty1 = 4 member x.InstanceProperty1 = x + 4 - check "vwoiwvoi1" (CallStaticMethod1 3) 7 - check "vwoiwvoi2" (CallStaticMethod2 (3, 4)) 11 - check "vwoiwvoi3" (CallStaticMethod3 (3, 4)) 11 - check "vwoiwvoi4" (CallOverloadedStaticMethod4 (3, 4)) 11 - check "vwoiwvoi5" (CallOverloadedStaticMethod4 (3, "four")) 11 - //check "vwoiwvoi6" (CallInstanceMethod1 (3, 4)) 12 // TODO- BUG - CODEGEN - //check "vwoiwvoi7" (CallInstanceProperty1 (3)) 7 // TODO- BUG - CODEGEN - check "vwoiwvoi8" (CallStaticProperty1 () : int32) 4 + check "2vwoiwvoi1" (CallStaticMethod1 3) 7 + check "2vwoiwvoi2" (CallStaticMethod2 (3, 4)) 11 + check "2vwoiwvoi3" (CallStaticMethod3 (3, 4)) 11 + check "2vwoiwvoi4" (CallOverloadedStaticMethod4 (3, 4)) 11 + check "2vwoiwvoi5" (CallOverloadedStaticMethod4 (3, "four")) 11 + //check "2vwoiwvoi6" (CallInstanceMethod1 (3, 4)) 12 // TODO- BUG - CODEGEN + //check "2vwoiwvoi7" (CallInstanceProperty1 (3)) 7 // TODO- BUG - CODEGEN + check "2vwoiwvoi8" (CallStaticProperty1 () : int32) 4 module Test1 = diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 08130fe71d2..7096e447f4b 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -529,6 +529,7 @@ module CoreTests = [] let extconstraint () = let cfg = testConfig "core/extconstraint" + let cfg = { cfg with fsc_flags = fsc_flags + " --langversion:preview" } fsc cfg "%s" cfg.fsc_flags ["test.fsx"] diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index b071e0c5f72..5340031907e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 4184f3edc59..2ca4bd450e9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 4b1a5e0d904..394481ad696 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index 99d34699194..821545638e2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index 8902030751c..dd58cb9a119 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index de4d65e71f8..c0221174d97 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index e7191ac3c4a..6f540b54250 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index 6936b8e97f5..f912b6b4c78 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index fefd197867e..5a2b75dce09 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 355d363084e..2b5303d91de 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 86ac32f4b37..73a72b806a2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index 0537632d5fc..474f99a3dcd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 17c64ffefb9..16b7339b2a4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1828,8 +1828,9 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size + # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" From c690eed5c84e9daa15158a1c9b811dc8c6d7a2a6 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 20 Jan 2020 18:27:46 +0000 Subject: [PATCH 07/82] fix build --- src/fsharp/ConstraintSolver.fs | 44 +++- tests/fsharp/core/extconstraint/test.fsx | 247 +++++++++++++++++++++++ tests/fsharp/tests.fs | 2 +- 3 files changed, 281 insertions(+), 12 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index a2601e0dbcf..a6df794f219 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -2882,52 +2882,72 @@ let AddCxMethodConstraint denv css m trace traitInfo = SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true PermitWeakResolution.No 0 m trace traitInfo |> OperationResult.ignore }) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeMustSupportNull denv css m trace ty = TryD (fun () -> SolveTypeSupportsNull (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeMustSupportComparison denv css m trace ty = TryD (fun () -> SolveTypeSupportsComparison (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeMustSupportEquality denv css m trace ty = TryD (fun () -> SolveTypeSupportsEquality (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeMustSupportDefaultCtor denv css m trace ty = TryD (fun () -> SolveTypeRequiresDefaultConstructor (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeIsReferenceType denv css m trace ty = TryD (fun () -> SolveTypeIsReferenceType (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeIsValueType denv css m trace ty = TryD (fun () -> SolveTypeIsNonNullableValueType (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeIsUnmanaged denv css m trace ty = TryD (fun () -> SolveTypeIsUnmanaged (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeIsEnum denv css m trace ty underlying = TryD (fun () -> SolveTypeIsEnum (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty underlying) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let AddCxTypeIsDelegate denv css m trace ty aty bty = TryD (fun () -> SolveTypeIsDelegate (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) 0 m trace ty aty bty) - (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { @@ -3057,7 +3077,9 @@ let ChooseTyparSolutionAndSolve css denv tp = let max, m = ChooseTyparSolutionAndRange g amap tp let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv TryD (fun () -> SolveTyparEqualsType csenv 0 m NoTrace (mkTyparTy tp) max) - (fun err -> ErrorD(ErrorFromApplyingDefault(g, denv, tp, max, err, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | err -> ErrorD(ErrorFromApplyingDefault(g, denv, tp, max, err, m))) |> RaiseOperationResult diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index ad87412c579..fb9320ea149 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -540,6 +540,253 @@ module Test2 = let z = "Bar".Foo("foo") let z0 = (Bar "Bar").Foo("foo") +module FSharpPlus_Applicatives = + open System + + type Ap = Ap with + static member inline Invoke (x:'T) : '``Applicative<'T>`` = + let inline call (mthd : ^M, output : ^R) = ((^M or ^R) : (static member Return: _*_ -> _) output, mthd) + call (Ap, Unchecked.defaultof<'``Applicative<'T>``>) x + static member inline InvokeOnInstance (x:'T) = (^``Applicative<'T>`` : (static member Return: ^T -> ^``Applicative<'T>``) x) + static member inline Return (r:'R , _:obj) = Ap.InvokeOnInstance :_ -> 'R + static member Return (_:seq<'a> , Ap ) = fun x -> Seq.singleton x : seq<'a> + static member Return (_:Tuple<'a>, Ap ) = fun x -> Tuple x : Tuple<'a> + static member Return (_:'r -> 'a , Ap ) = fun k _ -> k : 'a -> 'r -> _ + + let inline result (x:'T) = Ap.Invoke x + + let inline (<*>) (f:'``Applicative<'T->'U>``) (x:'``Applicative<'T>``) : '``Applicative<'U>`` = + (( ^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>): _*_ -> _) f, x) + + let inline (+) (a:'Num) (b:'Num) :'Num = a + b + + type ZipList<'s> = ZipList of 's seq with + static member Return (x:'a) = ZipList (Seq.initInfinite (fun _ -> x)) + static member (<*>) (ZipList (f:seq<'a->'b>), ZipList x) = ZipList (Seq.zip f x |> Seq.map (fun (f, x) -> f x)) :ZipList<'b> + + type Ii = Ii + type Idiomatic = Idiomatic with + static member inline ($) (Idiomatic, si) = fun sfi x -> (Idiomatic $ x) (sfi <*> si) + static member ($) (Idiomatic, Ii) = id + let inline idiomatic a b = (Idiomatic $ b) a + let inline iI x = (idiomatic << result) x + + let res1n2n3 = iI (+) (result 0M ) (ZipList [1M;2M;3M]) Ii + let res2n3n4 = iI (+) (result LanguagePrimitives.GenericOne) (ZipList [1 ;2 ;3 ]) Ii + +module FSharpPlus_FoldArgs = + type FoldArgs<'t> = FoldArgs of ('t -> 't -> 't) + + let inline foldArgs f (x:'t) (y:'t) :'rest = (FoldArgs f $ Unchecked.defaultof<'rest>) x y + + type FoldArgs<'t> with + static member inline ($) (FoldArgs f, _:'t-> 'rest) = fun (a:'t) -> f a >> foldArgs f + static member ($) (FoldArgs f, _:'t ) = f + + let test1() = + let x:int = foldArgs (+) 2 3 + let y:int = foldArgs (+) 2 3 4 + let z:int = foldArgs (+) 2 3 4 5 + let d:decimal = foldArgs (+) 2M 3M 4M + let e:string = foldArgs (+) "h" "e" "l" "l" "o" + let f:float = foldArgs (+) 2. 3. 4. + + let mult3Numbers a b c = a * b * c + let res2 = mult3Numbers 3 (foldArgs (+) 3 4) (foldArgs (+) 2 2 3 3) + () + + // Run the test + test1() + +// From https://github.com/dotnet/fsharp/issues/4171#issuecomment-528063764 +module TypeInferenceChangeWithSealedType1 = + // [] + type Id<'t> (v: 't) = + let value = v + member __.getValue = value + + [] + module Id = + let run (x: Id<_>) = x.getValue + let map f (x: Id<_>) = Id (f x.getValue) + let create x = Id x + + + type Bind = + static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U> + static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = source.ContinueWith(fun (x: Task<_>) -> f x.Result).Unwrap () : Task<'U> + static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U> + static member (>>=) (source , f: 'T -> _ ) = async.Bind (source, f) + static member (>>=) (source : Id<_> , f: 'T -> _ ) = f source.getValue : Id<'U> + + static member inline Invoke (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` = + let inline call (_mthd: 'M, input: 'I, _output: 'R, f) = ((^M or ^I or ^R) : (static member (>>=) : _*_ -> _) input, f) + call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, binder) + + let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f + + type Return = + static member inline Invoke (x: 'T) : '``Applicative<'T>`` = + let inline call (mthd: ^M, output: ^R) = ((^M or ^R) : (static member Return : _*_ -> _) output, mthd) + call (Unchecked.defaultof, Unchecked.defaultof<'``Applicative<'T>``>) x + + static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a> + static member Return (_: 'a Task , _: Return ) = fun x -> Task.FromResult x : 'a Task + static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a> + static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x + static member Return (_: 'a Id , _: Return ) = fun (x: 'a) -> Id x + + let inline result (x: 'T) : '``Functor<'T>`` = Return.Invoke x + + + type TypeT<'``monad<'t>``> = TypeT of obj + type Node<'``monad<'t>``,'t> = A | B of 't * TypeT<'``monad<'t>``> + + let inline wrap (mit: 'mit) = + let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit + TypeT mit : TypeT<'mt> + + let inline unwrap (TypeT mit : TypeT<'mt>) = + let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit + unbox mit : 'mit + + let inline empty () = wrap ((result Node<'mt,'t>.A) : 'mit) : TypeT<'mt> + + let inline concat l1 l2 = + let rec loop (l1: TypeT<'mt>) (lst2: TypeT<'mt>) = + let (l1, l2) = unwrap l1, unwrap lst2 + TypeT (l1 >>= function A -> l2 | B (x: 't, xs) -> ((result (B (x, loop xs lst2))) : 'mit)) + loop l1 l2 : TypeT<'mt> + + + let inline bind f (source: TypeT<'mt>) : TypeT<'mu> = + // let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_: 't) -> (result Unchecked.defaultof<'u>) : 'mu + let rec loop f input = + TypeT ( + (unwrap input : 'mit) >>= function + | A -> result <| (A : Node<'mu,'u>) : 'miu + | B (h:'t, t: TypeT<'mt>) -> + let res = concat (f h: TypeT<'mu>) (loop f t) + unwrap res : 'miu) + loop f source : TypeT<'mu> + + + let inline map (f: 'T->'U) (x: '``Monad<'T>`` ) = Bind.Invoke x (f >> Return.Invoke) : '``Monad<'U>`` + + + let inline unfold (f:'State -> '``M<('T * 'State) option>``) (s:'State) : TypeT<'MT> = + let rec loop f s = f s |> map (function + | Some (a, s) -> B (a, loop f s) + | None -> A) |> wrap + loop f s + + let inline create (al: '``Monad>``) : TypeT<'``Monad<'T>``> = + unfold (fun i -> map (fun (lst:list<_>) -> if lst.Length > i then Some (lst.[i], i+1) else None) al) 0 + + let inline run (lst: TypeT<'MT>) : '``Monad>`` = + let rec loop acc x = unwrap x >>= function + | A -> result (List.rev acc) + | B (x, xs) -> loop (x::acc) xs + loop [] lst + + let c0 = create (Id ([1..10])) + let res0 = c0 |> run |> create |> run + +// From https://github.com/dotnet/fsharp/issues/4171#issuecomment-528063764 +// This case is where the type gets labelled as Sealed +module TypeInferenceChangeWithSealedType2 = + [] + type Id<'t> (v: 't) = + let value = v + member __.getValue = value + + [] + module Id = + let run (x: Id<_>) = x.getValue + let map f (x: Id<_>) = Id (f x.getValue) + let create x = Id x + + + type Bind = + static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U> + static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = source.ContinueWith(fun (x: Task<_>) -> f x.Result).Unwrap () : Task<'U> + static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U> + static member (>>=) (source , f: 'T -> _ ) = async.Bind (source, f) + static member (>>=) (source : Id<_> , f: 'T -> _ ) = f source.getValue : Id<'U> + + static member inline Invoke (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` = + let inline call (_mthd: 'M, input: 'I, _output: 'R, f) = ((^M or ^I or ^R) : (static member (>>=) : _*_ -> _) input, f) + call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, binder) + + let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f + + type Return = + static member inline Invoke (x: 'T) : '``Applicative<'T>`` = + let inline call (mthd: ^M, output: ^R) = ((^M or ^R) : (static member Return : _*_ -> _) output, mthd) + call (Unchecked.defaultof, Unchecked.defaultof<'``Applicative<'T>``>) x + + static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a> + static member Return (_: 'a Task , _: Return ) = fun x -> Task.FromResult x : 'a Task + static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a> + static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x + static member Return (_: 'a Id , _: Return ) = fun (x: 'a) -> Id x + + let inline result (x: 'T) : '``Functor<'T>`` = Return.Invoke x + + + type TypeT<'``monad<'t>``> = TypeT of obj + type Node<'``monad<'t>``,'t> = A | B of 't * TypeT<'``monad<'t>``> + + let inline wrap (mit: 'mit) = + let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit + TypeT mit : TypeT<'mt> + + let inline unwrap (TypeT mit : TypeT<'mt>) = + let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit + unbox mit : 'mit + + let inline empty () = wrap ((result Node<'mt,'t>.A) : 'mit) : TypeT<'mt> + + let inline concat l1 l2 = + let rec loop (l1: TypeT<'mt>) (lst2: TypeT<'mt>) = + let (l1, l2) = unwrap l1, unwrap lst2 + TypeT (l1 >>= function A -> l2 | B (x: 't, xs) -> ((result (B (x, loop xs lst2))) : 'mit)) + loop l1 l2 : TypeT<'mt> + + + let inline bind f (source: TypeT<'mt>) : TypeT<'mu> = + // let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_: 't) -> (result Unchecked.defaultof<'u>) : 'mu + let rec loop f input = + TypeT ( + (unwrap input : 'mit) >>= function + | A -> result <| (A : Node<'mu,'u>) : 'miu + | B (h:'t, t: TypeT<'mt>) -> + let res = concat (f h: TypeT<'mu>) (loop f t) + unwrap res : 'miu) + loop f source : TypeT<'mu> + + + let inline map (f: 'T->'U) (x: '``Monad<'T>`` ) = Bind.Invoke x (f >> Return.Invoke) : '``Monad<'U>`` + + + let inline unfold (f:'State -> '``M<('T * 'State) option>``) (s:'State) : TypeT<'MT> = + let rec loop f s = f s |> map (function + | Some (a, s) -> B (a, loop f s) + | None -> A) |> wrap + loop f s + + let inline create (al: '``Monad>``) : TypeT<'``Monad<'T>``> = + unfold (fun i -> map (fun (lst:list<_>) -> if lst.Length > i then Some (lst.[i], i+1) else None) al) 0 + + let inline run (lst: TypeT<'MT>) : '``Monad>`` = + let rec loop acc x = unwrap x >>= function + | A -> result (List.rev acc) + | B (x, xs) -> loop (x::acc) xs + loop [] lst + + let c0 = create (Id ([1..10])) + let res0 = c0 |> run |> create |> run + #if TESTS_AS_APP let RUN() = !failures diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 7096e447f4b..d6506caeb05 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -529,7 +529,7 @@ module CoreTests = [] let extconstraint () = let cfg = testConfig "core/extconstraint" - let cfg = { cfg with fsc_flags = fsc_flags + " --langversion:preview" } + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } fsc cfg "%s" cfg.fsc_flags ["test.fsx"] From 0f4ee6dd89f47c7bc3407768063694be54f3b7a3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 22 Jan 2020 15:23:56 +0000 Subject: [PATCH 08/82] fix problem with extension methods on struct types --- src/fsharp/ConstraintSolver.fs | 44 ++-- src/fsharp/infos.fs | 3 +- tests/fsharp/core/extconstraint/test.fsx | 257 +---------------------- 3 files changed, 35 insertions(+), 269 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 55701e5aecd..2a3071f8102 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3037,6 +3037,11 @@ let ApplyTyparDefaultAtPriority denv css priority (tp: Typar) = |> RaiseOperationResult | _ -> ()) +let ObjArgExprNeedsAddressOf g argExprs = + match argExprs with + | [] -> false + | h :: _ -> not (isByrefTy g (tyOfExpr g h)) + let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { let css = { g = g @@ -3113,7 +3118,7 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra // Fix bug 1281: If we resolve to an instance method on a struct and we haven't yet taken // the address of the object then go do that - if minfo.IsStruct && minfo.IsInstance && (match argExprs with [] -> false | h :: _ -> not (isByrefTy g (tyOfExpr g h))) then + if minfo.IsStruct && minfo.IsInstance && (minfo.ObjArgNeedsAddress(amap, m)) && ObjArgExprNeedsAddressOf g argExprs then let h, t = List.headAndTail argExprs let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m ResultD (Some (wrap (Expr.Op (TOp.TraitCall (traitInfo), [], (h' :: t), m)))) @@ -3123,26 +3128,35 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra | Choice2Of5 (tinst, rfref, isSet) -> let res = match isSet, rfref.RecdField.IsStatic, argExprs.Length with + + // static setter | true, true, 1 -> - Some (mkStaticRecdFieldSet (rfref, tinst, argExprs.[0], m)) + Some (mkStaticRecdFieldSet (rfref, tinst, argExprs.[0], m)) + + // instance setter | true, false, 2 -> - // If we resolve to an instance field on a struct and we haven't yet taken - // the address of the object then go do that - if rfref.Tycon.IsStructOrEnumTycon && not (isByrefTy g (tyOfExpr g argExprs.[0])) then - let h = List.head argExprs - let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates h None m - Some (wrap (mkRecdFieldSetViaExprAddr (h', rfref, tinst, argExprs.[1], m))) - else - Some (mkRecdFieldSetViaExprAddr (argExprs.[0], rfref, tinst, argExprs.[1], m)) + // If we resolve to an instance field on a struct and we haven't yet taken + // the address of the object then go do that + if rfref.Tycon.IsStructOrEnumTycon && not (isByrefTy g (tyOfExpr g argExprs.[0])) then + let h = List.head argExprs + let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates h None m + Some (wrap (mkRecdFieldSetViaExprAddr (h', rfref, tinst, argExprs.[1], m))) + else + Some (mkRecdFieldSetViaExprAddr (argExprs.[0], rfref, tinst, argExprs.[1], m)) + + // static getter | false, true, 0 -> - Some (mkStaticRecdFieldGet (rfref, tinst, m)) + Some (mkStaticRecdFieldGet (rfref, tinst, m)) + + // instance getter | false, false, 1 -> - if rfref.Tycon.IsStructOrEnumTycon && isByrefTy g (tyOfExpr g argExprs.[0]) then - Some (mkRecdFieldGetViaExprAddr (argExprs.[0], rfref, tinst, m)) - else - Some (mkRecdFieldGet g (argExprs.[0], rfref, tinst, m)) + if rfref.Tycon.IsStructOrEnumTycon && isByrefTy g (tyOfExpr g argExprs.[0]) then + Some (mkRecdFieldGetViaExprAddr (argExprs.[0], rfref, tinst, m)) + else + Some (mkRecdFieldGet g (argExprs.[0], rfref, tinst, m)) | _ -> None ResultD res + | Choice3Of5 (anonInfo, tinst, i) -> let res = let tupInfo = anonInfo.TupInfo diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index c3398f6658c..3e1429f9d87 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -1209,7 +1209,8 @@ type MethInfo = | ILMeth (_, _, Some _) -> true | _ -> false - /// Indicates if this is an extension member (e.g. on a struct) that takes a byref arg + /// Indicates if this is an instance member on a struct, or + /// an extension instance member on a struct that takes a byref arg. member x.ObjArgNeedsAddress (amap: Import.ImportMap, m) = (x.IsStruct && not x.IsExtensionMember) || match x.GetObjArgTypes (amap, m, x.FormalMethodInst) with diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index fb9320ea149..fb7aa4427bb 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -51,8 +51,6 @@ module DotNetPrimtiveWithAmbiguousNewOperator = let f (x: string) = 1 ++ x do check "jfs9dlfdhsx2" 1 (f "2") - // TODO: this gives an internal error - //let f x = 1 ++ x /// Extending a .NET primitive type with new _internal_ operator module DotNetPrimtiveWithInternalOperator1 = @@ -412,8 +410,8 @@ module SystematicTests = check "aqvwoiwvoi3" (CallStaticMethod3 (r3, r4)).F 11 check "aqvwoiwvoi4" (CallOverloadedStaticMethod4 (r3, 4)).F 11 check "aqvwoiwvoi5" (CallOverloadedStaticMethod4 (r3, "four")).F 11 - //check "aqvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 // TODO - FAILING - //check "aqvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 // TODO - FAILING + check "aqvwoiwvoi6" (CallInstanceMethod1 (r3, r4)).F 12 + check "aqvwoiwvoi7" (CallInstanceProperty1 (r3)).F 7 check "aqvwoiwvoi8" (CallStaticProperty1().F : int32) 4 @@ -484,8 +482,8 @@ module SystematicTests = check "2vwoiwvoi3" (CallStaticMethod3 (3, 4)) 11 check "2vwoiwvoi4" (CallOverloadedStaticMethod4 (3, 4)) 11 check "2vwoiwvoi5" (CallOverloadedStaticMethod4 (3, "four")) 11 - //check "2vwoiwvoi6" (CallInstanceMethod1 (3, 4)) 12 // TODO- BUG - CODEGEN - //check "2vwoiwvoi7" (CallInstanceProperty1 (3)) 7 // TODO- BUG - CODEGEN + check "2vwoiwvoi6" (CallInstanceMethod1 (3, 4)) 12 + check "2vwoiwvoi7" (CallInstanceProperty1 (3)) 7 check "2vwoiwvoi8" (CallStaticProperty1 () : int32) 4 @@ -540,253 +538,6 @@ module Test2 = let z = "Bar".Foo("foo") let z0 = (Bar "Bar").Foo("foo") -module FSharpPlus_Applicatives = - open System - - type Ap = Ap with - static member inline Invoke (x:'T) : '``Applicative<'T>`` = - let inline call (mthd : ^M, output : ^R) = ((^M or ^R) : (static member Return: _*_ -> _) output, mthd) - call (Ap, Unchecked.defaultof<'``Applicative<'T>``>) x - static member inline InvokeOnInstance (x:'T) = (^``Applicative<'T>`` : (static member Return: ^T -> ^``Applicative<'T>``) x) - static member inline Return (r:'R , _:obj) = Ap.InvokeOnInstance :_ -> 'R - static member Return (_:seq<'a> , Ap ) = fun x -> Seq.singleton x : seq<'a> - static member Return (_:Tuple<'a>, Ap ) = fun x -> Tuple x : Tuple<'a> - static member Return (_:'r -> 'a , Ap ) = fun k _ -> k : 'a -> 'r -> _ - - let inline result (x:'T) = Ap.Invoke x - - let inline (<*>) (f:'``Applicative<'T->'U>``) (x:'``Applicative<'T>``) : '``Applicative<'U>`` = - (( ^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>): _*_ -> _) f, x) - - let inline (+) (a:'Num) (b:'Num) :'Num = a + b - - type ZipList<'s> = ZipList of 's seq with - static member Return (x:'a) = ZipList (Seq.initInfinite (fun _ -> x)) - static member (<*>) (ZipList (f:seq<'a->'b>), ZipList x) = ZipList (Seq.zip f x |> Seq.map (fun (f, x) -> f x)) :ZipList<'b> - - type Ii = Ii - type Idiomatic = Idiomatic with - static member inline ($) (Idiomatic, si) = fun sfi x -> (Idiomatic $ x) (sfi <*> si) - static member ($) (Idiomatic, Ii) = id - let inline idiomatic a b = (Idiomatic $ b) a - let inline iI x = (idiomatic << result) x - - let res1n2n3 = iI (+) (result 0M ) (ZipList [1M;2M;3M]) Ii - let res2n3n4 = iI (+) (result LanguagePrimitives.GenericOne) (ZipList [1 ;2 ;3 ]) Ii - -module FSharpPlus_FoldArgs = - type FoldArgs<'t> = FoldArgs of ('t -> 't -> 't) - - let inline foldArgs f (x:'t) (y:'t) :'rest = (FoldArgs f $ Unchecked.defaultof<'rest>) x y - - type FoldArgs<'t> with - static member inline ($) (FoldArgs f, _:'t-> 'rest) = fun (a:'t) -> f a >> foldArgs f - static member ($) (FoldArgs f, _:'t ) = f - - let test1() = - let x:int = foldArgs (+) 2 3 - let y:int = foldArgs (+) 2 3 4 - let z:int = foldArgs (+) 2 3 4 5 - let d:decimal = foldArgs (+) 2M 3M 4M - let e:string = foldArgs (+) "h" "e" "l" "l" "o" - let f:float = foldArgs (+) 2. 3. 4. - - let mult3Numbers a b c = a * b * c - let res2 = mult3Numbers 3 (foldArgs (+) 3 4) (foldArgs (+) 2 2 3 3) - () - - // Run the test - test1() - -// From https://github.com/dotnet/fsharp/issues/4171#issuecomment-528063764 -module TypeInferenceChangeWithSealedType1 = - // [] - type Id<'t> (v: 't) = - let value = v - member __.getValue = value - - [] - module Id = - let run (x: Id<_>) = x.getValue - let map f (x: Id<_>) = Id (f x.getValue) - let create x = Id x - - - type Bind = - static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U> - static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = source.ContinueWith(fun (x: Task<_>) -> f x.Result).Unwrap () : Task<'U> - static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U> - static member (>>=) (source , f: 'T -> _ ) = async.Bind (source, f) - static member (>>=) (source : Id<_> , f: 'T -> _ ) = f source.getValue : Id<'U> - - static member inline Invoke (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` = - let inline call (_mthd: 'M, input: 'I, _output: 'R, f) = ((^M or ^I or ^R) : (static member (>>=) : _*_ -> _) input, f) - call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, binder) - - let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f - - type Return = - static member inline Invoke (x: 'T) : '``Applicative<'T>`` = - let inline call (mthd: ^M, output: ^R) = ((^M or ^R) : (static member Return : _*_ -> _) output, mthd) - call (Unchecked.defaultof, Unchecked.defaultof<'``Applicative<'T>``>) x - - static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a> - static member Return (_: 'a Task , _: Return ) = fun x -> Task.FromResult x : 'a Task - static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a> - static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x - static member Return (_: 'a Id , _: Return ) = fun (x: 'a) -> Id x - - let inline result (x: 'T) : '``Functor<'T>`` = Return.Invoke x - - - type TypeT<'``monad<'t>``> = TypeT of obj - type Node<'``monad<'t>``,'t> = A | B of 't * TypeT<'``monad<'t>``> - - let inline wrap (mit: 'mit) = - let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit - TypeT mit : TypeT<'mt> - - let inline unwrap (TypeT mit : TypeT<'mt>) = - let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit - unbox mit : 'mit - - let inline empty () = wrap ((result Node<'mt,'t>.A) : 'mit) : TypeT<'mt> - - let inline concat l1 l2 = - let rec loop (l1: TypeT<'mt>) (lst2: TypeT<'mt>) = - let (l1, l2) = unwrap l1, unwrap lst2 - TypeT (l1 >>= function A -> l2 | B (x: 't, xs) -> ((result (B (x, loop xs lst2))) : 'mit)) - loop l1 l2 : TypeT<'mt> - - - let inline bind f (source: TypeT<'mt>) : TypeT<'mu> = - // let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_: 't) -> (result Unchecked.defaultof<'u>) : 'mu - let rec loop f input = - TypeT ( - (unwrap input : 'mit) >>= function - | A -> result <| (A : Node<'mu,'u>) : 'miu - | B (h:'t, t: TypeT<'mt>) -> - let res = concat (f h: TypeT<'mu>) (loop f t) - unwrap res : 'miu) - loop f source : TypeT<'mu> - - - let inline map (f: 'T->'U) (x: '``Monad<'T>`` ) = Bind.Invoke x (f >> Return.Invoke) : '``Monad<'U>`` - - - let inline unfold (f:'State -> '``M<('T * 'State) option>``) (s:'State) : TypeT<'MT> = - let rec loop f s = f s |> map (function - | Some (a, s) -> B (a, loop f s) - | None -> A) |> wrap - loop f s - - let inline create (al: '``Monad>``) : TypeT<'``Monad<'T>``> = - unfold (fun i -> map (fun (lst:list<_>) -> if lst.Length > i then Some (lst.[i], i+1) else None) al) 0 - - let inline run (lst: TypeT<'MT>) : '``Monad>`` = - let rec loop acc x = unwrap x >>= function - | A -> result (List.rev acc) - | B (x, xs) -> loop (x::acc) xs - loop [] lst - - let c0 = create (Id ([1..10])) - let res0 = c0 |> run |> create |> run - -// From https://github.com/dotnet/fsharp/issues/4171#issuecomment-528063764 -// This case is where the type gets labelled as Sealed -module TypeInferenceChangeWithSealedType2 = - [] - type Id<'t> (v: 't) = - let value = v - member __.getValue = value - - [] - module Id = - let run (x: Id<_>) = x.getValue - let map f (x: Id<_>) = Id (f x.getValue) - let create x = Id x - - - type Bind = - static member (>>=) (source: Lazy<'T> , f: 'T -> Lazy<'U> ) = lazy (f source.Value).Value : Lazy<'U> - static member (>>=) (source: Task<'T> , f: 'T -> Task<'U> ) = source.ContinueWith(fun (x: Task<_>) -> f x.Result).Unwrap () : Task<'U> - static member (>>=) (source , f: 'T -> _ ) = Option.bind f source : option<'U> - static member (>>=) (source , f: 'T -> _ ) = async.Bind (source, f) - static member (>>=) (source : Id<_> , f: 'T -> _ ) = f source.getValue : Id<'U> - - static member inline Invoke (source: '``Monad<'T>``) (binder: 'T -> '``Monad<'U>``) : '``Monad<'U>`` = - let inline call (_mthd: 'M, input: 'I, _output: 'R, f) = ((^M or ^I or ^R) : (static member (>>=) : _*_ -> _) input, f) - call (Unchecked.defaultof, source, Unchecked.defaultof<'``Monad<'U>``>, binder) - - let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f - - type Return = - static member inline Invoke (x: 'T) : '``Applicative<'T>`` = - let inline call (mthd: ^M, output: ^R) = ((^M or ^R) : (static member Return : _*_ -> _) output, mthd) - call (Unchecked.defaultof, Unchecked.defaultof<'``Applicative<'T>``>) x - - static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a> - static member Return (_: 'a Task , _: Return ) = fun x -> Task.FromResult x : 'a Task - static member Return (_: option<'a> , _: Return ) = fun x -> Some x : option<'a> - static member Return (_: 'a Async , _: Return ) = fun (x: 'a) -> async.Return x - static member Return (_: 'a Id , _: Return ) = fun (x: 'a) -> Id x - - let inline result (x: 'T) : '``Functor<'T>`` = Return.Invoke x - - - type TypeT<'``monad<'t>``> = TypeT of obj - type Node<'``monad<'t>``,'t> = A | B of 't * TypeT<'``monad<'t>``> - - let inline wrap (mit: 'mit) = - let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit - TypeT mit : TypeT<'mt> - - let inline unwrap (TypeT mit : TypeT<'mt>) = - let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_:'t) -> (result Node<'mt,'t>.A ) : 'mit - unbox mit : 'mit - - let inline empty () = wrap ((result Node<'mt,'t>.A) : 'mit) : TypeT<'mt> - - let inline concat l1 l2 = - let rec loop (l1: TypeT<'mt>) (lst2: TypeT<'mt>) = - let (l1, l2) = unwrap l1, unwrap lst2 - TypeT (l1 >>= function A -> l2 | B (x: 't, xs) -> ((result (B (x, loop xs lst2))) : 'mit)) - loop l1 l2 : TypeT<'mt> - - - let inline bind f (source: TypeT<'mt>) : TypeT<'mu> = - // let _mnil = (result Unchecked.defaultof<'t> : 'mt) >>= fun (_: 't) -> (result Unchecked.defaultof<'u>) : 'mu - let rec loop f input = - TypeT ( - (unwrap input : 'mit) >>= function - | A -> result <| (A : Node<'mu,'u>) : 'miu - | B (h:'t, t: TypeT<'mt>) -> - let res = concat (f h: TypeT<'mu>) (loop f t) - unwrap res : 'miu) - loop f source : TypeT<'mu> - - - let inline map (f: 'T->'U) (x: '``Monad<'T>`` ) = Bind.Invoke x (f >> Return.Invoke) : '``Monad<'U>`` - - - let inline unfold (f:'State -> '``M<('T * 'State) option>``) (s:'State) : TypeT<'MT> = - let rec loop f s = f s |> map (function - | Some (a, s) -> B (a, loop f s) - | None -> A) |> wrap - loop f s - - let inline create (al: '``Monad>``) : TypeT<'``Monad<'T>``> = - unfold (fun i -> map (fun (lst:list<_>) -> if lst.Length > i then Some (lst.[i], i+1) else None) al) 0 - - let inline run (lst: TypeT<'MT>) : '``Monad>`` = - let rec loop acc x = unwrap x >>= function - | A -> result (List.rev acc) - | B (x, xs) -> loop (x::acc) xs - loop [] lst - - let c0 = create (Id ([1..10])) - let res0 = c0 |> run |> create |> run - #if TESTS_AS_APP let RUN() = !failures From 44d087f2cf46cf768d16f22e82249ce0bfc25278 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 22 Jan 2020 16:41:27 +0000 Subject: [PATCH 09/82] align with master --- src/fsharp/ConstraintSolver.fs | 79 +++++++++++++++++----------------- src/fsharp/TastOps.fs | 21 ++++----- src/fsharp/TastPickle.fs | 4 +- 3 files changed, 54 insertions(+), 50 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 2a3071f8102..1713bc3514a 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -333,10 +333,10 @@ let isUnsignedIntegerTy g ty = typeEquivAux EraseMeasures g g.unativeint_ty ty || typeEquivAux EraseMeasures g g.uint64_ty ty -let rec isIntegerOrIntegerEnumTy g ty = +let rec IsIntegerOrIntegerEnumTy g ty = isSignedIntegerTy g ty || isUnsignedIntegerTy g ty || - (isEnumTy g ty && isIntegerOrIntegerEnumTy g (underlyingTypeOfEnumTy g ty)) + (isEnumTy g ty && IsIntegerOrIntegerEnumTy g (underlyingTypeOfEnumTy g ty)) let isIntegerTy g ty = isSignedIntegerTy g ty || @@ -357,7 +357,7 @@ let isFpTy g ty = let isDecimalTy g ty = typeEquivAux EraseMeasures g g.decimal_ty ty -let IsNonDecimalNumericOrIntegralEnumType g ty = isIntegerOrIntegerEnumTy g ty || isFpTy g ty +let IsNonDecimalNumericOrIntegralEnumType g ty = IsIntegerOrIntegerEnumTy g ty || isFpTy g ty let IsNumericOrIntegralEnumType g ty = IsNonDecimalNumericOrIntegralEnumType g ty || isDecimalTy g ty @@ -380,7 +380,7 @@ let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) -let IsBitwiseOpType g ty = isIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) +let IsBitwiseOpType g ty = IsIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) // For weak resolution, require a relevant primitive on one side // For strong resolution @@ -443,8 +443,7 @@ let IsMulDivTypeArgPair permitWeakResolution minfos g ty1 ty2 = IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty1 ty2 || IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty2 ty1 -/// Checks if the knowledge we have of the argument types is enough to commit to a path that simulates that -/// a type supports the get_Sign instance member +/// Checks the argument type for a built-in solution to a get_Sign constraint. let IsSignType g ty = isSignedIntegerTy g ty || isFpTy g ty || isDecimalTy g ty @@ -1366,7 +1365,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] - when isIntegerOrIntegerEnumTy g argty1 -> + when IsIntegerOrIntegerEnumTy g argty1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 @@ -1386,13 +1385,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, true, "get_Sign", [] - when (let argty = tys.Head in isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty) -> + when IsSignType g tys.Head -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.int32_ty return TTraitBuiltIn | _, false, ("op_LogicalNot" | "op_OnesComplement"), [argty] - when isIntegerOrIntegerEnumTy g argty -> + when IsIntegerOrIntegerEnumTy g argty -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty do! SolveDimensionlessNumericType csenv ndeep m2 trace argty @@ -3053,45 +3052,45 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let! _res = SolveMemberConstraint csenv true (PermitWeakResolution.Yes true) 0 m NoTrace traitInfo let sln = - match traitInfo.Solution with - | None -> Choice5Of5() - | Some sln -> + match traitInfo.Solution with + | None -> Choice5Of5() + | Some sln -> - // Given the solution information, reconstruct the MethInfo for the solution - match sln with - | ILMethSln(apparentTy, extOpt, mref, minst) -> + // Given the solution information, reconstruct the MethInfo for the solution + match sln with + | ILMethSln(apparentTy, extOpt, mref, minst) -> - let metadataTy = convertToTypeWithMetadataIfPossible g apparentTy + let metadataTy = convertToTypeWithMetadataIfPossible g apparentTy - // Find the actual type containing the solution - let actualTyconRef = - match extOpt with - | None -> tcrefOfAppTy g metadataTy - | Some ilActualTypeRef -> Import.ImportILTypeRef amap m ilActualTypeRef + // Find the actual type containing the solution + let actualTyconRef = + match extOpt with + | None -> tcrefOfAppTy g metadataTy + | Some ilActualTypeRef -> Import.ImportILTypeRef amap m ilActualTypeRef - let mdef = IL.resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref + let mdef = IL.resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref - let ilMethInfo = - match extOpt with - | None -> MethInfo.CreateILMeth(amap, m, apparentTy, mdef) - | Some _ -> MethInfo.CreateILExtensionMeth(amap, m, apparentTy, actualTyconRef, None, mdef) + let ilMethInfo = + match extOpt with + | None -> MethInfo.CreateILMeth(amap, m, apparentTy, mdef) + | Some _ -> MethInfo.CreateILExtensionMeth(amap, m, apparentTy, actualTyconRef, None, mdef) - Choice1Of5 (ilMethInfo, minst) + Choice1Of5 (ilMethInfo, minst) - | FSMethSln(ty, vref, minst) -> - Choice1Of5 (FSMeth(g, ty, vref, None), minst) + | FSMethSln(ty, vref, minst) -> + Choice1Of5 (FSMeth(g, ty, vref, None), minst) - | FSRecdFieldSln(tinst, rfref, isSetProp) -> - Choice2Of5 (tinst, rfref, isSetProp) + | FSRecdFieldSln(tinst, rfref, isSetProp) -> + Choice2Of5 (tinst, rfref, isSetProp) - | FSAnonRecdFieldSln(anonInfo, tinst, i) -> - Choice3Of5 (anonInfo, tinst, i) + | FSAnonRecdFieldSln(anonInfo, tinst, i) -> + Choice3Of5 (anonInfo, tinst, i) - | BuiltInSln -> - Choice5Of5 () + | BuiltInSln -> + Choice5Of5 () - | ClosedExprSln expr -> - Choice4Of5 expr + | ClosedExprSln expr -> + Choice4Of5 expr return! match sln with | Choice1Of5(minfo, methArgTys) -> @@ -3166,9 +3165,11 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra Some (mkAnonRecdFieldGet g (anonInfo, argExprs.[0], tinst, i, m)) ResultD res - | Choice4Of5 expr -> ResultD (Some (MakeApplicationAndBetaReduce g (expr, tyOfExpr g expr, [], argExprs, m))) + | Choice4Of5 expr -> + ResultD (Some (MakeApplicationAndBetaReduce g (expr, tyOfExpr g expr, [], argExprs, m))) - | Choice5Of5 () -> ResultD None + | Choice5Of5 () -> + ResultD None } let ChooseTyparSolutionAndSolve css denv tp = diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 7b36a802a11..22b50da2d5d 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -247,16 +247,18 @@ and remapTypesAux tyenv types = List.mapq (remapTypeAux tyenv) types and remapTyparConstraintsAux tyenv cs = cs |> List.choose (fun x -> match x with - | TyparConstraint.CoercesTo(ty,m) -> - Some(TyparConstraint.CoercesTo (remapTypeAux tyenv ty,m)) + | TyparConstraint.CoercesTo(ty, m) -> + Some(TyparConstraint.CoercesTo (remapTypeAux tyenv ty, m)) | TyparConstraint.MayResolveMember(traitInfo, m) -> Some(TyparConstraint.MayResolveMember (remapTraitAux tyenv traitInfo,m)) - | TyparConstraint.DefaultsTo(priority,ty,m) -> Some(TyparConstraint.DefaultsTo(priority,remapTypeAux tyenv ty,m)) - | TyparConstraint.IsEnum(uty,m) -> - Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty,m)) - | TyparConstraint.IsDelegate(uty1,uty2,m) -> - Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1,remapTypeAux tyenv uty2,m)) - | TyparConstraint.SimpleChoice(tys,m) -> Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys,m)) + | TyparConstraint.DefaultsTo(priority, ty, m) -> + Some(TyparConstraint.DefaultsTo(priority, remapTypeAux tyenv ty, m)) + | TyparConstraint.IsEnum(uty, m) -> + Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty, m)) + | TyparConstraint.IsDelegate(uty1, uty2, m) -> + Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1, remapTypeAux tyenv uty2, m)) + | TyparConstraint.SimpleChoice(tys, m) -> + Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys, m)) | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -291,7 +293,7 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, extSlns, ad)) if tyenv.extSlnsMap.ContainsKey nm then tyenv.extSlnsMap.[nm] else - extSlns // TODO: do we need to remap here??? + extSlns // Note: we reallocate a new solution cell (though keep existing solutions unless 'removeTraitSolutions'=true) on every traversal of a trait constraint // This feels incorrect for trait constraints that are quantified: it seems we should have @@ -1430,7 +1432,6 @@ type TyconRefMultiMap<'T>(contents: TyconRefMap<'T list>) = | _ -> [] member m.Add (v, x) = TyconRefMultiMap<'T>(contents.Add v (x :: m.Find v)) - member m.Contents = contents static member Empty = TyconRefMultiMap<'T>(TyconRefMap<_>.Empty) static member OfList vs = (vs, TyconRefMultiMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add (x, y)) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 5ce2a657c51..701e40a67ee 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1539,7 +1539,9 @@ let u_trait_sln st = let u_trait st = let a, b, c, d, e, f = u_tup6 u_tys u_string u_MemberFlags u_tys (u_option u_ty) (u_option u_trait_sln) st - // extSlns starts empty. TODO: check the ramifications of this when inlining solved trait calls from other assemblies + // extSlns starts empty when reading trait constraints from pickled + // data. This is ok as only generalized (pre-solution, pre-freshened) + // or solved constraints are propagated across assembly boundaries. TTrait (a, b, c, d, e, ref f, [], None) let p_rational q st = p_int32 (GetNumerator q) st; p_int32 (GetDenominator q) st From 9a193ad3006b7d47ed5373e9314705ebf62d6a50 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 22 Jan 2020 17:11:25 +0000 Subject: [PATCH 10/82] fix build --- src/fsharp/TastOps.fsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index ea358d68725..ecfa0819546 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -488,8 +488,6 @@ type TyconRefMultiMap<'T> = /// Make a new map, containing a new entry for the given type definition member Add : TyconRef * 'T -> TyconRefMultiMap<'T> - member Contents : TyconRefMap<'T list> - /// The empty map static member Empty : TyconRefMultiMap<'T> From dc20b193c849a6749923e039d4a7c517ef9cee09 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 23 Jan 2020 11:41:00 +0000 Subject: [PATCH 11/82] adjust baseline --- tests/fsharp/typecheck/sigs/neg116.bsl | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg116.bsl b/tests/fsharp/typecheck/sigs/neg116.bsl index 8bd4930a304..adef0933d01 100644 --- a/tests/fsharp/typecheck/sigs/neg116.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.bsl @@ -1,12 +1,2 @@ -neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. The available overloads are shown below. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'Complex' -. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'decimal' -. +neg116.fs(10,44,10,45): typecheck error FS0043: The type 'Polynomial' does not match the type 'float' From 4045843152bb5d7ab2723437bb5ada965e2b0b26 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 23 Jan 2020 18:04:25 +0000 Subject: [PATCH 12/82] fix test --- tests/fsharp/tests.fs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index b2233ba0c0d..121dfaef89c 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -527,7 +527,7 @@ module CoreTests = exec cfg ("." ++ "testcs.exe") "" [] - let extconstraint () = + let ``extconstraint-fsc`` () = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } @@ -535,21 +535,22 @@ module CoreTests = peverify cfg "test.exe" - begin - use testOkFile = fileguard cfg "test.ok" + use testOkFile = fileguard cfg "test.ok" - exec cfg ("." ++ "test.exe") "" + exec cfg ("." ++ "test.exe") "" - testOkFile.CheckExists() - end + testOkFile.CheckExists() - begin - use testOkFile = fileguard cfg "test.ok" + [] + let ``extconstraint-fsi`` () = + let cfg = testConfig "core/extconstraint" + let cfg = { cfg with fsi_flags = cfg.fsi_flags + " --langversion:preview" } - fsi cfg "" ["test.fsx"] + use testOkFile = fileguard cfg "test.ok" - testOkFile.CheckExists() - end + fsi cfg "%s" cfg.fsi_flags ["test.fsx"] + + testOkFile.CheckExists() // // Shadowcopy does not work for public signed assemblies From f3901d07b5e5dc0e76122bf2b852c577f4afe938 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 27 Jan 2020 18:07:21 +0000 Subject: [PATCH 13/82] add some compat testing --- src/fsharp/CompileOps.fs | 9 -- tests/fsharp/core/extconstraint/cslib.cs | 13 +++ .../fsharp/core/extconstraint/test-compat.fsx | 104 ++++++++++++++++++ .../core/extconstraint/test-compat.output.bsl | 67 +++++++++++ .../test-compat.output.feature-disabled.bsl | 62 +++++++++++ tests/fsharp/core/extconstraint/test.fsx | 1 - tests/fsharp/tests.fs | 56 +++++++++- 7 files changed, 301 insertions(+), 11 deletions(-) create mode 100644 tests/fsharp/core/extconstraint/cslib.cs create mode 100644 tests/fsharp/core/extconstraint/test-compat.fsx create mode 100644 tests/fsharp/core/extconstraint/test-compat.output.bsl create mode 100644 tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index c90e75a3ae6..7a28940bc38 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -5238,10 +5238,6 @@ module ScriptPreprocessClosure = let sources = if preSources.Length < postSources.Length then postSources.[preSources.Length..] else [] yield! resolveDependencyManagerSources filename -#if DEBUG - for (_,subFile) in sources do - printfn "visiting %s - has subsource of %s " filename subFile -#endif for (m, subFile) in sources do if IsScript subFile then for subSource in ClosureSourceOfFilename(subFile, m, tcConfigResult.inputCodePage, false) do @@ -5249,17 +5245,12 @@ module ScriptPreprocessClosure = else yield ClosureFile(subFile, m, None, [], [], []) -#if DEBUG - printfn "yielding source %s" filename -#endif yield ClosureFile(filename, m, Some parsedScriptAst, parseDiagnostics, errorLogger.Diagnostics, noWarns) | None -> - printfn "yielding source %s (failed parse)" filename yield ClosureFile(filename, m, None, parseDiagnostics, [], []) else // Don't traverse into .fs leafs. - printfn "yielding non-script source %s" filename yield ClosureFile(filename, m, None, [], [], []) ] closureSources |> List.collect loop, tcConfig diff --git a/tests/fsharp/core/extconstraint/cslib.cs b/tests/fsharp/core/extconstraint/cslib.cs new file mode 100644 index 00000000000..baad200998d --- /dev/null +++ b/tests/fsharp/core/extconstraint/cslib.cs @@ -0,0 +1,13 @@ + +// TODO add extension members here + +public struct S { + public int x; +} + +public class Class1 +{ + public string myField; + public readonly string myReadonlyField; + public Class1(string v) { this.myReadonlyField = v; } +} diff --git a/tests/fsharp/core/extconstraint/test-compat.fsx b/tests/fsharp/core/extconstraint/test-compat.fsx new file mode 100644 index 00000000000..6b80b841754 --- /dev/null +++ b/tests/fsharp/core/extconstraint/test-compat.fsx @@ -0,0 +1,104 @@ + +// We compile this and check the inferred signature against a baseline. +// The baseline is manually generated from a previous-generated F# compiler. + +module TestCompat + +module CheckNewOverloadsDoneConfusePreviousCode = + open System + + type System.DateTime with + static member (+)(a: DateTime, b: TimeSpan) = a + + let x = DateTime.Now + TimeSpan.Zero + let f1 (x: DateTime) = x + TimeSpan.Zero + let f2 (x: TimeSpan) y = y + x + let f3 x y = DateTime.op_Addition (x, y) + let f4 x y = TimeSpan.op_Addition (x, y) + + +module CheckNewOverloadsDoneConfusePreviousCode2 = + open System + open System.Numerics + + // This adds one op_Addition overload to a type that currently only has one op_Addition overload + type System.Numerics.Complex with + static member (+)(a: Complex, b: TimeSpan) = a + + type CheckNominal() = + static member CanResolveOverload(x: TimeSpan) = () + static member CanResolveOverload(x: Complex) = () + + // Next check we can resolve direct calls to the op_Addition overload both to new and old types. + // There is nothing new here, no SRTP constraints involved. + let f1 (x: Complex) (y: Complex) = System.Numerics.Complex.op_Addition (x, y) + let f2 (x: Complex) (y: TimeSpan) = System.Numerics.Complex.op_Addition (x, y) + + // Next check we can resolve the op_Addition overload with no type information. + // This in F# overload resolution the original method is preferred to the extension method. + // There is nothing new here, no SRTP constraints involved. + let f3 x y = System.Numerics.Complex.op_Addition (x, y) + + // Next check we can resolve the SRTP constraint implied by the use of the + // '+' operator when given two argument types (no return type) + let f4 (x: Complex) (y: Complex) = x + y + +#if LANGVERSION_PREVIEW + // Next check we can resolve the SRTP constraint implied by the use of the + // '+' operator when given two argument types (no return type), resolving to the + // extension member. + let f5 (x: Complex) (y: TimeSpan) = x + y +#endif + + // Next check we can resolve the SRTP constraint implied by the use of the + // '+' operator when given only the first argument type. This must resolve to the original + // overload. + // + // The original overload is preferred to the extension overload. + // + // Note the SRTP constraint is resolved based on one type only + // because canonicalization (weak resolution) is forced prior to + // generalizing 'f6', see calls to CanonicalizePartialInferenceProblem in TypeChecker.fs. + let f6 (x: Complex) y = x + y + + // The following does similar to the previous but checks more subtletly about when the resolution + // is done. + let f7 (x: Complex) (y: 'B) (z: 'C) : 'C = + // 1. Commit to first argument Complex + ((+): 'A -> 'B -> 'C) + // Processing the next fragment commits the first type to be Complex + x + // Processing the next fragment checks that we can do dot notation + // name resolution on the type of 'y', which must force 'y' to be nominal. + // + // Just prior to processing this, 'y' still + // has variable type. When processing it, canonicalization (weak resolution) is + // forced on the type of 'y' prior to name resolution, see calls + // to CanonicalizePartialInferenceProblem in TypeChecker.fs TcLookupThen. + (ignore y.Magnitude; y) + + // Next check that overload resolution eagerly commits to Complex * Complex -> Complex overload + let f8 (x: Complex) (y: 'B) (z: 'C) : 'C = + // 1. Commit to first argument Complex + ((+): 'A -> 'B -> 'C) + // Commit first type to be Complex + x + // Check we can do overload resolution based on the type of 'y', + // and this is enough to force 'y' to be nominal. Just prior to processing this, 'y' still + // has variable type, however canonicalization (weak resolution) + // is forced on the type of 'y' prior to overload resolution, see calls + // to CanonicalizePartialInferenceProblem in TypeChecker.fs. + (CheckNominal.CanResolveOverload y; y) + +#if LANGVERSION_PREVIEW + // Next check that overload resolution can commit to Complex * TimeSpan -> Complex overload + // as soon as enough information is available. + // Check resulting type is known to be Complex (by resolving .Magnitude + let f9 (x: Complex) (y: 'B) (z: 'C) : 'C = + // 1. Commit to first argument Complex + ((+): Complex -> 'B -> 'C) + // 2. Commit to second argument TimeSpan + (ignore (y: TimeSpan); x) + // 3. check we already know the type of 'z' + (ignore z.Magnitude; y) +#endif diff --git a/tests/fsharp/core/extconstraint/test-compat.output.bsl b/tests/fsharp/core/extconstraint/test-compat.output.bsl new file mode 100644 index 00000000000..9653c054013 --- /dev/null +++ b/tests/fsharp/core/extconstraint/test-compat.output.bsl @@ -0,0 +1,67 @@ + +test-compat.fsx(70,13): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'A has been constrained to be type 'Complex'. + +test-compat.fsx(68,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'B has been constrained to be type 'Complex'. + +test-compat.fsx(68,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'C has been constrained to be type 'Complex'. + +test-compat.fsx(85,13): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'A has been constrained to be type 'Complex'. + +test-compat.fsx(83,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'B has been constrained to be type 'Complex'. + +test-compat.fsx(83,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'C has been constrained to be type 'Complex'. + +test-compat.fsx(101,22): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'B has been constrained to be type 'TimeSpan'. + +test-compat.fsx(99,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'C has been constrained to be type 'Complex'. +module TestCompat +module CheckNewOverloadsDoneConfusePreviousCode = begin + type DateTime with + static member + ( + ) : a:System.DateTime * b:System.TimeSpan -> System.DateTime + val x : System.DateTime + val f1 : x:System.DateTime -> System.DateTime + val f2 : x:System.TimeSpan -> y:System.TimeSpan -> System.TimeSpan + val f3 : x:System.DateTime -> y:System.TimeSpan -> System.DateTime + val f4 : x:System.TimeSpan -> y:System.TimeSpan -> System.TimeSpan +end +module CheckNewOverloadsDoneConfusePreviousCode2 = begin + type Complex with + static member + ( + ) : a:System.Numerics.Complex * b:System.TimeSpan -> + System.Numerics.Complex + type CheckNominal = + class + new : unit -> CheckNominal + static member CanResolveOverload : x:System.TimeSpan -> unit + static member CanResolveOverload : x:System.Numerics.Complex -> unit + end + val f1 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f2 : + x:System.Numerics.Complex -> y:System.TimeSpan -> System.Numerics.Complex + val f3 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f4 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f5 : + x:System.Numerics.Complex -> y:System.TimeSpan -> System.Numerics.Complex + val f6 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f7 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> + z:System.Numerics.Complex -> System.Numerics.Complex + val f8 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> + z:System.Numerics.Complex -> System.Numerics.Complex + val f9 : + x:System.Numerics.Complex -> + y:System.TimeSpan -> z:System.Numerics.Complex -> System.Numerics.Complex +end + diff --git a/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl b/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl new file mode 100644 index 00000000000..161c0f6ad86 --- /dev/null +++ b/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl @@ -0,0 +1,62 @@ + +test-compat.fsx(11,24): warning FS1215: Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + +test-compat.fsx(26,24): warning FS1215: Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + +test-compat.fsx(70,13): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'A has been constrained to be type 'Complex'. + +test-compat.fsx(68,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'B has been constrained to be type 'Complex'. + +test-compat.fsx(68,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'C has been constrained to be type 'Complex'. + +test-compat.fsx(85,13): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'A has been constrained to be type 'Complex'. + +test-compat.fsx(83,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'B has been constrained to be type 'Complex'. + +test-compat.fsx(83,11): warning FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'C has been constrained to be type 'Complex'. +module TestCompat +module CheckNewOverloadsDoneConfusePreviousCode = begin + type DateTime with + static member + ( + ) : a:System.DateTime * b:System.TimeSpan -> System.DateTime + val x : System.DateTime + val f1 : x:System.DateTime -> System.DateTime + val f2 : x:System.TimeSpan -> y:System.TimeSpan -> System.TimeSpan + val f3 : x:System.DateTime -> y:System.TimeSpan -> System.DateTime + val f4 : x:System.TimeSpan -> y:System.TimeSpan -> System.TimeSpan +end +module CheckNewOverloadsDoneConfusePreviousCode2 = begin + type Complex with + static member + ( + ) : a:System.Numerics.Complex * b:System.TimeSpan -> + System.Numerics.Complex + type CheckNominal = + class + new : unit -> CheckNominal + static member CanResolveOverload : x:System.TimeSpan -> unit + static member CanResolveOverload : x:System.Numerics.Complex -> unit + end + val f1 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f2 : + x:System.Numerics.Complex -> y:System.TimeSpan -> System.Numerics.Complex + val f3 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f4 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f6 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> System.Numerics.Complex + val f7 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> + z:System.Numerics.Complex -> System.Numerics.Complex + val f8 : + x:System.Numerics.Complex -> + y:System.Numerics.Complex -> + z:System.Numerics.Complex -> System.Numerics.Complex +end + diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index fb7aa4427bb..ead652e0493 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -538,7 +538,6 @@ module Test2 = let z = "Bar".Foo("foo") let z0 = (Bar "Bar").Foo("foo") - #if TESTS_AS_APP let RUN() = !failures #else diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 121dfaef89c..579ec390d48 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -531,7 +531,9 @@ module CoreTests = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } - fsc cfg "%s" cfg.fsc_flags ["test.fsx"] + csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"] + + fsc cfg "%s -o:test.exe -r cslib.dll -g --optimize+" cfg.fsc_flags ["test.fsx"] peverify cfg "test.exe" @@ -541,6 +543,23 @@ module CoreTests = testOkFile.CheckExists() + [] + let ``extconstraint-fsc-no-optimize`` () = + let cfg = testConfig "core/extconstraint" + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } + + csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"] + + fsc cfg "%s -o:test-debug.exe -r cslib.dll -g --optimize-" cfg.fsc_flags ["test.fsx"] + + peverify cfg "test-debug.exe" + + use testOkFile = fileguard cfg "test.ok" + + exec cfg ("." ++ "test-debug.exe") "" + + testOkFile.CheckExists() + [] let ``extconstraint-fsi`` () = let cfg = testConfig "core/extconstraint" @@ -552,6 +571,41 @@ module CoreTests = testOkFile.CheckExists() + [] + let ``extconstraint-compat`` () = + let cfg = testConfig "core/extconstraint" + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --define:LANGVERSION_PREVIEW --langversion:preview" } + + let outFile = "test-compat.output.txt" + let expectedFile = "test-compat.output.bsl" + + fscBothToOut cfg outFile "%s -i --nologo" cfg.fsc_flags ["test-compat.fsx"] + + let diff = fsdiff cfg outFile expectedFile + + match diff with + | "" -> () + | _ -> + Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) + + [] + let ``extconstraint-compat2`` () = + let cfg = testConfig "core/extconstraint" + let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:4.6" } + + let outFile = "test-compat.output.feature-disabled.txt" + let expectedFile = "test-compat.output.feature-disabled.bsl" + + fscBothToOut cfg outFile "%s -i --nologo" cfg.fsc_flags ["test-compat.fsx"] + + let diff = fsdiff cfg outFile expectedFile + + match diff with + | "" -> () + | _ -> + Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) + + // // Shadowcopy does not work for public signed assemblies // ===================================================== From ca0690d679aa93ee048daf88b801c2f62ce8e995 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 31 Jan 2020 17:14:44 +0000 Subject: [PATCH 14/82] add more tests for SRTP variations --- tests/fsharp/tests.fs | 27 ++ tests/fsharp/typecheck/sigs/neg123.bsl | 2 + .../typecheck/sigs/neg123.fs} | 12 +- tests/fsharp/typecheck/sigs/neg124.bsl | 42 +++ tests/fsharp/typecheck/sigs/neg124.fs | 40 +++ tests/fsharp/typecheck/sigs/neg125.bsl | 26 ++ tests/fsharp/typecheck/sigs/neg125.fs | 51 +++ tests/fsharp/typecheck/sigs/neg126.bsl | 2 + tests/fsharp/typecheck/sigs/neg126.fs | 32 ++ tests/fsharp/typecheck/sigs/neg127.bsl | 26 ++ tests/fsharp/typecheck/sigs/neg127.fs | 59 ++++ tests/fsharp/typecheck/sigs/neg128.bsl | 2 + tests/fsharp/typecheck/sigs/neg128.fs | 36 ++ tests/fsharp/typecheck/sigs/neg129.bsl | 2 + tests/fsharp/typecheck/sigs/neg129.fs | 67 ++++ tests/fsharp/typecheck/sigs/pos35.fs | 315 ++++++++++++++++++ .../OverloadingMembers/env.lst | 2 - 17 files changed, 732 insertions(+), 11 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg123.bsl rename tests/{fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs => fsharp/typecheck/sigs/neg123.fs} (55%) create mode 100644 tests/fsharp/typecheck/sigs/neg124.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg124.fs create mode 100644 tests/fsharp/typecheck/sigs/neg125.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg125.fs create mode 100644 tests/fsharp/typecheck/sigs/neg126.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg126.fs create mode 100644 tests/fsharp/typecheck/sigs/neg127.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg127.fs create mode 100644 tests/fsharp/typecheck/sigs/neg128.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg128.fs create mode 100644 tests/fsharp/typecheck/sigs/neg129.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg129.fs create mode 100644 tests/fsharp/typecheck/sigs/pos35.fs diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 4dd0f4740a1..493aeb30eda 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2167,6 +2167,12 @@ module TypecheckTests = fsc cfg "%s --target:library -o:pos34.dll --warnaserror" cfg.fsc_flags ["pos34.fs"] peverify cfg "pos34.dll" + [] + let ``sigs pos35`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:pos35.dll --warnaserror" cfg.fsc_flags ["pos35.fs"] + peverify cfg "pos35.dll" + [] let ``sigs pos23`` () = let cfg = testConfig "typecheck/sigs" @@ -2687,6 +2693,27 @@ module TypecheckTests = [] let ``type check neg122`` () = singleNegTest (testConfig "typecheck/sigs") "neg122" + [] + let ``type check neg123`` () = singleNegTest (testConfig "typecheck/sigs") "neg123" + + [] + let ``type check neg124`` () = singleNegTest (testConfig "typecheck/sigs") "neg124" + + [] + let ``type check neg125`` () = singleNegTest (testConfig "typecheck/sigs") "neg125" + + [] + let ``type check neg126`` () = singleNegTest (testConfig "typecheck/sigs") "neg126" + + [] + let ``type check neg127`` () = singleNegTest (testConfig "typecheck/sigs") "neg127" + + [] + let ``type check neg128`` () = singleNegTest (testConfig "typecheck/sigs") "neg128" + + [] + let ``type check neg129`` () = singleNegTest (testConfig "typecheck/sigs") "neg129" + [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg123.bsl b/tests/fsharp/typecheck/sigs/neg123.bsl new file mode 100644 index 00000000000..a944f087500 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg123.bsl @@ -0,0 +1,2 @@ + +neg123.fs(19,18,19,27): typecheck error FS0003: This value is not a function and cannot be applied. diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs b/tests/fsharp/typecheck/sigs/neg123.fs similarity index 55% rename from tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs rename to tests/fsharp/typecheck/sigs/neg123.fs index 5737cdebf2c..14943058132 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs +++ b/tests/fsharp/typecheck/sigs/neg123.fs @@ -1,6 +1,5 @@ -// #Conformance #DeclarationElements #MemberDefinitions #Overloading -// https://github.com/Microsoft/visualfsharp/issues/351 - slow overlaod resolution -//This value is not a function and cannot be applied +module Neg123 + type Switcher = Switcher let inline checker< ^s, ^r when (^s or ^r) : (static member pass : ^r -> unit)> (s : ^s) (r : ^r) = () @@ -17,9 +16,4 @@ type Switcher with static member inline pass(_ : unit) = () static member inline pass(_ : int) = () -[] -let main argv = - let res : unit = format () "text" 5 "more text" () - printfn "%A" res - System.Console.ReadKey() - 0 // return an integer exit code +let res : unit = format () "text" 5 "more text" () diff --git a/tests/fsharp/typecheck/sigs/neg124.bsl b/tests/fsharp/typecheck/sigs/neg124.bsl new file mode 100644 index 00000000000..9383c8b7ac9 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg124.bsl @@ -0,0 +1,42 @@ + +neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. The available overloads are shown below. Consider adding further type constraints +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint64' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int64' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint32' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int32' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint16' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int16' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'byte' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'sbyte' +. diff --git a/tests/fsharp/typecheck/sigs/neg124.fs b/tests/fsharp/typecheck/sigs/neg124.fs new file mode 100644 index 00000000000..674fc9f6c33 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg124.fs @@ -0,0 +1,40 @@ +module Neg124 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +module NegativeTestCase1 = + type witnesses = + static member inline unsigned_witness (x : sbyte) = uint8 x + static member inline unsigned_witness (x : byte) = x + static member inline unsigned_witness (x : int16) = uint16 x + static member inline unsigned_witness (x : uint16) = x + static member inline unsigned_witness (x : int32) = uint32 x + static member inline unsigned_witness (x : uint32) = x + static member inline unsigned_witness (x : int64) = uint64 x + static member inline unsigned_witness (x : uint64) = x + + // Note, this doesn't try to use the output to select + let inline call_unsigned_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member unsigned_witness : ^input -> ^output)> (x : ^input) = + ((^witnesses or ^input) : (static member unsigned_witness : ^input -> ^output) x) + + // unsigned: ^a -> ^b + let inline unsigned num = call_unsigned_witness num + + // Positive cases + let v1 = unsigned 0y + let v2 = unsigned 0s + let v3 = unsigned 0 + let v4 = unsigned 0L + + let f1 : int8 -> uint8 = unsigned + let f2 : int16 -> uint16 = unsigned + let f3 : int32 -> uint32 = unsigned + let f4 : int64 -> uint64 = unsigned + + let g1 : int8 -> _ = unsigned + let g2 : int16 -> _ = unsigned + let g3 : int32 -> _ = unsigned + let g4 : int64 -> _ = unsigned + + // Negative case - not enough information here + let h1 : _ -> uint8 = unsigned + \ No newline at end of file diff --git a/tests/fsharp/typecheck/sigs/neg125.bsl b/tests/fsharp/typecheck/sigs/neg125.bsl new file mode 100644 index 00000000000..4c96bbcc15e --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg125.bsl @@ -0,0 +1,26 @@ + +neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg125.fs b/tests/fsharp/typecheck/sigs/neg125.fs new file mode 100644 index 00000000000..f2a0975a06d --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg125.fs @@ -0,0 +1,51 @@ +module Neg125 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// See also pos35.fs +// +// This removes ^output as a type selector for the witness, and no longer passes a dummy ^output +// +// This means that when both ^witnesses and ^input are known, the overload determining the ^output still can't be determined, +// and overload resolutiuon failures are reported +module Negative_SelectOverloadedWitnessBasedOnReturnTypeWithoutOutputTypeSelectAndWithoutPassingDummyArgument = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint) = x + static member inline convert_witness (x : bigint) = float x + static member inline convert_witness (x : bigint) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint) = float32 x + static member inline convert_witness (x : bigint) = decimal x + static member inline convert_witness (x : bigint) = Complex(float x, 0.0) + // Note ^output in the list of "or" types + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member convert_witness : ^input -> ^output)> (b : ^input) = + ((^witnesses or ^input) : (static member convert_witness : ^input -> ^output) (b)) + + let inline convert num = + call_convert_witness (num) + + let v1 : int32 = convert 0I + let v2 : int64 = convert 0I + let v3 : bigint = convert 0I + let v4 : float = convert 0I + let v5 : sbyte = convert 0I + let v6 : int16 = convert 0I + let v7 : byte = convert 0I + let v8 : uint16 = convert 0I + let v9 : uint32 = convert 0I + let v10 : uint64 = convert 0I + let v11 : float32 = convert 0I + let v12 : decimal = convert 0I + let v13 : Complex = convert 0I diff --git a/tests/fsharp/typecheck/sigs/neg126.bsl b/tests/fsharp/typecheck/sigs/neg126.bsl new file mode 100644 index 00000000000..b8808b85143 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg126.bsl @@ -0,0 +1,2 @@ + +neg126.fs(30,32,30,48): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'sbyte'. diff --git a/tests/fsharp/typecheck/sigs/neg126.fs b/tests/fsharp/typecheck/sigs/neg126.fs new file mode 100644 index 00000000000..b97cdeb1fb9 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg126.fs @@ -0,0 +1,32 @@ +module Neg126 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// Here we are attempting to select a witness based on input type. +// +// However, only one witness is present. +// +// Due to the problem described in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580396911, +// "generic inline code we apply weak resolution to constraints that could otherwise be generalised", +// this generates a warning because overload resolution is invoked and the input type of "foo" becomes "sbyte" +// +// The inferred type should ideally be +// foo: ^a -> ^b +// but is actually +// foo: sbyte -> byte +// +// That is, the code is not generic at all, because the F# compiler thinks that it commit to the one and only witness. +// +// This test exists to pin down that we get a warning produced saying ^a has been instantiated to "sbyte" + +module SelectOverloadedWitnessBasedOnInputTypeOneWitness = + type witnesses = + static member inline foo_witness (x : sbyte) : byte = byte x + + // Note, this doesn't try to use the output to select + let inline call_foo_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member foo_witness : ^input -> ^output)> (x : ^input) = + ((^witnesses or ^input) : (static member foo_witness : ^input -> ^output) x) + + let inline foo (num: ^a) = call_foo_witness num + let v1 = foo 0y + diff --git a/tests/fsharp/typecheck/sigs/neg127.bsl b/tests/fsharp/typecheck/sigs/neg127.bsl new file mode 100644 index 00000000000..0ab9e8c5348 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg127.bsl @@ -0,0 +1,26 @@ + +neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg127.fs b/tests/fsharp/typecheck/sigs/neg127.fs new file mode 100644 index 00000000000..ba44a1ae772 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg127.fs @@ -0,0 +1,59 @@ +module Neg127 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// See also pos35.fs, neg125.fs +// +// This no longer passes a dummy ^output but keeps ^output as a witness selector +// +// When both ^witnesses and ^input are known, the overload determining the ^output still can't be determined. +// However overload resolution is **not** delayed because the language rule is that overload resolution +// goes ahead once the support in the **argument** types of the constraint have all been resolved. +// +// This design decision for SRTP resolution was based on the (technically false but normally true) assumption that +// overload resolution will not depend on return type. +// +// The workaround for this in SRTP generic code is to pass a dummy Unchecked.defaultof<_> argument of the type of the +// return type. + +module Negative_SelectOverloadedWitnessBasedOnReturnTypeWithoutPassingDummyArgument = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint) = x + static member inline convert_witness (x : bigint) = float x + static member inline convert_witness (x : bigint) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint) = float32 x + static member inline convert_witness (x : bigint) = decimal x + static member inline convert_witness (x : bigint) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input or ^output) : (static member convert_witness : ^input -> ^output)> (b : ^input) = + ((^witnesses or ^input or ^output) : (static member convert_witness : ^input -> ^output) (b)) + + let inline convert num = + call_convert_witness (num) + // These all cause errors + let v1 : int32 = convert 0I + let v2 : int64 = convert 0I + let v3 : bigint = convert 0I + let v4 : float = convert 0I + let v5 : sbyte = convert 0I + let v6 : int16 = convert 0I + let v7 : byte = convert 0I + let v8 : uint16 = convert 0I + let v9 : uint32 = convert 0I + let v10 : uint64 = convert 0I + let v11 : float32 = convert 0I + let v12 : decimal = convert 0I + let v13 : Complex = convert 0I diff --git a/tests/fsharp/typecheck/sigs/neg128.bsl b/tests/fsharp/typecheck/sigs/neg128.bsl new file mode 100644 index 00000000000..3d91ad25b52 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg128.bsl @@ -0,0 +1,2 @@ + +neg128.fs(36,47,36,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg128.fs b/tests/fsharp/typecheck/sigs/neg128.fs new file mode 100644 index 00000000000..2406954036c --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg128.fs @@ -0,0 +1,36 @@ +module Neg128 + +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputSelector = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint, _output : int32) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint, _output : int64) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint, _output : bigint) = x + static member inline convert_witness (x : bigint, _output : float) = float x + static member inline convert_witness (x : bigint, _output : sbyte) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint, _output : int16) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint, _output : byte) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint, _output : uint16) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint, _output : uint32) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint, _output : uint64) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint, _output : float32) = float32 x + static member inline convert_witness (x : bigint, _output : decimal) = decimal x + static member inline convert_witness (x : bigint, _output : Complex) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, 'output when (^witnesses or ^input) : (static member convert_witness : ^input * 'output -> 'output)> (b : ^input, c : 'output) = + ((^witnesses or ^input) : (static member convert_witness : ^input * 'output -> 'output) (b, c)) + + let inline convert num : 'output = + call_convert_witness (num, Unchecked.defaultof<'output>) + + // These solve ok + let v1 : int32 = convert 777I + let v2 : int64 = convert 777I + + // This gives an error, because solving kicks in once all selector types are known + let inline inst (num: bigint) : 'output = convert num diff --git a/tests/fsharp/typecheck/sigs/neg129.bsl b/tests/fsharp/typecheck/sigs/neg129.bsl new file mode 100644 index 00000000000..8e34cc5331d --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg129.bsl @@ -0,0 +1,2 @@ + +neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg129.fs b/tests/fsharp/typecheck/sigs/neg129.fs new file mode 100644 index 00000000000..d65671900bd --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg129.fs @@ -0,0 +1,67 @@ +module Neg129 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// This removes ^output as a type selector for the witness, but continues to pass a dummy ^output +// +// This is sufficient to make nearly all resolutions go through except when we instantiate by input type alone +module Negative_SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentNoOutputSelector = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint, _output : int32) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint, _output : int64) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint, _output : bigint) = x + static member inline convert_witness (x : bigint, _output : float) = float x + static member inline convert_witness (x : bigint, _output : sbyte) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint, _output : int16) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint, _output : byte) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint, _output : uint16) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint, _output : uint32) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint, _output : uint64) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint, _output : float32) = float32 x + static member inline convert_witness (x : bigint, _output : decimal) = decimal x + static member inline convert_witness (x : bigint, _output : Complex) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member convert_witness : ^input * ^output -> ^output)> (b : ^input, c : ^output) = + ((^witnesses or ^input) : (static member convert_witness : ^input * ^output -> ^output) (b, c)) + + let inline convert num = + call_convert_witness (num, Unchecked.defaultof<'b>) + + // These are ok + let v1 : int32 = convert 777I + let v2 : int64 = convert 777I + let v3 : bigint = convert 777I + let v4 : float = convert 777I + let v5 : sbyte = convert 777I + let v6 : int16 = convert 777I + let v7 : byte = convert 777I + let v8 : uint16 = convert 777I + let v9 : uint32 = convert 777I + let v10 : uint64 = convert 777I + let v11 : float32 = convert 777I + let v12 : decimal = convert 777I + let v13 : Complex = convert 777I + + // These are ok + let f1 : _ -> int32 = convert + let f2 : _ -> int64 = convert + let f3 : _ -> bigint = convert + let f4 : _ -> float = convert + let f5 : _ -> sbyte = convert + let f6 : _ -> int16 = convert + let f7 : _ -> byte = convert + let f8 : _ -> uint16 = convert + let f9 : _ -> uint32 = convert + let f10 : _ -> uint64 = convert + let f11 : _ -> float32 = convert + let f12 : _ -> decimal = convert + let f13 : _ -> Complex = convert + + // This gives an error, because all selector types are known and overload resolution kicks in + let inline inst (num: bigint) : ^output = convert num diff --git a/tests/fsharp/typecheck/sigs/pos35.fs b/tests/fsharp/typecheck/sigs/pos35.fs new file mode 100644 index 00000000000..423e50f3a87 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/pos35.fs @@ -0,0 +1,315 @@ +module Pos35 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// We are selecting an overloaded witness based on input type +module SelectOverloadedWitnessBasedOnInputType = + type witnesses = + static member inline unsigned_witness (x : sbyte) = uint8 x + static member inline unsigned_witness (x : byte) = x + static member inline unsigned_witness (x : int16) = uint16 x + static member inline unsigned_witness (x : uint16) = x + static member inline unsigned_witness (x : int32) = uint32 x + static member inline unsigned_witness (x : uint32) = x + static member inline unsigned_witness (x : int64) = uint64 x + static member inline unsigned_witness (x : uint64) = x + + // Note, this doesn't try to use the output to select + let inline call_unsigned_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member unsigned_witness : ^input -> ^output)> (x : ^input) = + ((^witnesses or ^input) : (static member unsigned_witness : ^input -> ^output) x) + + // unsigned: ^a -> ^b + let inline unsigned num = call_unsigned_witness num + let v1 = unsigned 0y + let v2 = unsigned 0s + let v3 = unsigned 0 + let v4 = unsigned 0L + + let f1 : int8 -> uint8 = unsigned + let f2 : int16 -> uint16 = unsigned + let f3 : int32 -> uint32 = unsigned + let f4 : int64 -> uint64 = unsigned + + let g1 : int8 -> _ = unsigned + let g2 : int16 -> _ = unsigned + let g3 : int32 -> _ = unsigned + let g4 : int64 -> _ = unsigned + + // Negative cases - not enough information here - see neg124.fs which checks these + //let h1 : _ -> uint8 = unsigned + //let h2 : _ -> uint16 = unsigned + //let h3 : _ -> uint32 = unsigned + //let h4 : _ -> uint64 = unsigned + + +// Variation on the previous test case +// +// Note, this adds output as a selector though that shouldn't make any difference +module SelectOverloadedWitnessBasedOnInputTypePlusNeedlessOutputTypePossibility = + type witnesses = + static member inline unsigned_witness (x : sbyte) = uint8 x + static member inline unsigned_witness (x : byte) = x + static member inline unsigned_witness (x : int16) = uint16 x + static member inline unsigned_witness (x : uint16) = x + static member inline unsigned_witness (x : int32) = uint32 x + static member inline unsigned_witness (x : uint32) = x + static member inline unsigned_witness (x : int64) = uint64 x + static member inline unsigned_witness (x : uint64) = x + + let inline call_unsigned_witness< ^witnesses, ^input, ^output when (^witnesses or ^input or ^output) : (static member unsigned_witness : ^input -> ^output)> (x : ^input) = + ((^witnesses or ^input or ^output) : (static member unsigned_witness : ^input -> ^output) x) + + // unsigned: ^a -> ^b + let inline unsigned num = call_unsigned_witness num + let v1 = unsigned 0y + let v2 = unsigned 0s + let v3 = unsigned 0 + let v4 = unsigned 0L + + let f1 : int8 -> uint8 = unsigned + let f2 : int16 -> uint16 = unsigned + let f3 : int32 -> uint32 = unsigned + let f4 : int64 -> uint64 = unsigned + + let g1 : int8 -> _ = unsigned + let g2 : int16 -> _ = unsigned + let g3 : int32 -> _ = unsigned + let g4 : int64 -> _ = unsigned + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgument = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint, _output : int32) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint, _output : int64) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint, _output : bigint) = x + static member inline convert_witness (x : bigint, _output : float) = float x + static member inline convert_witness (x : bigint, _output : sbyte) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint, _output : int16) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint, _output : byte) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint, _output : uint16) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint, _output : uint32) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint, _output : uint64) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint, _output : float32) = float32 x + static member inline convert_witness (x : bigint, _output : decimal) = decimal x + static member inline convert_witness (x : bigint, _output : Complex) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input or ^output) : (static member convert_witness : ^input * ^output -> ^output)> (b : ^input, c : ^output) = + ((^witnesses or ^input or ^output) : (static member convert_witness : ^input * ^output -> ^output) (b, c)) + + let inline convert num = + call_convert_witness (num, Unchecked.defaultof<'b>) + + let v1 : int32 = convert 777I + let v2 : int64 = convert 777I + let v3 : bigint = convert 777I + let v4 : float = convert 777I + let v5 : sbyte = convert 777I + let v6 : int16 = convert 777I + let v7 : byte = convert 777I + let v8 : uint16 = convert 777I + let v9 : uint32 = convert 777I + let v10 : uint64 = convert 777I + let v11 : float32 = convert 777I + let v12 : decimal = convert 777I + let v13 : Complex = convert 777I + + // This is enough to determine the input as bigint because those are the only solutions available + let f1 : _ -> int32 = convert + let f2 : _ -> int64 = convert + let f3 : _ -> bigint = convert + let f4 : _ -> float = convert + let f5 : _ -> sbyte = convert + let f6 : _ -> int16 = convert + let f7 : _ -> byte = convert + let f8 : _ -> uint16 = convert + let f9 : _ -> uint32 = convert + let f10 : _ -> uint64 = convert + let f11 : _ -> float32 = convert + let f12 : _ -> decimal = convert + let f13 : _ -> Complex = convert + + // This is permitted because the ^output type is still a selector + // + // The resulting type is like this: + // + // val inline inst : num:bigint -> ^output when (witnesses or bigint or ^output) : (static member convert_witness : bigint * ^output -> ^output) + let inline inst (num: bigint) : ^output = convert num + let i1 : int32 = inst 777I + let i2 : int64 = inst 777I + let i3 : bigint = inst 777I + let i4 : float = inst 777I + let i5 : sbyte = inst 777I + let i6 : int16 = inst 777I + let i7 : byte = inst 777I + let i8 : uint16 = inst 777I + let i9 : uint32 = inst 777I + let i10 : uint64 = inst 777I + let i11 : float32 = inst 777I + let i12 : decimal = inst 777I + let i13 : Complex = inst 777I + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// This removes ^output as a type selector for the witness, but continues to pass a dummy ^output +// +// This is sufficient to make the resolutions go through +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentNoOutputSelector = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint, _output : int32) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint, _output : int64) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint, _output : bigint) = x + static member inline convert_witness (x : bigint, _output : float) = float x + static member inline convert_witness (x : bigint, _output : sbyte) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint, _output : int16) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint, _output : byte) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint, _output : uint16) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint, _output : uint32) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint, _output : uint64) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint, _output : float32) = float32 x + static member inline convert_witness (x : bigint, _output : decimal) = decimal x + static member inline convert_witness (x : bigint, _output : Complex) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input) : (static member convert_witness : ^input * ^output -> ^output)> (b : ^input, c : ^output) = + ((^witnesses or ^input) : (static member convert_witness : ^input * ^output -> ^output) (b, c)) + + let inline convert num = + call_convert_witness (num, Unchecked.defaultof<'b>) + + let v1 : int32 = convert 777I + let v2 : int64 = convert 777I + let v3 : bigint = convert 777I + let v4 : float = convert 777I + let v5 : sbyte = convert 777I + let v6 : int16 = convert 777I + let v7 : byte = convert 777I + let v8 : uint16 = convert 777I + let v9 : uint32 = convert 777I + let v10 : uint64 = convert 777I + let v11 : float32 = convert 777I + let v12 : decimal = convert 777I + let v13 : Complex = convert 777I + + // This is enough to determine the input as bigint because those are the only solutions available + let f1 : _ -> int32 = convert + let f2 : _ -> int64 = convert + let f3 : _ -> bigint = convert + let f4 : _ -> float = convert + let f5 : _ -> sbyte = convert + let f6 : _ -> int16 = convert + let f7 : _ -> byte = convert + let f8 : _ -> uint16 = convert + let f9 : _ -> uint32 = convert + let f10 : _ -> uint64 = convert + let f11 : _ -> float32 = convert + let f12 : _ -> decimal = convert + let f13 : _ -> Complex = convert + + // Adding this gives an error, see neg129.fs for the test for this + // let inline inst (num: bigint) : ^output = convert num + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// Same as SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentNoOutputSelector but the output type +// parameter is generic 'output rather than SRTP ^output +// + +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputSelector = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + static member inline convert_witness (x : bigint, _output : int32) = int (uint32 (x &&& _uint32max)) + static member inline convert_witness (x : bigint, _output : int64) = int64 (uint64 (x &&& _uint64max)) + static member inline convert_witness (x : bigint, _output : bigint) = x + static member inline convert_witness (x : bigint, _output : float) = float x + static member inline convert_witness (x : bigint, _output : sbyte) = sbyte (byte (x &&& _uint8max)) + static member inline convert_witness (x : bigint, _output : int16) = int16 (uint16 (x &&& _uint16max)) + static member inline convert_witness (x : bigint, _output : byte) = byte (x &&& _uint8max) + static member inline convert_witness (x : bigint, _output : uint16) = uint16 (x &&& _uint16max) + static member inline convert_witness (x : bigint, _output : uint32) = uint32 (x &&& _uint32max) + static member inline convert_witness (x : bigint, _output : uint64) = uint64 (x &&& _uint64max) + static member inline convert_witness (x : bigint, _output : float32) = float32 x + static member inline convert_witness (x : bigint, _output : decimal) = decimal x + static member inline convert_witness (x : bigint, _output : Complex) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, 'output when (^witnesses or ^input) : (static member convert_witness : ^input * 'output -> 'output)> (b : ^input, c : 'output) = + ((^witnesses or ^input) : (static member convert_witness : ^input * 'output -> 'output) (b, c)) + + let inline convert num : 'output = + call_convert_witness (num, Unchecked.defaultof<'output>) + + let v1 : int32 = convert 777I + let v2 : int64 = convert 777I + let v3 : bigint = convert 777I + let v4 : float = convert 777I + let v5 : sbyte = convert 777I + let v6 : int16 = convert 777I + let v7 : byte = convert 777I + let v8 : uint16 = convert 777I + let v9 : uint32 = convert 777I + let v10 : uint64 = convert 777I + let v11 : float32 = convert 777I + let v12 : decimal = convert 777I + let v13 : Complex = convert 777I + + // This is enough to determine the input as bigint because those are the only solutions available + let f1 : _ -> int32 = convert + let f2 : _ -> int64 = convert + let f3 : _ -> bigint = convert + let f4 : _ -> float = convert + let f5 : _ -> sbyte = convert + let f6 : _ -> int16 = convert + let f7 : _ -> byte = convert + let f8 : _ -> uint16 = convert + let f9 : _ -> uint32 = convert + let f10 : _ -> uint64 = convert + let f11 : _ -> float32 = convert + let f12 : _ -> decimal = convert + let f13 : _ -> Complex = convert + + // Adding this gives an error, see neg128.fs for the test for this + // let inline inst (num: bigint) : 'output = convert num + + +// Reduced FSharpPlus tests case from https://github.com/dotnet/fsharp/pull/6805#issuecomment-580365649 +module PositiveTestCase3 = + [] + module Extensions = + + type Async<'T> with + + static member Quack (x:seq>) : Async> = failwith "" + + type Option<'T> with + + static member Quack (x: seq>) : option> = failwith "" + + let inline CallQuack (x: ^a) : ^Output = (^a : (static member Quack : ^a -> ^Output) x) + + type Witnesses = + + static member inline QuackWitness (x: ^a, _output: ^Output, _impl: Witnesses) : ^Output = CallQuack x + static member inline QuackWitness (x: ref<_>, _output: ^Output, _impl: Witnesses) : ^Output = Unchecked.defaultof<_> + + let inline CallQuackWitness (x: ^a, output: ^Output, witnesses: ^Witnesses) = + ((^a or ^Output or ^Witnesses) : (static member QuackWitness : _*_*_ -> _) (x, output, witnesses)) + + let inline call (x: seq< ^b > ) : ^Output = + CallQuackWitness (x, Unchecked.defaultof< ^Output >, Unchecked.defaultof) + + + diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst index a7384556634..44481e7ef72 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst @@ -26,8 +26,6 @@ NOMONO,NoMT SOURCE=ConsumeOverloadGenericMethods.fs SCFLAGS="-r:lib.dll" PRECMD= SOURCE=InferenceForLambdaArgs.fs # InferenceForLambdaArgs.fs - SOURCE=SlowOverloadResolution.fs # SlowOverloadResolution.fs - SOURCE=E_OverloadCurriedFunc.fs # E_OverloadCurriedFunc.fs SOURCE=E_OverloadMismatch.fs # E_OverloadMismatch.fs SOURCE=NoWarningWhenOverloadingInSubClass01.fs SCFLAGS="--warnaserror" # NoWarningWhenOverloadingInSubClass01.fs From cdde3c6f66deef5a023cda3cd32a46d5253803a3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 31 Jan 2020 17:49:32 +0000 Subject: [PATCH 15/82] teak names of tests --- tests/fsharp/typecheck/sigs/neg124.fs | 2 +- tests/fsharp/typecheck/sigs/neg126.fs | 2 +- tests/fsharp/typecheck/sigs/neg128.fs | 2 +- tests/fsharp/typecheck/sigs/pos35.fs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg124.fs b/tests/fsharp/typecheck/sigs/neg124.fs index 674fc9f6c33..d8a7c937dd4 100644 --- a/tests/fsharp/typecheck/sigs/neg124.fs +++ b/tests/fsharp/typecheck/sigs/neg124.fs @@ -1,7 +1,7 @@ module Neg124 // Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 -module NegativeTestCase1 = +module Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector = type witnesses = static member inline unsigned_witness (x : sbyte) = uint8 x static member inline unsigned_witness (x : byte) = x diff --git a/tests/fsharp/typecheck/sigs/neg126.fs b/tests/fsharp/typecheck/sigs/neg126.fs index b97cdeb1fb9..232a35bb9c1 100644 --- a/tests/fsharp/typecheck/sigs/neg126.fs +++ b/tests/fsharp/typecheck/sigs/neg126.fs @@ -19,7 +19,7 @@ module Neg126 // // This test exists to pin down that we get a warning produced saying ^a has been instantiated to "sbyte" -module SelectOverloadedWitnessBasedOnInputTypeOneWitness = +module Negative_SelectOverloadedWitnessBasedOnInputTypeOneWitness = type witnesses = static member inline foo_witness (x : sbyte) : byte = byte x diff --git a/tests/fsharp/typecheck/sigs/neg128.fs b/tests/fsharp/typecheck/sigs/neg128.fs index 2406954036c..b936ee254b6 100644 --- a/tests/fsharp/typecheck/sigs/neg128.fs +++ b/tests/fsharp/typecheck/sigs/neg128.fs @@ -1,6 +1,6 @@ module Neg128 -module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputSelector = +module Negative_SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputSelector = open System open System.Numerics let _uint8max = bigint (uint32 Byte.MaxValue) diff --git a/tests/fsharp/typecheck/sigs/pos35.fs b/tests/fsharp/typecheck/sigs/pos35.fs index 423e50f3a87..8848c965cd5 100644 --- a/tests/fsharp/typecheck/sigs/pos35.fs +++ b/tests/fsharp/typecheck/sigs/pos35.fs @@ -45,7 +45,7 @@ module SelectOverloadedWitnessBasedOnInputType = // Variation on the previous test case // // Note, this adds output as a selector though that shouldn't make any difference -module SelectOverloadedWitnessBasedOnInputTypePlusNeedlessOutputTypePossibility = +module SelectOverloadedWitnessBasedOnInputTypePlusNeedlessOutputTypeSelector = type witnesses = static member inline unsigned_witness (x : sbyte) = uint8 x static member inline unsigned_witness (x : byte) = x @@ -77,7 +77,7 @@ module SelectOverloadedWitnessBasedOnInputTypePlusNeedlessOutputTypePossibility let g4 : int64 -> _ = unsigned // Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 -module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgument = +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentAndUsingOutputSelector = open System open System.Numerics let _uint8max = bigint (uint32 Byte.MaxValue) @@ -224,7 +224,7 @@ module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentNoOutputSel // parameter is generic 'output rather than SRTP ^output // -module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputSelector = +module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGenericOutputType = open System open System.Numerics let _uint8max = bigint (uint32 Byte.MaxValue) From 5603467ffe69339cc45cbe3aa60dc837578c953e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 3 Feb 2020 16:58:42 +0000 Subject: [PATCH 16/82] add return type overloading, extensive + operator widening tests, preview mode testing --- src/fsharp/ConstraintSolver.fs | 49 ++- src/fsharp/FSharp.Core/prim-types.fs | 5 + src/fsharp/FSharp.Core/prim-types.fsi | 10 + src/fsharp/PostInferenceChecks.fs | 14 +- src/fsharp/TcGlobals.fs | 1 + src/fsharp/TypeChecker.fs | 35 +- src/fsharp/infos.fs | 18 +- src/fsharp/symbols/Exprs.fs | 2 +- src/fsharp/symbols/Symbols.fs | 2 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 10 +- src/fsharp/xlf/FSComp.txt.de.xlf | 10 +- src/fsharp/xlf/FSComp.txt.es.xlf | 10 +- src/fsharp/xlf/FSComp.txt.fr.xlf | 10 +- src/fsharp/xlf/FSComp.txt.it.xlf | 10 +- src/fsharp/xlf/FSComp.txt.ja.xlf | 10 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 10 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 10 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 10 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 10 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 10 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 10 +- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 10 +- tests/fsharp/core/extconstraint/test.fsx | 6 + tests/fsharp/single-test.fs | 44 ++- tests/fsharp/tests.fs | 141 ++++++-- .../fsharp/typecheck/sigs/neg120.preview.bsl | 27 ++ .../fsharp/typecheck/sigs/neg121.preview.bsl | 2 + .../fsharp/typecheck/sigs/neg122.preview.bsl | 2 + .../fsharp/typecheck/sigs/neg123.preview.bsl | 22 ++ tests/fsharp/typecheck/sigs/neg124.bsl | 16 +- .../fsharp/typecheck/sigs/neg124.preview.bsl | 42 +++ .../fsharp/typecheck/sigs/neg125.preview.bsl | 26 ++ .../fsharp/typecheck/sigs/neg126.preview.bsl | 2 + .../fsharp/typecheck/sigs/neg127.preview.bsl | 26 ++ .../fsharp/typecheck/sigs/neg128.preview.bsl | 2 + .../fsharp/typecheck/sigs/neg129.preview.bsl | 2 + tests/fsharp/typecheck/sigs/pos35.fs | 2 + tests/fsharp/typecheck/sigs/pos35.preview.bsl | 2 + tests/fsharp/typecheck/sigs/pos36.fs | 64 ++++ tests/fsharp/typecheck/sigs/widen1.fs | 261 +++++++++++++++ tests/fsharp/typecheck/sigs/widen2.fs | 308 ++++++++++++++++++ tests/fsharp/typecheck/sigs/widen3.fs | 261 +++++++++++++++ tests/fsharp/typecheck/sigs/widen4.fs | 261 +++++++++++++++ tests/fsharp/typecheck/sigs/widen5.fs | 294 +++++++++++++++++ tests/fsharp/typecheck/sigs/widen6.fs | 250 ++++++++++++++ 45 files changed, 2172 insertions(+), 157 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg120.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg121.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg122.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg123.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg124.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg125.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg126.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg127.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg128.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg129.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/pos35.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/pos36.fs create mode 100644 tests/fsharp/typecheck/sigs/widen1.fs create mode 100644 tests/fsharp/typecheck/sigs/widen2.fs create mode 100644 tests/fsharp/typecheck/sigs/widen3.fs create mode 100644 tests/fsharp/typecheck/sigs/widen4.fs create mode 100644 tests/fsharp/typecheck/sigs/widen5.fs create mode 100644 tests/fsharp/typecheck/sigs/widen6.fs diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 07c2b72075c..a03b1911088 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -397,17 +397,33 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = | PermitWeakResolution.No -> if isNil minfos then // compat path - not (isTyparTy g ty2) + not (isTyparTy g ty2) && + // All built-in rules only apply in cases where left and right operator types are equal (after + // erasing units) + typeEquivAux EraseMeasures g ty1 ty2 else - // normal path - p2 ty2 + // normal path - for builtin binary op solutions we check the underlying types are equivalent + p2 ty2 && + // all built-in rules only apply in cases where left and right operator types are equal (after + // erasing units) + typeEquivAux EraseMeasures g ty1 ty2 // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we // ignore the possibility that method overloads may resolve the constraint - | PermitWeakResolution.Yes false -> true + | PermitWeakResolution.Yes false -> + // weak resolution lets the other type be a variable type + isTyparTy g ty2 || + // If the other type is not a variable type, it is nominal, + // and all built-in rules only apply in cases where left and right operator types are equal (after + // erasing units) + typeEquivAux EraseMeasures g ty1 ty2 // During codegen we only apply a builtin resolution if both the types are correct - | PermitWeakResolution.Yes true -> p2 ty2 + | PermitWeakResolution.Yes true -> + p2 ty2 && + // All built-in rules only apply in cases where left and right operator types are equal (after + // erasing units) + typeEquivAux EraseMeasures g ty1 ty2 let IsSymmetricBinaryOpArgTypePair p permitWeakResolution minfos g ty1 ty2 = IsBinaryOpArgTypePair p p permitWeakResolution minfos g ty1 ty2 || @@ -1589,15 +1605,17 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // reasons we use the more restrictive isNil frees. if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors - // Otherwise re-record the trait waiting for canonicalization else do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees - - match errors with - | ErrorResult (_, UnresolvedOverloading _) when not ignoreUnresolvedOverload && (not (nm = "op_Explicit" || nm = "op_Implicit")) -> - return! ErrorD AbortForFailedOverloadResolution - | _ -> + + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then return TTraitUnsolved + else + match errors with + | ErrorResult (_, UnresolvedOverloading _) when not ignoreUnresolvedOverload && (not (nm = "op_Explicit" || nm = "op_Implicit")) -> + return! ErrorD AbortForFailedOverloadResolution + | _ -> + return TTraitUnsolved } return! RecordMemberConstraintSolution csenv.SolverState m trace traitInfo res } @@ -2527,8 +2545,13 @@ and ResolveOverloading // - Always take the return type into account for // -- op_Explicit, op_Implicit - // -- candidate method sets that potentially use tupling of unfilled out args - let alwaysCheckReturn = isOpConversion || candidates |> List.exists (fun cmeth -> cmeth.HasOutArgs) + // -- candidate method sets that potentially use tupling of unfilled out args or overloading on return type + let alwaysCheckReturn = + isOpConversion || + candidates |> List.exists (fun cmeth -> + cmeth.HasOutArgs || + (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions && + AttributeChecking.MethInfoHasAttribute g m g.attrib_AllowOverloadByReturnTypeAttribute cmeth.Method)) // Exact match rule. // diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 4bff05856c9..23a367025f1 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -81,6 +81,11 @@ namespace Microsoft.FSharp.Core member x.Value = value new () = new AllowNullLiteralAttribute(true) + [] + [] + type AllowOverloadByReturnTypeAttribute() = + inherit System.Attribute() + [] [] type VolatileFieldAttribute() = diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index afa0719602c..c6bb96d7482 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -232,6 +232,16 @@ namespace Microsoft.FSharp.Core /// The value of the attribute, indicating whether the type allows the null literal or not member Value: bool + /// Adding this attribute to a method allows that method to be overloaded by return type. + [] + [] + type AllowOverloadByReturnTypeAttribute = + inherit Attribute + + /// Creates an instance of the attribute + /// AllowOverloadByReturnTypeAttribute + new : unit -> AllowOverloadByReturnTypeAttribute + /// Adding this attribute to a value causes it to be compiled as a CLI constant literal. [] [] diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 5698ff692e4..1a98462fa5f 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -1974,12 +1974,16 @@ let CheckEntityDefn cenv env (tycon: Entity) = |> List.filter (fun minfo -> minfo.IsVirtual) | None -> [] - let namesOfMethodsThatMayDifferOnlyInReturnType = ["op_Explicit";"op_Implicit"] (* hardwired *) - let methodUniquenessIncludesReturnType (minfo: MethInfo) = List.contains minfo.LogicalName namesOfMethodsThatMayDifferOnlyInReturnType + let methodUniquenessIncludesReturnType (minfo: MethInfo) = + minfo.LogicalName = "op_Explicit" || + minfo.LogicalName = "op_Implicit" || + (AttributeChecking.MethInfoHasAttribute g m g.attrib_AllowOverloadByReturnTypeAttribute minfo) + let MethInfosEquivWrtUniqueness eraseFlag m minfo minfo2 = - if methodUniquenessIncludesReturnType minfo - then MethInfosEquivByNameAndSig eraseFlag true g cenv.amap m minfo minfo2 - else MethInfosEquivByNameAndPartialSig eraseFlag true g cenv.amap m minfo minfo2 (* partial ignores return type *) + if methodUniquenessIncludesReturnType minfo then + MethInfosEquivByNameAndSig eraseFlag true g cenv.amap m minfo minfo2 + else + MethInfosEquivByNameAndPartialSig eraseFlag true g cenv.amap m minfo minfo2 (* partial ignores return type *) let immediateMeths = [ for v in tycon.AllGeneratedValues do yield FSMeth (g, ty, v, None) diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index c70a378f6f2..2b4182eb769 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -1178,6 +1178,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val attrib_CLIEventAttribute = mk_MFCore_attrib "CLIEventAttribute" member val attrib_CLIMutableAttribute = mk_MFCore_attrib "CLIMutableAttribute" member val attrib_AllowNullLiteralAttribute = mk_MFCore_attrib "AllowNullLiteralAttribute" + member val attrib_AllowOverloadByReturnTypeAttribute = mk_MFCore_attrib "AllowOverloadByReturnTypeAttribute" member val attrib_NoEqualityAttribute = mk_MFCore_attrib "NoEqualityAttribute" member val attrib_NoComparisonAttribute = mk_MFCore_attrib "NoComparisonAttribute" member val attrib_CustomEqualityAttribute = mk_MFCore_attrib "CustomEqualityAttribute" diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index a1489bee83b..8fe2f7dc471 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -331,7 +331,7 @@ let AddLocalValMap tcSink scopem (vals: Val NameMap) env = { env with eNameResEnv = AddValMapToNameEnv vals env.eNameResEnv eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } - CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Add a list of local values to TcEnv and report them to the sink @@ -343,7 +343,7 @@ let AddLocalVals tcSink scopem (vals: Val list) env = { env with eNameResEnv = AddValListToNameEnv vals env.eNameResEnv eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } - CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Add a local value to TcEnv and report it to the sink @@ -359,7 +359,7 @@ let AddLocalExnDefnAndReport tcSink scopem env (exnc: Tycon) = let env = { env with eNameResEnv = AddExceptionDeclsToNameEnv BulkAdd.No env.eNameResEnv (mkLocalEntityRef exnc) } // Also make VisualStudio think there is an identifier in scope at the range of the identifier text of its binding location CallEnvSink tcSink (exnc.Range, env.NameEnv, env.AccessRights) - CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Add a list of type definitions to TcEnv @@ -375,7 +375,7 @@ let AddLocalTycons g amap m (tycons: Tycon list) env = /// Add a list of type definitions to TcEnv and report them to the sink let AddLocalTyconsAndReport tcSink scopem g amap m tycons env = let env = AddLocalTycons g amap m tycons env - CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Adjust the TcEnv to account for opening the set of modules, namespaces or static classes implied by an `open` declaration @@ -451,7 +451,7 @@ let AddLocalSubModule g amap m env (modul: ModuleOrNamespace) = /// Add a "module X = ..." definition to the TcEnv and report it to the sink let AddLocalSubModuleAndReport tcSink scopem g amap m env (modul: ModuleOrNamespace) = let env = AddLocalSubModule g amap m env modul - CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Add a set of explicitly declared type parameters as being available in the TcEnv @@ -2012,7 +2012,7 @@ let BuildFieldMap cenv env isPartial ty flds m = // Record the precise resolution of the field for intellisense let item = FreshenRecdFieldRef cenv.nameResolver m fref2 - CallNameResolutionSink cenv.tcSink ((snd fld).idRange, env.eNameResEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) + CallNameResolutionSink cenv.tcSink ((snd fld).idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) CheckRecdFieldAccessible cenv.amap m env.eAccessRights fref2 |> ignore CheckFSharpAttributes cenv.g fref2.PropertyAttribs m |> CommitOperationResult @@ -2740,9 +2740,9 @@ let TcValEarlyGeneralizationConsistencyCheck cenv (env: TcEnv) (v: Val, vrec, ti /// F# object model member, in which case the optInst is the type instantiation /// inferred by member overload resolution, and vrefFlags indicate if the /// member is being used in a special way, i.e. may be one of: -/// | CtorValUsedAsSuperInit "inherit Panel()" -/// | CtorValUsedAsSelfInit "new() = new OwnType(3)" -/// | VSlotDirectCall "base.OnClick(eventArgs)" +/// | CtorValUsedAsSuperInit "inherit Panel()" +/// | CtorValUsedAsSelfInit "new() = new OwnType(3)" +/// | VSlotDirectCall "base.OnClick(eventArgs)" let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst optAfterResolution m = let (tpsorig, _, _, _, tinst, _) as res = let v = vref.Deref @@ -2794,8 +2794,8 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op tpsorig, NormalValUse, tinst, tau, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, _, tptys, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty - tpsorig, NormalValUse, tptys, tau, tpenv + let tpsorig, _, tinst, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty + tpsorig, NormalValUse, tinst, tau, tpenv // If we have got an explicit instantiation then use that | Some(vrefFlags, checkTys) -> @@ -4588,7 +4588,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a | None -> if newOk = NoNewTypars then let suggestTypeParameters (addToBuffer: string -> unit) = - for p in env.NameEnv.eTypars do + for p in env.eNameResEnv.eTypars do addToBuffer ("'" + p.Key) match tpenv with @@ -5961,7 +5961,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = TcNewExpr cenv env tpenv objTy (Some synObjTy.Range) superInit arg mNewExpr | SynExpr.ObjExpr (objTy, argopt, binds, extraImpls, mNewExpr, m) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) TcObjectExpr cenv overallTy env tpenv (objTy, argopt, binds, extraImpls, mNewExpr, m) | SynExpr.Record (inherits, optOrigExpr, flds, mWholeExpr) -> @@ -6614,7 +6614,7 @@ and TcRecordConstruction cenv overallTy env tpenv optOrigExprInfo objTy fldsList // Check accessibility: this is also done in BuildFieldMap, but also need to check // for fields in { new R with a=1 and b=2 } constructions and { r with a=1 } copy-and-update expressions rfrefs |> List.iter (fun rfref -> - CheckRecdFieldAccessible cenv.amap m env.AccessRights rfref |> ignore + CheckRecdFieldAccessible cenv.amap m env.eAccessRights rfref |> ignore CheckFSharpAttributes cenv.g rfref.PropertyAttribs m |> CommitOperationResult) let args = List.map snd fldsList @@ -6711,7 +6711,8 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implty: TType) virtNameAndArit | [(_, absSlot)] -> - let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = FreshenAbstractSlot env.TraitFreshner cenv.g cenv.amap mBinding synTyparDecls absSlot + let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot + = FreshenAbstractSlot env.TraitFreshner cenv.g cenv.amap mBinding synTyparDecls absSlot // Work out the required type of the member let bindingTy = implty --> (mkMethodTy cenv.g argTysFromAbsSlot retTyFromAbsSlot) @@ -9269,7 +9270,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let mkConstrApp _mArgs = function [arg] -> arg | _ -> error(InternalError("ApplyUnionCaseOrExn", mItem)) mkConstrApp, [ucaseAppTy], [ for (s, m) in apinfo.ActiveTagsWithRanges -> mkSynId m s ] | _ -> - let ucref = mkChoiceCaseRef cenv.g mItem aparity n + let ucref = mkChoiceCaseRef g mItem aparity n let _, _, tinst, _ = FreshenTyconRef2 env.TraitFreshner mItem ucref.TyconRef let ucinfo = UnionCaseInfo (tinst, ucref) ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) @@ -14491,7 +14492,7 @@ module MutRecBindingChecking = for tp in unsolvedTyparsForRecursiveBlockInvolvingGeneralizedVariables do //printfn "solving unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" tp.DisplayName tp.Stamp if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then - ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denv tp + ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denv tp // Now that we know what we've generalized we can adjust the recursive references let defnsCs = TcMutRecBindings_Phase2C_FixupRecursiveReferences cenv (denv, defnsBs, generalizedTyparsForRecursiveBlock, generalizedRecBinds, scopem) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 3e1429f9d87..1eec142bd27 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -323,14 +323,14 @@ let FreshenTrait traitFreshner traitInfo = /// Note: this now looks identical to constraint instantiation. let CopyTyparConstraints traitFreshner m tprefInst (tporig: Typar) = - tporig.Constraints - |> List.map (fun tpc -> - match tpc with - | TyparConstraint.CoercesTo(ty, _) -> + tporig.Constraints + |> List.map (fun tpc -> + match tpc with + | TyparConstraint.CoercesTo(ty, _) -> TyparConstraint.CoercesTo (instType tprefInst ty, m) - | TyparConstraint.DefaultsTo(priority, ty, _) -> + | TyparConstraint.DefaultsTo(priority, ty, _) -> TyparConstraint.DefaultsTo (priority, instType tprefInst ty, m) - | TyparConstraint.SupportsNull _ -> + | TyparConstraint.SupportsNull _ -> TyparConstraint.SupportsNull m | TyparConstraint.IsEnum (uty, _) -> TyparConstraint.IsEnum (instType tprefInst uty, m) @@ -354,8 +354,8 @@ let CopyTyparConstraints traitFreshner m tprefInst (tporig: Typar) = let traitInfo2 = FreshenTrait traitFreshner traitInfo TyparConstraint.MayResolveMember (instTrait tprefInst traitInfo2, m)) -/// The constraints for each typar copied from another typar can only be fixed up once -/// we have generated all the new constraints, e.g. f List, B :> List> ... +/// The constraints for each typar copied from another typar can only be fixed up once +/// we have generated all the new constraints, e.g. f List, B :> List> ... let FixupNewTypars traitFreshner m (formalEnclosingTypars:Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = // Checks.. These are defensive programming against early reported errors. let n0 = formalEnclosingTypars.Length @@ -368,7 +368,7 @@ let FixupNewTypars traitFreshner m (formalEnclosingTypars:Typars) (tinst: TType // The real code.. let renaming, tptys = mkTyparToTyparRenaming tpsorig tps let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitFreshner m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitFreshner m tprefInst tporig)) renaming, tptys diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index ec0a3cf1f6c..fbd6660baa2 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -827,7 +827,7 @@ module FSharpExprConvert = let typR = ConvType cenv (mkAppTy tycr tyargs) E.UnionCaseTag(ConvExpr cenv env arg1, typR) - | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution, _extSlns, _ad)), _, _ -> + | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution, _extSlns, _ad)), _, _ -> let tysR = ConvTypes cenv tys let tyargsR = ConvTypes cenv tyargs let argtysR = ConvTypes cenv argtys diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 5777184275f..60eeb589122 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1278,7 +1278,7 @@ and FSharpGenericParameterConstraint(cenv, cx: TyparConstraint) = member __.MemberConstraintData = match cx with - | TyparConstraint.MayResolveMember(info, _) -> FSharpGenericParameterMemberConstraint(cenv, info) + | TyparConstraint.MayResolveMember(info, _) -> FSharpGenericParameterMemberConstraint(cenv, info) | _ -> invalidOp "not a member constraint" member __.IsNonNullableValueTypeConstraint = diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 43c4a025a25..3d85d19f7f4 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -82,11 +82,6 @@ Atributy nejde použít pro rozšíření typů. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ Atribut System.Diagnostics.ConditionalAttribute je platný jenom u metod nebo tříd atributů. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Členové rozšíření nemůžou poskytovat přetížení operátorů. Zvažte možnost definovat místo toho operátor v definici typu. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Název souboru MDB musí být <název-souboru-sestavení>.mdb. Parametr --pdb se bude ignorovat. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index eaab7b73127..d3266324ea4 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -82,11 +82,6 @@ Attribute können nicht auf Typerweiterungen angewendet werden. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ Das Attribut "System.Diagnostics.ConditionalAttribute" ist nur bei Methoden oder Attributklassen gültig. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Erweiterungsmember können keine Operatorüberladungen bereitstellen. Definieren Sie den Operator stattdessen als Teil der Typdefinition. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Der Name der MDB-Datei muss "<assembly-file-name>.mdb" lauten. Die Option "--pdb" wird ignoriert. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index c93598aa34c..0fbf10ee041 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -82,11 +82,6 @@ Los atributos no se pueden aplicar a las extensiones de tipo. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ El atributo 'System.Diagnostics.ConditionalAttribute' es válido sólo en métodos o clases de atributos. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Los miembros de extensión no pueden proporcionar sobrecargas de operador. En su lugar, considere definir el operador como parte de la definición de tipo. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. El nombre del archivo MDB debe ser <nombre de archivo de ensamblado>.mdb. Se omitirá la opción--pdb. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 465021b9343..208b5df146f 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -82,11 +82,6 @@ Impossible d'appliquer des attributs aux extensions de type. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ L'attribute 'System.Diagnostics.ConditionalAttribute' n'est valide que sur les méthodes ou les classes d'attributs + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Les membres d'extension ne peuvent pas fournir de surcharges d'opérateur. Définissez l'opérateur comme faisant partie de la définition de type. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Le nom du fichier MDB doit être <nom_fichier_assembly>.mdb. L'option --pdb est ignorée. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 1b48ce15b15..87607c68dde 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -82,11 +82,6 @@ Gli attributi non possono essere applicati a estensioni di tipo. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ L'attributo 'System.Diagnostics.ConditionalAttribute' è valido solo in classi di attributi o metodi + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + I membri di estensione non possono fornire overload di operatori. Provare a definire l'operatore come parte della definizione del tipo. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Il nome del file MDB deve essere <nome-file-assembly>.mdb. L'opzione --pdb verrà ignorata. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index eb348a88b0a..fc807fd3da9 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -82,11 +82,6 @@ 属性を型拡張に適用することはできません。 - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ 属性 'System.Diagnostics.ConditionalAttribute' はメソッド クラスまたは属性クラスでのみ有効です + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + 拡張メンバーでは演算子のオーバーロードを実行できません。代わりに型定義の一部として演算子を定義してください。 + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB ファイルの名前は <assembly-file-name>.mdb でなければなりません、--pdb オプションは無視されます。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 9dc4218eaea..4354b83a019 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -82,11 +82,6 @@ 형식 확장에 특성을 적용할 수 없습니다. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ 'System.Diagnostics.ConditionalAttribute' 특성은 메서드 또는 특성 클래스에만 사용할 수 있습니다. + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + 확장 멤버가 연산자 오버로드를 제공할 수 없습니다. 대신 연산자를 형식 정의의 일부분으로 정의하세요. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 파일의 이름은 <어셈블리 파일 이름>.mdb여야 합니다. --pdb 옵션은 무시됩니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 54015aa04b6..2f9150028e5 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -82,11 +82,6 @@ Atrybutów nie można stosować do rozszerzeń typu. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ Atrybut „System.Diagnostics.ConditionalAttribute” jest prawidłowy tylko w przypadku metod lub klas atrybutów + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Elementy członkowskie rozszerzeń nie mogą udostępniać przeciążeń operatorów. Zamiast tego rozważ zdefiniowanie operatora jako części definicji typu. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. Plik MDB musi mieć nazwę <nazwa-pliku-zestawu>.mdb. Opcja --pdb zostanie zignorowana. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index fb80254f150..f09542103c3 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -82,11 +82,6 @@ Os atributos não podem ser aplicados às extensões de tipo. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ O atributo 'System.Diagnostics.ConditionalAttribute' somente é válido em classes de métodos ou atributos + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Membros de extensão não podem fornecer sobrecargas de operadores. Considere definir o operador como parte da definição de tipo. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. O nome do arquivo MDB deve ser <assembly-file-name>.mdb. A opção --pdb será ignorada. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index d3f77a61209..0460038d6f9 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -82,11 +82,6 @@ Атрибуты не могут быть применены к расширениям типа. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ Атрибут System.Diagnostics.ConditionalAttribute допустим только в методах или классах атрибутов + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Элементы расширения не могут предоставлять перегрузку операторов. Вместо этого рекомендуется определить оператор как часть определения типа. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB-файл должен иметь имя <assembly-file-name>.mdb. Параметр --pdb будет проигнорирован. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index f568e2afcba..8df54eda5f9 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -82,11 +82,6 @@ Öznitelikler tür uzantılarına uygulanamaz. - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ 'System.Diagnostics.ConditionalAttribute' özniteliği yalnızca metotlarda veya öznitelik sınıflarında geçerlidir + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + Uzantı üyeleri işleç aşırı yüklemeleri sağlayamaz. Bunun yerine işleci tür tanımının parçası olarak tanımlamayı düşünün. + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB dosyasının adı <assembly-file-name>.mdb olmalıdır. --pdb seçeneği yoksayılacak. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index faa82d66b62..daf8925fab2 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -82,11 +82,6 @@ 属性不可应用于类型扩展。 - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ 特性“System.Diagnostics.ConditionalAttribute”仅对方法或特性类有效 + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + 扩展成员无法提供运算符重载。 请考虑改为将运算符定义为类型定义的一部分。 + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 文件的名称必须是 <程序集文件名称>.mdb。将忽略 --pdb 选项。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 8a9c2fa3c38..3fe7318b45e 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -82,11 +82,6 @@ 屬性無法套用到類型延伸模組。 - - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - - use! may not be combined with and! use! may not be combined with and! @@ -5332,6 +5327,11 @@ 屬性 'System.Diagnostics.ConditionalAttribute' 只有在方法或屬性類別上才有效 + + Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. + 擴充成員無法提供運算子多載。請考慮將運算子改成定義為類型定義的一部分。 + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. MDB 檔案的名稱必須是 <組件檔名稱>.mdb。會略過 --pdb 選項。 diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index ead652e0493..0a59ad23377 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -32,6 +32,12 @@ module DotNetPrimtiveWithNewOperator = static member (++)(a: int, b: int) = a do check "jfs9dlfdh" 1 (1 ++ 2) +/// Extending a .NET primitive type with new instance of an operator +module DotNetPrimtiveExistingOperator1 = + type System.Double with + static member (+)(a: int, b: float) = float a + b + do check "jfs9dlfdh" 3.0 (2.0 + 1) + /// Extending a .NET primitive type with new operator module DotNetPrimtiveWithAmbiguousNewOperator = [] diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 236ef364371..11d2cd71b1e 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -387,11 +387,19 @@ let singleVersionedNegTest (cfg: TestConfig) version testname = fsi_flags = sprintf "%s %s" cfg.fsi_flags (if not (String.IsNullOrEmpty(version)) then "--langversion:" + version else "") } + let ERRFILE, BSLFILE = + let vbsl = sprintf "%s.%s.bsl" testname version + if fileExists cfg vbsl then + sprintf "%s.%s.err" testname version, vbsl + else + sprintf "%s.err" testname, sprintf "%s.bsl" testname + // REM == Set baseline (fsc vs vs, in case the vs baseline exists) - let VSBSLFILE = - if (sprintf "%s.vsbsl" testname) |> (fileExists cfg) - then sprintf "%s.vsbsl" testname - else sprintf "%s.bsl" testname + let VSERRFILE, VSBSLFILE = + if fileExists cfg (sprintf "%s.vsbsl" testname) then + sprintf "%s.vserr" testname, sprintf "%s.vsbsl" testname + else + ERRFILE, BSLFILE let sources = [ let src = [ testname + ".mli"; testname + ".fsi"; testname + ".ml"; testname + ".fs"; testname + ".fsx"; @@ -426,28 +434,28 @@ let singleVersionedNegTest (cfg: TestConfig) version testname = if cfg.fsc_flags.Contains("--warnaserror-") then String.Empty else "--warnaserror" - fscAppendErrExpectFail cfg (sprintf "%s.err" testname) """%s --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll""" cfg.fsc_flags warnaserror testname sources + fscAppendErrExpectFail cfg ERRFILE """%s --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll""" cfg.fsc_flags warnaserror testname sources - let diff = fsdiff cfg (sprintf "%s.err" testname) (sprintf "%s.bsl" testname) + let diff = fsdiff cfg ERRFILE BSLFILE - fscAppendErrExpectFail cfg (sprintf "%s.vserr" testname) "%s --test:ContinueAfterParseFailure --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll" cfg.fsc_flags warnaserror testname sources + fscAppendErrExpectFail cfg VSERRFILE "%s --test:ContinueAfterParseFailure --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll" cfg.fsc_flags warnaserror testname sources - let vbslDiff = fsdiff cfg (sprintf "%s.vserr" testname) VSBSLFILE + let vbslDiff = fsdiff cfg VSERRFILE VSBSLFILE match diff,vbslDiff with | "","" -> - log "Good, output %s.err matched %s.bsl" testname testname - log "Good, output %s.vserr matched %s" testname VSBSLFILE + log "Good, output %s matched %s" ERRFILE BSLFILE + log "Good, output %s matched %s" VSERRFILE VSBSLFILE | l,"" -> - log "***** %s.err %s.bsl differed: a bug or baseline may need updating" testname testname - failwithf "%s.err %s.bsl differ; %A" testname testname l + log "***** %s %s differed: a bug or baseline may need updating" ERRFILE BSLFILE + failwithf "%s %s differ; %A" ERRFILE BSLFILE l | "",l -> - log "Good, output %s.err matched %s.bsl" testname testname - log "***** %s.vserr %s differed: a bug or baseline may need updating" testname VSBSLFILE - failwithf "%s.vserr %s differ; %A" testname VSBSLFILE l + log "Good, output %s matched %s" ERRFILE BSLFILE + log "***** %s %s differed: a bug or baseline may need updating" VSERRFILE VSBSLFILE + failwithf "%s %s differ; %A" VSERRFILE VSBSLFILE l | l1,l2 -> - log "***** %s.err %s.bsl differed: a bug or baseline may need updating" testname testname - log "***** %s.vserr %s differed: a bug or baseline may need updating" testname VSBSLFILE - failwithf "%s.err %s.bsl differ; %A; %s.vserr %s differ; %A" testname testname l1 testname VSBSLFILE l2 + log "***** %s %s differed: a bug or baseline may need updating" ERRFILE BSLFILE + log "***** %s %s differed: a bug or baseline may need updating" VSERRFILE VSBSLFILE + failwithf "%s %s differ; %A; %s %s differ; %A" ERRFILE BSLFILE l1 VSERRFILE VSBSLFILE l2 let singleNegTest (cfg: TestConfig) testname = singleVersionedNegTest (cfg: TestConfig) "" testname diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 4c20ac1331e..5fc0c4f11a1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -527,7 +527,7 @@ module CoreTests = exec cfg ("." ++ "testcs.exe") "" [] - let ``extconstraint-fsc`` () = + let ``extconstraint-fsc preview`` () = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } @@ -544,7 +544,7 @@ module CoreTests = testOkFile.CheckExists() [] - let ``extconstraint-fsc-no-optimize`` () = + let ``extconstraint-fsc-no-optimize preview`` () = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } @@ -561,7 +561,7 @@ module CoreTests = testOkFile.CheckExists() [] - let ``extconstraint-fsi`` () = + let ``extconstraint-fsi preview`` () = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsi_flags = cfg.fsi_flags + " --langversion:preview" } @@ -572,7 +572,7 @@ module CoreTests = testOkFile.CheckExists() [] - let ``extconstraint-compat`` () = + let ``extconstraint-compat preview`` () = let cfg = testConfig "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --define:LANGVERSION_PREVIEW --langversion:preview" } @@ -2181,10 +2181,10 @@ module TypecheckTests = #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] - let ``sigs pos26`` () = + let ``sigs pos24`` () = let cfg = testConfig "typecheck/sigs" - fsc cfg "%s --target:exe -o:pos26.exe" cfg.fsc_flags ["pos26.fsi"; "pos26.fs"] - peverify cfg "pos26.exe" + fsc cfg "%s --target:exe -o:pos24.exe" cfg.fsc_flags ["pos24.fs"] + peverify cfg "pos24.exe" [] let ``sigs pos25`` () = @@ -2192,6 +2192,12 @@ module TypecheckTests = fsc cfg "%s --target:exe -o:pos25.exe" cfg.fsc_flags ["pos25.fs"] peverify cfg "pos25.exe" + [] + let ``sigs pos26`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:exe -o:pos26.exe" cfg.fsc_flags ["pos26.fsi"; "pos26.fs"] + peverify cfg "pos26.exe" + [] let ``sigs pos27`` () = let cfg = testConfig "typecheck/sigs" @@ -2216,12 +2222,6 @@ module TypecheckTests = fsc cfg "%s --target:exe -o:pos30.exe --warnaserror+" cfg.fsc_flags ["pos30.fs"] peverify cfg "pos30.exe" - [] - let ``sigs pos24`` () = - let cfg = testConfig "typecheck/sigs" - fsc cfg "%s --target:exe -o:pos24.exe" cfg.fsc_flags ["pos24.fs"] - peverify cfg "pos24.exe" - [] let ``sigs pos31`` () = let cfg = testConfig "typecheck/sigs" @@ -2246,12 +2246,73 @@ module TypecheckTests = fsc cfg "%s --target:library -o:pos34.dll --warnaserror" cfg.fsc_flags ["pos34.fs"] peverify cfg "pos34.dll" + // We also run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs pos34 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:pos34-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["pos34.fs"] + peverify cfg "pos34-preview.dll" + [] let ``sigs pos35`` () = let cfg = testConfig "typecheck/sigs" fsc cfg "%s --target:library -o:pos35.dll --warnaserror" cfg.fsc_flags ["pos35.fs"] peverify cfg "pos35.dll" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs pos35 preview (now negative)`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "pos35" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs pos36 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:pos36.dll --langversion:preview --warnaserror" cfg.fsc_flags ["pos36.fs"] + peverify cfg "pos36.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen1 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen1.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen1.fs"] + peverify cfg "widen1.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen2 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen2.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen2.fs"] + peverify cfg "widen2.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen3 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen3.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen3.fs"] + peverify cfg "widen3.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen4 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen4.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen4.fs"] + peverify cfg "widen4.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen5 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen5.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen5.fs"] + peverify cfg "widen5.dll" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``sigs widen6 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:widen6.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen6.fs"] + peverify cfg "widen6.dll" + [] let ``sigs pos23`` () = let cfg = testConfig "typecheck/sigs" @@ -2773,25 +2834,65 @@ module TypecheckTests = let ``type check neg122`` () = singleNegTest (testConfig "typecheck/sigs") "neg122" [] - let ``type check neg123`` () = singleNegTest (testConfig "typecheck/sigs") "neg123" + let ``type check neg123`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg123" + + [] + let ``type check neg124`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg124" + + [] + let ``type check neg125`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg125" + + [] + let ``type check neg126`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg126" + + [] + let ``type check neg127`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg127" + + [] + let ``type check neg128`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg128" + + [] + let ``type check neg129`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg129" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``type check neg120 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg120" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``type check neg121 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg121" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``type check neg122 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg122" + + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``type check neg123 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg123" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg124`` () = singleNegTest (testConfig "typecheck/sigs") "neg124" + let ``type check neg124 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg124" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg125`` () = singleNegTest (testConfig "typecheck/sigs") "neg125" + let ``type check neg125 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg125" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg126`` () = singleNegTest (testConfig "typecheck/sigs") "neg126" + let ``type check neg126 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg126" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg127`` () = singleNegTest (testConfig "typecheck/sigs") "neg127" + let ``type check neg127 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg127" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg128`` () = singleNegTest (testConfig "typecheck/sigs") "neg128" + let ``type check neg128 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg128" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg129`` () = singleNegTest (testConfig "typecheck/sigs") "neg129" + let ``type check neg129 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg129" [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg120.preview.bsl b/tests/fsharp/typecheck/sigs/neg120.preview.bsl new file mode 100644 index 00000000000..1d7137c417f --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg120.preview.bsl @@ -0,0 +1,27 @@ + +neg120.fs(95,18,95,21): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_GreaterGreaterEquals'. The available overloads are shown below. Consider adding further type constraints +neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U>'. Type constraint mismatch. The type + 'int -> obj' +is not compatible with type + ''a -> Id<'b>' +. +neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1>'. Type constraint mismatch. The type + 'Id' +is not compatible with type + 'Async<'a>' +. +neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option'. Type constraint mismatch. The type + 'Id' +is not compatible with type + ''a option' +. +neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U>'. Type constraint mismatch. The type + 'Id' +is not compatible with type + 'Task<'a>' +. +neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U>'. Type constraint mismatch. The type + 'Id' +is not compatible with type + 'Lazy<'a>' +. diff --git a/tests/fsharp/typecheck/sigs/neg121.preview.bsl b/tests/fsharp/typecheck/sigs/neg121.preview.bsl new file mode 100644 index 00000000000..b32b35aa102 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg121.preview.bsl @@ -0,0 +1,2 @@ + +neg121.fs(19,28,19,38): typecheck error FS0071: Type constraint mismatch when applying the default type 'int' for a type inference variable. Method or object constructor 'ParseApply' not found Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg122.preview.bsl b/tests/fsharp/typecheck/sigs/neg122.preview.bsl new file mode 100644 index 00000000000..a2dccc17ac0 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg122.preview.bsl @@ -0,0 +1,2 @@ + +neg122.fs(19,65,19,98): typecheck error FS0001: Method or object constructor 'ParseApply' not found diff --git a/tests/fsharp/typecheck/sigs/neg123.preview.bsl b/tests/fsharp/typecheck/sigs/neg123.preview.bsl new file mode 100644 index 00000000000..f23c8006034 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg123.preview.bsl @@ -0,0 +1,22 @@ + +neg123.fs(19,49,19,51): typecheck error FS0001: No overloads match for method 'pass'. The available overloads are shown below. +neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : int -> unit'. Type constraint mismatch. The type + 'unit -> unit' +is not compatible with type + 'int' +. +neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : unit -> unit'. Type constraint mismatch. The type + 'unit -> unit' +is not compatible with type + 'unit' +. +neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit)'. Type constraint mismatch. The type + 'unit -> unit' +is not compatible with type + 'int -> 'a' +. +neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit)'. Type constraint mismatch. The type + 'unit -> unit' +is not compatible with type + 'string -> 'a' +. diff --git a/tests/fsharp/typecheck/sigs/neg124.bsl b/tests/fsharp/typecheck/sigs/neg124.bsl index 9383c8b7ac9..b9c55eba735 100644 --- a/tests/fsharp/typecheck/sigs/neg124.bsl +++ b/tests/fsharp/typecheck/sigs/neg124.bsl @@ -1,41 +1,41 @@ neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. The available overloads are shown below. Consider adding further type constraints -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type 'obj' is not compatible with type 'uint64' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type 'obj' is not compatible with type 'int64' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type 'obj' is not compatible with type 'uint32' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type 'obj' is not compatible with type 'int32' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type 'obj' is not compatible with type 'uint16' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type 'obj' is not compatible with type 'int16' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type 'obj' is not compatible with type 'byte' . -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member NegativeTestCase1.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type 'obj' is not compatible with type 'sbyte' diff --git a/tests/fsharp/typecheck/sigs/neg124.preview.bsl b/tests/fsharp/typecheck/sigs/neg124.preview.bsl new file mode 100644 index 00000000000..b9c55eba735 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg124.preview.bsl @@ -0,0 +1,42 @@ + +neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. The available overloads are shown below. Consider adding further type constraints +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint64' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int64' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint32' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int32' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'uint16' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'int16' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'byte' +. +neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type + 'obj' +is not compatible with type + 'sbyte' +. diff --git a/tests/fsharp/typecheck/sigs/neg125.preview.bsl b/tests/fsharp/typecheck/sigs/neg125.preview.bsl new file mode 100644 index 00000000000..4c96bbcc15e --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg125.preview.bsl @@ -0,0 +1,26 @@ + +neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg126.preview.bsl b/tests/fsharp/typecheck/sigs/neg126.preview.bsl new file mode 100644 index 00000000000..b8808b85143 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg126.preview.bsl @@ -0,0 +1,2 @@ + +neg126.fs(30,32,30,48): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'sbyte'. diff --git a/tests/fsharp/typecheck/sigs/neg127.preview.bsl b/tests/fsharp/typecheck/sigs/neg127.preview.bsl new file mode 100644 index 00000000000..0ab9e8c5348 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg127.preview.bsl @@ -0,0 +1,26 @@ + +neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg128.preview.bsl b/tests/fsharp/typecheck/sigs/neg128.preview.bsl new file mode 100644 index 00000000000..3d91ad25b52 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg128.preview.bsl @@ -0,0 +1,2 @@ + +neg128.fs(36,47,36,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg129.preview.bsl b/tests/fsharp/typecheck/sigs/neg129.preview.bsl new file mode 100644 index 00000000000..8e34cc5331d --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg129.preview.bsl @@ -0,0 +1,2 @@ + +neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/pos35.fs b/tests/fsharp/typecheck/sigs/pos35.fs index 8848c965cd5..b2b1fb79156 100644 --- a/tests/fsharp/typecheck/sigs/pos35.fs +++ b/tests/fsharp/typecheck/sigs/pos35.fs @@ -308,6 +308,8 @@ module PositiveTestCase3 = let inline CallQuackWitness (x: ^a, output: ^Output, witnesses: ^Witnesses) = ((^a or ^Output or ^Witnesses) : (static member QuackWitness : _*_*_ -> _) (x, output, witnesses)) + // This becomes a negative test when RFC FS-1043 is enabled, because the existence of the extension + // members is now taken into account let inline call (x: seq< ^b > ) : ^Output = CallQuackWitness (x, Unchecked.defaultof< ^Output >, Unchecked.defaultof) diff --git a/tests/fsharp/typecheck/sigs/pos35.preview.bsl b/tests/fsharp/typecheck/sigs/pos35.preview.bsl new file mode 100644 index 00000000000..105d85ea227 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/pos35.preview.bsl @@ -0,0 +1,2 @@ + +pos35.fs(314,9,314,25): typecheck error FS0043: A unique overload for method 'Quack' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member Async.Quack : x:seq> -> Async>, static member Option.Quack : x:seq<'T option> -> seq<'T> option diff --git a/tests/fsharp/typecheck/sigs/pos36.fs b/tests/fsharp/typecheck/sigs/pos36.fs new file mode 100644 index 00000000000..b2be2a95ed2 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/pos36.fs @@ -0,0 +1,64 @@ +module Pos36 + +// Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 +// +// See also pos35.fs, neg125.fs, neg127.fs +// +// This no longer passes a dummy ^output but keeps ^output as a witness selector +// +// With RFC FS-1043 this now passes with the use of AllowOverloadByReturnType + +module Positive_SelectOverloadedWitnessBasedOnReturnTypeWithoutPassingDummyArgument = + open System + open System.Numerics + let _uint8max = bigint (uint32 Byte.MaxValue) + let _uint16max = bigint (uint32 UInt16.MaxValue) + let _uint32max = bigint UInt32.MaxValue + let _uint64max = bigint UInt64.MaxValue + type witnesses = + [] + static member inline convert_witness (x : bigint) = int (uint32 (x &&& _uint32max)) + [] + static member inline convert_witness (x : bigint) = int64 (uint64 (x &&& _uint64max)) + [] + static member inline convert_witness (x : bigint) = x + [] + static member inline convert_witness (x : bigint) = float x + [] + static member inline convert_witness (x : bigint) = sbyte (byte (x &&& _uint8max)) + [] + static member inline convert_witness (x : bigint) = int16 (uint16 (x &&& _uint16max)) + [] + static member inline convert_witness (x : bigint) = byte (x &&& _uint8max) + [] + static member inline convert_witness (x : bigint) = uint16 (x &&& _uint16max) + [] + static member inline convert_witness (x : bigint) = uint32 (x &&& _uint32max) + [] + static member inline convert_witness (x : bigint) = uint64 (x &&& _uint64max) + [] + static member inline convert_witness (x : bigint) = float32 x + [] + static member inline convert_witness (x : bigint) = decimal x + [] + static member inline convert_witness (x : bigint) = Complex(float x, 0.0) + + let inline call_convert_witness< ^witnesses, ^input, ^output when (^witnesses or ^input or ^output) : (static member convert_witness : ^input -> ^output)> (b : ^input) = + ((^witnesses or ^input or ^output) : (static member convert_witness : ^input -> ^output) (b)) + + let inline convert num = + call_convert_witness (num) + // These all cause errors + let v1 : int32 = convert 0I + let v2 : int64 = convert 0I + let v3 : bigint = convert 0I + let v4 : float = convert 0I + let v5 : sbyte = convert 0I + let v6 : int16 = convert 0I + let v7 : byte = convert 0I + let v8 : uint16 = convert 0I + let v9 : uint32 = convert 0I + let v10 : uint64 = convert 0I + let v11 : float32 = convert 0I + let v12 : decimal = convert 0I + let v13 : Complex = convert 0I diff --git a/tests/fsharp/typecheck/sigs/widen1.fs b/tests/fsharp/typecheck/sigs/widen1.fs new file mode 100644 index 00000000000..08dfc486c3d --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen1.fs @@ -0,0 +1,261 @@ +module App + +type System.SByte with + static member inline widen_to_int16 (a: sbyte) : int16 = int16 a + static member inline widen_to_int32 (a: sbyte) : int32 = int32 a + static member inline widen_to_int64 (a: sbyte) : int64 = int64 a + static member inline widen_to_nativeint (a: sbyte) : nativeint = nativeint a + static member inline widen_to_single (a: sbyte) : single = single a + static member inline widen_to_double (a: sbyte) : double = double a + +type System.Byte with + static member inline widen_to_int16 (a: byte) : int16 = int16 a + static member inline widen_to_uint16 (a: byte) : uint16 = uint16 a + static member inline widen_to_int32 (a: byte) : int32 = int32 a + static member inline widen_to_uint32 (a: byte) : uint32 = uint32 a + static member inline widen_to_int64 (a: byte) : int64 = int64 a + static member inline widen_to_uint64 (a: byte) : uint64 = uint64 a + static member inline widen_to_nativeint (a: byte) : nativeint = nativeint a + static member inline widen_to_unativeint (a: byte) : unativeint = unativeint a + static member inline widen_to_single (a: byte) : single = single a + static member inline widen_to_double (a: byte) : double = double a + +type System.Int16 with + static member inline widen_to_int32 (a: int16) : int32 = int32 a + static member inline widen_to_int64 (a: int16) : int64 = int64 a + static member inline widen_to_nativeint (a: int16) : nativeint = nativeint a + static member inline widen_to_single (a: int16) : single = single a + static member inline widen_to_double (a: int16) : double = double a + +type System.UInt16 with + static member inline widen_to_int32 (a: uint16) : int32 = int32 a + static member inline widen_to_uint32 (a: uint16) : uint32 = uint32 a + static member inline widen_to_int64 (a: uint16) : int64 = int64 a + static member inline widen_to_uint64 (a: uint16) : uint64 = uint64 a + static member inline widen_to_nativeint (a: uint16) : nativeint = nativeint a + static member inline widen_to_unativeint (a: uint16) : unativeint = unativeint a + static member inline widen_to_single (a: uint16) : single = single a + static member inline widen_to_double (a: uint16) : double = double a + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + static member inline widen_to_nativeint (a: int32) : nativeint = nativeint a + static member inline widen_to_single (a: int32) : single = single a + static member inline widen_to_double (a: int32) : double = double a + +type System.UInt32 with + static member inline widen_to_int64 (a: uint32) : int64 = int64 a + static member inline widen_to_uint64 (a: uint32) : uint64 = uint64 a + static member inline widen_to_unativeint (a: uint32) : unativeint = unativeint a + static member inline widen_to_single (a: uint32) : single = single a + static member inline widen_to_double (a: uint32) : double = double a + +type System.Int64 with + static member inline widen_to_double (a: int64) : double = double a + +type System.UInt64 with + static member inline widen_to_double (a: uint64) : double = double a + +type System.IntPtr with + static member inline widen_to_int64 (a: nativeint) : int64 = int64 a + static member inline widen_to_double (a: nativeint) : double = double a + +type System.UIntPtr with + static member inline widen_to_uint64 (a: unativeint) : uint64 = uint64 a + static member inline widen_to_double (a: unativeint) : double = double a + +type System.Single with + static member inline widen_to_double (a: int) : double = double a + +let inline widen_to_byte (x: ^T) : byte = (^T : (static member widen_to_byte : ^T -> byte) (x)) +let inline widen_to_sbyte (x: ^T) : sbyte = (^T : (static member widen_to_sbyte : ^T -> sbyte) (x)) +let inline widen_to_int16 (x: ^T) : int16 = (^T : (static member widen_to_int16 : ^T -> int16) (x)) +let inline widen_to_uint16 (x: ^T) : uint16 = (^T : (static member widen_to_uint16 : ^T -> uint16) (x)) +let inline widen_to_int32 (x: ^T) : int32 = (^T : (static member widen_to_int32 : ^T -> int32) (x)) +let inline widen_to_uint32 (x: ^T) : uint32 = (^T : (static member widen_to_uint32 : ^T -> uint32) (x)) +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) +let inline widen_to_uint64 (x: ^T) : uint64 = (^T : (static member widen_to_uint64 : ^T -> uint64) (x)) +let inline widen_to_nativeint (x: ^T) : nativeint = (^T : (static member widen_to_nativeint : ^T -> nativeint) (x)) +let inline widen_to_unativeint (x: ^T) : unativeint = (^T : (static member widen_to_unativeint : ^T -> unativeint) (x)) +let inline widen_to_single (x: ^T) : single = (^T : (static member widen_to_single : ^T -> single) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + widen_to_byte b + static member inline (+)(a: 'T, b: byte) : byte = widen_to_byte a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + widen_to_sbyte b + static member inline (+)(a: 'T, b: sbyte) : sbyte = widen_to_sbyte a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + widen_to_int16 b + static member inline (+)(a: 'T, b: int16) : int16 = widen_to_int16 a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + widen_to_uint16 b + static member inline (+)(a: 'T, b: uint16) : uint16 = widen_to_uint16 a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + widen_to_int32 b + static member inline (+)(a: 'T, b: int32) : int32 = widen_to_int32 a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + widen_to_uint32 b + static member inline (+)(a: 'T, b: uint32) : uint32 = widen_to_uint32 a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen_to_int64 b + static member inline (+)(a: 'T, b: int64) : int64 = widen_to_int64 a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + widen_to_uint64 b + static member inline (+)(a: 'T, b: uint64) : uint64 = widen_to_uint64 a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + widen_to_nativeint b + static member inline (+)(a: 'T, b: nativeint) : nativeint = widen_to_nativeint a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + widen_to_unativeint b + static member inline (+)(a: 'T, b: unativeint) : unativeint = widen_to_unativeint a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen_to_single b + static member inline (+)(a: 'T, b: single) : single = widen_to_single a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + diff --git a/tests/fsharp/typecheck/sigs/widen2.fs b/tests/fsharp/typecheck/sigs/widen2.fs new file mode 100644 index 00000000000..aa29d401420 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen2.fs @@ -0,0 +1,308 @@ +module App + +type System.SByte with + [] + static member inline widen (a: sbyte) : int16 = int16 a + [] + static member inline widen (a: sbyte) : int32 = int32 a + [] + static member inline widen (a: sbyte) : int64 = int64 a + [] + static member inline widen (a: sbyte) : nativeint = nativeint a + [] + static member inline widen (a: sbyte) : single = single a + [] + static member inline widen (a: sbyte) : double = double a + +type System.Byte with + [] + static member inline widen (a: byte) : int16 = int16 a + [] + static member inline widen (a: byte) : uint16 = uint16 a + [] + static member inline widen (a: byte) : int32 = int32 a + [] + static member inline widen (a: byte) : uint32 = uint32 a + [] + static member inline widen (a: byte) : int64 = int64 a + [] + static member inline widen (a: byte) : uint64 = uint64 a + [] + static member inline widen (a: byte) : nativeint = nativeint a + [] + static member inline widen (a: byte) : unativeint = unativeint a + [] + static member inline widen (a: byte) : single = single a + [] + static member inline widen (a: byte) : double = double a + +type System.Int16 with + [] + static member inline widen (a: int16) : int32 = int32 a + [] + static member inline widen (a: int16) : int64 = int64 a + [] + static member inline widen (a: int16) : nativeint = nativeint a + [] + static member inline widen (a: int16) : single = single a + [] + static member inline widen (a: int16) : double = double a + +type System.UInt16 with + [] + static member inline widen (a: uint16) : int32 = int32 a + [] + static member inline widen (a: uint16) : uint32 = uint32 a + [] + static member inline widen (a: uint16) : int64 = int64 a + [] + static member inline widen (a: uint16) : uint64 = uint64 a + [] + static member inline widen (a: uint16) : nativeint = nativeint a + [] + static member inline widen (a: uint16) : unativeint = unativeint a + [] + static member inline widen (a: uint16) : single = single a + [] + static member inline widen (a: uint16) : double = double a + +type System.Int32 with + [] + static member inline widen (a: int32) : int64 = int64 a + [] + static member inline widen (a: int32) : nativeint = nativeint a + [] + static member inline widen (a: int32) : single = single a + [] + static member inline widen (a: int32) : double = double a + +type System.UInt32 with + static member inline widen (a: uint32) : int64 = int64 a + [] + static member inline widen (a: uint32) : uint64 = uint64 a + [] + static member inline widen (a: uint32) : unativeint = unativeint a + [] + static member inline widen (a: uint32) : single = single a + [] + static member inline widen (a: uint32) : double = double a + +type System.Int64 with + [] + static member inline widen (a: int64) : double = double a + +type System.UInt64 with + [] + static member inline widen (a: uint64) : double = double a + +type System.IntPtr with + [] + static member inline widen (a: nativeint) : int64 = int64 a + [] + static member inline widen (a: nativeint) : double = double a + +type System.UIntPtr with + [] + static member inline widen (a: unativeint) : uint64 = uint64 a + [] + static member inline widen (a: unativeint) : double = double a + +type System.Single with + [] + static member inline widen (a: int) : double = double a + +let inline widen (x: ^T) : ^U = ((^T or ^U) : (static member widen : ^T -> ^U) (x)) + + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + widen b + static member inline (+)(a: 'T, b: byte) : byte = widen a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + widen b + static member inline (+)(a: 'T, b: sbyte) : sbyte = widen a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + widen b + static member inline (+)(a: 'T, b: int16) : int16 = widen a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + widen b + static member inline (+)(a: 'T, b: uint16) : uint16 = widen a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + widen b + static member inline (+)(a: 'T, b: int32) : int32 = widen a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + widen b + static member inline (+)(a: 'T, b: uint32) : uint32 = widen a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen b + static member inline (+)(a: 'T, b: int64) : int64 = widen a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + widen b + static member inline (+)(a: 'T, b: uint64) : uint64 = widen a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + widen b + static member inline (+)(a: 'T, b: nativeint) : nativeint = widen a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + widen b + static member inline (+)(a: 'T, b: unativeint) : unativeint = widen a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen b + static member inline (+)(a: 'T, b: single) : single = widen a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen b + static member inline (+)(a: 'T, b: double) : double = widen a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + +let explicit_widen_calls = + (System.SByte.widen 1y : int16) |> ignore + (System.SByte.widen 1y : int32) |> ignore + (System.SByte.widen 1y : int64) |> ignore + (System.SByte.widen 1y : nativeint) |> ignore + (System.SByte.widen 1y : double) |> ignore + (System.SByte.widen 1y : single) |> ignore + + (System.Int16.widen 1s : int32) |> ignore + (System.Int16.widen 1s : int64) |> ignore + (System.Int16.widen 1s : nativeint) |> ignore + (System.Int16.widen 1s : double) |> ignore + (System.Int16.widen 1s : single) |> ignore diff --git a/tests/fsharp/typecheck/sigs/widen3.fs b/tests/fsharp/typecheck/sigs/widen3.fs new file mode 100644 index 00000000000..4a82e5ffd98 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen3.fs @@ -0,0 +1,261 @@ +module App + +type System.SByte with + member inline a.widen_to_int16 () : int16 = int16 a + member inline a.widen_to_int32 () : int32 = int32 a + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_nativeint () : nativeint = nativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.Byte with + member inline a.widen_to_int16 () : int16 = int16 a + member inline a.widen_to_uint16 () : uint16 = uint16 a + member inline a.widen_to_int32 () : int32 = int32 a + member inline a.widen_to_uint32 () : uint32 = uint32 a + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_uint64 () : uint64 = uint64 a + member inline a.widen_to_nativeint () : nativeint = nativeint a + member inline a.widen_to_unativeint () : unativeint = unativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.Int16 with + member inline a.widen_to_int32 () : int32 = int32 a + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_nativeint () : nativeint = nativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.UInt16 with + member inline a.widen_to_int32 () : int32 = int32 a + member inline a.widen_to_uint32 () : uint32 = uint32 a + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_uint64 () : uint64 = uint64 a + member inline a.widen_to_nativeint () : nativeint = nativeint a + member inline a.widen_to_unativeint () : unativeint = unativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.Int32 with + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_nativeint () : nativeint = nativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.UInt32 with + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_uint64 () : uint64 = uint64 a + member inline a.widen_to_unativeint () : unativeint = unativeint a + member inline a.widen_to_single () : single = single a + member inline a.widen_to_double () : double = double a + +type System.Int64 with + member inline a.widen_to_double () : double = double a + +type System.UInt64 with + member inline a.widen_to_double () : double = double a + +type System.IntPtr with + member inline a.widen_to_int64 () : int64 = int64 a + member inline a.widen_to_double () : double = double a + +type System.UIntPtr with + member inline a.widen_to_uint64 () : uint64 = uint64 a + member inline a.widen_to_double () : double = double a + +type System.Single with + member inline a.widen_to_double () : double = double a + +let inline widen_to_byte (x: ^T) : byte = (^T : (member widen_to_byte : unit -> byte) (x)) +let inline widen_to_sbyte (x: ^T) : sbyte = (^T : (member widen_to_sbyte : unit -> sbyte) (x)) +let inline widen_to_int16 (x: ^T) : int16 = (^T : (member widen_to_int16 : unit -> int16) (x)) +let inline widen_to_uint16 (x: ^T) : uint16 = (^T : (member widen_to_uint16 : unit -> uint16) (x)) +let inline widen_to_int32 (x: ^T) : int32 = (^T : (member widen_to_int32 : unit -> int32) (x)) +let inline widen_to_uint32 (x: ^T) : uint32 = (^T : (member widen_to_uint32 : unit -> uint32) (x)) +let inline widen_to_int64 (x: ^T) : int64 = (^T : (member widen_to_int64 : unit -> int64) (x)) +let inline widen_to_uint64 (x: ^T) : uint64 = (^T : (member widen_to_uint64 : unit -> uint64) (x)) +let inline widen_to_nativeint (x: ^T) : nativeint = (^T : (member widen_to_nativeint : unit -> nativeint) (x)) +let inline widen_to_unativeint (x: ^T) : unativeint = (^T : (member widen_to_unativeint : unit -> unativeint) (x)) +let inline widen_to_single (x: ^T) : single = (^T : (member widen_to_single : unit -> single) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (member widen_to_double : unit -> double) (x)) + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + widen_to_byte b + static member inline (+)(a: 'T, b: byte) : byte = widen_to_byte a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + widen_to_sbyte b + static member inline (+)(a: 'T, b: sbyte) : sbyte = widen_to_sbyte a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + widen_to_int16 b + static member inline (+)(a: 'T, b: int16) : int16 = widen_to_int16 a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + widen_to_uint16 b + static member inline (+)(a: 'T, b: uint16) : uint16 = widen_to_uint16 a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + widen_to_int32 b + static member inline (+)(a: 'T, b: int32) : int32 = widen_to_int32 a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + widen_to_uint32 b + static member inline (+)(a: 'T, b: uint32) : uint32 = widen_to_uint32 a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen_to_int64 b + static member inline (+)(a: 'T, b: int64) : int64 = widen_to_int64 a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + widen_to_uint64 b + static member inline (+)(a: 'T, b: uint64) : uint64 = widen_to_uint64 a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + widen_to_nativeint b + static member inline (+)(a: 'T, b: nativeint) : nativeint = widen_to_nativeint a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + widen_to_unativeint b + static member inline (+)(a: 'T, b: unativeint) : unativeint = widen_to_unativeint a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen_to_single b + static member inline (+)(a: 'T, b: single) : single = widen_to_single a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + diff --git a/tests/fsharp/typecheck/sigs/widen4.fs b/tests/fsharp/typecheck/sigs/widen4.fs new file mode 100644 index 00000000000..1487cabaf2f --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen4.fs @@ -0,0 +1,261 @@ +module App + +type System.SByte with + member inline a.ToInt16 () : int16 = int16 a + member inline a.ToInt32 () : int32 = int32 a + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToIntPtr () : nativeint = nativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.Byte with + member inline a.ToInt16 () : int16 = int16 a + member inline a.ToUInt16 () : uint16 = uint16 a + member inline a.ToInt32 () : int32 = int32 a + member inline a.ToUInt32 () : uint32 = uint32 a + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToUInt64 () : uint64 = uint64 a + member inline a.ToIntPtr () : nativeint = nativeint a + member inline a.ToUIntPtr () : unativeint = unativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.Int16 with + member inline a.ToInt32 () : int32 = int32 a + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToIntPtr () : nativeint = nativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.UInt16 with + member inline a.ToInt32 () : int32 = int32 a + member inline a.ToUInt32 () : uint32 = uint32 a + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToUInt64 () : uint64 = uint64 a + member inline a.ToIntPtr () : nativeint = nativeint a + member inline a.ToUIntPtr () : unativeint = unativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.Int32 with + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToIntPtr () : nativeint = nativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.UInt32 with + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToUInt64 () : uint64 = uint64 a + member inline a.ToUIntPtr () : unativeint = unativeint a + member inline a.ToSingle () : single = single a + member inline a.ToDouble () : double = double a + +type System.Int64 with + member inline a.ToDouble () : double = double a + +type System.UInt64 with + member inline a.ToDouble () : double = double a + +type System.IntPtr with + member inline a.ToInt64 () : int64 = int64 a + member inline a.ToDouble () : double = double a + +type System.UIntPtr with + member inline a.ToUInt64 () : uint64 = uint64 a + member inline a.ToDouble () : double = double a + +type System.Single with + member inline a.ToDouble () : double = double a + +let inline ToByte (x: ^T) : byte = (^T : (member ToByte : unit -> byte) (x)) +let inline ToSbyte (x: ^T) : sbyte = (^T : (member ToSbyte : unit -> sbyte) (x)) +let inline ToInt16 (x: ^T) : int16 = (^T : (member ToInt16 : unit -> int16) (x)) +let inline ToUInt16 (x: ^T) : uint16 = (^T : (member ToUInt16 : unit -> uint16) (x)) +let inline ToInt32 (x: ^T) : int32 = (^T : (member ToInt32 : unit -> int32) (x)) +let inline ToUInt32 (x: ^T) : uint32 = (^T : (member ToUInt32 : unit -> uint32) (x)) +let inline ToInt64 (x: ^T) : int64 = (^T : (member ToInt64 : unit -> int64) (x)) +let inline ToUInt64 (x: ^T) : uint64 = (^T : (member ToUInt64 : unit -> uint64) (x)) +let inline ToIntPtr (x: ^T) : nativeint = (^T : (member ToIntPtr : unit -> nativeint) (x)) +let inline ToUIntPtr (x: ^T) : unativeint = (^T : (member ToUIntPtr : unit -> unativeint) (x)) +let inline ToSingle (x: ^T) : single = (^T : (member ToSingle : unit -> single) (x)) +let inline ToDouble (x: ^T) : double = (^T : (member ToDouble : unit -> double) (x)) + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + ToByte b + static member inline (+)(a: 'T, b: byte) : byte = ToByte a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + ToSbyte b + static member inline (+)(a: 'T, b: sbyte) : sbyte = ToSbyte a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + ToInt16 b + static member inline (+)(a: 'T, b: int16) : int16 = ToInt16 a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + ToUInt16 b + static member inline (+)(a: 'T, b: uint16) : uint16 = ToUInt16 a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + ToInt32 b + static member inline (+)(a: 'T, b: int32) : int32 = ToInt32 a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + ToUInt32 b + static member inline (+)(a: 'T, b: uint32) : uint32 = ToUInt32 a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + ToInt64 b + static member inline (+)(a: 'T, b: int64) : int64 = ToInt64 a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + ToUInt64 b + static member inline (+)(a: 'T, b: uint64) : uint64 = ToUInt64 a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + ToIntPtr b + static member inline (+)(a: 'T, b: nativeint) : nativeint = ToIntPtr a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + ToUIntPtr b + static member inline (+)(a: 'T, b: unativeint) : unativeint = ToUIntPtr a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + ToSingle b + static member inline (+)(a: 'T, b: single) : single = ToSingle a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + ToDouble b + static member inline (+)(a: 'T, b: double) : double = ToDouble a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + diff --git a/tests/fsharp/typecheck/sigs/widen5.fs b/tests/fsharp/typecheck/sigs/widen5.fs new file mode 100644 index 00000000000..92e8a8c648a --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen5.fs @@ -0,0 +1,294 @@ +module App + +type System.SByte with + [] + member a.widen () : int16 = int16 a + [] + member a.widen () : int32 = int32 a + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : nativeint = nativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.Byte with + [] + member a.widen () : int16 = int16 a + [] + member a.widen () : uint16 = uint16 a + [] + member a.widen () : int32 = int32 a + [] + member a.widen () : uint32 = uint32 a + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : uint64 = uint64 a + [] + member a.widen () : nativeint = nativeint a + [] + member a.widen () : unativeint = unativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.Int16 with + [] + member a.widen () : int32 = int32 a + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : nativeint = nativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.UInt16 with + [] + member a.widen () : int32 = int32 a + [] + member a.widen () : uint32 = uint32 a + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : uint64 = uint64 a + [] + member a.widen () : nativeint = nativeint a + [] + member a.widen () : unativeint = unativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.Int32 with + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : nativeint = nativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.UInt32 with + member a.widen () : int64 = int64 a + [] + member a.widen () : uint64 = uint64 a + [] + member a.widen () : unativeint = unativeint a + [] + member a.widen () : single = single a + [] + member a.widen () : double = double a + +type System.Int64 with + [] + member a.widen () : double = double a + +type System.UInt64 with + [] + member a.widen () : double = double a + +type System.IntPtr with + [] + member a.widen () : int64 = int64 a + [] + member a.widen () : double = double a + +type System.UIntPtr with + [] + member a.widen () : uint64 = uint64 a + [] + member a.widen () : double = double a + +type System.Single with + [] + member a.widen () : double = double a + +let inline widen (x: ^T) : ^U = (^T : (member widen : unit -> ^U) (x)) + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + widen b + static member inline (+)(a: 'T, b: byte) : byte = widen a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + widen b + static member inline (+)(a: 'T, b: sbyte) : sbyte = widen a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + widen b + static member inline (+)(a: 'T, b: int16) : int16 = widen a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + widen b + static member inline (+)(a: 'T, b: uint16) : uint16 = widen a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + widen b + static member inline (+)(a: 'T, b: int32) : int32 = widen a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + widen b + static member inline (+)(a: 'T, b: uint32) : uint32 = widen a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen b + static member inline (+)(a: 'T, b: int64) : int64 = widen a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + widen b + static member inline (+)(a: 'T, b: uint64) : uint64 = widen a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + widen b + static member inline (+)(a: 'T, b: nativeint) : nativeint = widen a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + widen b + static member inline (+)(a: 'T, b: unativeint) : unativeint = widen a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen b + static member inline (+)(a: 'T, b: single) : single = widen a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen b + static member inline (+)(a: 'T, b: double) : double = widen a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + diff --git a/tests/fsharp/typecheck/sigs/widen6.fs b/tests/fsharp/typecheck/sigs/widen6.fs new file mode 100644 index 00000000000..9271a91d85c --- /dev/null +++ b/tests/fsharp/typecheck/sigs/widen6.fs @@ -0,0 +1,250 @@ +module App + +type System.SByte with + static member inline op_Implicit (a: sbyte) : int16 = int16 a + static member inline op_Implicit (a: sbyte) : int32 = int32 a + static member inline op_Implicit (a: sbyte) : int64 = int64 a + static member inline op_Implicit (a: sbyte) : nativeint = nativeint a + static member inline op_Implicit (a: sbyte) : single = single a + static member inline op_Implicit (a: sbyte) : double = double a + +type System.Byte with + static member inline op_Implicit (a: byte) : int16 = int16 a + static member inline op_Implicit (a: byte) : uint16 = uint16 a + static member inline op_Implicit (a: byte) : int32 = int32 a + static member inline op_Implicit (a: byte) : uint32 = uint32 a + static member inline op_Implicit (a: byte) : int64 = int64 a + static member inline op_Implicit (a: byte) : uint64 = uint64 a + static member inline op_Implicit (a: byte) : nativeint = nativeint a + static member inline op_Implicit (a: byte) : unativeint = unativeint a + static member inline op_Implicit (a: byte) : single = single a + static member inline op_Implicit (a: byte) : double = double a + +type System.Int16 with + static member inline op_Implicit (a: int16) : int32 = int32 a + static member inline op_Implicit (a: int16) : int64 = int64 a + static member inline op_Implicit (a: int16) : nativeint = nativeint a + static member inline op_Implicit (a: int16) : single = single a + static member inline op_Implicit (a: int16) : double = double a + +type System.UInt16 with + static member inline op_Implicit (a: uint16) : int32 = int32 a + static member inline op_Implicit (a: uint16) : uint32 = uint32 a + static member inline op_Implicit (a: uint16) : int64 = int64 a + static member inline op_Implicit (a: uint16) : uint64 = uint64 a + static member inline op_Implicit (a: uint16) : nativeint = nativeint a + static member inline op_Implicit (a: uint16) : unativeint = unativeint a + static member inline op_Implicit (a: uint16) : single = single a + static member inline op_Implicit (a: uint16) : double = double a + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + static member inline op_Implicit (a: int32) : nativeint = nativeint a + static member inline op_Implicit (a: int32) : single = single a + static member inline op_Implicit (a: int32) : double = double a + +type System.UInt32 with + static member inline op_Implicit (a: uint32) : int64 = int64 a + static member inline op_Implicit (a: uint32) : uint64 = uint64 a + static member inline op_Implicit (a: uint32) : unativeint = unativeint a + static member inline op_Implicit (a: uint32) : single = single a + static member inline op_Implicit (a: uint32) : double = double a + +type System.Int64 with + static member inline op_Implicit (a: int64) : double = double a + +type System.UInt64 with + static member inline op_Implicit (a: uint64) : double = double a + +type System.IntPtr with + static member inline op_Implicit (a: nativeint) : int64 = int64 a + static member inline op_Implicit (a: nativeint) : double = double a + +type System.UIntPtr with + static member inline op_Implicit (a: unativeint) : uint64 = uint64 a + static member inline op_Implicit (a: unativeint) : double = double a + +type System.Single with + static member inline op_Implicit (a: int) : double = double a + +let inline widen (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) + +type System.Byte with + static member inline (+)(a: byte, b: 'T) : byte = a + widen b + static member inline (+)(a: 'T, b: byte) : byte = widen a + b + +type System.SByte with + static member inline (+)(a: sbyte, b: 'T) : sbyte = a + widen b + static member inline (+)(a: 'T, b: sbyte) : sbyte = widen a + b + +type System.Int16 with + static member inline (+)(a: int16, b: 'T) : int16 = a + widen b + static member inline (+)(a: 'T, b: int16) : int16 = widen a + b + +type System.UInt16 with + static member inline (+)(a: uint16, b: 'T) : uint16 = a + widen b + static member inline (+)(a: 'T, b: uint16) : uint16 = widen a + b + +type System.Int32 with + static member inline (+)(a: int32, b: 'T) : int32 = a + widen b + static member inline (+)(a: 'T, b: int32) : int32 = widen a + b + +type System.UInt32 with + static member inline (+)(a: uint32, b: 'T) : uint32 = a + widen b + static member inline (+)(a: 'T, b: uint32) : uint32 = widen a + b + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen b + static member inline (+)(a: 'T, b: int64) : int64 = widen a + b + +type System.UInt64 with + static member inline (+)(a: uint64, b: 'T) : uint64 = a + widen b + static member inline (+)(a: 'T, b: uint64) : uint64 = widen a + b + +type System.IntPtr with + static member inline (+)(a: nativeint, b: 'T) : nativeint = a + widen b + static member inline (+)(a: 'T, b: nativeint) : nativeint = widen a + b + +type System.UIntPtr with + static member inline (+)(a: unativeint, b: 'T) : unativeint = a + widen b + static member inline (+)(a: 'T, b: unativeint) : unativeint = widen a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen b + static member inline (+)(a: 'T, b: single) : single = widen a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen b + static member inline (+)(a: 'T, b: double) : double = widen a + b + +let table = + (1y + 2y) |> ignore + //(1y + 2uy) |> ignore + (1y + 2s) |> ignore + //1y + 2us |> ignore + (1y + 2) |> ignore + //(1y + 2u) |> ignore + (1y + 2L) |> ignore + //1y + 2UL |> ignore + (1y + 2n) |> ignore + //(1y + 2un) |> ignore + (1y + 2.0f) |> ignore + (1y + 2.0) |> ignore + + //(1uy + 2y) |> ignore + (1uy + 2uy) |> ignore + (1uy + 2s) |> ignore + (1uy + 2us) |> ignore + (1uy + 2) |> ignore + (1uy + 2u) |> ignore + (1uy + 2L) |> ignore + (1uy + 2UL) |> ignore + (1uy + 2n) |> ignore + (1uy + 2un) |> ignore + (1uy + 2.0f) |> ignore + (1uy + 2.0) |> ignore + + (1s + 2y) |> ignore + (1s + 2uy) |> ignore + (1s + 2s) |> ignore + //1s + 2us |> ignore + (1s + 2) |> ignore + //(1s + 2u) |> ignore + (1s + 2L) |> ignore + //1s + 2UL |> ignore + (1s + 2n) |> ignore + //(1s + 2un) |> ignore + (1s + 2.0f) |> ignore + (1s + 2.0) |> ignore + + //(1us + 2y) |> ignore + (1us + 2uy) |> ignore + //(1us + 2s) |> ignore + (1us + 2us) |> ignore + (1us + 2) |> ignore + (1us + 2u) |> ignore + (1us + 2L) |> ignore + (1us + 2UL) |> ignore + (1us + 2n) |> ignore + (1us + 2un) |> ignore + (1us + 2.0f) |> ignore + (1us + 2.0) |> ignore + + (1 + 2y) |> ignore + (1 + 2uy) |> ignore + (1 + 2s) |> ignore + 1 + 2us |> ignore + (1 + 2) |> ignore + //(1 + 2u) |> ignore + (1 + 2L) |> ignore + //1 + 2UL |> ignore + (1 + 2n) |> ignore + //(1 + 2un) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + //(1u + 2y) |> ignore + (1u + 2uy) |> ignore + //(1us + 2s) |> ignore + (1u + 2us) |> ignore + //(1u + 2) |> ignore + (1u + 2u) |> ignore + (1u + 2L) |> ignore + (1u + 2UL) |> ignore + //(1u + 2n) |> ignore + (1u + 2un) |> ignore + (1u + 2.0f) |> ignore + (1u + 2.0) |> ignore + + (1L + 2y) |> ignore + (1L + 2uy) |> ignore + (1L + 2s) |> ignore + (1L + 2us) |> ignore + (1L + 2) |> ignore + //(1L + 2u) // gives error + (1L + 2L) |> ignore + //1L + 2UL // gives error + (1L + 2n) |> ignore + //(1L + 2un) // gives error + //(1L + 2.0f) // gives error + (1L + 2.0) |> ignore + + //(1u + 2y) // gives error + (1UL + 2uy) |> ignore + //(1us + 2s) // gives error + (1UL + 2us) |> ignore + //(1u + 2) // gives error + (1UL + 2u) |> ignore + //(1UL + 2L) // gives error + (1UL + 2UL) |> ignore + //(1u + 2n) // gives error + (1UL + 2un) |> ignore + //(1UL + 2.0f) // gives error + (1UL + 2.0) |> ignore + + (1n + 2y) |> ignore + (1n + 2uy) |> ignore + (1n + 2s) |> ignore + (1n + 2us) |> ignore + (1n + 2) |> ignore + //(1n + 2u) // gives error + (1n + 2L) |> ignore + //1n + 2UL // gives error + (1n + 2n) |> ignore + //(1n + 2un) // gives error + //(1n + 2.0f) // gives error + (1n + 2.0) |> ignore + + //(1un + 2y) // gives error + (1un + 2uy) |> ignore + //(1un + 2s) // gives error + (1un + 2us) |> ignore + //(1un + 2) // gives error + (1un + 2u) |> ignore + //(1un + 2L) // gives error + (1un + 2UL) |> ignore + //(1un + 2n) // gives error + (1un + 2un) |> ignore + //(1un + 2.0f) // gives error + (1un + 2.0) |> ignore + From 00f8e3d05dd07cb37f1f16b764e86d474006fdd9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 3 Feb 2020 17:41:51 +0000 Subject: [PATCH 17/82] fix test --- tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs | 1 + tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index 896e7629da0..6d153e0ead1 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -640,6 +640,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadByReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index 82141617d93..f43aa025bdf 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -640,6 +640,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadByReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() From 1f15262920f33a65e140c995b8e245385924f320 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 3 Feb 2020 17:51:37 +0000 Subject: [PATCH 18/82] minimize diff --- src/fsharp/TastOps.fs | 10 ++++------ src/fsharp/TastOps.fsi | 1 - src/fsharp/TastPickle.fs | 2 +- src/fsharp/TypeChecker.fs | 21 ++++++++++----------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index b8b85220e35..39d2ff504ff 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -400,15 +400,13 @@ let mkInstRemap tpinst = extSlnsMap = Map.empty } // entry points for "typar -> TType" instantiation -let instType tpinst x = if isNil tpinst then x else remapTypeAux (mkInstRemap tpinst) x -let instTypes tpinst x = if isNil tpinst then x else remapTypesAux (mkInstRemap tpinst) x -let instTrait tpinst x = if isNil tpinst then x else remapTraitAux (mkInstRemap tpinst) x -let instValRef tpinst x = if isNil tpinst then x else remapValRef (mkInstRemap tpinst) x +let instType tpinst x = if isNil tpinst then x else remapTypeAux (mkInstRemap tpinst) x +let instTypes tpinst x = if isNil tpinst then x else remapTypesAux (mkInstRemap tpinst) x +let instTrait tpinst x = if isNil tpinst then x else remapTraitAux (mkInstRemap tpinst) x let instTyparConstraints tpinst x = if isNil tpinst then x else remapTyparConstraintsAux (mkInstRemap tpinst) x let instSlotSig tpinst ss = remapSlotSig (fun _ -> []) (mkInstRemap tpinst) ss let copySlotSig ss = remapSlotSig (fun _ -> []) Remap.Empty ss - let mkTyparToTyparRenaming tpsOrig tps = let tinst = generalizeTypars tps mkTyparInst tpsOrig tinst, tinst @@ -4305,7 +4303,7 @@ let IsHidden setF accessF remapF = check rest (remapF rpi x)) fun mrmi x -> check mrmi x - + let IsHiddenTycon mrmi x = IsHidden (fun mhi -> mhi.HiddenTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) mrmi x let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) mrmi x diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index e9083187787..91e0847cd1e 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -561,7 +561,6 @@ val instTypes : TyparInst -> TypeInst -> TypeInst val instTyparConstraints : TyparInst -> TyparConstraint list -> TyparConstraint list val instTrait : TyparInst -> TraitConstraintInfo -> TraitConstraintInfo -val instValRef : TyparInst -> ValRef -> ValRef //------------------------------------------------------------------------- // From typars to types diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 701e40a67ee..913fb6b17e3 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1537,7 +1537,7 @@ let u_trait_sln st = FSAnonRecdFieldSln(a, b, c) | _ -> ufailwith st "u_trait_sln" -let u_trait st = +let u_trait st = let a, b, c, d, e, f = u_tup6 u_tys u_string u_MemberFlags u_tys (u_option u_ty) (u_option u_trait_sln) st // extSlns starts empty when reading trait constraints from pickled // data. This is ok as only generalized (pre-solution, pre-freshened) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 8fe2f7dc471..be49db4ec89 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -331,7 +331,7 @@ let AddLocalValMap tcSink scopem (vals: Val NameMap) env = { env with eNameResEnv = AddValMapToNameEnv vals env.eNameResEnv eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) env /// Add a list of local values to TcEnv and report them to the sink @@ -343,7 +343,7 @@ let AddLocalVals tcSink scopem (vals: Val list) env = { env with eNameResEnv = AddValListToNameEnv vals env.eNameResEnv eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) env /// Add a local value to TcEnv and report it to the sink @@ -359,7 +359,7 @@ let AddLocalExnDefnAndReport tcSink scopem env (exnc: Tycon) = let env = { env with eNameResEnv = AddExceptionDeclsToNameEnv BulkAdd.No env.eNameResEnv (mkLocalEntityRef exnc) } // Also make VisualStudio think there is an identifier in scope at the range of the identifier text of its binding location CallEnvSink tcSink (exnc.Range, env.NameEnv, env.AccessRights) - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) + CallEnvSink tcSink (scopem, env.NameEnv, env.AccessRights) env /// Add a list of type definitions to TcEnv @@ -1073,9 +1073,8 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, optIm if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(name, n), m)) if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments name, m)) - if isExtrinsic && IsMangledOpName id.idText then - if not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) then - warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) + if isExtrinsic && IsMangledOpName id.idText && not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) then + warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) ValMemberInfoTransient(memberInfo, logicalName, compiledName) @@ -4577,7 +4576,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a let item = Item.TypeVar(id.idText, res) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) // record the ' as well for tokenization - // CallNameResolutionSink cenv.tcSink (tp.Range.StartRange, env.NameEnv, item, item, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) + // CallNameResolutionSink cenv.tcSink (tp.Range.StartRange, env.NameEnv, item, item, ItemOccurence.UseInType, env.DisplayEnv, env.eAccessRights) res, tpenv let key = id.idText match env.eNameResEnv.eTypars.TryGetValue key with @@ -4622,7 +4621,7 @@ and TcTyparDecl cenv env (TyparDecl(Attributes synAttrs, (Typar(id, _, _) as stp | None -> () let item = Item.TypeVar(id.idText, tp) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.AccessRights) + CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.UseInType, env.DisplayEnv, env.eAccessRights) tp @@ -6614,7 +6613,7 @@ and TcRecordConstruction cenv overallTy env tpenv optOrigExprInfo objTy fldsList // Check accessibility: this is also done in BuildFieldMap, but also need to check // for fields in { new R with a=1 and b=2 } constructions and { r with a=1 } copy-and-update expressions rfrefs |> List.iter (fun rfref -> - CheckRecdFieldAccessible cenv.amap m env.eAccessRights rfref |> ignore + CheckRecdFieldAccessible cenv.amap m env.eAccessRights rfref |> ignore CheckFSharpAttributes cenv.g rfref.PropertyAttribs m |> CommitOperationResult) let args = List.map snd fldsList @@ -12296,7 +12295,7 @@ and TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv (pgr let maxInferredTypars = freeInTypeLeftToRight cenv.g false tau let canGeneralizeConstrained = GeneralizationHelpers.CanGeneralizeConstrainedTyparsForDecl rbinfo.DeclKind - let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars,tau,isCtor) + let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars, tau, isCtor) generalizedTypars /// Compute the type variables which may have member constraints that need to be canonicalized prior to generalization @@ -12538,7 +12537,7 @@ let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind, memF let flex = ExplicitTyparInfo(declaredTypars, declaredTypars, synCanInferTypars) - let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars(cenv, denv, id.idRange, emptyFreeTypars, canInferTypars, CanGeneralizeConstrainedTypars, inlineFlag, None, allDeclaredTypars,freeInType, ty, false) + let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars(cenv, denv, id.idRange, emptyFreeTypars, canInferTypars, CanGeneralizeConstrainedTypars, inlineFlag, None, allDeclaredTypars, freeInType, ty, false) let valscheme1 = PrelimValScheme1(id, flex, ty, Some partialValReprInfo, memberInfoOpt, mutableFlag, inlineFlag, NormalVal, noArgOrRetAttribs, vis, false) From d7fa8fd092b9e4f1a55c4988a2a02e3d62dba1b8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 3 Feb 2020 18:27:48 +0000 Subject: [PATCH 19/82] fix build --- tests/fsharp/tests.fs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index e70a986dc21..5fc0c4f11a1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2313,12 +2313,6 @@ module TypecheckTests = fsc cfg "%s --target:library -o:widen6.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen6.fs"] peverify cfg "widen6.dll" - [] - let ``sigs pos35`` () = - let cfg = testConfig "typecheck/sigs" - fsc cfg "%s --target:library -o:pos35.dll --warnaserror" cfg.fsc_flags ["pos35.fs"] - peverify cfg "pos35.dll" - [] let ``sigs pos23`` () = let cfg = testConfig "typecheck/sigs" From 992c6b2644d5f2d373726233564d0616e341dc87 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Feb 2020 12:37:00 +0000 Subject: [PATCH 20/82] update baselines and add extension priority testing --- src/fsharp/FSComp.txt | 4 +- tests/fsharp/core/extconstraint/test.fsx | 81 ++++++- tests/fsharp/tests.fs | 4 + tests/fsharp/typecheck/sigs/neg116.bsl | 12 +- .../fsharp/typecheck/sigs/neg116.preview.bsl | 12 ++ tests/fsharp/typecheck/sigs/neg21.bsl | 4 +- tests/fsharp/typecheck/sigs/neg60.bsl | 6 +- tests/fsharp/typecheck/sigs/neg68.vsbsl | 4 +- tests/fsharp/typecheck/sigs/neg74.vsbsl | 2 +- .../BindingExpressions/Binding/in05.fs | 4 +- .../E_RigidTypeAnnotation02.fsx | 20 +- .../E_ConstraintCall1.fs | 2 +- .../E_ExplicitMemberConstraints2.fs | 2 +- .../CheckingSyntacticTypes/E_Regression02.fs | 200 +++++++++--------- .../General/E_NullableOperators01.fs | 2 +- .../Tests.LanguageService.Script.fs | 3 +- 16 files changed, 232 insertions(+), 130 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg116.preview.bsl diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 6a4e5da6b1c..9c1e85b097a 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -304,9 +304,9 @@ csExpectedArguments,"Expected arguments to an instance member" csIndexArgumentMismatch,"This indexer expects %d arguments but is here given %d" csExpectTypeWithOperatorButGivenFunction,"Expecting a type supporting the operator '%s' but given a function type. You may be missing an argument to a function." csExpectTypeWithOperatorButGivenTuple,"Expecting a type supporting the operator '%s' but given a tuple type" -csTypesDoNotSupportOperator,"None of the types '%s' support the operator '%s'" +csTypesDoNotSupportOperator,"The types '%s' do not support the operator '%s'" csTypeDoesNotSupportOperator,"The type '%s' does not support the operator '%s'" -csTypesDoNotSupportOperatorNullable,"None of the types '%s' support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'." +csTypesDoNotSupportOperatorNullable,"The types '%s' do not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'." csTypeDoesNotSupportOperatorNullable,"The type '%s' does not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'." csTypeDoesNotSupportConversion,"The type '%s' does not support a conversion to the type '%s'" csMethodFoundButIsStatic,"The type '%s' has a method '%s' (full name '%s'), but the method is static" diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index 0a59ad23377..f2ff8c1c378 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -30,13 +30,90 @@ type MyType = module DotNetPrimtiveWithNewOperator = type System.Int32 with static member (++)(a: int, b: int) = a - do check "jfs9dlfdh" 1 (1 ++ 2) + do check "jfs9dlfdhQ" 1 (1 ++ 2) /// Extending a .NET primitive type with new instance of an operator module DotNetPrimtiveExistingOperator1 = type System.Double with static member (+)(a: int, b: float) = float a + b - do check "jfs9dlfdh" 3.0 (2.0 + 1) + do check "jfs9dlfdhA" 3.0 (2 + 1.0) + +/// Extending a .NET primitive type with new instance of an operator +module DotNetPrimtiveExistingOperator2 = + type System.Double with + static member (+)(a: float, b: int) = a + float b + do check "jfs9dlfdh0" 3.0 (1.0 + 2) + do check "jfs9dlfdh1" 3.0 (1.0 + 2.0) + +/// Extending a .NET primitive type with new instance of an operator +module DotNetPrimtiveExistingOperator3 = + type System.Double with + static member (+)(a: float, b: int) = a + float b + static member (+)(a: int, b: float) = float a + b + do check "jfs9dlfdh2" 3 (2 + 1) + do check "jfs9dlfdh3" 3.0 (2 + 1.0) + do check "jfs9dlfdh4" 3.0 (1.0 + 2) + do check "jfs9dlfdh5" 3.0 (1.0 + 2.0) + +/// Extension members take precedence in most-recently-opened order +module ExtensionPrecedence1 = + [] + module M1 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + + [] + module M2 = + type System.Double with + static member (+)(a: int, b: float) = float a + b + 4.0 + do check "jfs9dlfdh6" 7.0 (2 + 1.0) // note we call the second one + +/// Extension members take precedence in most-recently-opened order +/// +/// Like the previous test but we change the declarations a little +module ExtensionPrecedence2 = + [] + module M1 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + + [] + module M2 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + 4.0 + + do check "jfs9dlfdh6" 7.0 (2 + 1.0) // note we call the second one + +/// Extension members take precedence in most-recently-opened order +/// +/// Like the previous test but we change the declarations a little +module ExtensionPrecedence3 = + module Extensions1 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + + module Extensions2 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + 4.0 + open Extensions1 + open Extensions2 + do check "jfs9dlfdh7" 7.0 (2 + 1.0) // note we call the second one + +/// Extension members take precedence in most-recently-opened order +/// +/// Like the previous test but we change the declarations a little +module ExtensionPrecedence4 = + module Extensions2 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + 4.0 + + module Extensions1 = + type System.Int32 with + static member (+)(a: int, b: float) = float a + b + + open Extensions1 + open Extensions2 + do check "jfs9dlfdh8" 7.0 (2 + 1.0) // note we call the Extensions2 one /// Extending a .NET primitive type with new operator module DotNetPrimtiveWithAmbiguousNewOperator = diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 5fc0c4f11a1..43c01182ad1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2815,6 +2815,10 @@ module TypecheckTests = [] let ``type check neg116`` () = singleNegTest (testConfig "typecheck/sigs") "neg116" + // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + [] + let ``type check neg116 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg116" + [] let ``type check neg117`` () = singleNegTest (testConfig "typecheck/sigs") "neg117" diff --git a/tests/fsharp/typecheck/sigs/neg116.bsl b/tests/fsharp/typecheck/sigs/neg116.bsl index adef0933d01..8bd4930a304 100644 --- a/tests/fsharp/typecheck/sigs/neg116.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.bsl @@ -1,2 +1,12 @@ -neg116.fs(10,44,10,45): typecheck error FS0043: The type 'Polynomial' does not match the type 'float' +neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. The available overloads are shown below. +neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial'. Type constraint mismatch. The type + 'float' +is not compatible with type + 'Complex' +. +neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial'. Type constraint mismatch. The type + 'float' +is not compatible with type + 'decimal' +. diff --git a/tests/fsharp/typecheck/sigs/neg116.preview.bsl b/tests/fsharp/typecheck/sigs/neg116.preview.bsl new file mode 100644 index 00000000000..8bd4930a304 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg116.preview.bsl @@ -0,0 +1,12 @@ + +neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. The available overloads are shown below. +neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial'. Type constraint mismatch. The type + 'float' +is not compatible with type + 'Complex' +. +neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial'. Type constraint mismatch. The type + 'float' +is not compatible with type + 'decimal' +. diff --git a/tests/fsharp/typecheck/sigs/neg21.bsl b/tests/fsharp/typecheck/sigs/neg21.bsl index d395b72b03b..de46028026e 100644 --- a/tests/fsharp/typecheck/sigs/neg21.bsl +++ b/tests/fsharp/typecheck/sigs/neg21.bsl @@ -7,9 +7,9 @@ neg21.fs(13,19,13,28): typecheck error FS0001: The unit of measure 'sqrm' does n neg21.fs(13,17,13,18): typecheck error FS0043: The unit of measure 'sqrm' does not match the unit of measure 's' -neg21.fs(14,19,14,23): typecheck error FS0001: The type 'float32' does not match the type 'float<'u>' +neg21.fs(14,19,14,23): typecheck error FS0001: The types 'float, float32' do not support the operator '/' -neg21.fs(14,17,14,18): typecheck error FS0043: The type 'float32' does not match the type 'float<'u>' +neg21.fs(14,17,14,18): typecheck error FS0043: The types 'float, float32' do not support the operator '/' neg21.fs(17,26,17,34): typecheck error FS0001: Type mismatch. Expecting a 'float' diff --git a/tests/fsharp/typecheck/sigs/neg60.bsl b/tests/fsharp/typecheck/sigs/neg60.bsl index 9e05fc389f2..b2329cac08d 100644 --- a/tests/fsharp/typecheck/sigs/neg60.bsl +++ b/tests/fsharp/typecheck/sigs/neg60.bsl @@ -66,11 +66,11 @@ neg60.fs(71,36,71,40): typecheck error FS0043: The type 'System.Nullable' d neg60.fs(77,16,77,19): typecheck error FS0043: The type 'System.Nullable' does not support the operator '?>='. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. -neg60.fs(78,16,78,19): typecheck error FS0043: None of the types 'System.Nullable, int' support the operator '?>='. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. +neg60.fs(78,16,78,19): typecheck error FS0043: The types 'System.Nullable, int' do not support the operator '?>='. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. -neg60.fs(79,18,79,21): typecheck error FS0001: The type ''a * 'b' does not match the type 'int' +neg60.fs(79,18,79,21): typecheck error FS0001: Expecting a type supporting the operator '+' but given a tuple type -neg60.fs(79,15,79,16): typecheck error FS0043: The type ''a * 'b' does not match the type 'int' +neg60.fs(79,15,79,16): typecheck error FS0043: Expecting a type supporting the operator '+' but given a tuple type neg60.fs(80,22,80,25): typecheck error FS0001: Expecting a type supporting the operator '+' but given a tuple type diff --git a/tests/fsharp/typecheck/sigs/neg68.vsbsl b/tests/fsharp/typecheck/sigs/neg68.vsbsl index 15966211aa0..78c34e95539 100644 --- a/tests/fsharp/typecheck/sigs/neg68.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg68.vsbsl @@ -3,6 +3,6 @@ neg68.fsx(71,46,71,47): parse error FS0010: Unexpected symbol ')' in binding. Ex neg68.fsx(71,46,71,47): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. -neg68.fsx(123,40,123,41): typecheck error FS0001: The type 'bool' does not match the type 'float<'u>' +neg68.fsx(123,40,123,41): typecheck error FS0001: The types 'float, bool' do not support the operator '*' -neg68.fsx(123,38,123,39): typecheck error FS0043: The type 'bool' does not match the type 'float<'u>' +neg68.fsx(123,38,123,39): typecheck error FS0043: The types 'float, bool' do not support the operator '*' diff --git a/tests/fsharp/typecheck/sigs/neg74.vsbsl b/tests/fsharp/typecheck/sigs/neg74.vsbsl index 609fcc1264e..dbc4c7436ac 100644 --- a/tests/fsharp/typecheck/sigs/neg74.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg74.vsbsl @@ -111,4 +111,4 @@ neg74.fsx(242,1,242,3): parse error FS0058: Possible incorrect indentation: this neg74.fsx(254,1,254,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file -neg74.fsx(183,52,183,53): typecheck error FS0043: The type 'unit' does not match the type 'float' +neg74.fsx(183,52,183,53): typecheck error FS0043: The types 'float, unit' do not support the operator '+' diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs index eaefd989c14..5ef920389e7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs @@ -3,8 +3,8 @@ // These are pretty pathological cases related to ";;" and "in" // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. -//The type 'int' does not match the type 'unit'$ -//Type mismatch\. Expecting a. ''a -> 'b' .but given a. ''a -> unit' .The type 'int' does not match the type 'unit'$ +//The types 'unit, int' do not support the operator '+'$ +//The types 'unit, int' do not support the operator '+'$ //The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ module E = let a = 3 in diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx index ad279dbc4de..ddfad446795 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx @@ -16,14 +16,14 @@ let f4 x = (x : decimal) + "" exit 1 -//The type 'int' does not match the type 'string' -//The type 'int' does not match the type 'string' -//The type 'byte' does not match the type 'string' -//The type 'byte' does not match the type 'string' +//The types 'string, int' do not support the operator '+' +//The types 'string, int' do not support the operator '+' +//The types 'string, byte' do not support the operator '+' +//The types 'string, byte' do not support the operator '+' //This expression was expected to have type. 'float' .but here has type. 'int' -//The type 'int' does not match the type 'float' -//The type 'int' does not match the type 'float' -//The type 'decimal' does not match the type 'float32' -//The type 'decimal' does not match the type 'float32' -//The type 'string' does not match the type 'decimal' -//The type 'string' does not match the type 'decimal' +//The types 'float, int' do not support the operator '+' +//The types 'float, int' do not support the operator '+' +//The types 'float32, decimal' do not support the operator '+' +//The types 'float32, decimal' do not support the operator '+' +//The types 'decimal, string' do not support the operator '+' +//The types 'decimal, string' do not support the operator '+' diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ConstraintCall1.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ConstraintCall1.fs index 6686176a6b0..78855047688 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ConstraintCall1.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ConstraintCall1.fs @@ -1,4 +1,4 @@ // #Conformance #ConstraintCall -//None of the types 'int, bool, string' support the operator 'M' +//The types 'int, bool, string' do not support the operator 'M' let inline h (x, y, z) = ((^a or ^b or ^c) : (static member M : ^a * ^b * ^c -> ^d) (x,y,z)) let _ : int = h (1,false,"") diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ExplicitMemberConstraints2.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ExplicitMemberConstraints2.fs index 70699d463f2..e0ea03b1a4f 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ExplicitMemberConstraints2.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_ExplicitMemberConstraints2.fs @@ -1,5 +1,5 @@ // #Conformance #TypeConstraints -//None of the types 'bool, int, string' support the operator 'get_M' +//The types 'bool, int, string' do not support the operator 'get_M' let inline g< ^t, ^u, ^v when (^t or ^u or ^v) : (static member M : string)>() = 0 diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs index deb1f392352..b295ea22dc4 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs @@ -1,106 +1,106 @@ // #Regression #Conformance #TypeConstraints // Regression test for CTP bug reported at http://cs.hubfs.net/forums/thread/9313.aspx // In CTP, this was a stack overflow in the compiler. Now we give 64 errors -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined +//The types 'int32, uint32' do not support the operator '+' +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator '+' +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator '+' +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator '+' +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator '+' +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P1' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P2' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P3' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P4' is not defined. +// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0039: The value or constructor 'P4' is not defined. module SmartHashUtils = let ByteToUInt (array:byte[]) offset length endian = diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_NullableOperators01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_NullableOperators01.fs index fbe1aab5902..e06477bf638 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_NullableOperators01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_NullableOperators01.fs @@ -25,7 +25,7 @@ let _ = iq ? iq -//None of the types 'System\.Nullable, int' support the operator '\?>='\. Consider opening the module 'Microsoft\.FSharp\.Linq\.NullableOperators'\.$ +//The types 'System\.Nullable, int' do not support the operator '\?>='\. Consider opening the module 'Microsoft\.FSharp\.Linq\.NullableOperators'\.$ //The type 'System\.Nullable' does not support the operator '\?>'\. Consider opening the module 'Microsoft\.FSharp\.Linq\.NullableOperators'\.$ //The type 'System\.Nullable' does not support the operator '\?<='\. Consider opening the module 'Microsoft\.FSharp\.Linq\.NullableOperators'\.$ //The type 'System\.Nullable' does not support the operator '\?<'\. Consider opening the module 'Microsoft\.FSharp\.Linq\.NullableOperators'\.$ diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index cd1589117ad..85a39030e94 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -1122,8 +1122,7 @@ type UsingMSBuild() as this = MoveCursorToEndOfMarker(file2,"#load @\"Fi") let ans = GetSquiggleAtCursor(file2) - AssertSquiggleIsErrorContaining(ans, "'string'") - AssertSquiggleIsErrorContaining(ans, "'int'") + AssertSquiggleIsErrorContaining(ans, "'int, string'") AssertSquiggleIsErrorNotContaining(ans, "foo") // In this bug the .fsx project directory was wrong so it couldn't reference a relative file. From 8f8c0b3a7aada79cfb3598f8b3e3d9d7000916d8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Feb 2020 12:51:11 +0000 Subject: [PATCH 21/82] PR for trials related to FS-1043 (#8404) * weak resolution hack test * do weak overload resolution in fewer places * merge feature/ext --- src/fsharp/ConstraintSolver.fs | 27 ++++++++++++++++----------- src/fsharp/ConstraintSolver.fsi | 2 +- src/fsharp/TypeChecker.fs | 21 +++++++++++++++------ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index a03b1911088..70fb8723440 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -310,9 +310,12 @@ let rec occursCheck g un ty = /// During code gen we run with permitWeakResolution on, but we only apply it where one of the argument types for the built-in constraint resolution is /// a variable type. type PermitWeakResolution = - | Yes of codegen: bool + | YesAtInlineGeneralization + | YesAtResolution + | YesAtCodeGen | No - member x.Permit = match x with Yes _ -> true | No -> false + member x.PerformWeakBuiltInResolution = match x with YesAtInlineGeneralization | YesAtResolution | YesAtCodeGen -> true | No -> false + member x.PerformWeakOverloadResolution = match x with YesAtResolution -> true | YesAtInlineGeneralization | YesAtCodeGen | No -> false let rec isNativeIntegerTy g ty = typeEquivAux EraseMeasures g g.nativeint_ty ty || @@ -410,7 +413,8 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we // ignore the possibility that method overloads may resolve the constraint - | PermitWeakResolution.Yes false -> + | PermitWeakResolution.YesAtInlineGeneralization + | PermitWeakResolution.YesAtResolution -> // weak resolution lets the other type be a variable type isTyparTy g ty2 || // If the other type is not a variable type, it is nominal, @@ -419,7 +423,7 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = typeEquivAux EraseMeasures g ty1 ty2 // During codegen we only apply a builtin resolution if both the types are correct - | PermitWeakResolution.Yes true -> + | PermitWeakResolution.YesAtCodeGen -> p2 ty2 && // All built-in rules only apply in cases where left and right operator types are equal (after // erasing units) @@ -1603,7 +1607,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // If there's nothing left to learn then raise the errors. // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability // reasons we use the more restrictive isNil frees. - if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + if (permitWeakResolution.PerformWeakOverloadResolution && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors else do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees @@ -1709,7 +1713,7 @@ and GetRelevantExtensionMethodsForTrait m (amap: Import.ImportMap) (traitInfo: T /// That is, don't perform resolution if more nominal information may influence the set of available overloads and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, extSlns, ad) as traitInfo) : MethInfo list = let results = - if permitWeakResolution.Permit || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then + if permitWeakResolution.PerformWeakOverloadResolution || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m let minfos = match memFlags.MemberKind with @@ -1816,8 +1820,9 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (pe let csenv = { csenv with m = m2 } SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) -and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps = - SolveRelevantMemberConstraints csenv ndeep (PermitWeakResolution.Yes false) trace tps +and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps isInline = + let permitWeakResolution = (if isInline then PermitWeakResolution.YesAtInlineGeneralization else PermitWeakResolution.YesAtResolution) + SolveRelevantMemberConstraints csenv ndeep permitWeakResolution trace tps and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) traitInfo support (frees: Typar list) = let g = csenv.g @@ -3080,7 +3085,7 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let! _res = SolveMemberConstraint csenv true (PermitWeakResolution.Yes true) 0 m NoTrace traitInfo + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.YesAtCodeGen 0 m NoTrace traitInfo let sln = match traitInfo.Solution with @@ -3225,11 +3230,11 @@ let CheckDeclaredTypars denv css m typars1 typars2 = ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult -let CanonicalizePartialInferenceProblem css denv m tps = +let CanonicalizePartialInferenceProblem css denv m tps isInline = // Canonicalize constraints prior to generalization let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv TryD_IgnoreAbortForFailedOverloadResolution - (fun () -> CanonicalizeRelevantMemberConstraints csenv 0 NoTrace tps) + (fun () -> CanonicalizeRelevantMemberConstraints csenv 0 NoTrace tps isInline) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 4045d26f9d9..3089ac2337c 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -190,4 +190,4 @@ val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool -val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit \ No newline at end of file +val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit \ No newline at end of file diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index be49db4ec89..dd9c575f885 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -6772,7 +6772,7 @@ and TcObjectExprBinding cenv (env: TcEnv) implty tpenv (absSlotInfo, bind) = | _ -> declaredTypars // Canonicalize constraints prior to generalization - ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv m declaredTypars + ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv m declaredTypars true let freeInEnv = GeneralizationHelpers.ComputeUngeneralizableTypars env @@ -9862,7 +9862,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela // Canonicalize inference problem prior to '.' lookup on variable types if isTyparTy cenv.g objExprTy then - ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight cenv.g false objExprTy) + ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight cenv.g false objExprTy) false let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId findFlag false let mExprAndItem = unionRanges mObjExpr mItem @@ -10410,8 +10410,8 @@ and TcMethodApplication // about the possible target of the call. if not uniquelyResolved then ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv mItem - (//freeInTypeLeftToRight cenv.g false returnTy @ - (unnamedCurriedCallerArgs |> List.collectSquared (fun callerArg -> freeInTypeLeftToRight cenv.g false callerArg.Type))) + (unnamedCurriedCallerArgs |> List.collectSquared (fun callerArg -> freeInTypeLeftToRight cenv.g false callerArg.Type)) + false let result, errors = ResolveOverloadingForCall denv cenv.css mMethExpr methodName 0 None callerArgCounts ad postArgumentTypeCheckingCalledMethGroup true (Some returnTy) @@ -11371,12 +11371,17 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds // Canonicalize constraints prior to generalization let denv = env.DisplayEnv + let isInline = + (checkedBinds |> List.forall (fun tbinfo -> + let (CheckedBindingInfo(inl, _, _, _, _, _, _, _, _, _, _, _, _, _)) = tbinfo + (inl = ValInline.PseudoVal))) ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv synBindsRange (checkedBinds |> List.collect (fun tbinfo -> let (CheckedBindingInfo(_, _, _, _, flex, _, _, _, tauTy, _, _, _, _, _)) = tbinfo let (ExplicitTyparInfo(_, declaredTypars, _)) = flex let maxInferredTypars = (freeInTypeLeftToRight cenv.g false tauTy) declaredTypars @ maxInferredTypars)) + isInline let lazyFreeInEnv = lazy (GeneralizationHelpers.ComputeUngeneralizableTypars env) @@ -12246,7 +12251,11 @@ and TcIncrementalLetRecGeneralization cenv scopem else let supportForBindings = newGeneralizableBindings |> List.collect (TcLetrecComputeSupportForBinding cenv) - ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv scopem supportForBindings + let isInline = + (newGeneralizableBindings |> List.forall (fun tbinfo -> + let (CheckedBindingInfo(inl, _, _, _, _, _, _, _, _, _, _, _, _, _)) = tbinfo.CheckedBinding + (inl = ValInline.PseudoVal))) + ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denv scopem supportForBindings isInline let generalizedTyparsL = newGeneralizableBindings |> List.map (TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv) @@ -17751,7 +17760,7 @@ let ApplyDefaults cenv g denvAtEnd m mexpr extraAttribs = try let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) - ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denvAtEnd m unsolved + ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denvAtEnd m unsolved false // The priority order comes from the order of declaration of the defaults in FSharp.Core. for priority = 10 downto 0 do From a06c2ee8f39b9cd5dde2c234ed4ea9db45d795da Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Feb 2020 14:05:42 +0000 Subject: [PATCH 22/82] fix baseline --- .../BindingExpressions/Binding/in05.fs | 4 +- .../BindingExpressions/Binding/in05.fsx | 2 +- .../E_RigidTypeAnnotation02.fsx | 20 ++-- .../CheckingSyntacticTypes/E_Regression02.fs | 100 +++++++++--------- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs index 5ef920389e7..9e8f6acf09a 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fs @@ -3,8 +3,8 @@ // These are pretty pathological cases related to ";;" and "in" // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. -//The types 'unit, int' do not support the operator '+'$ -//The types 'unit, int' do not support the operator '+'$ +//The types 'unit, int' do not support the operator +//The types 'unit, int' do not support the operator //The result of this expression has type 'bool' and is implicitly ignored\. Consider using 'ignore' to discard this value explicitly, e\.g\. 'expr \|> ignore', or 'let' to bind the result to a name, e\.g\. 'let result = expr'.$ module E = let a = 3 in diff --git a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fsx b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fsx index 2b8f8265d99..b6f62042f92 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/BindingExpressions/Binding/in05.fsx @@ -3,7 +3,7 @@ // These are pretty pathological cases related to ";;" and "in" // I'm adding these cases to make sure we do not accidentally change the behavior from version to version // Eventually, we will deprecated them - and the specs will be updated. -//The type 'int' does not match the type 'unit'$ +//The types 'unit, int' do not support the operator let a = 3 in a + 1 |> ignore diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx index ddfad446795..c5e4273fbf9 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx @@ -16,14 +16,14 @@ let f4 x = (x : decimal) + "" exit 1 -//The types 'string, int' do not support the operator '+' -//The types 'string, int' do not support the operator '+' -//The types 'string, byte' do not support the operator '+' -//The types 'string, byte' do not support the operator '+' +//The types 'string, int' do not support the operator +//The types 'string, int' do not support the operator +//The types 'string, byte' do not support the operator +//The types 'string, byte' do not support the operator //This expression was expected to have type. 'float' .but here has type. 'int' -//The types 'float, int' do not support the operator '+' -//The types 'float, int' do not support the operator '+' -//The types 'float32, decimal' do not support the operator '+' -//The types 'float32, decimal' do not support the operator '+' -//The types 'decimal, string' do not support the operator '+' -//The types 'decimal, string' do not support the operator '+' +//The types 'float, int' do not support the operator +//The types 'float, int' do not support the operator +//The types 'float32, decimal' do not support the operator +//The types 'float32, decimal' do not support the operator +//The types 'decimal, string' do not support the operator +//The types 'decimal, string' do not support the operator diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs index b295ea22dc4..eab23384106 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs @@ -1,105 +1,105 @@ // #Regression #Conformance #TypeConstraints // Regression test for CTP bug reported at http://cs.hubfs.net/forums/thread/9313.aspx // In CTP, this was a stack overflow in the compiler. Now we give 64 errors -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator '+' +//The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P4' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator '+' +// FS0001: The types 'int32, uint32' do not support the operator // FS0039: The value or constructor 'P4' is not defined. module SmartHashUtils = let ByteToUInt (array:byte[]) offset length endian = From 7f5a0c24e3270cb5a3eaf6daa7060c2961945fc8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Feb 2020 15:16:51 +0000 Subject: [PATCH 23/82] fix baseline --- .../CheckingSyntacticTypes/E_Regression02.fs | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs index eab23384106..2ce01147daa 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs @@ -12,95 +12,95 @@ //The types 'int32, uint32' do not support the operator //The value or constructor 'P1' is not defined. //The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P1' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P2' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P3' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P4' is not defined. -// FS0001: The types 'int32, uint32' do not support the operator -// FS0039: The value or constructor 'P4' is not defined. +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P1' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P2' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P3' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P4' is not defined. +//The types 'int32, uint32' do not support the operator +//The value or constructor 'P4' is not defined. module SmartHashUtils = let ByteToUInt (array:byte[]) offset length endian = From d49b8277397f1210e2cbe71f252c45ef6b05699d Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Feb 2020 17:57:03 +0000 Subject: [PATCH 24/82] better version checks --- src/fsharp/ConstraintSolver.fs | 38 ++++-- tests/fsharp/core/subtype/test.fsx | 28 +++++ tests/fsharp/single-test.fs | 6 +- tests/fsharp/tests.fs | 115 +++++++++++++----- .../sigs/{neg126.bsl => neg126.4.7.bsl} | 0 .../fsharp/typecheck/sigs/neg126.preview.bsl | 2 - .../sigs/{neg128.bsl => neg128.4.7.bsl} | 0 .../fsharp/typecheck/sigs/neg128.preview.bsl | 2 - .../sigs/{neg129.bsl => neg129.4.7.bsl} | 0 .../fsharp/typecheck/sigs/neg129.preview.bsl | 2 - tests/fsharp/typecheck/sigs/pos35.fs | 4 +- 11 files changed, 146 insertions(+), 51 deletions(-) rename tests/fsharp/typecheck/sigs/{neg126.bsl => neg126.4.7.bsl} (100%) delete mode 100644 tests/fsharp/typecheck/sigs/neg126.preview.bsl rename tests/fsharp/typecheck/sigs/{neg128.bsl => neg128.4.7.bsl} (100%) delete mode 100644 tests/fsharp/typecheck/sigs/neg128.preview.bsl rename tests/fsharp/typecheck/sigs/{neg129.bsl => neg129.4.7.bsl} (100%) delete mode 100644 tests/fsharp/typecheck/sigs/neg129.preview.bsl diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 70fb8723440..ba92fc5bb47 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -310,12 +310,36 @@ let rec occursCheck g un ty = /// During code gen we run with permitWeakResolution on, but we only apply it where one of the argument types for the built-in constraint resolution is /// a variable type. type PermitWeakResolution = + + /// Represents the point where we are generalizing inline code | YesAtInlineGeneralization - | YesAtResolution + + /// Represents points where we are choosing a default solution to trait constraints + | YesAtChooseSolution + + /// Represents legacy invocations of the constraint solver during codegen | YesAtCodeGen + + /// No weak resolution allowed | No - member x.PerformWeakBuiltInResolution = match x with YesAtInlineGeneralization | YesAtResolution | YesAtCodeGen -> true | No -> false - member x.PerformWeakOverloadResolution = match x with YesAtResolution -> true | YesAtInlineGeneralization | YesAtCodeGen | No -> false + + /// Determine if the weak resolution flag means we perform overload resolution + /// based on weak information. + member x.PerformWeakOverloadResolution (g: TcGlobals) = + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + match x with + | YesAtChooseSolution -> true + | YesAtInlineGeneralization + | YesAtCodeGen + | No -> false + else + //legacy + match x with + | YesAtChooseSolution -> true + | YesAtCodeGen -> true + | YesAtInlineGeneralization -> true + | No -> false + let rec isNativeIntegerTy g ty = typeEquivAux EraseMeasures g g.nativeint_ty ty || @@ -414,7 +438,7 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we // ignore the possibility that method overloads may resolve the constraint | PermitWeakResolution.YesAtInlineGeneralization - | PermitWeakResolution.YesAtResolution -> + | PermitWeakResolution.YesAtChooseSolution -> // weak resolution lets the other type be a variable type isTyparTy g ty2 || // If the other type is not a variable type, it is nominal, @@ -1607,7 +1631,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // If there's nothing left to learn then raise the errors. // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability // reasons we use the more restrictive isNil frees. - if (permitWeakResolution.PerformWeakOverloadResolution && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + if (permitWeakResolution.PerformWeakOverloadResolution g && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors else do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees @@ -1713,7 +1737,7 @@ and GetRelevantExtensionMethodsForTrait m (amap: Import.ImportMap) (traitInfo: T /// That is, don't perform resolution if more nominal information may influence the set of available overloads and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, extSlns, ad) as traitInfo) : MethInfo list = let results = - if permitWeakResolution.PerformWeakOverloadResolution || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then + if permitWeakResolution.PerformWeakOverloadResolution csenv.g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m let minfos = match memFlags.MemberKind with @@ -1821,7 +1845,7 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (pe SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps isInline = - let permitWeakResolution = (if isInline then PermitWeakResolution.YesAtInlineGeneralization else PermitWeakResolution.YesAtResolution) + let permitWeakResolution = (if isInline then PermitWeakResolution.YesAtInlineGeneralization else PermitWeakResolution.YesAtChooseSolution) SolveRelevantMemberConstraints csenv ndeep permitWeakResolution trace tps and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) traitInfo support (frees: Typar list) = diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index cb4995e2a70..9573d0a36b2 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1979,6 +1979,34 @@ module TestConverter = test "cenwceoiwe2" ((id |> toConverter |> fromConverter |> toConverter2 |> implicitConv) 6 = 6) #endif +// See https://github.com/dotnet/fsharp/issues/3814#issuecomment-441048460 +module TestAnotherCaseOfSRTP = + + type X = + static member Method (a: int) = 2 + static member Method (a: int64) = 3 + + + let inline Test< ^t, ^a when (^t or ^a): (static member Method: ^a -> int)> (value: ^a) = + ( (^t or ^a): (static member Method: ^a -> int)(value)) + + let inline Test2< ^t when (X or ^t) : (static member Method : ^t -> int)> a = Test a + + check "fweew-0wve" (Test2 0) 2 + +// See https://github.com/dotnet/fsharp/issues/3814#issuecomment-395686007 +module YetTestAnotherCaseOfSRTP = + type X = + static member Method (a: int) = 2 + static member Method (a: int64) = 3 + + + let inline Test< ^t, ^a when ^t: (static member Method: ^a -> int)> (value: ^a) = + ( ^t: (static member Method: ^a -> int)(value)) + + let inline Test2< ^t> a = Test a + + check "vwevwepovwe" (Test2 0) 2 #if TESTS_AS_APP let RUN() = !failures diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 11d2cd71b1e..4f5e227cbb1 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -416,10 +416,8 @@ let singleVersionedNegTest (cfg: TestConfig) version testname = ] - if fileExists cfg (testname + "-pre.fs") - then - fsc cfg "%s -a -o:%s-pre.dll" cfg.fsc_flags testname [testname + "-pre.fs"] - else () + if fileExists cfg (testname + "-pre.fs") then + fsc cfg "%s -a -o:%s-pre.dll" cfg.fsc_flags testname [testname + "-pre.fs"] if fileExists cfg (testname + "-pre.fsx") then fsi_script cfg "--exec %s %s %s" diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 43c01182ad1..66f5b296d3b 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2259,10 +2259,11 @@ module TypecheckTests = fsc cfg "%s --target:library -o:pos35.dll --warnaserror" cfg.fsc_flags ["pos35.fs"] peverify cfg "pos35.dll" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``sigs pos35 preview (now negative)`` () = - singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "pos35" + let ``sigs pos35 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:pos35.dll --warnaserror --langversion:preview" cfg.fsc_flags ["pos35.fs"] + peverify cfg "pos35.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] @@ -2749,8 +2750,9 @@ module TypecheckTests = [] let ``type check neg93`` () = singleNegTest (testConfig "typecheck/sigs") "neg93" + // The code in the "pre" file no longer compiles in "preview". This is by design - an extra type annotation is needed. [] - let ``type check neg94`` () = singleNegTest (testConfig "typecheck/sigs") "neg94" + let ``type check neg94 langversion 4_7`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg94" [] let ``type check neg95`` () = singleNegTest (testConfig "typecheck/sigs") "neg95" @@ -2822,81 +2824,130 @@ module TypecheckTests = [] let ``type check neg117`` () = singleNegTest (testConfig "typecheck/sigs") "neg117" + // We also run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + // This test can replace the one above once RFC-1043 is activated in default language version + [] + let ``type check neg117 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:neg117-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg117.fs"] + peverify cfg "neg117-preview.dll" + [] let ``type check neg118`` () = singleNegTest (testConfig "typecheck/sigs") "neg118" [] let ``type check neg119`` () = singleNegTest (testConfig "typecheck/sigs") "neg119" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] let ``type check neg120`` () = singleNegTest (testConfig "typecheck/sigs") "neg120" [] - let ``type check neg121`` () = singleNegTest (testConfig "typecheck/sigs") "neg121" + let ``type check neg120 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg120" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg122`` () = singleNegTest (testConfig "typecheck/sigs") "neg122" + let ``type check neg121`` () = singleNegTest (testConfig "typecheck/sigs") "neg121" + // The code in this test fails to compile even when FS-1043 is enabled - this is expected. + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and may be affected by RFC FS-1043 [] - let ``type check neg123`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg123" + let ``type check neg121 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg121" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg124`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg124" + let ``type check neg122`` () = singleNegTest (testConfig "typecheck/sigs") "neg122" [] - let ``type check neg125`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg125" + let ``type check neg122 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg122" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg126`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg126" + let ``type check neg123`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg123" [] - let ``type check neg127`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg127" + let ``type check neg123 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg123" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg128`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg128" + let ``type check neg124`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg124" [] - let ``type check neg129`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg129" + let ``type check neg124 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg124" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg120 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg120" + let ``type check neg125`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg125" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg121 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg121" + let ``type check neg125 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg125" + // The code in this test starts to compile once FS-1043 is enabled. + // // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg122 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg122" + let ``type check neg126`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg126" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg123 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg123" + let ``type check neg126 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:neg126-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg126.fs"] + peverify cfg "neg126-preview.dll" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:4.7 and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 [] - let ``type check neg124 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg124" + let ``type check neg127 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "" "neg127" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg125 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg125" + let ``type check neg127 preview`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg127" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + // The code in this test starts to compile once FS-1043 is enabled. [] - let ``type check neg126 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg126" + let ``type check neg128 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg128" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg127 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg127" + let ``type check neg128 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:neg128-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg128.fs"] + peverify cfg "neg128-preview.dll" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview + // The code in this test starts to compile once FS-1043 is enabled. [] - let ``type check neg128 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg128" + let ``type check neg129 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg129" - // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] - let ``type check neg129 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg129" + let ``type check neg129 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s --target:library -o:neg129-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg129.fs"] + peverify cfg "neg129-preview.dll" [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg126.bsl b/tests/fsharp/typecheck/sigs/neg126.4.7.bsl similarity index 100% rename from tests/fsharp/typecheck/sigs/neg126.bsl rename to tests/fsharp/typecheck/sigs/neg126.4.7.bsl diff --git a/tests/fsharp/typecheck/sigs/neg126.preview.bsl b/tests/fsharp/typecheck/sigs/neg126.preview.bsl deleted file mode 100644 index b8808b85143..00000000000 --- a/tests/fsharp/typecheck/sigs/neg126.preview.bsl +++ /dev/null @@ -1,2 +0,0 @@ - -neg126.fs(30,32,30,48): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'sbyte'. diff --git a/tests/fsharp/typecheck/sigs/neg128.bsl b/tests/fsharp/typecheck/sigs/neg128.4.7.bsl similarity index 100% rename from tests/fsharp/typecheck/sigs/neg128.bsl rename to tests/fsharp/typecheck/sigs/neg128.4.7.bsl diff --git a/tests/fsharp/typecheck/sigs/neg128.preview.bsl b/tests/fsharp/typecheck/sigs/neg128.preview.bsl deleted file mode 100644 index 3d91ad25b52..00000000000 --- a/tests/fsharp/typecheck/sigs/neg128.preview.bsl +++ /dev/null @@ -1,2 +0,0 @@ - -neg128.fs(36,47,36,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg129.bsl b/tests/fsharp/typecheck/sigs/neg129.4.7.bsl similarity index 100% rename from tests/fsharp/typecheck/sigs/neg129.bsl rename to tests/fsharp/typecheck/sigs/neg129.4.7.bsl diff --git a/tests/fsharp/typecheck/sigs/neg129.preview.bsl b/tests/fsharp/typecheck/sigs/neg129.preview.bsl deleted file mode 100644 index 8e34cc5331d..00000000000 --- a/tests/fsharp/typecheck/sigs/neg129.preview.bsl +++ /dev/null @@ -1,2 +0,0 @@ - -neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/pos35.fs b/tests/fsharp/typecheck/sigs/pos35.fs index b2b1fb79156..73a104bb171 100644 --- a/tests/fsharp/typecheck/sigs/pos35.fs +++ b/tests/fsharp/typecheck/sigs/pos35.fs @@ -308,8 +308,8 @@ module PositiveTestCase3 = let inline CallQuackWitness (x: ^a, output: ^Output, witnesses: ^Witnesses) = ((^a or ^Output or ^Witnesses) : (static member QuackWitness : _*_*_ -> _) (x, output, witnesses)) - // This becomes a negative test when RFC FS-1043 is enabled, because the existence of the extension - // members is now taken into account + // This requires the rule "Weak resolution no longer forces overload resolution for SRTP constraints prior + // to generalizing inline code" that is part of RFC FS-1043 let inline call (x: seq< ^b > ) : ^Output = CallQuackWitness (x, Unchecked.defaultof< ^Output >, Unchecked.defaultof) From e9b569d746aaa0207471bc436e56715149ebab5f Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 5 Feb 2020 12:25:04 +0000 Subject: [PATCH 25/82] update test files --- tests/fsharp/core/subtype/test.fsx | 56 ---- tests/fsharp/tests.fs | 20 ++ tests/fsharp/typecheck/sigs/neg129.fs | 2 +- tests/fsharp/typecheck/sigs/neg130.4.7.bsl | 16 + tests/fsharp/typecheck/sigs/neg130.fs | 48 +++ tests/fsharp/typecheck/sigs/neg131.bsl | 256 ++++++++++++++ tests/fsharp/typecheck/sigs/neg131.fs | 214 ++++++++++++ .../CheckingSyntacticTypes/E_Regression02.fs | 315 ------------------ .../CheckingSyntacticTypes/env.lst | 1 - 9 files changed, 555 insertions(+), 373 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg130.4.7.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg130.fs create mode 100644 tests/fsharp/typecheck/sigs/neg131.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg131.fs delete mode 100644 tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index 9573d0a36b2..ae4b8f3f34b 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1764,48 +1764,6 @@ module GenericPropertyConstraintSolvedByRecord = let v = print_foo_memb { foo=1 } -/// In this case, the presence of the Method(obj) overload meant overload resolution was being applied and resolving to that -/// overload, even before the full signature of the trait constraint was known. -module MethodOverloadingForTraitConstraintsIsNotDeterminedUntilSignatureIsKnnown = - type X = - static member Method (a: obj) = 1 - static member Method (a: int) = 2 - static member Method (a: int64) = 3 - - - let inline Test< ^t, ^a when ^t: (static member Method: ^a -> int)> (value: ^a) = - ( ^t: (static member Method: ^a -> int)(value)) - - let inline Test2< ^t> a = Test a - - // This test has been added to pin down current behaviour pending a future bug fix. - check "slvde0vver90u1" (Test2 0) 1 - check "slvde0vver90u2" (Test2 0L) 1 - -/// In this case, the presence of the "Equals" method on System.Object was causing method overloading to be resolved too -/// early, when ^t was not yet known. The underlying problem was that we were proceeding with weak resolution -/// even for a single-support-type trait constraint. -module MethodOverloadingForTraitConstraintsWhereSomeMethodsComeFromObjectTypeIsNotDeterminedTooEarly = - type Test() = - member __.Equals (_: Test) = true - - //let inline Equals(a: obj) (b: ^t) = - // match a with - // | :? ^t as x -> (^t: (member Equals: ^t -> bool) (b, x)) - // | _-> false - - let a = Test() - let b = Test() - - // NOTE, this is seen to be a bug, see https://github.com/Microsoft/visualfsharp/issues/3814 - // - // The result should be true. - // - // This test should be added to pin down current behaviour pending a future bug fix. - // - // However the code generated fails peverify.exe so even the pin-down test has been removed for now. - //check "cewjewcwec09ew" (Equals a b) false - module SRTPFix = open System @@ -1994,20 +1952,6 @@ module TestAnotherCaseOfSRTP = check "fweew-0wve" (Test2 0) 2 -// See https://github.com/dotnet/fsharp/issues/3814#issuecomment-395686007 -module YetTestAnotherCaseOfSRTP = - type X = - static member Method (a: int) = 2 - static member Method (a: int64) = 3 - - - let inline Test< ^t, ^a when ^t: (static member Method: ^a -> int)> (value: ^a) = - ( ^t: (static member Method: ^a -> int)(value)) - - let inline Test2< ^t> a = Test a - - check "vwevwepovwe" (Test2 0) 2 - #if TESTS_AS_APP let RUN() = !failures #else diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 66f5b296d3b..9617e269861 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2949,6 +2949,26 @@ module TypecheckTests = fsc cfg "%s --target:library -o:neg129-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg129.fs"] peverify cfg "neg129-preview.dll" + // The code in this test starts to compile once FS-1043 is enabled. + [] + let ``type check neg130 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg130" + + [] + let ``type check neg130 preview`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s -o:neg130-preview.exe --langversion:preview --warnaserror" cfg.fsc_flags ["neg130.fs"] + peverify cfg "neg130-preview.exe" + exec cfg ("." ++ "neg130-preview.exe") "" + + [] + let ``type check neg131 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg131" + + [] + let ``type check neg131 preview`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg131" + [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg129.fs b/tests/fsharp/typecheck/sigs/neg129.fs index d65671900bd..1daa9c1c2db 100644 --- a/tests/fsharp/typecheck/sigs/neg129.fs +++ b/tests/fsharp/typecheck/sigs/neg129.fs @@ -1,5 +1,5 @@ module Neg129 - +// The code in this test starts to compile once FS-1043 is enabled. // Variation on test case mentioned in https://github.com/dotnet/fsharp/pull/6805#issuecomment-580368303 // // This removes ^output as a type selector for the witness, but continues to pass a dummy ^output diff --git a/tests/fsharp/typecheck/sigs/neg130.4.7.bsl b/tests/fsharp/typecheck/sigs/neg130.4.7.bsl new file mode 100644 index 00000000000..5efa2ece8d7 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg130.4.7.bsl @@ -0,0 +1,16 @@ + +neg130.fs(15,31,15,35): typecheck error FS0043: No overloads match for method 'Method'. The available overloads are shown below. +neg130.fs(15,31,15,35): typecheck error FS0043: Possible overload: 'static member X.Method : a:int64 -> int'. Type constraint mismatch. The type + ''t' +is not compatible with type + 'int64' +. +neg130.fs(15,31,15,35): typecheck error FS0043: Possible overload: 'static member X.Method : a:int -> int'. Type constraint mismatch. The type + ''t' +is not compatible with type + 'int' +. + +neg130.fs(17,8,17,13): typecheck error FS0039: The value or constructor 'Test2' is not defined. Maybe you want one of the following: + Test + Text diff --git a/tests/fsharp/typecheck/sigs/neg130.fs b/tests/fsharp/typecheck/sigs/neg130.fs new file mode 100644 index 00000000000..9e1ddbf9442 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg130.fs @@ -0,0 +1,48 @@ +module Neg130 + + +// The code in this test starts to compile once FS-1043 is enabled. +// See https://github.com/dotnet/fsharp/issues/3814#issuecomment-395686007 +module YetTestAnotherCaseOfSRTP = + type X = + static member Method (a: int) = 2 + static member Method (a: int64) = 3 + + + let inline Test< ^t, ^a when ^t: (static member Method: ^a -> int)> (value: ^a) = + ( ^t: (static member Method: ^a -> int)(value)) + + let inline Test2< ^t> a = Test a + + if Test2 0 <> 2 then + printfn "test failed" + exit 1 + + +/// In this case, the presence of the "Equals" method on System.Object was causing method overloading to be resolved too +/// early, when ^t was not yet known. The underlying problem was that we were proceeding with weak resolution +/// even for a single-support-type trait constraint. +module MethodOverloadingForTraitConstraintsWhereSomeMethodsComeFromObjectTypeIsNotDeterminedTooEarly = + type Test() = + member __.Equals (_: Test) = true + + let inline Equals(a: obj) (b: ^t) = + match a with + | :? ^t as x -> (^t: (member Equals: ^t -> bool) (b, x)) + | _-> false + + let a = Test() + let b = Test() + + // NOTE, this was a bug fixed by RFC FS-1043, see https://github.com/Microsoft/visualfsharp/issues/3814 + // + // The result should be true. + // + // This test has been added to pin down current behaviour pending a future bug fix. + if Equals a b <> true then + printfn "test failed" + exit 1 + + + + diff --git a/tests/fsharp/typecheck/sigs/neg131.bsl b/tests/fsharp/typecheck/sigs/neg131.bsl new file mode 100644 index 00000000000..afea02dfd55 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg131.bsl @@ -0,0 +1,256 @@ + +neg131.fs(143,23,143,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(143,27,143,29): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(144,22,144,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(144,25,144,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(145,22,145,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(145,25,145,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(146,22,146,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(146,25,146,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(147,22,147,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(147,25,147,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(148,22,148,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(148,25,148,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(149,22,149,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(149,25,149,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(150,22,150,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(150,25,150,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(151,22,151,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(151,25,151,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(152,22,152,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(152,25,152,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(153,22,153,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(153,25,153,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(154,22,154,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(154,25,154,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(155,22,155,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(155,25,155,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(156,22,156,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(156,25,156,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(157,22,157,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(157,25,157,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(158,22,158,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(158,25,158,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg131.fs(160,22,160,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(160,25,160,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(161,22,161,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(161,25,161,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(162,22,162,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(162,25,162,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(163,22,163,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(163,25,163,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(164,22,164,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(164,25,164,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(165,22,165,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(165,25,165,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(166,22,166,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(166,25,166,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(167,22,167,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(167,25,167,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(168,22,168,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(168,25,168,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(169,22,169,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(169,25,169,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(170,22,170,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(170,25,170,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(171,22,171,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(171,25,171,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(172,22,172,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(172,25,172,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(173,22,173,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(173,25,173,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(174,22,174,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(174,25,174,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(175,22,175,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(175,25,175,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg131.fs(177,22,177,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(177,25,177,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(178,22,178,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(178,25,178,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(179,22,179,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(179,25,179,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(180,22,180,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(180,25,180,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(181,22,181,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(181,25,181,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(182,22,182,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(182,25,182,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(183,22,183,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(183,25,183,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(184,22,184,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(184,25,184,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(185,22,185,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(185,25,185,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(186,22,186,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(186,25,186,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(187,22,187,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(187,25,187,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(188,22,188,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(188,25,188,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(189,22,189,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(189,25,189,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(190,22,190,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(190,25,190,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(191,22,191,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(191,25,191,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(192,22,192,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(192,25,192,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg131.fs(194,22,194,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(194,25,194,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(195,22,195,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(195,25,195,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(196,22,196,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(196,25,196,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(197,22,197,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(197,25,197,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(198,22,198,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(198,25,198,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(199,22,199,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(199,25,199,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(200,22,200,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(200,25,200,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(201,22,201,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(201,25,201,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(202,22,202,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(202,25,202,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(203,22,203,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(203,25,203,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(204,22,204,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(204,25,204,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(205,22,205,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(205,25,205,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(206,22,206,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(206,25,206,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(207,22,207,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(207,25,207,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(208,22,208,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(208,25,208,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg131.fs(209,22,209,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg131.fs(209,25,209,27): typecheck error FS0039: The value or constructor 'P4' is not defined. diff --git a/tests/fsharp/typecheck/sigs/neg131.fs b/tests/fsharp/typecheck/sigs/neg131.fs new file mode 100644 index 00000000000..9366d707a91 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg131.fs @@ -0,0 +1,214 @@ +module Neg131 + +module SmartHashUtils = + let ByteToUInt (array:byte[]) offset length endian = + + let temp:uint32[] = Array.create (length / 4) (uint32 0) + let ff = uint32 0xff + + match endian with + | 0 -> + let funn i n = + (uint32 array.[offset + i*4] &&& ff) ||| + ((uint32 array.[offset + i*4+1] &&& ff) <<< 8) ||| + ((uint32 array.[offset + i*4+2] &&& ff) <<< 16) ||| + ((uint32 array.[offset + i*4+3] &&& ff) <<< 24) + Array.mapi funn temp + | _ -> + let funn i n = + ((uint32 array.[offset + i*4] &&& ff) <<< 24) ||| + ((uint32 array.[offset + i*4+1] &&& ff) <<< 16) ||| + ((uint32 array.[offset + i*4+2] &&& ff) <<< 8) ||| + (uint32 array.[offset + i*4+3] &&& ff) + Array.mapi funn temp + + + let UIntToByte (array:uint32[]) offset length endian = + let temp:byte[] = Array.create (length * 4) (byte 0) + + match endian with + | 0 -> + let funn i n = byte (array.[offset + i/4] >>> (i%4 * 8)) + Array.mapi funn temp + | _ -> + let funn i n = byte (array.[offset + i/4] >>> ((3 - i%4) * 8)) + Array.mapi funn temp + + + let ULongToByte (array:uint64[]) offset length endian = + let temp:byte[] = Array.create (length * 8) (byte 0) + + match endian with + | 0 -> + let funn i n = byte (array.[offset + i/8] >>> (i%8 * 8)) + Array.mapi funn temp + | _ -> + let funn i n = byte (array.[offset + i/8] >>> ((7 - i%8) * 8)) + Array.mapi funn temp + + + let LS (x:uint32) n = uint32 ((x <<< n) ||| (x >>> (32 - n))) + let RS (x:uint32) n = uint32 ((x >>> n) ||| (x <<< (32 - n))) + +module SmartHashBlock = + open System.Security.Cryptography + + [] + type BlockHashAlgorithm() = + inherit HashAlgorithm() + ///The size in bytes of an individual block. + let mutable blockSize = 1 + ///The length of bytes, that have been processed. + ///This number includes the number of bytes currently waiting in the buffer. + let mutable count:uint64 = uint64 0 + ///Buffer for storing leftover bytes that are waiting to be processed. + let mutable buffer = Array.zeroCreate blockSize + ///The number of bytes currently in the Buffer waiting to be processed. + let mutable bufferCount = 0 + + member b.BlockSize with get() = blockSize and set(v) = blockSize <- v + member b.BufferCount with get() = bufferCount and set(v) = bufferCount <- v + member b.Count with get() = count and set(v) = count <- v + + default x.Initialize() = + count <- uint64 0 + bufferCount <- 0 + buffer <- Array.zeroCreate blockSize + + default x.HashCore(array, ibStart, cbSize) = + //let engineUpdate input offset' length' = + let mutable offset = ibStart + let mutable length = cbSize + count <- count + (uint64 length) + + if ((bufferCount > 0) && ((bufferCount + length) >= blockSize)) then + let off = blockSize - bufferCount + Array.blit array offset buffer bufferCount off + offset <- offset + off + length <- length - off + bufferCount <- 0 + x.BlockTransform (buffer, 0) + + let numBlocks = length / blockSize + for i in 0..(numBlocks-1) do + x.BlockTransform (array, (offset + i * blockSize)) + + let bytesLeft = length % blockSize + + if (bytesLeft <> 0) then + Array.blit array (offset + (length - bytesLeft)) buffer bufferCount bytesLeft + bufferCount <- bufferCount + bytesLeft + + abstract BlockTransform: (byte[] * int) -> unit + + member x.CreatePadding(minSize, append) = + let mutable paddingSize = x.BlockSize - ((int x.Count) % x.BlockSize) + + if (paddingSize < minSize) then paddingSize <- paddingSize + x.BlockSize + + let Padding = Array.create paddingSize (byte 0) + Padding.[0] <- append + Padding + +module SmartHashMD5 = + open SmartHashUtils + open SmartHashBlock + + + type MD5() as this = + inherit BlockHashAlgorithm() + ///The size in bytes of an individual block. + let mutable state:int32[] = null + + do this.BlockSize <- 64 + do this.HashSizeValue <- 128 + do state <- Array.zeroCreate 4 + do this.Initialize() + + override x.Initialize() = + base.Initialize() + state.[0] <- 0x67452301 + state.[1] <- 0xEFCDAB89 + state.[2] <- 0x98BADCFE + state.[3] <- 0x10325476 + + member x.BlockTransform(data, iOffset) = + let mutable A = state.[0] + let mutable B = state.[3] + let mutable C = state.[2] + let mutable D = state.[1] + + let X = ByteToUInt data iOffset 64 0 + + A <- D + LS (P1 D C B + A + X.[0] + uint32 0xD76AA478) 7 + B <- A + LS(P1 A D C + B + X.[1] + uint32 0xE8C7B756) 12 + C <- B + LS(P1 B A D + C + X.[2] + uint32 0x242070DB) 17 + D <- C + LS(P1 C B A + D + X.[3] + uint32 0xC1BDCEEE) 22 + A <- D + LS(P1 D C B + A + X.[4] + uint32 0xF57C0FAF) 7 + B <- A + LS(P1 A D C + B + X.[5] + uint32 0x4787C62A) 12 + C <- B + LS(P1 B A D + C + X.[6] + uint32 0xA8304613) 17 + D <- C + LS(P1 C B A + D + X.[7] + uint32 0xFD469501) 22 + A <- D + LS(P1 D C B + A + X.[8] + uint32 0x698098D8) 7 + B <- A + LS(P1 A D C + B + X.[9] + uint32 0x8B44F7AF) 12 + C <- B + LS(P1 B A D + C + X.[10] + uint32 0xFFFF5BB1) 17 + D <- C + LS(P1 C B A + D + X.[11] + uint32 0x895CD7BE) 22 + A <- D + LS(P1 D C B + A + X.[12] + uint32 0x6B901122) 7 + B <- A + LS(P1 A D C + B + X.[13] + uint32 0xFD987193) 12 + C <- B + LS(P1 B A D + C + X.[14] + uint32 0xA679438E) 17 + D <- C + LS(P1 C B A + D + X.[15] + uint32 0x49B40821) 22 + + A <- D + LS(P2 D C B + A + X.[1] + uint32 0xF61E2562) 5 + B <- A + LS(P2 A D C + B + X.[6] + uint32 0xC040B340) 9 + C <- B + LS(P2 B A D + C + X.[11] + uint32 0x265E5A51) 14 + D <- C + LS(P2 C B A + D + X.[0] + uint32 0xE9B6C7AA) 20 + A <- D + LS(P2 D C B + A + X.[5] + uint32 0xD62F105D) 5 + B <- A + LS(P2 A D C + B + X.[10] + uint32 0x02441453) 9 + C <- B + LS(P2 B A D + C + X.[15] + uint32 0xD8A1E681) 14 + D <- C + LS(P2 C B A + D + X.[4] + uint32 0xE7D3FBC8) 20 + A <- D + LS(P2 D C B + A + X.[9] + uint32 0x21E1CDE6) 5 + B <- A + LS(P2 A D C + B + X.[14] + uint32 0xC33707D6) 9 + C <- B + LS(P2 B A D + C + X.[3] + uint32 0xF4D50D87) 14 + D <- C + LS(P2 C B A + D + X.[8] + uint32 0x455A14ED) 20 + A <- D + LS(P2 D C B + A + X.[13] + uint32 0xA9E3E905) 5 + B <- A + LS(P2 A D C + B + X.[2] + uint32 0xFCEFA3F8) 9 + C <- B + LS(P2 B A D + C + X.[7] + uint32 0x676F02D9) 14 + D <- C + LS(P2 C B A + D + X.[12] + uint32 0x8D2A4C8A) 20 + + A <- D + LS(P3 D C B + A + X.[5] + uint32 0xFFFA3942) 4 + B <- A + LS(P3 A D C + B + X.[8] + uint32 0x8771F681) 11 + C <- B + LS(P3 B A D + C + X.[11] + uint32 0x6D9D6122) 16 + D <- C + LS(P3 C B A + D + X.[14] + uint32 0xFDE5380C) 23 + A <- D + LS(P3 D C B + A + X.[1] + uint32 0xA4BEEA44) 4 + B <- A + LS(P3 A D C + B + X.[4] + uint32 0x4BDECFA9) 11 + C <- B + LS(P3 B A D + C + X.[7] + uint32 0xF6BB4B60) 16 + D <- C + LS(P3 C B A + D + X.[10] + uint32 0xBEBFBC70) 23 + A <- D + LS(P3 D C B + A + X.[13] + uint32 0x289B7EC6) 4 + B <- A + LS(P3 A D C + B + X.[0] + uint32 0xEAA127FA) 11 + C <- B + LS(P3 B A D + C + X.[3] + uint32 0xD4EF3085) 16 + D <- C + LS(P3 C B A + D + X.[6] + uint32 0x04881D05) 23 + A <- D + LS(P3 D C B + A + X.[9] + uint32 0xD9D4D039) 4 + B <- A + LS(P3 A D C + B + X.[12] + uint32 0xE6DB99E5) 11 + C <- B + LS(P3 B A D + C + X.[15] + uint32 0x1FA27CF8) 16 + D <- C + LS(P3 C B A + D + X.[2] + uint32 0xC4AC5665) 23 + + A <- D + LS(P4 D C B + A + X.[0] + uint32 0xF4292244) 6 + B <- A + LS(P4 A D C + B + X.[7] + uint32 0x432AFF97) 10 + C <- B + LS(P4 B A D + C + X.[14] + uint32 0xAB9423A7) 15 + D <- C + LS(P4 C B A + D + X.[5] + uint32 0xFC93A039) 21 + A <- D + LS(P4 D C B + A + X.[12] + uint32 0x655B59C3) 6 + B <- A + LS(P4 A D C + B + X.[3] + uint32 0x8F0CCC92) 10 + C <- B + LS(P4 B A D + C + X.[10] + uint32 0xFFEFF47D) 15 + D <- C + LS(P4 C B A + D + X.[1] + uint32 0x85845DD1) 21 + A <- D + LS(P4 D C B + A + X.[8] + uint32 0x6FA87E4F) 6 + B <- A + LS(P4 A D C + B + X.[15] + uint32 0xFE2CE6E0) 10 + C <- B + LS(P4 B A D + C + X.[6] + uint32 0xA3014314) 15 + D <- C + LS(P4 C B A + D + X.[13] + uint32 0x4E0811A1) 21 + A <- D + LS(P4 D C B + A + X.[4] + uint32 0xF7537E82) 6 + B <- A + LS(P4 A D C + B + X.[11] + uint32 0xBD3AF235) 10 + C <- B + LS(P4 B A D + C + X.[2] + uint32 0x2AD7D2BB) 15 + D <- C + LS(P4 C B A + D + X.[9] + uint32 0xEB86D391) 21 + + state.[0] <- state.[0] + A + state.[3] <- state.[3] + B + state.[2] <- state.[2] + C + state.[1] <- state.[1] + D diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs deleted file mode 100644 index 2ce01147daa..00000000000 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ /dev/null @@ -1,315 +0,0 @@ -// #Regression #Conformance #TypeConstraints -// Regression test for CTP bug reported at http://cs.hubfs.net/forums/thread/9313.aspx -// In CTP, this was a stack overflow in the compiler. Now we give 64 errors -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P1' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P2' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P3' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P4' is not defined. -//The types 'int32, uint32' do not support the operator -//The value or constructor 'P4' is not defined. -module SmartHashUtils = - let ByteToUInt (array:byte[]) offset length endian = - - let temp:uint32[] = Array.create (length / 4) (uint32 0) - let ff = uint32 0xff - - match endian with - | 0 -> - let funn i n = - (uint32 array.[offset + i*4] &&& ff) ||| - ((uint32 array.[offset + i*4+1] &&& ff) <<< 8) ||| - ((uint32 array.[offset + i*4+2] &&& ff) <<< 16) ||| - ((uint32 array.[offset + i*4+3] &&& ff) <<< 24) - Array.mapi funn temp - | _ -> - let funn i n = - ((uint32 array.[offset + i*4] &&& ff) <<< 24) ||| - ((uint32 array.[offset + i*4+1] &&& ff) <<< 16) ||| - ((uint32 array.[offset + i*4+2] &&& ff) <<< 8) ||| - (uint32 array.[offset + i*4+3] &&& ff) - Array.mapi funn temp - - - let UIntToByte (array:uint32[]) offset length endian = - let temp:byte[] = Array.create (length * 4) (byte 0) - - match endian with - | 0 -> - let funn i n = byte (array.[offset + i/4] >>> (i%4 * 8)) - Array.mapi funn temp - | _ -> - let funn i n = byte (array.[offset + i/4] >>> ((3 - i%4) * 8)) - Array.mapi funn temp - - - let ULongToByte (array:uint64[]) offset length endian = - let temp:byte[] = Array.create (length * 8) (byte 0) - - match endian with - | 0 -> - let funn i n = byte (array.[offset + i/8] >>> (i%8 * 8)) - Array.mapi funn temp - | _ -> - let funn i n = byte (array.[offset + i/8] >>> ((7 - i%8) * 8)) - Array.mapi funn temp - - - let LS (x:uint32) n = uint32 ((x <<< n) ||| (x >>> (32 - n))) - let RS (x:uint32) n = uint32 ((x >>> n) ||| (x <<< (32 - n))) - -module SmartHashBlock = - open System.Security.Cryptography - - [] - type BlockHashAlgorithm() = - inherit HashAlgorithm() - ///The size in bytes of an individual block. - let mutable blockSize = 1 - ///The length of bytes, that have been processed. - ///This number includes the number of bytes currently waiting in the buffer. - let mutable count:uint64 = uint64 0 - ///Buffer for storing leftover bytes that are waiting to be processed. - let mutable buffer = Array.zeroCreate blockSize - ///The number of bytes currently in the Buffer waiting to be processed. - let mutable bufferCount = 0 - - member b.BlockSize with get() = blockSize and set(v) = blockSize <- v - member b.BufferCount with get() = bufferCount and set(v) = bufferCount <- v - member b.Count with get() = count and set(v) = count <- v - - default x.Initialize() = - count <- uint64 0 - bufferCount <- 0 - buffer <- Array.zeroCreate blockSize - - default x.HashCore(array, ibStart, cbSize) = - //let engineUpdate input offset' length' = - let mutable offset = ibStart - let mutable length = cbSize - count <- count + (uint64 length) - - if ((bufferCount > 0) && ((bufferCount + length) >= blockSize)) then - let off = blockSize - bufferCount - Array.blit array offset buffer bufferCount off - offset <- offset + off - length <- length - off - bufferCount <- 0 - x.BlockTransform (buffer, 0) - - let numBlocks = length / blockSize - for i in 0..(numBlocks-1) do - x.BlockTransform (array, (offset + i * blockSize)) - - let bytesLeft = length % blockSize - - if (bytesLeft <> 0) then - Array.blit array (offset + (length - bytesLeft)) buffer bufferCount bytesLeft - bufferCount <- bufferCount + bytesLeft - - abstract BlockTransform: (byte[] * int) -> unit - - member x.CreatePadding(minSize, append) = - let mutable paddingSize = x.BlockSize - ((int x.Count) % x.BlockSize) - - if (paddingSize < minSize) then paddingSize <- paddingSize + x.BlockSize - - let Padding = Array.create paddingSize (byte 0) - Padding.[0] <- append - Padding - -module SmartHashMD5 = - open SmartHashUtils - open SmartHashBlock - - - type MD5() as this = - inherit BlockHashAlgorithm() - ///The size in bytes of an individual block. - let mutable state:int32[] = null - - do this.BlockSize <- 64 - do this.HashSizeValue <- 128 - do state <- Array.zeroCreate 4 - do this.Initialize() - - override x.Initialize() = - base.Initialize() - state.[0] <- 0x67452301 - state.[1] <- 0xEFCDAB89 - state.[2] <- 0x98BADCFE - state.[3] <- 0x10325476 - - member x.BlockTransform(data, iOffset) = - let mutable A = state.[0] - let mutable B = state.[3] - let mutable C = state.[2] - let mutable D = state.[1] - - let X = ByteToUInt data iOffset 64 0 - - A <- D + LS (P1 D C B + A + X.[0] + uint32 0xD76AA478) 7 - B <- A + LS(P1 A D C + B + X.[1] + uint32 0xE8C7B756) 12 - C <- B + LS(P1 B A D + C + X.[2] + uint32 0x242070DB) 17 - D <- C + LS(P1 C B A + D + X.[3] + uint32 0xC1BDCEEE) 22 - A <- D + LS(P1 D C B + A + X.[4] + uint32 0xF57C0FAF) 7 - B <- A + LS(P1 A D C + B + X.[5] + uint32 0x4787C62A) 12 - C <- B + LS(P1 B A D + C + X.[6] + uint32 0xA8304613) 17 - D <- C + LS(P1 C B A + D + X.[7] + uint32 0xFD469501) 22 - A <- D + LS(P1 D C B + A + X.[8] + uint32 0x698098D8) 7 - B <- A + LS(P1 A D C + B + X.[9] + uint32 0x8B44F7AF) 12 - C <- B + LS(P1 B A D + C + X.[10] + uint32 0xFFFF5BB1) 17 - D <- C + LS(P1 C B A + D + X.[11] + uint32 0x895CD7BE) 22 - A <- D + LS(P1 D C B + A + X.[12] + uint32 0x6B901122) 7 - B <- A + LS(P1 A D C + B + X.[13] + uint32 0xFD987193) 12 - C <- B + LS(P1 B A D + C + X.[14] + uint32 0xA679438E) 17 - D <- C + LS(P1 C B A + D + X.[15] + uint32 0x49B40821) 22 - - A <- D + LS(P2 D C B + A + X.[1] + uint32 0xF61E2562) 5 - B <- A + LS(P2 A D C + B + X.[6] + uint32 0xC040B340) 9 - C <- B + LS(P2 B A D + C + X.[11] + uint32 0x265E5A51) 14 - D <- C + LS(P2 C B A + D + X.[0] + uint32 0xE9B6C7AA) 20 - A <- D + LS(P2 D C B + A + X.[5] + uint32 0xD62F105D) 5 - B <- A + LS(P2 A D C + B + X.[10] + uint32 0x02441453) 9 - C <- B + LS(P2 B A D + C + X.[15] + uint32 0xD8A1E681) 14 - D <- C + LS(P2 C B A + D + X.[4] + uint32 0xE7D3FBC8) 20 - A <- D + LS(P2 D C B + A + X.[9] + uint32 0x21E1CDE6) 5 - B <- A + LS(P2 A D C + B + X.[14] + uint32 0xC33707D6) 9 - C <- B + LS(P2 B A D + C + X.[3] + uint32 0xF4D50D87) 14 - D <- C + LS(P2 C B A + D + X.[8] + uint32 0x455A14ED) 20 - A <- D + LS(P2 D C B + A + X.[13] + uint32 0xA9E3E905) 5 - B <- A + LS(P2 A D C + B + X.[2] + uint32 0xFCEFA3F8) 9 - C <- B + LS(P2 B A D + C + X.[7] + uint32 0x676F02D9) 14 - D <- C + LS(P2 C B A + D + X.[12] + uint32 0x8D2A4C8A) 20 - - A <- D + LS(P3 D C B + A + X.[5] + uint32 0xFFFA3942) 4 - B <- A + LS(P3 A D C + B + X.[8] + uint32 0x8771F681) 11 - C <- B + LS(P3 B A D + C + X.[11] + uint32 0x6D9D6122) 16 - D <- C + LS(P3 C B A + D + X.[14] + uint32 0xFDE5380C) 23 - A <- D + LS(P3 D C B + A + X.[1] + uint32 0xA4BEEA44) 4 - B <- A + LS(P3 A D C + B + X.[4] + uint32 0x4BDECFA9) 11 - C <- B + LS(P3 B A D + C + X.[7] + uint32 0xF6BB4B60) 16 - D <- C + LS(P3 C B A + D + X.[10] + uint32 0xBEBFBC70) 23 - A <- D + LS(P3 D C B + A + X.[13] + uint32 0x289B7EC6) 4 - B <- A + LS(P3 A D C + B + X.[0] + uint32 0xEAA127FA) 11 - C <- B + LS(P3 B A D + C + X.[3] + uint32 0xD4EF3085) 16 - D <- C + LS(P3 C B A + D + X.[6] + uint32 0x04881D05) 23 - A <- D + LS(P3 D C B + A + X.[9] + uint32 0xD9D4D039) 4 - B <- A + LS(P3 A D C + B + X.[12] + uint32 0xE6DB99E5) 11 - C <- B + LS(P3 B A D + C + X.[15] + uint32 0x1FA27CF8) 16 - D <- C + LS(P3 C B A + D + X.[2] + uint32 0xC4AC5665) 23 - - A <- D + LS(P4 D C B + A + X.[0] + uint32 0xF4292244) 6 - B <- A + LS(P4 A D C + B + X.[7] + uint32 0x432AFF97) 10 - C <- B + LS(P4 B A D + C + X.[14] + uint32 0xAB9423A7) 15 - D <- C + LS(P4 C B A + D + X.[5] + uint32 0xFC93A039) 21 - A <- D + LS(P4 D C B + A + X.[12] + uint32 0x655B59C3) 6 - B <- A + LS(P4 A D C + B + X.[3] + uint32 0x8F0CCC92) 10 - C <- B + LS(P4 B A D + C + X.[10] + uint32 0xFFEFF47D) 15 - D <- C + LS(P4 C B A + D + X.[1] + uint32 0x85845DD1) 21 - A <- D + LS(P4 D C B + A + X.[8] + uint32 0x6FA87E4F) 6 - B <- A + LS(P4 A D C + B + X.[15] + uint32 0xFE2CE6E0) 10 - C <- B + LS(P4 B A D + C + X.[6] + uint32 0xA3014314) 15 - D <- C + LS(P4 C B A + D + X.[13] + uint32 0x4E0811A1) 21 - A <- D + LS(P4 D C B + A + X.[4] + uint32 0xF7537E82) 6 - B <- A + LS(P4 A D C + B + X.[11] + uint32 0xBD3AF235) 10 - C <- B + LS(P4 B A D + C + X.[2] + uint32 0x2AD7D2BB) 15 - D <- C + LS(P4 C B A + D + X.[9] + uint32 0xEB86D391) 21 - - state.[0] <- state.[0] + A - state.[3] <- state.[3] + B - state.[2] <- state.[2] + C - state.[1] <- state.[1] + D diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/env.lst b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/env.lst index 1c7f13eeeba..b3bcfd18bc0 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/env.lst @@ -9,7 +9,6 @@ NoMT SOURCE=ByRef04.fsx FSIMODE=PIPE COMPILE_ONLY=1 # ByRef04.fsx SOURCE=Regressions01.fs # Regressions01.fs SOURCE=E_Regressions01.fs SCFLAGS="--test:ErrorRanges" # E_Regressions01.fs - SOURCE=E_Regression02.fs # E_Regression02.fs SOURCE=DefaultConstructorConstraint01.fs SCFLAGS="--test:ErrorRanges" # DefaultConstructorConstraint01.fs SOURCE=DefaultConstructorConstraint02.fs SCFLAGS="--test:ErrorRanges" # DefaultConstructorConstraint02.fs SOURCE=DefaultConstructorConstraint03.fs SCFLAGS="--test:ErrorRanges" # DefaultConstructorConstraint03.fs From d5768b3446a95590f67b23e1e4fcf6c03644d68b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 6 Feb 2020 18:41:53 +0000 Subject: [PATCH 26/82] push traitCtxt to all freshen operations --- src/fsharp/AccessibilityLogic.fs | 2 +- src/fsharp/CheckFormatStrings.fs | 2 +- src/fsharp/ConstraintSolver.fs | 102 ++++----- src/fsharp/ConstraintSolver.fsi | 16 +- src/fsharp/FindUnsolved.fs | 2 +- src/fsharp/MethodCalls.fs | 41 ++-- src/fsharp/MethodOverrides.fs | 2 +- src/fsharp/NameResolution.fs | 249 +++++++++++---------- src/fsharp/NameResolution.fsi | 37 +-- src/fsharp/NicePrint.fs | 2 +- src/fsharp/PostInferenceChecks.fs | 4 +- src/fsharp/TastOps.fs | 83 +++---- src/fsharp/TastOps.fsi | 4 +- src/fsharp/TastPickle.fs | 4 +- src/fsharp/TypeChecker.fs | 153 +++++++------ src/fsharp/TypeChecker.fsi | 4 +- src/fsharp/fsc.fs | 5 +- src/fsharp/fsi/fsi.fs | 10 +- src/fsharp/infos.fs | 33 ++- src/fsharp/service/FSharpCheckerResults.fs | 12 +- src/fsharp/symbols/Exprs.fs | 2 +- src/fsharp/symbols/Symbols.fs | 2 +- src/fsharp/tast.fs | 44 ++-- 23 files changed, 412 insertions(+), 403 deletions(-) diff --git a/src/fsharp/AccessibilityLogic.fs b/src/fsharp/AccessibilityLogic.fs index 0f1f2b67e30..57a739c19ed 100644 --- a/src/fsharp/AccessibilityLogic.fs +++ b/src/fsharp/AccessibilityLogic.fs @@ -37,7 +37,7 @@ type AccessorDomain = /// An AccessorDomain which returns all items | AccessibleFromSomewhere - interface TraitAccessorDomain + interface ITraitAccessorDomain // Hashing and comparison is used for the memoization tables keyed by an accessor domain. // It is dependent on a TcGlobals because of the TyconRef in the data structure diff --git a/src/fsharp/CheckFormatStrings.fs b/src/fsharp/CheckFormatStrings.fs index eb78165819e..0be3de360de 100644 --- a/src/fsharp/CheckFormatStrings.fs +++ b/src/fsharp/CheckFormatStrings.fs @@ -15,7 +15,7 @@ open FSharp.Compiler.NameResolution type FormatItem = Simple of TType | FuncAndVal let copyAndFixupFormatTypar m tp = - let _,_,tinst = FreshenAndFixupTypars None m TyparRigidity.Flexible [] [] [tp] + let _,_,tinst = FreshenAndFixupTypars traitCtxtNone m TyparRigidity.Flexible [] [] [tp] List.head tinst let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index ba92fc5bb47..f3989eccf2e 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -104,35 +104,32 @@ let NewByRefKindInferenceType (g: TcGlobals) m = let NewInferenceTypes l = l |> List.map (fun _ -> NewInferenceType ()) -/// Freshen a trait for use at a particular location -type TraitFreshener = (TraitConstraintInfo -> TraitPossibleExtensionMemberSolutions * TraitAccessorDomain) - // QUERY: should 'rigid' ever really be 'true'? We set this when we know // we are going to have to generalize a typar, e.g. when implementing a // abstract generic method slot. But we later check the generalization // condition anyway, so we could get away with a non-rigid typar. This // would sort of be cleaner, though give errors later. -let FreshenAndFixupTypars (traitFreshner: TraitFreshener option) m rigid fctps tinst tpsorig = +let FreshenAndFixupTypars (traitCtxt: ITraitContext option) m rigid fctps tinst tpsorig = let copy_tyvar (tp: Typar) = NewCompGenTypar (tp.Kind, rigid, tp.StaticReq, (if rigid=TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No), false) let tps = tpsorig |> List.map copy_tyvar - let renaming, tinst = FixupNewTypars traitFreshner m fctps tinst tpsorig tps + let renaming, tinst = FixupNewTypars traitCtxt m fctps tinst tpsorig tps tps, renaming, tinst -let FreshenTypeInst traitFreshner m tpsorig = - FreshenAndFixupTypars traitFreshner m TyparRigidity.Flexible [] [] tpsorig +let FreshenTypeInst traitCtxt m tpsorig = + FreshenAndFixupTypars traitCtxt m TyparRigidity.Flexible [] [] tpsorig -let FreshenMethInst traitFreshner m fctps tinst tpsorig = - FreshenAndFixupTypars traitFreshner m TyparRigidity.Flexible fctps tinst tpsorig +let FreshenMethInst traitCtxt m fctps tinst tpsorig = + FreshenAndFixupTypars traitCtxt m TyparRigidity.Flexible fctps tinst tpsorig -let FreshenTypars traitFreshner m tpsorig = +let FreshenTypars traitCtxt m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tptys = FreshenTypeInst traitFreshner m tpsorig + let _, _, tptys = FreshenTypeInst traitCtxt m tpsorig tptys -let FreshenMethInfo traitFreshner m (minfo: MethInfo) = - let _, _, tptys = FreshenMethInst traitFreshner m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars +let FreshenMethInfo traitCtxt m (minfo: MethInfo) = + let _, _, tptys = FreshenMethInst traitCtxt m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tptys @@ -1280,7 +1277,8 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// /// 2. Some additional solutions are forced prior to generalization (permitWeakResolution= Yes or YesDuringCodeGen). See above and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload (permitWeakResolution: PermitWeakResolution) ndeep m2 trace traitInfo : OperationResult = trackErrors { - let (TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, extSlns, traitAD)) = traitInfo + let (TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, traitCtxt)) = traitInfo + let traitAD = match traitCtxt with None -> AccessorDomain.AccessibleFromEverywhere | Some c -> (c.AccessRights :?> AccessorDomain) // Do not re-solve if already solved if sln.Value.IsSome then return true else let g = csenv.g @@ -1295,15 +1293,15 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let tys = ListSet.setify (typeAEquiv g aenv) tys // Rebuild the trait info after removing duplicates - let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, extSlns, traitAD) + let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, rty, sln, traitCtxt) let rty = GetFSharpViewOfReturnType g rty - let traitAD = match traitAD with None -> AccessibilityLogic.AccessibleFromEverywhere | Some ad -> (ad :?> AccessorDomain) // Assert the object type if the constraint is for an instance member if memFlags.IsInstance then match tys, traitObjAndArgTys with | [ty], (h :: _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) + // Trait calls are only supported on pseudo type (variables) for e in tys do do! SolveTypStaticReq csenv trace HeadTypeStaticReq e @@ -1584,11 +1582,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload minfos // curried members may not be used to satisfy constraints |> List.choose (fun minfo -> - if minfo.IsCurried then None else - let callerArgs = argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr)) - let minst = FreshenMethInfo None m minfo - let callerObjTys = if memFlags.IsInstance then [ List.head traitObjAndArgTys ] else [] - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo None, m, traitAD, minfo, minst, minst, None, callerObjTys, [(callerArgs, [])], false, false, None))) + if minfo.IsCurried then + None + else + let callerArgs = argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr)) + let minst = FreshenMethInfo traitCtxt m minfo + let callerObjTys = if memFlags.IsInstance then [ List.head traitObjAndArgTys ] else [] + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo traitCtxt, m, traitAD, minfo, minst, minst, None, callerObjTys, [(callerArgs, [])], false, false, None))) let methOverloadResult, errors = trace.CollectThenUndoOrCommit @@ -1656,7 +1656,7 @@ and RecordMemberConstraintSolution css m trace traitInfo res = ResultD false | TTraitSolved (minfo, minst) -> - let sln = MemberConstraintSolutionOfMethInfo css m minfo minst + let sln = MemberConstraintSolutionOfMethInfo css m traitInfo.TraitContext minfo minst TransactMemberConstraintSolution traitInfo trace sln ResultD true @@ -1675,7 +1675,7 @@ and RecordMemberConstraintSolution css m trace traitInfo res = ResultD true /// Convert a MethInfo into the data we save in the TAST -and MemberConstraintSolutionOfMethInfo css m minfo minst = +and MemberConstraintSolutionOfMethInfo css m traitCtxt minfo minst = #if !NO_EXTENSIONTYPING #else // to prevent unused parameter warning @@ -1699,7 +1699,7 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = let minst = [] // GENERIC TYPE PROVIDERS: for generics, we would have an minst here let allArgVars, allArgs = minfo.GetParamTypes(amap, m, minst) |> List.concat |> List.mapi (fun i ty -> mkLocal m ("arg"+string i) ty) |> List.unzip let objArgVars, objArgs = (if minfo.IsInstance then [mkLocal m "this" minfo.ApparentEnclosingType] else []) |> List.unzip - let callMethInfoOpt, callExpr, callExprTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall css.TcVal (g, amap, mi, objArgs, NeverMutates, false, ValUseFlag.NormalValUse, allArgs, m) + let callMethInfoOpt, callExpr, callExprTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall css.TcVal (g, amap, traitCtxt, mi, objArgs, NeverMutates, false, ValUseFlag.NormalValUse, allArgs, m) let closedExprSln = ClosedExprSln (mkLambdas m [] (objArgVars@allArgVars) (callExpr, callExprTy) ) // If the call is a simple call to an IL method with all the arguments in the natural order, then revert to use ILMethSln. @@ -1724,18 +1724,18 @@ and TransactMemberConstraintSolution traitInfo (trace: OptionalTrace) sln = let prev = traitInfo.Solution trace.Exec (fun () -> traitInfo.Solution <- Some sln) (fun () -> traitInfo.Solution <- prev) -and GetRelevantExtensionMethodsForTrait m (amap: Import.ImportMap) (traitInfo: TraitConstraintInfo) = - - (traitInfo.SupportTypes, traitInfo.PossibleExtensionSolutions) - ||> List.allPairs - |> List.choose (fun (traitSupportTy,extMem) -> - match (extMem :?> ExtensionMember) with - | FSExtMem (vref, pri) -> Some (FSMeth(amap.g, traitSupportTy, vref, Some pri) ) - | ILExtMem (actualParent, minfo, pri) -> TrySelectExtensionMethInfoOfILExtMem m amap traitSupportTy (actualParent, minfo, pri)) +and GetRelevantExtensionMethodsForTrait m (infoReader: InfoReader) (traitInfo: TraitConstraintInfo) = + match traitInfo.TraitContext with + | None -> [] + | Some traitCtxt -> + [ for extMethInfo in traitCtxt.SelectExtensionMethods(traitInfo, m, infoReader=infoReader) do + yield (extMethInfo :?> MethInfo) ] /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads -and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, extSlns, ad) as traitInfo) : MethInfo list = +and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, traitCtxt) as traitInfo) : MethInfo list = + //let traitAD = traitCtxt.AccessRights :?> AccessorDomain + let results = if permitWeakResolution.PerformWeakOverloadResolution csenv.g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m @@ -1754,7 +1754,7 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio // Extension members are not used when canonicalizing prior to generalization (permitWeakResolution=true) let extMInfos = if MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then - GetRelevantExtensionMethodsForTrait csenv.m csenv.amap traitInfo + GetRelevantExtensionMethodsForTrait csenv.m csenv.InfoReader traitInfo else [] let extMInfos = extMInfos |> ListSet.setify MethInfo.MethInfosUseIdenticalDefinitions @@ -1773,17 +1773,17 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio // The trait name "op_Explicit" also covers "op_Implicit", so look for that one too. if nm = "op_Explicit" then - results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" (TTrait(tys, "op_Implicit", memFlags, argtys, rty, soln, extSlns, ad)) + results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" (TTrait(tys, "op_Implicit", memFlags, argtys, rty, soln, traitCtxt)) else results /// The nominal support of the member constraint -and GetSupportOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _, _)) = +and GetSupportOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _)) = tys |> List.choose (tryAnyParTyOption csenv.g) /// Check if the support is fully solved. -and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _, _)) = +and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _, _)) = tys |> List.forall (isAnyParTy csenv.g >> not) // This may be relevant to future bug fixes, see https://github.com/Microsoft/visualfsharp/issues/3814 @@ -1792,7 +1792,7 @@ and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait( // tys |> List.exists (isAnyParTy csenv.g >> not) /// Get all the unsolved typars (statically resolved or not) relevant to the member constraint -and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, argtys, rty, _, _, _)) = +and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, argtys, rty, _, _)) = freeInTypesLeftToRightSkippingConstraints csenv.g (tys@argtys@ Option.toList rty) and MemberConstraintIsReadyForWeakResolution csenv traitInfo = @@ -1820,16 +1820,6 @@ and SolveRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep permitWeak | ValueNone -> ResultD false)) -and GetTraitFreshner (g: TcGlobals) (ad: AccessorDomain) (nenv: NameResolutionEnv) (traitInfo: TraitConstraintInfo) = - - if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then - let slns = - NameMultiMap.find traitInfo.MemberName nenv.eExtensionMembersByName - |> List.map (fun extMem -> (extMem :> TraitPossibleExtensionMemberSolution)) - slns, (ad :> TraitAccessorDomain) - else - [], (AccessorDomain.AccessibleFromEverywhere :> TraitAccessorDomain) - and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (permitWeakResolution: PermitWeakResolution) (trace:OptionalTrace) tp = let cxst = csenv.SolverState.ExtraCxs let tpn = tp.Stamp @@ -1890,8 +1880,8 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint // may require type annotations. See FSharp 1.0 bug 6477. let consistent tpc1 tpc2 = match tpc1, tpc2 with - | (TyparConstraint.MayResolveMember(TTrait(tys1, nm1, memFlags1, argtys1, rty1, _, _, _), _), - TyparConstraint.MayResolveMember(TTrait(tys2, nm2, memFlags2, argtys2, rty2, _, _, _), _)) + | (TyparConstraint.MayResolveMember(TTrait(tys1, nm1, memFlags1, argtys1, rty1, _, _), _), + TyparConstraint.MayResolveMember(TTrait(tys2, nm2, memFlags2, argtys2, rty2, _, _), _)) when (memFlags1 = memFlags2 && nm1 = nm2 && // Multiple op_Explicit and op_Implicit constraints can exist for the same type variable. @@ -2587,7 +2577,7 @@ and ResolveOverloading // See what candidates we have based on current inferred type information // and _exact_ matches of argument types. match candidates |> FilterEachThenUndo (fun newTrace calledMeth -> - let cxsln = Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs)) cx + let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) CanMemberSigsMatchUpToCheck csenv permitOptArgs @@ -2604,7 +2594,7 @@ and ResolveOverloading // Now determine the applicable methods. // Subsumption on arguments is allowed. let applicable = candidates |> FilterEachThenUndo (fun newTrace candidate -> - let cxsln = Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m candidate.Method candidate.CalledTyArgs)) cx + let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext candidate.Method candidate.CalledTyArgs)) CanMemberSigsMatchUpToCheck csenv permitOptArgs @@ -2643,7 +2633,7 @@ and ResolveOverloading candidates |> List.choose (fun calledMeth -> match CollectThenUndo (fun newTrace -> - let cxsln = Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs)) cx + let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) CanMemberSigsMatchUpToCheck csenv permitOptArgs @@ -2826,7 +2816,7 @@ and ResolveOverloading calledMethOpt, trackErrors { do! errors - let cxsln = Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs)) cx + let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) match calledMethTrace with | NoTrace -> return! @@ -3265,7 +3255,7 @@ let CanonicalizePartialInferenceProblem css denv m tps isInline = /// An approximation used during name resolution for intellisense to eliminate extension members which will not /// apply to a particular object argument. This is given as the isApplicableMeth argument to the partial name resolution /// functions in nameres.fs. -let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = +let IsApplicableMethApprox g amap m traitCtxt (minfo: MethInfo) availObjTy = // Prepare an instance of a constraint solver // If it's an instance method, then try to match the object argument against the required object argument if minfo.IsExtensionMember then @@ -3276,7 +3266,7 @@ let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = ExtraCxs = HashMultiMap(10, HashIdentity.Structural) InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let minst = FreshenMethInfo None m minfo + let minst = FreshenMethInfo traitCtxt m minfo match minfo.GetObjArgTypes(amap, m, minst) with | [reqdObjTy] -> let reqdObjTy = if isByrefTy g reqdObjTy then destByrefTy g reqdObjTy else reqdObjTy // This is to support byref extension methods. diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 3089ac2337c..1c7b33a3479 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -35,24 +35,18 @@ val NewErrorMeasure: unit -> Measure /// Create a list of inference type variables, one for each element in the input list val NewInferenceTypes: 'a list -> TType list -/// Freshen a trait for use at a particular location -type TraitFreshener = (TraitConstraintInfo -> TraitPossibleExtensionMemberSolutions * TraitAccessorDomain) - /// Given a set of formal type parameters and their constraints, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted to refer to these. -val FreshenAndFixupTypars : TraitFreshener option -> range -> TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInst * TType list +val FreshenAndFixupTypars : ITraitContext option -> range -> TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInst * TType list /// Make new type inference variables for the use of a generic construct at a particular location -val FreshenTypeInst : TraitFreshener option -> range -> Typars -> Typars * TyparInst * TType list +val FreshenTypeInst : ITraitContext option -> range -> Typars -> Typars * TyparInst * TType list /// Make new type inference variables for the use of a generic construct at a particular location -val FreshenTypars : TraitFreshener option -> range -> Typars -> TType list +val FreshenTypars : ITraitContext option -> range -> Typars -> TType list /// Make new type inference variables for the use of a method at a particular location -val FreshenMethInfo : TraitFreshener option -> range -> MethInfo -> TType list - -/// Get the trait freshener for a particular location -val GetTraitFreshner : TcGlobals -> AccessorDomain -> NameResolutionEnv -> TraitFreshener +val FreshenMethInfo : ITraitContext option -> range -> MethInfo -> TType list [] /// Information about the context of a type equation, for better error reporting @@ -188,6 +182,6 @@ val CodegenWitnessThatTypeSupportsTraitConstraint: TcValF -> TcGlobals -> Import val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> unit -val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool +val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> ITraitContext option -> MethInfo -> TType -> bool val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit \ No newline at end of file diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs index 02c5e56b151..f3f0e1527c7 100644 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -135,7 +135,7 @@ and accOp cenv env (op, tyargs, args, _m) = accTypeInst cenv env enclTypeArgs accTypeInst cenv env methTypeArgs accTypeInst cenv env tys - | TOp.TraitCall (TTrait(tys, _nm, _, argtys, rty, _sln, _extSlns, _ad)) -> + | TOp.TraitCall (TTrait(tys, _nm, _, argtys, rty, _sln, _traitCtxt)) -> argtys |> accTypeInst cenv env rty |> Option.iter (accTy cenv env) tys |> List.iter (accTy cenv env) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 4fb8d9182a1..834cdff9b53 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -559,8 +559,8 @@ let BuildObjCtorCall (g: TcGlobals) m = Expr.Op (TOp.ILCall (false, false, false, false, CtorValUsedAsSuperInit, false, true, ilMethRef, [], [], [g.obj_ty]), [], [], m) /// Implements the elaborated form of adhoc conversions from functions to delegates at member callsites -let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, invokeMethInfo: MethInfo, delArgTys, f, fty, m) = - let slotsig = invokeMethInfo.GetSlotSig(amap, m) +let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, traitCtxt, delegateTy, invokeMethInfo: MethInfo, delArgTys, f, fty, m) = + let slotsig = invokeMethInfo.GetSlotSig(amap, m, traitCtxt) let delArgVals, expr = let topValInfo = ValReprInfo([], List.replicate (max 1 (List.length delArgTys)) ValReprInfo.unnamedTopArg, ValReprInfo.unnamedRetVal) @@ -599,12 +599,12 @@ let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, i let meth = TObjExprMethod(slotsig, [], [], [delArgVals], expr, m) mkObjExpr(delegateTy, None, BuildObjCtorCall g m, [meth], [], m) -let CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr delegateTy = +let CoerceFromFSharpFuncToDelegate g amap traitCtxt infoReader ad callerArgTy m callerArgExpr delegateTy = let (SigOfFunctionForDelegate(invokeMethInfo, delArgTys, _, _)) = GetSigOfFunctionForDelegate infoReader delegateTy m ad - BuildNewDelegateExpr (None, g, amap, delegateTy, invokeMethInfo, delArgTys, callerArgExpr, callerArgTy, m) + BuildNewDelegateExpr (None, g, amap, traitCtxt, delegateTy, invokeMethInfo, delArgTys, callerArgExpr, callerArgTy, m) // Handle adhoc argument conversions -let AdjustCallerArgExprForCoercions (g: TcGlobals) amap infoReader ad isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = +let AdjustCallerArgExprForCoercions (g: TcGlobals) amap traitCtxt infoReader ad isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then None, Expr.Op (TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) @@ -616,11 +616,11 @@ let AdjustCallerArgExprForCoercions (g: TcGlobals) amap infoReader ad isOutArg c #endif elif isDelegateTy g calledArgTy && isFunTy g callerArgTy then - None, CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr calledArgTy + None, CoerceFromFSharpFuncToDelegate g amap traitCtxt infoReader ad callerArgTy m callerArgExpr calledArgTy elif isLinqExpressionTy g calledArgTy && isDelegateTy g (destLinqExpressionTy g calledArgTy) && isFunTy g callerArgTy then let delegateTy = destLinqExpressionTy g calledArgTy - let expr = CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr delegateTy + let expr = CoerceFromFSharpFuncToDelegate g amap traitCtxt infoReader ad callerArgTy m callerArgExpr delegateTy None, mkCallQuoteToLinqLambdaExpression g m delegateTy (Expr.Quote (expr, ref None, false, m, mkQuotedExprTy g delegateTy)) // auto conversions to quotations (to match auto conversions to LINQ expressions) @@ -814,7 +814,7 @@ let AdjustOutCallerArgExprs g (calledMeth: CalledMeth<_>) mMethExpr = outArg, outArgExpr, mkCompGenBind outv expr) |> List.unzip3 -let AdjustParamArrayCallerArgExprs g amap infoReader ad (calledMeth: CalledMeth<_>) mMethExpr = +let AdjustParamArrayCallerArgExprs g amap traitCtxt infoReader ad (calledMeth: CalledMeth<_>) mMethExpr = let argSets = calledMeth.ArgSets let paramArrayCallerArgs = argSets |> List.collect (fun argSet -> argSet.ParamArrayCallerArgs) @@ -828,7 +828,7 @@ let AdjustParamArrayCallerArgExprs g amap infoReader ad (calledMeth: CalledMeth< paramArrayCallerArgs |> List.map (fun callerArg -> let (CallerArg(callerArgTy, m, isOutArg, callerArgExpr)) = callerArg - AdjustCallerArgExprForCoercions g amap infoReader ad isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) + AdjustCallerArgExprForCoercions g amap traitCtxt infoReader ad isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) |> List.unzip let arg = @@ -840,7 +840,7 @@ let AdjustParamArrayCallerArgExprs g amap infoReader ad (calledMeth: CalledMeth< /// Build the argument list for a method call. Adjust for param array, optional arguments, byref arguments and coercions. /// For example, if you pass an F# reference cell to a byref then we must get the address of the /// contents of the ref. Likewise lots of adjustments are made for optional arguments etc. -let AdjustCallerArgExprs tcFieldInit eCallerMemberName g amap infoReader ad (calledMeth: CalledMeth<_>) objArgs lambdaVars mItem mMethExpr = +let AdjustCallerArgExprs tcFieldInit eCallerMemberName g amap traitCtxt infoReader ad (calledMeth: CalledMeth<_>) objArgs lambdaVars mItem mMethExpr = let calledMethInfo = calledMeth.Method // Some of the code below must allocate temporary variables or bind other variables to particular values. @@ -863,7 +863,7 @@ let AdjustCallerArgExprs tcFieldInit eCallerMemberName g amap infoReader ad (cal // Handle param array and optional arguments let paramArrayPreBinders, paramArrayArgs = - AdjustParamArrayCallerArgExprs g amap infoReader ad calledMeth mMethExpr + AdjustParamArrayCallerArgExprs g amap traitCtxt infoReader ad calledMeth mMethExpr let optArgs, optArgPreBinder, adjustedNormalUnnamedArgs, adjustedFinalAssignedNamedArgs = AdjustOptionalCallerArgExprs tcFieldInit eCallerMemberName g calledMeth mItem mMethExpr @@ -889,7 +889,7 @@ let AdjustCallerArgExprs tcFieldInit eCallerMemberName g amap infoReader ad (cal let calledArgTy = assignedArg.CalledArg.CalledArgumentType let (CallerArg(callerArgTy, m, _, e)) = assignedArg.CallerArg - AdjustCallerArgExprForCoercions g amap infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m e) + AdjustCallerArgExprForCoercions g amap traitCtxt infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m e) |> List.unzip objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds @@ -1293,7 +1293,12 @@ module ProvidedMethodCalls = (thisArg: Expr option, allArgs: Exprs, paramVars: Tainted[], - g, amap, mut, isProp, isSuperInit, m, + g, + amap, + traitCtxt, + mut, + isProp, + isSuperInit, m, expr: Tainted) = let varConv = @@ -1433,7 +1438,7 @@ module ProvidedMethodCalls = let lambdaExpr = mkLambdas m [] vsT (delegateBodyExprT, tyOfExpr g delegateBodyExprT) let lambdaExprTy = tyOfExpr g lambdaExpr let infoReader = InfoReader(g, amap) - let exprT = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyT + let exprT = CoerceFromFSharpFuncToDelegate g amap traitCtxt infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyT None, (exprT, tyOfExpr g exprT) | None -> #if PROVIDED_ADDRESS_OF @@ -1553,7 +1558,7 @@ module ProvidedMethodCalls = // fill in parameter holes in the expression - let TranslateInvokerExpressionForProvidedMethodCall tcVal (g, amap, mut, isProp, isSuperInit, mi: Tainted, objArgs, allArgs, m) = + let TranslateInvokerExpressionForProvidedMethodCall tcVal (g, amap, traitCtxt, mut, isProp, isSuperInit, mi: Tainted, objArgs, allArgs, m) = let parameters = mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) let paramTys = @@ -1579,12 +1584,12 @@ module ProvidedMethodCalls = let ea = mi.PApplyWithProvider((fun (methodInfo, provider) -> ExtensionTyping.GetInvokerExpression(provider, methodInfo, [| for p in paramVars -> p.PUntaintNoFailure id |])), m) - convertProvidedExpressionToExprAndWitness tcVal (thisArg, allArgs, paramVars, g, amap, mut, isProp, isSuperInit, m, ea) + convertProvidedExpressionToExprAndWitness tcVal (thisArg, allArgs, paramVars, g, amap, traitCtxt, mut, isProp, isSuperInit, m, ea) - let BuildInvokerExpressionForProvidedMethodCall tcVal (g, amap, mi: Tainted, objArgs, mut, isProp, isSuperInit, allArgs, m) = + let BuildInvokerExpressionForProvidedMethodCall tcVal (g, amap, traitCtxt, mi: Tainted, objArgs, mut, isProp, isSuperInit, allArgs, m) = try - let methInfoOpt, (expr, retTy) = TranslateInvokerExpressionForProvidedMethodCall tcVal (g, amap, mut, isProp, isSuperInit, mi, objArgs, allArgs, m) + let methInfoOpt, (expr, retTy) = TranslateInvokerExpressionForProvidedMethodCall tcVal (g, amap, traitCtxt, mut, isProp, isSuperInit, mi, objArgs, allArgs, m) let exprty = GetCompiledReturnTyOfProvidedMethodInfo amap m mi |> GetFSharpViewOfReturnType g let expr = mkCoerceIfNeeded g exprty retTy expr diff --git a/src/fsharp/MethodOverrides.fs b/src/fsharp/MethodOverrides.fs index c621706b9b8..5e54a3be670 100644 --- a/src/fsharp/MethodOverrides.fs +++ b/src/fsharp/MethodOverrides.fs @@ -660,7 +660,7 @@ module DispatchSlotChecking = | None -> () // not an F# slot // Get the slotsig of the overridden method - let slotsig = dispatchSlot.GetSlotSig(amap, m) + let slotsig = dispatchSlot.GetSlotSig(amap, m, NameResolution.traitCtxtNone) // The slotsig from the overridden method is in terms of the type parameters on the parent type of the overriding method, // Modify map the slotsig so it is in terms of the type parameters for the overriding method diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 48535f39029..d82e92bd935 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -31,28 +31,32 @@ open System.Collections.Generic open FSharp.Compiler.ExtensionTyping #endif + /// An object that captures the logical context for name resolution. type NameResolver(g: TcGlobals, amap: Import.ImportMap, infoReader: InfoReader, - instantiationGenerator: (range -> Typars -> TypeInst)) = + instantiationGenerator: range -> Typars -> ITraitContext option -> TypeInst) = - /// Used to transform typars into new inference typars - // instantiationGenerator is a function to help us create the - // type parameters by copying them from type parameter specifications read - // from IL code. - // - // When looking up items in generic types we create a fresh instantiation - // of the type, i.e. instantiate the type with inference variables. - // This means the item is returned ready for use by the type inference engine - // without further freshening. However it does mean we end up plumbing 'instantiationGenerator' - // around a bit more than we would like to, which is a bit annoying. - member nr.InstantiationGenerator = instantiationGenerator member nr.g = g member nr.amap = amap member nr.InfoReader = infoReader member nr.languageSupportsNameOf = g.langVersion.SupportsFeature LanguageFeature.NameOf + /// Used to transform typars into new inference typars + /// instantiationGenerator is a function to help us create the + /// type parameters by copying them from type parameter specifications read + /// from IL code. + /// + /// If these includes trait constraints then the process is context dependent. + /// + /// When looking up items in generic types we create a fresh instantiation + /// of the type, i.e. instantiate the type with inference variables. + /// This means the item is returned ready for use by the type inference engine + /// without further freshening. However it does mean we end up plumbing 'instantiationGenerator' + /// around a bit more than we would like to, which is a bit annoying. + member nr.InstantiationGenerator = instantiationGenerator + //------------------------------------------------------------------------- // Helpers for unionconstrs and recdfields //------------------------------------------------------------------------- @@ -284,8 +288,6 @@ type ExtensionMember = /// IL-style extension member, backed by some kind of method with an [] attribute | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority - interface TraitPossibleExtensionMemberSolution - /// Check if two extension members refer to the same definition static member Equality g e1 e2 = match e1, e2 with @@ -315,16 +317,17 @@ type ExtensionMember = match x with | FSExtMem (vref, _) -> vref.LogicalName | ILExtMem (_, minfo, _) -> minfo.LogicalName - + type FullyQualifiedFlag = /// Only resolve full paths | FullyQualified /// Resolve any paths accessible via 'open' | OpenQualified - type UnqualifiedItems = LayeredMap +let traitCtxtNone : ITraitContext option = None + [] /// The environment of information used to resolve names type NameResolutionEnv = @@ -1067,24 +1070,23 @@ let AddDeclaredTyparsToNameEnv check nenv typars = /// Convert a reference to a named type into a type that includes /// a fresh set of inference type variables for the type parameters of the union type. -let FreshenTycon (ncenv: NameResolver) m (tcref: TyconRef) = - let tinst = ncenv.InstantiationGenerator m (tcref.Typars m) +let FreshenTycon (ncenv: NameResolver) traitCtxt m (tcref: TyconRef) = + let tinst = ncenv.InstantiationGenerator m (tcref.Typars m) traitCtxt let improvedTy = ncenv.g.decompileType tcref tinst improvedTy /// Convert a reference to a union case into a UnionCaseInfo that includes /// a fresh set of inference type variables for the type parameters of the union type. -let FreshenUnionCaseRef (ncenv: NameResolver) m (ucref: UnionCaseRef) = - let tinst = ncenv.InstantiationGenerator m (ucref.TyconRef.Typars m) +let FreshenUnionCaseRef (ncenv: NameResolver) traitCtxt m (ucref: UnionCaseRef) = + let tinst = ncenv.InstantiationGenerator m (ucref.TyconRef.Typars m) traitCtxt UnionCaseInfo(tinst, ucref) /// This must be called after fetching unqualified items that may need to be freshened -let FreshenUnqualifiedItem (ncenv: NameResolver) m res = +let FreshenUnqualifiedItem ncenv traitCtxt m res = match res with - | Item.UnionCase(UnionCaseInfo(_, ucref), _) -> Item.UnionCase(FreshenUnionCaseRef ncenv m ucref, false) + | Item.UnionCase(UnionCaseInfo(_, ucref), _) -> Item.UnionCase(FreshenUnionCaseRef ncenv traitCtxt m ucref, false) | _ -> res - //------------------------------------------------------------------------- // Resolve module paths, value, field etc. lookups. Doing this involves // searching through many possibilities and disambiguating. Hence first @@ -1373,13 +1375,13 @@ let LookupTypeNameInEntityMaybeHaveArity (amap, m, ad, nm, staticResInfo: TypeNa /// /// Handle the .NET/C# business where nested generic types implicitly accumulate the type parameters /// from their enclosing types. -let MakeNestedType (ncenv: NameResolver) (tinst: TType list) m (tcrefNested: TyconRef) = +let MakeNestedType (ncenv: NameResolver) traitCtxt (tinst: TType list) m (tcrefNested: TyconRef) = let tps = List.drop tinst.Length (tcrefNested.Typars m) - let tinstNested = ncenv.InstantiationGenerator m tps + let tinstNested = ncenv.InstantiationGenerator m tps traitCtxt mkAppTy tcrefNested (tinst @ tinstNested) /// Get all the accessible nested types of an existing type. -let GetNestedTypesOfType (ad, ncenv: NameResolver, optFilter, staticResInfo, checkForGenerated, m) ty = +let GetNestedTypesOfType (ncenv: NameResolver, ad, traitCtxt, optFilter, staticResInfo, checkForGenerated, m) ty = let g = ncenv.g ncenv.InfoReader.GetPrimaryTypeHierarchy(AllowMultiIntfInstantiations.Yes, m, ty) |> List.collect (fun ty -> match ty with @@ -1397,7 +1399,7 @@ let GetNestedTypesOfType (ad, ncenv: NameResolver, optFilter, staticResInfo, che match optFilter with | Some nm -> let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, m, ad, nm, staticResInfo, tcref) - tcrefs |> List.map (MakeNestedType ncenv tinst m) + tcrefs |> List.map (MakeNestedType ncenv traitCtxt tinst m) | None -> #if !NO_EXTENSIONTYPING match tycon.TypeReprInfo with @@ -1405,13 +1407,13 @@ let GetNestedTypesOfType (ad, ncenv: NameResolver, optFilter, staticResInfo, che [ for nestedType in info.ProvidedType.PApplyArray((fun sty -> sty.GetNestedTypes()), "GetNestedTypes", m) do let nestedTypeName = nestedType.PUntaint((fun t -> t.Name), m) for nestedTcref in LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, m, ad, nestedTypeName, staticResInfo, tcref) do - yield MakeNestedType ncenv tinst m nestedTcref ] + yield MakeNestedType ncenv traitCtxt tinst m nestedTcref ] | _ -> #endif mty.TypesByAccessNames.Values |> List.choose (fun entity -> - let ty = tcref.NestedTyconRef entity |> MakeNestedType ncenv tinst m + let ty = tcref.NestedTyconRef entity |> MakeNestedType ncenv traitCtxt tinst m if IsTypeAccessible g ncenv.amap m ad ty then Some ty else None) | _ -> []) @@ -1950,7 +1952,7 @@ let CheckAllTyparsInferrable amap m item = type ResolutionInfo = | ResolutionInfo of (*entityPath, reversed*)(range * EntityRef) list * (*warnings/errors*)(ResultTyparChecker -> unit) - static member SendEntityPathToSink(sink, ncenv: NameResolver, nenv, occ, ad, ResolutionInfo(entityPath, warnings), typarChecker) = + static member SendEntityPathToSink(sink, ncenv: NameResolver, nenv, occ, ad, traitCtxt, ResolutionInfo(entityPath, warnings), typarChecker) = entityPath |> List.iter (fun (m, eref: EntityRef) -> CheckEntityAttributes ncenv.g eref m |> CommitOperationResult CheckTyconAccessible ncenv.amap m ad eref |> ignore @@ -1958,7 +1960,7 @@ type ResolutionInfo = if eref.IsModuleOrNamespace then Item.ModuleOrNamespaces [eref] else - Item.Types(eref.DisplayName, [FreshenTycon ncenv m eref]) + Item.Types(eref.DisplayName, [FreshenTycon ncenv traitCtxt m eref]) CallNameResolutionSink sink (m, nenv, item, item, emptyTyparInst, occ, nenv.eDisplayEnv, ad)) warnings typarChecker @@ -2267,7 +2269,7 @@ let GetRecordLabelsForType g nenv ty = // REVIEW: this shows up on performance logs. Consider for example endless resolutions of "List.map" to // the empty set of results, or "x.Length" for a list or array type. This indicates it could be worth adding a cache here. -let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInfo: ResolutionInfo) depth m ad (id: Ident) (rest: Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) ty = +let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInfo: ResolutionInfo) depth m ad traitCtxt (id: Ident) (rest: Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) ty = let g = ncenv.g let m = unionRanges m id.idRange let nm = id.idText // used to filter the searches of the tables @@ -2340,7 +2342,7 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf let nestedSearchAccessible = match rest with | [] -> - let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, typeNameResInfo.StaticArgsInfo, true, m) ty + let nestedTypes = GetNestedTypesOfType (ncenv, ad, traitCtxt, Some nm, typeNameResInfo.StaticArgsInfo, true, m) ty if isNil nestedTypes then NoResultsOrUsefulErrors else @@ -2352,8 +2354,8 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf | ResolveTypeNamesToTypeRefs -> OneSuccess (resInfo, Item.Types (nm, nestedTypes), rest) | id2 :: rest2 -> - let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, TypeNameResolutionStaticArgsInfo.Indefinite, true, m) ty - ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad id2 rest2 findFlag typeNameResInfo nestedTypes + let nestedTypes = GetNestedTypesOfType (ncenv, ad, traitCtxt, Some nm, TypeNameResolutionStaticArgsInfo.Indefinite, true, m) ty + ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad traitCtxt id2 rest2 findFlag typeNameResInfo nestedTypes match nestedSearchAccessible with | Result res when not (isNil res) -> nestedSearchAccessible @@ -2386,7 +2388,7 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf raze (UndefinedName (depth, FSComp.SR.undefinedNameFieldConstructorOrMember, id, suggestMembers)) -and ResolveLongIdentInNestedTypes (ncenv: NameResolver) nenv lookupKind resInfo depth id m ad (id2: Ident) (rest: Ident list) findFlag typeNameResInfo tys = +and ResolveLongIdentInNestedTypes (ncenv: NameResolver) nenv lookupKind resInfo depth id m ad traitCtxt (id2: Ident) (rest: Ident list) findFlag typeNameResInfo tys = tys |> CollectAtMostOneResult (fun ty -> let resInfo = @@ -2395,31 +2397,31 @@ and ResolveLongIdentInNestedTypes (ncenv: NameResolver) nenv lookupKind resInfo resInfo.AddEntity(id.idRange, tcref) | _ -> resInfo - ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id2 rest findFlag typeNameResInfo ty + ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad traitCtxt id2 rest findFlag typeNameResInfo ty |> AtMostOneResult m) /// Resolve a long identifier using type-qualified name resolution. -let ResolveLongIdentInType sink ncenv nenv lookupKind m ad id findFlag typeNameResInfo ty = +let ResolveLongIdentInType sink ncenv nenv lookupKind m ad traitCtxt id findFlag typeNameResInfo ty = let resInfo, item, rest = - ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad id [] findFlag typeNameResInfo ty + ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad traitCtxt id [] findFlag typeNameResInfo ty |> AtMostOneResult m |> ForceRaise - ResolutionInfo.SendEntityPathToSink (sink, ncenv, nenv, ItemOccurence.UseInType, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + ResolutionInfo.SendEntityPathToSink (sink, ncenv, nenv, ItemOccurence.UseInType, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) item, rest -let private ResolveLongIdentInTyconRef (ncenv: NameResolver) nenv lookupKind resInfo depth m ad id rest typeNameResInfo tcref = +let private ResolveLongIdentInTyconRef (ncenv: NameResolver) nenv lookupKind resInfo depth m ad traitCtxt id rest typeNameResInfo tcref = #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a member! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) #endif - let ty = FreshenTycon ncenv m tcref - ty |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id rest IgnoreOverrides typeNameResInfo + let ty = FreshenTycon ncenv traitCtxt m tcref + ty |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad traitCtxt id rest IgnoreOverrides typeNameResInfo -let private ResolveLongIdentInTyconRefs atMostOne (ncenv: NameResolver) nenv lookupKind depth m ad id rest typeNameResInfo idRange tcrefs = +let private ResolveLongIdentInTyconRefs atMostOne (ncenv: NameResolver) nenv lookupKind depth m ad traitCtxt id rest typeNameResInfo idRange tcrefs = tcrefs |> CollectResults2 atMostOne (fun (resInfo: ResolutionInfo, tcref) -> let resInfo = resInfo.AddEntity(idRange, tcref) - tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad id rest typeNameResInfo |> AtMostOneResult m) + tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad traitCtxt id rest typeNameResInfo |> AtMostOneResult m) //------------------------------------------------------------------------- // ResolveExprLongIdentInModuleOrNamespace @@ -2429,7 +2431,7 @@ let (|AccessibleEntityRef|_|) amap m ad (modref: ModuleOrNamespaceRef) mspec = let eref = modref.NestedTyconRef mspec if IsEntityAccessible amap m ad eref then Some eref else None -let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad resInfo depth m modref (mty: ModuleOrNamespaceType) (id: Ident) (rest: Ident list) = +let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad traitCtxt resInfo depth m modref (mty: ModuleOrNamespaceType) (id: Ident) (rest: Ident list) = // resInfo records the modules or namespaces actually relevant to a resolution let m = unionRanges m id.idRange match mty.AllValsByLogicalName.TryGetValue id.idText with @@ -2445,7 +2447,7 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (type match TryFindTypeWithUnionCase modref id with | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> let ucref = mkUnionCaseRef (modref.NestedTyconRef tycon) id.idText - let ucinfo = FreshenUnionCaseRef ncenv m ucref + let ucinfo = FreshenUnionCaseRef ncenv traitCtxt m ucref let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs success [resInfo, Item.UnionCase(ucinfo, hasRequireQualifiedAccessAttribute), rest], hasRequireQualifiedAccessAttribute | _ -> NoResultsOrUsefulErrors, false @@ -2467,7 +2469,7 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (type let typeNameResInfo = TypeNameResolutionInfo (ResolveTypeNamesToTypeRefs, TypeNameResolutionStaticArgsInfo.Indefinite) CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad traitCtxt id2 rest2 typeNameResInfo id.idRange tcrefs // Check if we've got some explicit type arguments | _ -> @@ -2475,12 +2477,12 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (type match typeNameResInfo.ResolutionFlag with | ResolveTypeNamesToTypeRefs -> success [ for (resInfo, tcref) in tcrefs do - let ty = FreshenTycon ncenv m tcref + let ty = FreshenTycon ncenv traitCtxt m tcref let item = (resInfo, Item.Types(id.idText, [ty]), []) yield item ] | ResolveTypeNamesToCtors -> tcrefs - |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv m tcref) + |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv traitCtxt m tcref) |> CollectAtMostOneResult (fun (resInfo, ty) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad ty) |> MapResults (fun (resInfo, item) -> (resInfo, item, [])) @@ -2493,7 +2495,7 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (type | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange, submodref) - OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) + OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad traitCtxt resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) | _ -> NoResultsOrUsefulErrors | _ -> @@ -2529,23 +2531,23 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv (type /// An identifier has resolved to a type name in an expression (corresponding to one or more TyconRefs). /// Return either a set of constructors (later refined by overload resolution), or a set of TyconRefs. -let ChooseTyconRefInExpr (ncenv: NameResolver, m, ad, nenv, id: Ident, typeNameResInfo: TypeNameResolutionInfo, resInfo: ResolutionInfo, tcrefs) = +let ChooseTyconRefInExpr (ncenv: NameResolver, m, ad, traitCtxt, nenv, id: Ident, typeNameResInfo: TypeNameResolutionInfo, resInfo: ResolutionInfo, tcrefs) = let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo, tcref)) let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, m) match typeNameResInfo.ResolutionFlag with | ResolveTypeNamesToCtors -> - let tys = tcrefs |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv m tcref)) + let tys = tcrefs |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv traitCtxt m tcref)) tys |> CollectAtMostOneResult (fun (resInfo, ty) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad ty) |> MapResults (fun (resInfo, item) -> (resInfo, item, [])) | ResolveTypeNamesToTypeRefs -> - let tys = tcrefs |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv m tcref)) + let tys = tcrefs |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv traitCtxt m tcref)) success (tys |> List.map (fun (resInfo, ty) -> (resInfo, Item.Types(id.idText, [ty]), []))) /// Resolve F# "A.B.C" syntax in expressions /// Not all of the sequence will necessarily be swallowed, i.e. we return some identifiers /// that may represent further actions, e.g. further lookups. -let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified m ad nenv (typeNameResInfo: TypeNameResolutionInfo) (id: Ident) (rest: Ident list) isOpenDecl = +let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified m ad traitCtxt nenv (typeNameResInfo: TypeNameResolutionInfo) (id: Ident) (rest: Ident list) isOpenDecl = let resInfo = ResolutionInfo.Empty let canSuggestThisItem (item:Item) = // All items can be suggested except nameof when it comes from FSharp.Core.dll and the nameof feature is not enabled @@ -2561,9 +2563,9 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified | [] -> error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) | [next] -> - ResolveExprLongIdentPrim sink ncenv false fullyQualified m ad nenv typeNameResInfo next [] isOpenDecl + ResolveExprLongIdentPrim sink ncenv false fullyQualified m ad traitCtxt nenv typeNameResInfo next [] isOpenDecl | id2 :: rest2 -> - ResolveExprLongIdentPrim sink ncenv false FullyQualified m ad nenv typeNameResInfo id2 rest2 isOpenDecl + ResolveExprLongIdentPrim sink ncenv false FullyQualified m ad traitCtxt nenv typeNameResInfo id2 rest2 isOpenDecl else if isNil rest && fullyQualified <> FullyQualified then let mutable typeError = None @@ -2581,16 +2583,16 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo || typeNameResInfo.StaticArgsInfo.NumStaticArgs = tcref.Typars(m).Length) - let search = ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + let search = ChooseTyconRefInExpr (ncenv, m, ad, traitCtxt, nenv, id, typeNameResInfo, resInfo, tcrefs) match AtMostOneResult m search with | Result _ as res -> let resInfo, item, rest = ForceRaise res - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) Some(item, rest) | Exception e -> typeError <- Some e; None | true, res -> - let fresh = FreshenUnqualifiedItem ncenv m res + let fresh = FreshenUnqualifiedItem ncenv traitCtxt m res match fresh with | Item.Value value -> let isNameOfOperator = valRefEq ncenv.g ncenv.g.nameof_vref value @@ -2610,7 +2612,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified // Check if it's a type name, e.g. a constructor call or a type instantiation let ctorSearch = let tcrefs = LookupTypeNameInEnvMaybeHaveArity fullyQualified id.idText typeNameResInfo nenv - ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + ChooseTyconRefInExpr (ncenv, m, ad, traitCtxt, nenv, id, typeNameResInfo, resInfo, tcrefs) let implicitOpSearch() = if IsMangledOpName id.idText then @@ -2653,7 +2655,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified raze (UndefinedName(0, FSComp.SR.undefinedNameValueOfConstructor, id, suggestNamesAndTypes)) ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) item, rest @@ -2679,7 +2681,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified // For each module referenced by 'id', search the module as if it were an F# module and/or a .NET namespace. let moduleSearch ad () = ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest isOpenDecl - (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad) + (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad traitCtxt) // REVIEW: somewhat surprisingly, this shows up on performance traces, with tcrefs non-nil. // This seems strange since we would expect in the vast majority of cases tcrefs is empty here. @@ -2692,7 +2694,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified let tcrefs = let typeNameResInfo = TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite) CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad id2 rest2 typeNameResInfo id.idRange tcrefs + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad traitCtxt id2 rest2 typeNameResInfo id.idRange tcrefs | _ -> NoResultsOrUsefulErrors @@ -2705,7 +2707,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified match nenv.eUnqualifiedItems.TryGetValue id.idText with | true, Item.UnqualifiedType _ | false, _ -> NoResultsOrUsefulErrors - | true, res -> OneSuccess (resInfo, FreshenUnqualifiedItem ncenv m res, rest) + | true, res -> OneSuccess (resInfo, FreshenUnqualifiedItem ncenv traitCtxt m res, rest) moduleSearch ad () +++ tyconSearch ad +++ envSearch @@ -2744,26 +2746,26 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified let failingCase = raze (UndefinedName(0, FSComp.SR.undefinedNameValueNamespaceTypeOrModule, id, suggestEverythingInScope)) ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) item, rest -let ResolveExprLongIdent sink (ncenv: NameResolver) m ad nenv typeNameResInfo lid = +let ResolveExprLongIdent sink (ncenv: NameResolver) m ad traitCtxt nenv typeNameResInfo lid = match lid with | [] -> error (Error(FSComp.SR.nrInvalidExpression(textOfLid lid), m)) - | id :: rest -> ResolveExprLongIdentPrim sink ncenv true OpenQualified m ad nenv typeNameResInfo id rest false + | id :: rest -> ResolveExprLongIdentPrim sink ncenv true OpenQualified m ad traitCtxt nenv typeNameResInfo id rest false //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in patterns //------------------------------------------------------------------------- -let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv numTyArgsOpt ad resInfo depth m modref (mty: ModuleOrNamespaceType) (id: Ident) (rest: Ident list) = +let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv numTyArgsOpt ad traitCtxt resInfo depth m modref (mty: ModuleOrNamespaceType) (id: Ident) (rest: Ident list) = let m = unionRanges m id.idRange match TryFindTypeWithUnionCase modref id with | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> let tcref = modref.NestedTyconRef tycon let ucref = mkUnionCaseRef tcref id.idText let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - let ucinfo = FreshenUnionCaseRef ncenv m ucref + let ucinfo = FreshenUnionCaseRef ncenv traitCtxt m ucref success (resInfo, Item.UnionCase(ucinfo, showDeprecated), rest) | _ -> match mty.ExceptionDefinitionsByDemangledName.TryGetValue id.idText with @@ -2788,7 +2790,7 @@ let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv nu match rest with | id2 :: rest2 -> let tcrefs = tcrefs.Force() - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv: NameResolver) nenv LookupKind.Pattern (depth+1) m ad id2 rest2 numTyArgsOpt id.idRange tcrefs + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv: NameResolver) nenv LookupKind.Pattern (depth+1) m ad traitCtxt id2 rest2 numTyArgsOpt id.idRange tcrefs | _ -> NoResultsOrUsefulErrors @@ -2796,7 +2798,7 @@ let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv nu let ctorSearch() = if isNil rest then tcrefs.Force() - |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv m tcref)) + |> List.map (fun (resInfo, tcref) -> (resInfo, FreshenTycon ncenv traitCtxt m tcref)) |> CollectAtMostOneResult (fun (resInfo, ty) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad ty) |> MapResults (fun (resInfo, item) -> (resInfo, item, [])) else @@ -2809,7 +2811,7 @@ let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv nu match mty.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange, submodref) - OneResult (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) + OneResult (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad traitCtxt resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) | _ -> NoResultsOrUsefulErrors | [] -> NoResultsOrUsefulErrors @@ -2836,13 +2838,13 @@ exception UpperCaseIdentifierInPattern of range type WarnOnUpperFlag = WarnOnUpperCase | AllIdsOK // Long ID in a pattern -let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt (id: Ident) (rest: Ident list) = +let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified warnOnUpper newDef m ad traitCtxt nenv numTyArgsOpt (id: Ident) (rest: Ident list) = if id.idText = MangledGlobalName then match rest with | [] -> error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) | id2 :: rest2 -> - ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt id2 rest2 + ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad traitCtxt nenv numTyArgsOpt id2 rest2 else // Single identifiers in patterns if isNil rest && fullyQualified <> FullyQualified then @@ -2850,7 +2852,7 @@ let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified wa // For the special case of // let C = x match nenv.ePatItems.TryGetValue id.idText with - | true, res when not newDef -> FreshenUnqualifiedItem ncenv m res + | true, res when not newDef -> FreshenUnqualifiedItem ncenv traitCtxt m res | _ -> // Single identifiers in patterns - variable bindings if not newDef && @@ -2864,7 +2866,7 @@ let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified wa else let moduleSearch ad () = ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest false - (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) + (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad traitCtxt) let tyconSearch ad = match rest with @@ -2872,7 +2874,7 @@ let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified wa let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv if isNil tcrefs then NoResultsOrUsefulErrors else let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty, tcref)) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 id.idRange ad id2 rest2 numTyArgsOpt id.idRange tcrefs + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 id.idRange ad traitCtxt id2 rest2 numTyArgsOpt id.idRange tcrefs | _ -> NoResultsOrUsefulErrors @@ -2885,17 +2887,17 @@ let rec ResolvePatternLongIdentPrim sink (ncenv: NameResolver) fullyQualified wa |> AtMostOneResult m |> ForceRaise - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> true)) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> true)) match rest with | [] -> res | element :: _ -> error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(), element.idRange)) /// Resolve a long identifier when used in a pattern. -let ResolvePatternLongIdent sink (ncenv: NameResolver) warnOnUpper newDef m ad nenv numTyArgsOpt (lid: Ident list) = +let ResolvePatternLongIdent sink (ncenv: NameResolver) warnOnUpper newDef m ad traitCtxt nenv numTyArgsOpt (lid: Ident list) = match lid with | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(), m)) - | id :: rest -> ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad nenv numTyArgsOpt id rest + | id :: rest -> ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad traitCtxt nenv numTyArgsOpt id rest //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in types @@ -2961,15 +2963,15 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv: NameResolver) (typeNameResInf AtMostOneResult m tyconSearch /// Resolve a long identifier representing a type name and report the result -let ResolveTypeLongIdentInTyconRef sink (ncenv: NameResolver) nenv typeNameResInfo ad m tcref (lid: Ident list) = +let ResolveTypeLongIdentInTyconRef sink (ncenv: NameResolver) nenv typeNameResInfo ad traitCtxt m tcref (lid: Ident list) = let resInfo, tcref = match lid with | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(), m)) | id :: rest -> ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref id rest) - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> true)) - let item = Item.Types(tcref.DisplayName, [FreshenTycon ncenv m tcref]) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> true)) + let item = Item.Types(tcref.DisplayName, [FreshenTycon ncenv traitCtxt m tcref]) CallNameResolutionSink sink (rangeOfLid lid, nenv, item, item, emptyTyparInst, ItemOccurence.UseInType, nenv.eDisplayEnv, ad) tcref @@ -3108,7 +3110,7 @@ let rec ResolveTypeLongIdentPrim sink (ncenv: NameResolver) occurence first full /// Resolve a long identifier representing a type and report it -let ResolveTypeLongIdent sink (ncenv: NameResolver) occurence fullyQualified nenv ad (lid: Ident list) staticResInfo genOk = +let ResolveTypeLongIdent sink (ncenv: NameResolver) occurence fullyQualified nenv ad traitCtxt (lid: Ident list) staticResInfo genOk = let m = rangeOfLid lid let res = match lid with @@ -3120,8 +3122,8 @@ let ResolveTypeLongIdent sink (ncenv: NameResolver) occurence fullyQualified nen // Register the result as a name resolution match res with | Result (resInfo, tcref) -> - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.UseInType, ad, resInfo, ResultTyparChecker(fun () -> true)) - let item = Item.Types(tcref.DisplayName, [FreshenTycon ncenv m tcref]) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.UseInType, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> true)) + let item = Item.Types(tcref.DisplayName, [FreshenTycon ncenv traitCtxt m tcref]) CallNameResolutionSink sink (m, nenv, item, item, emptyTyparInst, occurence, nenv.eDisplayEnv, ad) | _ -> () res |?> snd @@ -3131,7 +3133,7 @@ let ResolveTypeLongIdent sink (ncenv: NameResolver) occurence fullyQualified nen //------------------------------------------------------------------------- /// Resolve a long identifier representing a record field in a module or namespace -let rec ResolveFieldInModuleOrNamespace (ncenv: NameResolver) nenv ad (resInfo: ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (id: Ident) (rest: Ident list) = +let rec ResolveFieldInModuleOrNamespace (ncenv: NameResolver) nenv ad traitCtxt (resInfo: ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (id: Ident) (rest: Ident list) = let typeNameResInfo = TypeNameResolutionInfo.Default let m = unionRanges m id.idRange // search for module-qualified names, e.g. { Microsoft.FSharp.Core.contents = 1 } @@ -3149,7 +3151,7 @@ let rec ResolveFieldInModuleOrNamespace (ncenv: NameResolver) nenv ad (resInfo: let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) if isNil tcrefs then NoResultsOrUsefulErrors else let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty, tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad traitCtxt id2 rest2 typeNameResInfo id.idRange tcrefs // choose only fields let tyconSearch = tyconSearch |?> List.choose (function (resInfo, Item.RecdField(RecdFieldInfo(_, rfref)), rest) -> Some(resInfo, FieldResolution(rfref, false), rest) | _ -> None) tyconSearch @@ -3163,7 +3165,7 @@ let rec ResolveFieldInModuleOrNamespace (ncenv: NameResolver) nenv ad (resInfo: match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange, submodref) - ResolveFieldInModuleOrNamespace ncenv nenv ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 + ResolveFieldInModuleOrNamespace ncenv nenv ad traitCtxt resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 |> OneResult | _ -> raze (UndefinedName(depth, FSComp.SR.undefinedNameRecordLabelOrNamespace, id, NoSuggestions)) | _ -> raze (UndefinedName(depth, FSComp.SR.undefinedNameRecordLabelOrNamespace, id, NoSuggestions)) @@ -3229,7 +3231,7 @@ let SuggestLabelsOfRelatedRecords g (nenv: NameResolutionEnv) (id: Ident) (allFi UndefinedName(0, FSComp.SR.undefinedNameRecordLabel, id, suggestLabels) /// Resolve a long identifier representing a record field -let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad ty (mp, id: Ident) allFields = +let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad traitCtxt ty (mp, id: Ident) allFields = let typeNameResInfo = TypeNameResolutionInfo.Default let g = ncenv.g let m = id.idRange @@ -3274,7 +3276,7 @@ let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad ty (mp, id: Ident) allFi let tcrefs = LookupTypeNameInEnvNoArity OpenQualified tn.idText nenv if isNil tcrefs then NoResultsOrUsefulErrors else let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty, tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad id2 rest2 typeNameResInfo tn.idRange tcrefs + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad traitCtxt id2 rest2 typeNameResInfo tn.idRange tcrefs // choose only fields let tyconSearch = tyconSearch |?> List.choose (function (resInfo, Item.RecdField(RecdFieldInfo(_, rfref)), rest) -> Some(resInfo, FieldResolution(rfref, false), rest) | _ -> None) tyconSearch @@ -3285,7 +3287,7 @@ let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad ty (mp, id: Ident) allFi | [] -> NoResultsOrUsefulErrors | id2 :: rest2 -> ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m OpenQualified nenv ad id2 rest2 false - (ResolveFieldInModuleOrNamespace ncenv nenv ad) + (ResolveFieldInModuleOrNamespace ncenv nenv ad traitCtxt) let resInfo, item, rest = modulSearch ad () +++ tyconSearch ad +++ modulSearch AccessibleFromSomeFSharpCode +++ tyconSearch AccessibleFromSomeFSharpCode @@ -3297,19 +3299,19 @@ let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad ty (mp, id: Ident) allFi [(resInfo, item)] -let ResolveField sink ncenv nenv ad ty (mp, id) allFields = - let res = ResolveFieldPrim sink ncenv nenv ad ty (mp, id) allFields +let ResolveField sink ncenv nenv ad traitCtxt ty (mp, id) allFields = + let res = ResolveFieldPrim sink ncenv nenv ad traitCtxt ty (mp, id) allFields // Register the results of any field paths "Module.Type" in "Module.Type.field" as a name resolution. (Note, the path resolution // info is only non-empty if there was a unique resolution of the field) let checker = ResultTyparChecker(fun () -> true) res |> List.map (fun (resInfo, rfref) -> - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.UseInType, ad, resInfo, checker) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.UseInType, ad, traitCtxt, resInfo, checker) rfref) /// Generate a new reference to a record field with a fresh type instantiation -let FreshenRecdFieldRef (ncenv: NameResolver) m (rfref: RecdFieldRef) = - Item.RecdField(RecdFieldInfo(ncenv.InstantiationGenerator m (rfref.Tycon.Typars m), rfref)) +let FreshenRecdFieldRef (ncenv: NameResolver) traitCtxt m (rfref: RecdFieldRef) = + Item.RecdField(RecdFieldInfo(ncenv.InstantiationGenerator m (rfref.Tycon.Typars m) traitCtxt, rfref)) /// Resolve F#/IL "." syntax in expressions (2). @@ -3321,9 +3323,9 @@ let FreshenRecdFieldRef (ncenv: NameResolver) m (rfref: RecdFieldRef) = /// determine any valid members // // QUERY (instantiationGenerator cleanup): it would be really nice not to flow instantiationGenerator to here. -let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Ident) rest findFlag = +let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad traitCtxt nenv ty (id: Ident) rest findFlag = let typeNameResInfo = TypeNameResolutionInfo.Default - let adhocDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad id rest findFlag typeNameResInfo ty) + let adhocDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad traitCtxt id rest findFlag typeNameResInfo ty) match adhocDotSearchAccessible with | Exception _ -> // If the dot is not resolved by adhoc overloading then look for a record field @@ -3337,11 +3339,11 @@ let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Iden | true, rfref :: _ -> // NOTE (instantiationGenerator cleanup): we need to freshen here because we don't know the type. // But perhaps the caller should freshen?? - let item = FreshenRecdFieldRef ncenv m rfref + let item = FreshenRecdFieldRef ncenv traitCtxt m rfref OneSuccess (ResolutionInfo.Empty, item, rest) | _ -> NoResultsOrUsefulErrors - let adhocDotSearchAll () = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode id rest findFlag typeNameResInfo ty + let adhocDotSearchAll () = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode traitCtxt id rest findFlag typeNameResInfo ty dotFieldIdSearch +++ adhocDotSearchAll |> AtMostOneResult m @@ -3393,8 +3395,8 @@ type AfterResolution = /// Resolve a long identifier occurring in an expression position. /// /// Called for 'TypeName.Bar' - for VS IntelliSense, we can filter out instance members from method groups -let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameResolver) wholem ad nenv typeNameResInfo lid = - let item1, rest = ResolveExprLongIdent sink ncenv wholem ad nenv typeNameResInfo lid +let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameResolver) wholem ad traitCtxt nenv typeNameResInfo lid = + let item1, rest = ResolveExprLongIdent sink ncenv wholem ad traitCtxt nenv typeNameResInfo lid let itemRange = ComputeItemRange wholem lid rest let item = FilterMethodGroups ncenv itemRange item1 true @@ -3454,18 +3456,18 @@ let (|NonOverridable|_|) namedItem = /// Called for 'expression.Bar' - for VS IntelliSense, we can filter out static members from method groups /// Also called for 'GenericType.Bar' - for VS IntelliSense, we can filter out non-static members from method groups -let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameResolver) wholem ad nenv ty lid findFlag thisIsActuallyATyAppNotAnExpr = +let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameResolver) wholem ad traitCtxt nenv ty lid findFlag thisIsActuallyATyAppNotAnExpr = let resolveExpr findFlag = let resInfo, item, rest = match lid with | id :: rest -> - ResolveExprDotLongIdent ncenv wholem ad nenv ty id rest findFlag + ResolveExprDotLongIdent ncenv wholem ad traitCtxt nenv ty id rest findFlag | _ -> error(InternalError("ResolveExprDotLongIdentAndComputeRange", wholem)) let itemRange = ComputeItemRange wholem lid rest resInfo, item, rest, itemRange // "true" resolution let resInfo, item, rest, itemRange = resolveExpr findFlag - ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap itemRange item)) + ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurence.Use, ad, traitCtxt, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap itemRange item)) // Record the precise resolution of the field for intellisense/goto definition let afterResolution = @@ -3522,7 +3524,7 @@ let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameRes //------------------------------------------------------------------------- /// A generator of type instantiations used when no more specific type instantiation is known. -let FakeInstantiationGenerator (_m: range) gps = List.map mkTyparTy gps +let FakeInstantiationGenerator = (fun (_m: range) gps (_traitCtxt: ITraitContext option) -> List.map mkTyparTy gps) // note: using local refs is ok since it is only used by VS let ItemForModuleOrNamespaceRef v = Item.ModuleOrNamespaces [v] @@ -3557,7 +3559,7 @@ let ItemIsUnseen ad g amap m item = | _ -> false let ItemOfTyconRef ncenv m (x: TyconRef) = - Item.Types (x.DisplayName, [FreshenTycon ncenv m x]) + Item.Types (x.DisplayName, [FreshenTycon ncenv traitCtxtNone m x]) let ItemOfTy g x = let nm = @@ -3605,6 +3607,7 @@ type ResolveCompletionTargets = /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions, qualified by type. let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: ResolveCompletionTargets) m ad statics ty = + let traitCtxt = traitCtxtNone protectAssemblyExploration [] <| fun () -> let g = ncenv.g let amap = ncenv.amap @@ -3634,7 +3637,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso let nestedTypes = if completionTargets.ResolveAll && statics then ty - |> GetNestedTypesOfType (ad, ncenv, None, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) + |> GetNestedTypesOfType (ncenv, ad, traitCtxt, None, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) else [] @@ -3667,7 +3670,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso let delegateType = einfo.GetDelegateType(amap, m) let (SigOfFunctionForDelegate(invokeMethInfo, _, _, _)) = GetSigOfFunctionForDelegate ncenv.InfoReader delegateType m ad // Only events with void return types are suppressed in intellisense. - if slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(amap, m)) then + if slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(amap, m, traitCtxtNone)) then yield einfo.AddMethod.DisplayName yield einfo.RemoveMethod.DisplayName ] else [] @@ -3817,6 +3820,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMeth m ad statics plid ty = let g = ncenv.g let amap = ncenv.amap + let traitCtxt = traitCtxtNone match plid with | [] -> ResolveCompletionsInType ncenv nenv isApplicableMeth m ad statics ty | id :: rest -> @@ -3827,7 +3831,7 @@ let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMet let nestedTypes = ty - |> GetNestedTypesOfType (ad, ncenv, Some id, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) + |> GetNestedTypesOfType (ncenv, ad, traitCtxt, Some id, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) // e.g. .. (rfinfos |> List.collect (fun x -> x.FieldType |> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest)) @ @@ -3872,7 +3876,7 @@ let InfosForTyconConstructors (ncenv: NameResolver) m ad (tcref: TyconRef) = if tcref.IsTypeAbbrev then [] else - let ty = FreshenTycon ncenv m tcref + let ty = FreshenTycon ncenv traitCtxtNone m tcref match ResolveObjectConstructor ncenv (DisplayEnv.Empty g) m ad ty with | Result item -> match item with @@ -4055,7 +4059,7 @@ let TryToResolveLongIdentAsType (ncenv: NameResolver) (nenv: NameResolutionEnv) |> List.tryHead |> Option.map (fun tcref -> let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m - FreshenTycon ncenv m tcref) + FreshenTycon ncenv traitCtxtNone m tcref) | _ -> None /// allowObsolete - specifies whether we should return obsolete types & modules @@ -4152,7 +4156,7 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE // type.lookup: lookup a static something in a type for tcref in LookupTypeNameInEnvNoArity OpenQualified id nenv do let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m - let ty = FreshenTycon ncenv m tcref + let ty = FreshenTycon ncenv traitCtxtNone m tcref yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad true rest ty ] namespaces @ values @ staticSomethingInType @@ -4204,7 +4208,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe for tycon in tycons do let nested = modref.NestedTyconRef tycon if IsEntityAccessible ncenv.amap m ad nested then - let ttype = FreshenTycon ncenv m nested + let ttype = FreshenTycon ncenv traitCtxtNone m nested yield! ncenv.InfoReader.GetRecordOrClassFieldsOfType(None, ad, m, ttype) |> List.map Item.RecdField @@ -4227,7 +4231,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe |> List.filter (fun tc -> tc.IsRecordTycon) |> List.collect (fun tycon -> let tcref = modref.NestedTyconRef tycon - let ttype = FreshenTycon ncenv m tcref + let ttype = FreshenTycon ncenv traitCtxtNone m tcref ncenv.InfoReader.GetRecordOrClassFieldsOfType(None, ad, m, ttype)) |> List.map Item.RecdField | _ -> [] @@ -4302,7 +4306,7 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv: let tycons = LookupTypeNameInEnvNoArity OpenQualified id nenv tycons |> List.collect (fun tcref -> - let ttype = FreshenTycon ncenv m tcref + let ttype = FreshenTycon ncenv traitCtxtNone m tcref ncenv.InfoReader.GetRecordOrClassFieldsOfType(None, ad, m, ttype)) |> List.map Item.RecdField | _-> [] @@ -4345,7 +4349,7 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( |> List.map Item.ILField | Item.Types _ -> if statics then - yield! ty |> GetNestedTypesOfType (ad, ncenv, None, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) |> List.map (ItemOfTy g) + yield! ty |> GetNestedTypesOfType (ncenv, ad, traitCtxtNone, None, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) |> List.map (ItemOfTy g) | _ -> if not statics then match tryDestAnonRecdTy g ty with @@ -4381,11 +4385,10 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( let delegateType = einfo.GetDelegateType(amap, m) let (SigOfFunctionForDelegate(invokeMethInfo, _, _, _)) = GetSigOfFunctionForDelegate ncenv.InfoReader delegateType m ad // Only events with void return types are suppressed in intellisense. - if slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(amap, m)) then + if slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(amap, m, traitCtxtNone)) then yield einfo.AddMethod.DisplayName yield einfo.RemoveMethod.DisplayName ] - let pinfos = pinfosIncludingUnseen |> List.filter (fun x -> not (PropInfoIsUnseen m x)) @@ -4510,7 +4513,7 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta ncenv.InfoReader.GetRecordOrClassFieldsOfType(None, ad, m, ty) |> List.filter (fun fref -> fref.Name = id && IsRecdFieldAccessible ncenv.amap m ad fref.RecdFieldRef && fref.RecdField.IsStatic = statics) - let nestedTypes = ty |> GetNestedTypesOfType (ad, ncenv, Some id, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) + let nestedTypes = ty |> GetNestedTypesOfType (ncenv, ad, traitCtxtNone, Some id, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) // e.g. .. for rfinfo in rfinfos do @@ -4736,7 +4739,7 @@ let rec GetCompletionForItem (ncenv: NameResolver) (nenv: NameResolutionEnv) m a // type.lookup: lookup a static something in a type for tcref in LookupTypeNameInEnvNoArity OpenQualified id nenv do let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m - let ty = FreshenTycon ncenv m tcref + let ty = FreshenTycon ncenv traitCtxtNone m tcref yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad true rest item ty } diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 903a2ef6d62..0e2dd0ed3b6 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -18,7 +18,7 @@ open FSharp.Compiler.Text /// A NameResolver is a context for name resolution. It primarily holds an InfoReader. type NameResolver = - new : g:TcGlobals * amap:ImportMap * infoReader:InfoReader * instantiationGenerator:(range -> Typars -> TypeInst) -> NameResolver + new : g:TcGlobals * amap:ImportMap * infoReader:InfoReader * instantiationGenerator: (range -> Typars -> ITraitContext option -> TypeInst) -> NameResolver member InfoReader : InfoReader member amap : ImportMap member g : TcGlobals @@ -150,8 +150,6 @@ type ExtensionMember = /// IL-style extension member, backed by some kind of method with an [] attribute | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority - interface TraitPossibleExtensionMemberSolution - /// The logical name, e.g. for constraint solving member LogicalName : string @@ -159,6 +157,8 @@ type ExtensionMember = /// later through 'open' get priority in overload resolution. member Priority : ExtensionMethodPriority +/// Freshen a trait for use at a particular location + /// The environment of information used to resolve names [] type NameResolutionEnv = @@ -499,7 +499,7 @@ exception internal IndeterminateType of range exception internal UpperCaseIdentifierInPattern of range /// Generate a new reference to a record field with a fresh type instantiation -val FreshenRecdFieldRef :NameResolver -> Range.range -> Tast.RecdFieldRef -> Item +val FreshenRecdFieldRef: NameResolver -> ITraitContext option -> Range.range -> Tast.RecdFieldRef -> Item /// Indicates the kind of lookup being performed. Note, this type should be made private to nameres.fs. [] @@ -530,28 +530,25 @@ val internal ResolveLongIndentAsModuleOrNamespaceOrStaticClass : TcResultsSink val internal ResolveObjectConstructor : NameResolver -> DisplayEnv -> range -> AccessorDomain -> TType -> ResultOrException /// Resolve a long identifier using type-qualified name resolution. -val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list +val internal ResolveLongIdentInType: TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> ITraitContext option -> Ident -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list /// Resolve a long identifier when used in a pattern. -val internal ResolvePatternLongIdent : TcResultsSink -> NameResolver -> WarnOnUpperFlag -> bool -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item +val internal ResolvePatternLongIdent : TcResultsSink -> NameResolver -> WarnOnUpperFlag -> bool -> range -> AccessorDomain -> ITraitContext option -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item /// Resolve a long identifier representing a type name -val internal ResolveTypeLongIdentInTyconRef : TcResultsSink -> NameResolver -> NameResolutionEnv -> TypeNameResolutionInfo -> AccessorDomain -> range -> ModuleOrNamespaceRef -> Ident list -> TyconRef +val internal ResolveTypeLongIdentInTyconRef: TcResultsSink -> NameResolver -> NameResolutionEnv -> TypeNameResolutionInfo -> AccessorDomain -> ITraitContext option -> range -> ModuleOrNamespaceRef -> Ident list -> TyconRef /// Resolve a long identifier to a type definition -val internal ResolveTypeLongIdent : TcResultsSink -> NameResolver -> ItemOccurence -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident list -> TypeNameResolutionStaticArgsInfo -> PermitDirectReferenceToGeneratedType -> ResultOrException +val internal ResolveTypeLongIdent: TcResultsSink -> NameResolver -> ItemOccurence -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> ITraitContext option -> Ident list -> TypeNameResolutionStaticArgsInfo -> PermitDirectReferenceToGeneratedType -> ResultOrException /// Resolve a long identifier to a field -val internal ResolveField : TcResultsSink -> NameResolver -> NameResolutionEnv -> AccessorDomain -> TType -> Ident list * Ident -> Ident list -> FieldResolution list +val internal ResolveField: TcResultsSink -> NameResolver -> NameResolutionEnv -> AccessorDomain -> ITraitContext option -> TType -> Ident list * Ident -> Ident list -> FieldResolution list /// Resolve a long identifier occurring in an expression position -val internal ResolveExprLongIdent : TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item * Ident list - -/// Resolve a (possibly incomplete) long identifier to a loist of possible class or record fields -val internal ResolvePartialLongIdentToClassOrRecdFields : NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> Item list +val internal ResolveExprLongIdent: TcResultsSink -> NameResolver -> range -> AccessorDomain -> ITraitContext option -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item * Ident list /// Return the fields for the given class or record -val internal ResolveRecordOrClassFieldsOfType : NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list +val internal ResolveRecordOrClassFieldsOfType: NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list /// Specifies extra work to do after overload resolution [] @@ -571,17 +568,20 @@ type AfterResolution = | RecordResolution of Item option * (TyparInst -> unit) * (MethInfo * PropInfo option * TyparInst -> unit) * (unit -> unit) /// Resolve a long identifier occurring in an expression position. -val internal ResolveLongIdentAsExprAndComputeRange : TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item * range * Ident list * AfterResolution +val internal ResolveLongIdentAsExprAndComputeRange : TcResultsSink -> NameResolver -> range -> AccessorDomain -> ITraitContext option -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item * range * Ident list * AfterResolution /// Resolve a long identifier occurring in an expression position, qualified by a type. -val internal ResolveExprDotLongIdentAndComputeRange : TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TType -> Ident list -> FindMemberFlag -> bool -> Item * range * Ident list * AfterResolution +val internal ResolveExprDotLongIdentAndComputeRange : TcResultsSink -> NameResolver -> range -> AccessorDomain -> ITraitContext option -> NameResolutionEnv -> TType -> Ident list -> FindMemberFlag -> bool -> Item * range * Ident list * AfterResolution /// A generator of type instantiations used when no more specific type instantiation is known. -val FakeInstantiationGenerator : range -> Typar list -> TType list +val FakeInstantiationGenerator : (range -> Typars -> ITraitContext option -> TypeInst) /// Try to resolve a long identifier as type. val TryToResolveLongIdentAsType : NameResolver -> NameResolutionEnv -> range -> string list -> TType option +/// Resolve a (possibly incomplete) long identifier to a loist of possible class or record fields +val internal ResolvePartialLongIdentToClassOrRecdFields : NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> Item list + /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions. val ResolvePartialLongIdent : NameResolver -> NameResolutionEnv -> (MethInfo -> TType -> bool) -> range -> AccessorDomain -> string list -> bool -> Item list @@ -599,3 +599,6 @@ val IsItemResolvable : NameResolver -> NameResolutionEnv -> range -> AccessorDom val TrySelectExtensionMethInfoOfILExtMem : range -> ImportMap -> TType -> TyconRef * MethInfo * ExtensionMethodPriority -> MethInfo option +val traitCtxtNone: ITraitContext option + +val ExtensionMethInfosOfTypeInScope: ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> range -> TType -> MethInfo list diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 598a963341b..11a7a92e275 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -864,7 +864,7 @@ module private PrintTypes = WordL.arrow ^^ (layoutTyparRefWithInfo denv env tp)) |> longConstraintPrefix] - and private layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argtys, rty, _, _, _)) = + and private layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argtys, rty, _, _)) = let nm = DemangleOperatorName nm if denv.shortConstraints then WordL.keywordMember ^^ wordL (tagMember nm) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 1a98462fa5f..456db3a5927 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -325,7 +325,7 @@ let rec CheckTypeDeep (cenv: cenv) ((visitTy, visitTyconRefOpt, visitAppTyOpt, v | TType_var tp when tp.Solution.IsSome -> for cx in tp.Constraints do match cx with - | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln, _, _)), _) -> + | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln, _)), _) -> match visitTraitSolutionOpt, !soln with | Some visitTraitSolution, Some sln -> visitTraitSolution sln | _ -> () @@ -402,7 +402,7 @@ and CheckTypeConstraintDeep cenv f g env x = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> () -and CheckTraitInfoDeep cenv ((_, _, _, visitTraitSolutionOpt, _) as f) g env (TTrait(tys, _, _, argtys, rty, soln, _extSlns, _ad)) = +and CheckTraitInfoDeep cenv ((_, _, _, visitTraitSolutionOpt, _) as f) g env (TTrait(tys, _, _, argtys, rty, soln, _traitCtxt)) = CheckTypesDeep cenv f g env tys CheckTypesDeep cenv f g env argtys Option.iter (CheckTypeDeep cenv f g env true ) rty diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 39d2ff504ff..0e9dffd5545 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -105,14 +105,14 @@ type Remap = removeTraitSolutions: bool /// A map indicating how to fill in extSlns for traits as we copy an expression. Indexed by the member name of the trait - extSlnsMap: Map } + traitCtxtsMap: Map } let emptyRemap = { tpinst = emptyTyparInst tyconRefRemap = emptyTyconRefRemap valRemap = ValMap.Empty removeTraitSolutions = false - extSlnsMap = Map.empty } + traitCtxtsMap = Map.empty } type Remap with static member Empty = emptyRemap @@ -267,7 +267,7 @@ and remapTyparConstraintsAux tyenv cs = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> Some x) -and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, extSlns, ad)) = +and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, traitCtxt)) = let slnCell = match !slnCell with | None -> None @@ -289,11 +289,11 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, extSlns, ad)) ClosedExprSln e // no need to remap because it is a closed expression, referring only to external types Some sln - let extSlnsNew = - if tyenv.extSlnsMap.ContainsKey nm then - tyenv.extSlnsMap.[nm] + let traitCtxtNew = + if tyenv.traitCtxtsMap.ContainsKey nm then + Some tyenv.traitCtxtsMap.[nm] else - extSlns + traitCtxt // Note: we reallocate a new solution cell (though keep existing solutions unless 'removeTraitSolutions'=true) on every traversal of a trait constraint // This feels incorrect for trait constraints that are quantified: it seems we should have @@ -303,7 +303,7 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, extSlns, ad)) // The danger here is that a solution for one syntactic occurrence of a trait constraint won't // be propagated to other, "linked" solutions. However trait constraints don't appear in any algebra // in the same way as types - TTrait(remapTypesAux tyenv tys, nm, mf, remapTypesAux tyenv argtys, Option.map (remapTypeAux tyenv) rty, ref slnCell, extSlnsNew, ad) + TTrait(remapTypesAux tyenv tys, nm, mf, remapTypesAux tyenv argtys, Option.map (remapTypeAux tyenv) rty, ref slnCell, traitCtxtNew) and bindTypars tps tyargs tpinst = match tps with @@ -397,7 +397,7 @@ let mkInstRemap tpinst = tpinst = tpinst valRemap = ValMap.Empty removeTraitSolutions = false - extSlnsMap = Map.empty } + traitCtxtsMap = Map.empty } // entry points for "typar -> TType" instantiation let instType tpinst x = if isNil tpinst then x else remapTypeAux (mkInstRemap tpinst) x @@ -908,8 +908,8 @@ type TypeEquivEnv with TypeEquivEnv.Empty.BindEquivTypars tps1 tps2 let rec traitsAEquivAux erasureFlag g aenv traitInfo1 traitInfo2 = - let (TTrait(tys1, nm, mf1, argtys, rty, _, _extSlnsNew, _ad)) = traitInfo1 - let (TTrait(tys2, nm2, mf2, argtys2, rty2, _, _extSlnsNew2, _ad2)) = traitInfo2 + let (TTrait(tys1, nm, mf1, argtys, rty, _, _traitCtxt)) = traitInfo1 + let (TTrait(tys2, nm2, mf2, argtys2, rty2, _, _traitCtxt2)) = traitInfo2 mf1 = mf2 && nm = nm2 && ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 && @@ -2045,7 +2045,7 @@ and accFreeInTyparConstraint opts tpc acc = | TyparConstraint.IsUnmanaged _ | TyparConstraint.RequiresDefaultConstructor _ -> acc -and accFreeInTrait opts (TTrait(tys, _, _, argtys, rty, sln, _, _ad)) acc = +and accFreeInTrait opts (TTrait(tys, _, _, argtys, rty, sln, _)) acc = Option.foldBack (accFreeInTraitSln opts) sln.Value (accFreeInTypes opts tys (accFreeInTypes opts argtys @@ -2165,7 +2165,7 @@ and accFreeInTyparConstraintLeftToRight g cxFlag thruFlag acc tpc = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> acc -and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argtys, rty, _, _extSlns, _ad)) = +and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argtys, rty, _, _traitCtxt)) = let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc tys let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc argtys let acc = Option.fold (accFreeInTypeLeftToRight g cxFlag thruFlag) acc rty @@ -2230,49 +2230,50 @@ let valsOfBinds (binds: Bindings) = binds |> List.map (fun b -> b.Var) //-------------------------------------------------------------------------- // Collect extSlns. This is done prior to beta reduction of type parameters when inlining. We take the (solved) -// type arguments and strip them for extSlns, and record those extSlns in the remapped/copied/instantiated body +// type arguments and strip them for trait contexts, and use those in the remapped/copied/instantiated body // of the implementation. //-------------------------------------------------------------------------- -let rec accExtSlnsInTyparConstraints acc cxs = - List.fold accExtSlnsInTyparConstraint acc cxs +let rec accTraitCtxtsInTyparConstraints acc cxs = + List.fold accTraitCtxtsInTyparConstraint acc cxs -and accExtSlnsInTyparConstraint acc tpc = +and accTraitCtxtsInTyparConstraint acc tpc = match tpc with - | TyparConstraint.MayResolveMember (traitInfo, _) -> accExtSlnsInTrait acc traitInfo + | TyparConstraint.MayResolveMember (traitInfo, _) -> accTraitCtxtsInTrait acc traitInfo | _ -> acc -and accExtSlnsInTrait acc (TTrait(_typs, nm, _, _argtys, _rty, _, extSlns, _ad)) = - // We don't traverse the contents of traits, that wouldn't terminate and is not necessary since the type variables individiaull contain the extSlns we need - //let acc = accExtSlnsInTypes g acc typs - //let acc = accExtSlnsInTypes g acc argtys - //let acc = Option.fold (accExtSlnsInType g) acc rty +and accTraitCtxtsInTrait acc (TTrait(_typs, nm, _, _argtys, _rty, _, traitCtxt)) = + // We don't traverse the contents of traits, that wouldn't terminate and is not necessary since the type variables individiually contain the contexts we need + //let acc = accTraitCtxtsInTypes g acc typs + //let acc = accTraitCtxtsInTypes g acc argtys + //let acc = Option.fold (accTraitCtxtsInType g) acc rty // Only record the extSlns if they have been solved in a useful way - if isNil extSlns then acc else - Map.add nm extSlns acc + match traitCtxt with + | None -> acc + | Some c -> Map.add nm c acc -and accExtSlnsTyparRef acc (tp:Typar) = - let acc = accExtSlnsInTyparConstraints acc tp.Constraints +and accTraitCtxtsTyparRef acc (tp:Typar) = + let acc = accTraitCtxtsInTyparConstraints acc tp.Constraints match tp.Solution with | None -> acc - | Some sln -> accExtSlnsInType acc sln + | Some sln -> accTraitCtxtsInType acc sln -and accExtSlnsInType acc ty = +and accTraitCtxtsInType acc ty = // NOTE: Unlike almost everywhere else, we do NOT strip ANY equations here. // We _must_ traverse the solved typar containing the new extSlns for the grounded typar constraint, that's the whole point match ty with | TType_tuple (_, tys) | TType_anon (_, tys) | TType_app (_, tys) - | TType_ucase (_, tys) -> accExtSlnsInTypes acc tys - | TType_fun (d, r) -> accExtSlnsInType (accExtSlnsInType acc d) r - | TType_var r -> accExtSlnsTyparRef acc r - | TType_forall (_tps, r) -> accExtSlnsInType acc r - | TType_measure unt -> List.foldBack (fun (tp, _) acc -> accExtSlnsTyparRef acc tp) (ListMeasureVarOccsWithNonZeroExponents unt) acc + | TType_ucase (_, tys) -> accTraitCtxtsInTypes acc tys + | TType_fun (d, r) -> accTraitCtxtsInType (accTraitCtxtsInType acc d) r + | TType_var r -> accTraitCtxtsTyparRef acc r + | TType_forall (_tps, r) -> accTraitCtxtsInType acc r + | TType_measure unt -> List.foldBack (fun (tp, _) acc -> accTraitCtxtsTyparRef acc tp) (ListMeasureVarOccsWithNonZeroExponents unt) acc -and accExtSlnsInTypes acc tys = (acc, tys) ||> List.fold accExtSlnsInType +and accTraitCtxtsInTypes acc tys = (acc, tys) ||> List.fold accTraitCtxtsInType -let extSlnsInTypes tys = accExtSlnsInTypes Map.empty tys +let traitCtxtsInTypes tys = accTraitCtxtsInTypes Map.empty tys //-------------------------------------------------------------------------- // Values representing member functions on F# types @@ -3470,7 +3471,7 @@ module DebugPrint = and auxTraitL env (ttrait: TraitConstraintInfo) = #if DEBUG - let (TTrait(tys, nm, memFlags, argtys, rty, _, _extSlns, _ad)) = ttrait + let (TTrait(tys, nm, memFlags, argtys, rty, _, _traitCtxt)) = ttrait match global_g with | None -> wordL (tagText "") | Some g -> @@ -4068,7 +4069,7 @@ let mkRepackageRemapping mrpi = tpinst = emptyTyparInst tyconRefRemap = TyconRefMap.OfList mrpi.RepackagedEntities removeTraitSolutions = false - extSlnsMap = Map.empty } + traitCtxtsMap = Map.empty } //-------------------------------------------------------------------------- // Compute instances of the above for mty -> mty @@ -4701,7 +4702,7 @@ and accFreeInOp opts op acc = | TOp.Reraise -> accUsesRethrow true acc - | TOp.TraitCall (TTrait (tys, _, _, argtys, rty, sln, _extSlns, _ad)) -> + | TOp.TraitCall (TTrait (tys, _, _, argtys, rty, sln, _traitCtxt)) -> Option.foldBack (accFreeVarsInTraitSln opts) sln.Value (accFreeVarsInTys opts tys (accFreeVarsInTys opts argtys @@ -5569,8 +5570,8 @@ let copyImplFile g compgen e = remapImplFile g compgen Remap.Empty e |> fst /// Copy an expression applying a type instantiation. let instExpr g tpinst e = - let extSlnsMap = extSlnsInTypes (List.map snd tpinst) - remapExpr g CloneAll { mkInstRemap tpinst with extSlnsMap = extSlnsMap } e + let traitCtxtsMap = traitCtxtsInTypes (List.map snd tpinst) + remapExpr g CloneAll { mkInstRemap tpinst with traitCtxtsMap = traitCtxtsMap } e //-------------------------------------------------------------------------- // Replace Marks - adjust debugging marks when a lambda gets diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 91e0847cd1e..ea3385e1894 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -539,8 +539,8 @@ type Remap = /// Remove existing trait solutions? removeTraitSolutions: bool - /// A map indicating how to fill in extSlns for traits as we copy an expression. Indexed by the member name of the trait - extSlnsMap: Map } + /// A map indicating how to fill in trait contexts for traits as we copy an expression. Indexed by the member name of the trait + traitCtxtsMap: Map } static member Empty : Remap diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 913fb6b17e3..e9bb6e3231a 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1504,7 +1504,7 @@ let p_trait_sln sln st = p_byte 5 st; p_tup3 p_anonInfo p_tys p_int (a, b, c) st -let p_trait (TTrait(a, b, c, d, e, f, _extSlns, _ad)) st = +let p_trait (TTrait(a, b, c, d, e, f, _traitCtxt)) st = // The _extSlns do not get pickled. We are assuming this is a generic or solved constraint p_tup6 p_tys p_string p_MemberFlags p_tys (p_option p_ty) (p_option p_trait_sln) (a, b, c, d, e, !f) st @@ -1542,7 +1542,7 @@ let u_trait st = // extSlns starts empty when reading trait constraints from pickled // data. This is ok as only generalized (pre-solution, pre-freshened) // or solved constraints are propagated across assembly boundaries. - TTrait (a, b, c, d, e, ref f, [], None) + TTrait (a, b, c, d, e, ref f, None) let p_rational q st = p_int32 (GetNumerator q) st; p_int32 (GetDenominator q) st diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index dd9c575f885..9729f5f3d86 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -221,7 +221,23 @@ type TcEnv = member tenv.AccessRights = tenv.eAccessRights - member tenv.TraitFreshner = Some (GetTraitFreshner tenv.g tenv.AccessRights tenv.NameEnv) + /// Makes this environment available in a form that can be stored into a trait during solving. + member tenv.TraitContext = Some (tenv :> ITraitContext) + + interface ITraitContext with + + member tenv.SelectExtensionMethods(traitInfo, m, infoReader) = + let infoReader = unbox(infoReader) + if tenv.g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + [ for traitSupportTy in traitInfo.SupportTypes do + if not (isTyparTy tenv.g traitSupportTy) then + let extMethInfos = ExtensionMethInfosOfTypeInScope ResultCollectionSettings.AllResults infoReader tenv.eNameResEnv (Some traitInfo.MemberName) m traitSupportTy + for extMethInfo in extMethInfos do + yield (extMethInfo :> ITraitExtensionMember) ] + else + [] + + member tenv.AccessRights = (tenv.eAccessRights :> ITraitAccessorDomain) override tenv.ToString() = "TcEnv(...)" @@ -521,7 +537,7 @@ type cenv = /// Create a new compilation environment static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring) = let infoReader = new InfoReader(g, amap) - let instantiationGenerator m tpsorig = ConstraintSolver.FreshenTypars None m tpsorig // TODO: check 'None' here for env.TraitFreshner + let instantiationGenerator m tpsorig traitCtxt = ConstraintSolver.FreshenTypars traitCtxt m tpsorig let nameResolver = new NameResolver(g, amap, infoReader, instantiationGenerator) { g = g amap = amap @@ -896,7 +912,7 @@ let TcConst cenv ty m env c = | SynMeasure.One -> Measure.One | SynMeasure.Named(tc, m) -> let ad = env.eAccessRights - let tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Use OpenQualified env.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) + let tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Use OpenQualified env.eNameResEnv ad env.TraitContext tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match tcref.TypeOrMeasureKind with | TyparKind.Type -> error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) | TyparKind.Measure -> Measure.Con tcref @@ -1980,7 +1996,7 @@ let BuildFieldMap cenv env isPartial ty flds m = let allFields = flds |> List.map (fun ((_, ident), _) -> ident) flds |> List.map (fun (fld, fldExpr) -> - let frefSet = ResolveField cenv.tcSink cenv.nameResolver env.eNameResEnv ad ty fld allFields + let frefSet = ResolveField cenv.tcSink cenv.nameResolver env.eNameResEnv ad env.TraitContext ty fld allFields fld, frefSet, fldExpr) let relevantTypeSets = @@ -2010,7 +2026,7 @@ let BuildFieldMap cenv env isPartial ty flds m = | [FieldResolution(fref2, showDeprecated)] -> // Record the precise resolution of the field for intellisense - let item = FreshenRecdFieldRef cenv.nameResolver m fref2 + let item = FreshenRecdFieldRef cenv.nameResolver env.TraitContext m fref2 CallNameResolutionSink cenv.tcSink ((snd fld).idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) CheckRecdFieldAccessible cenv.amap m env.eAccessRights fref2 |> ignore @@ -2069,7 +2085,7 @@ let UnionCaseOrExnCheck (env: TcEnv) numArgTys numArgs m = let TcUnionCaseOrExnField cenv (env: TcEnv) ty1 m c n funcs = let ad = env.eAccessRights let mkf, argTys, _argNames = - match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false m ad env.eNameResEnv TypeNameResolutionInfo.Default c with + match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false m ad env.TraitContext env.eNameResEnv TypeNameResolutionInfo.Default c with | (Item.UnionCase _ | Item.ExnCase _) as item -> ApplyUnionCaseOrExn funcs m cenv env ty1 item | _ -> error(Error(FSComp.SR.tcUnknownUnion(), m)) @@ -2536,7 +2552,7 @@ module BindingNormalization = let typars = match tyargs with None -> inferredTyparDecls | Some typars -> typars match memberFlagsOpt with | None -> - match ResolvePatternLongIdent cenv.tcSink nameResolver AllIdsOK true m ad env.NameEnv TypeNameResolutionInfo.Default longId with + match ResolvePatternLongIdent cenv.tcSink nameResolver AllIdsOK true m ad env.TraitContext env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> if id.idText = opNameCons then NormalizedBindingPat(pat, rhsExpr, valSynData, typars) @@ -2844,7 +2860,7 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op /// simplified version of TcVal used in calls to BuildMethodCall (typrelns.fs) /// this function is used on typechecking step for making calls to provided methods and on optimization step (for the same purpose). -let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = +let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = let v = vref.Deref let vty = vref.Type // byref-typed values get dereferenced @@ -2853,13 +2869,13 @@ let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTy else match v.LiteralValue with | Some c -> - let _, _, _, tau = FreshenPossibleForallTy None g m TyparRigidity.Flexible vty + let _, _, _, tau = FreshenPossibleForallTy traitCtxt g m TyparRigidity.Flexible vty Expr.Const (c, m, tau), tau | None -> // Instantiate the value let tau = // If we have got an explicit instantiation then use that - let _, tps, tptys, tau = FreshenPossibleForallTy None g m TyparRigidity.Flexible vty + let _, tps, tptys, tau = FreshenPossibleForallTy traitCtxtNone g m TyparRigidity.Flexible vty if tptys.Length <> vrefTypeInst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tps.Length, vrefTypeInst.Length), m)) instType (mkTyparInst tps vrefTypeInst) tau @@ -3029,14 +3045,14 @@ let BuildPossiblyConditionalMethodCall cenv env isMutable m isProp minfo valUseF // BuildInvokerExpressionForProvidedMethodCall converts references to F# intrinsics back to values // and uses TcVal to do this. However we don't want to check attributes again for provided references to values, // so we pass 'false' for 'checkAttributes'. - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g - let _, retExpt, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (cenv.g, cenv.amap, mi, objArgs, isMutable, isProp, valUseFlags, args, m) + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext + let _, retExpt, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (cenv.g, cenv.amap, env.TraitContext, mi, objArgs, isMutable, isProp, valUseFlags, args, m) retExpt, retTy | _ -> #endif let tcVal valref valUse ttypes m = - let _, a, _, b, _, _ = TcVal env.TraitFreshner true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m + let _, a, _, b, _, _ = TcVal env.TraitContext true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m a, b BuildMethodCall tcVal cenv.g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args @@ -3179,7 +3195,7 @@ let (|JoinRelation|_|) cenv env (e: SynExpr) = let isOpName opName vref s = (s = opName) && - match ResolveExprLongIdent cenv.tcSink cenv.nameResolver m ad env.eNameResEnv TypeNameResolutionInfo.Default [ident(opName, m)] with + match ResolveExprLongIdent cenv.tcSink cenv.nameResolver m ad env.TraitContext env.eNameResEnv TypeNameResolutionInfo.Default [ident(opName, m)] with | Item.Value vref2, [] -> valRefEq cenv.g vref vref2 | _ -> false @@ -3292,7 +3308,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result getEnumerator_minfo -> - let getEnumerator_minst = FreshenMethInfo env.TraitFreshner m getEnumerator_minfo + let getEnumerator_minst = FreshenMethInfo env.TraitContext m getEnumerator_minfo let retTypeOfGetEnumerator = getEnumerator_minfo.GetFSharpReturnTy(cenv.amap, m, getEnumerator_minst) if hasArgs getEnumerator_minfo getEnumerator_minst then err true tyToSearchForGetEnumeratorAndItem else @@ -3300,7 +3316,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result moveNext_minfo -> - let moveNext_minst = FreshenMethInfo env.TraitFreshner m moveNext_minfo + let moveNext_minst = FreshenMethInfo env.TraitContext m moveNext_minfo let retTypeOfMoveNext = moveNext_minfo.GetFSharpReturnTy(cenv.amap, m, moveNext_minst) if not (typeEquiv cenv.g cenv.g.bool_ty retTypeOfMoveNext) then err false retTypeOfGetEnumerator else if hasArgs moveNext_minfo moveNext_minst then err false retTypeOfGetEnumerator else @@ -3309,7 +3325,7 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr | Exception e -> Exception e | Result get_Current_minfo -> - let get_Current_minst = FreshenMethInfo env.TraitFreshner m get_Current_minfo + let get_Current_minst = FreshenMethInfo env.TraitContext m get_Current_minfo if hasArgs get_Current_minfo get_Current_minst then err false retTypeOfGetEnumerator else let enumElemTy = get_Current_minfo.GetFSharpReturnTy(cenv.amap, m, get_Current_minst) @@ -4375,7 +4391,7 @@ let rec TcTyparConstraint ridx cenv newOk checkCxs occ (env: TcEnv) tpenv c = | WhereTyparSupportsMember(tps, memSpfn, m) -> let traitInfo, tpenv = TcPseudoMemberSpec cenv newOk env tps tpenv memSpfn m match traitInfo with - | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _, _, _) when memberFlags.MemberKind = MemberKind.Constructor -> + | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _, _) when memberFlags.MemberKind = MemberKind.Constructor -> match objtys, argTys with | [ty], [] when typeEquiv cenv.g ty (GetFSharpViewOfReturnType cenv.g returnTy) -> AddCxTypeMustSupportDefaultCtor env.DisplayEnv cenv.css m NoTrace ty @@ -4411,9 +4427,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv memSpfn m = let item = Item.ArgName (id, memberConstraintTy, None) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) - // extSlns starts off empty because the trait has some support - // ad starts off as None because the trait has some support - TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None, [], None), tpenv + TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None, env.TraitContext), tpenv | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) @@ -4429,7 +4443,7 @@ and TcValSpec cenv env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv match tcrefContainerInfo with | Some(MemberOrValContainerInfo(tcref, _, _, _, declaredTyconTypars)) -> let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let _, enclosingDeclaredTypars, _, _, thisTy = FreshenObjectArgType cenv env.TraitFreshner m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars + let _, enclosingDeclaredTypars, _, _, thisTy = FreshenObjectArgType cenv env.TraitContext m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars // An implemented interface type is in terms of the type's type parameters. // We need a signature in terms of the values' type parameters. // let optIntfSlotTy = Option.map (instType renaming) optIntfSlotTy in @@ -4642,7 +4656,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope | SynType.LongIdent(LongIdentWithDots(tc, _) as lidwd) -> let m = lidwd.Range let ad = env.eAccessRights - let tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver occ OpenQualified env.NameEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) + let tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver occ OpenQualified env.NameEnv ad env.TraitContext tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match optKind, tcref.TypeOrMeasureKind with | Some TyparKind.Type, TyparKind.Measure -> error(Error(FSComp.SR.tcExpectedTypeNotUnitOfMeasure(), m)) @@ -4660,7 +4674,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope let tcref = let tyResInfo = TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length - ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInType OpenQualified env.eNameResEnv ad tc tyResInfo PermitDirectReferenceToGeneratedType.No + ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInType OpenQualified env.eNameResEnv ad env.TraitContext tc tyResInfo PermitDirectReferenceToGeneratedType.No |> ForceRaise match optKind, tcref.TypeOrMeasureKind with @@ -4691,7 +4705,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope let ltyp, tpenv = TcType cenv newOk checkCxs occ env tpenv ltyp match ltyp with | AppTy g (tcref, tinst) -> - let tcref = ResolveTypeLongIdentInTyconRef cenv.tcSink cenv.nameResolver env.eNameResEnv (TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length)) ad m tcref longId + let tcref = ResolveTypeLongIdentInTyconRef cenv.tcSink cenv.nameResolver env.eNameResEnv (TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length)) ad env.TraitContext m tcref longId TcTypeApp cenv newOk checkCxs occ env tpenv m tcref tinst args | _ -> error(Error(FSComp.SR.tcTypeHasNoNestedTypes(), m)) @@ -5063,7 +5077,7 @@ and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys: if tcref.Deref.IsProvided then TcProvidedTypeApp cenv env tpenv tcref synArgTys m else #endif - let tps, _, tinst, _ = FreshenTyconRef2 env.TraitFreshner m tcref + let tps, _, tinst, _ = FreshenTyconRef2 env.TraitContext m tcref // If we're not checking constraints, i.e. when we first assert the super/interfaces of a type definition, then just // clear the constraint lists of the freshly generated type variables. A little ugly but fairly localized. @@ -5117,7 +5131,7 @@ and TcNestedTypeApplication cenv newOk checkCxs occ env tpenv mWholeTypeApp ty t and TryAdjustHiddenVarNameToCompGenName cenv env (id: Ident) altNameRefCellOpt = match altNameRefCellOpt with | Some ({contents = Undecided altId } as altNameRefCell) -> - match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false id.idRange env.eAccessRights env.eNameResEnv TypeNameResolutionInfo.Default [id] with + match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false id.idRange env.eAccessRights env.TraitContext env.eNameResEnv TypeNameResolutionInfo.Default [id] with | Item.NewDef _ -> None // the name is not in scope as a pattern identifier (e.g. union case), so do not use the alternate ID | _ -> altNameRefCell := Decided altId; Some altId // the name is in scope as a pattern identifier, so use the alternate ID | Some ({contents = Decided altId }) -> Some altId @@ -5348,7 +5362,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | SynConstructorArgs.NamePatPairs (pairs, _) -> pairs.Length if numArgs <> 0 then error(Error(FSComp.SR.tcLiteralDoesNotTakeArguments(), m)) - match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver warnOnUpperForId false m ad env.NameEnv TypeNameResolutionInfo.Default longId with + match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver warnOnUpperForId false m ad env.TraitContext env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> match args with | SynConstructorArgs.Pats [] @@ -5358,7 +5372,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | Item.ActivePatternCase(APElemRef(apinfo, vref, idx)) as item -> let args = match args with SynConstructorArgs.Pats args -> args | _ -> error(Error(FSComp.SR.tcNamedActivePattern(apinfo.ActiveTags.[idx]), m)) // TOTAL/PARTIAL ACTIVE PATTERNS - let _, vexp, _, _, tinst, _ = TcVal env.TraitFreshner true cenv env tpenv vref None None m + let _, vexp, _, _, tinst, _ = TcVal env.TraitContext true cenv env tpenv vref None None m let vexp = MakeApplicableExprWithFlex cenv env vexp let vexpty = vexp.Type @@ -5524,7 +5538,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) | Some lit -> - let _, _, _, vexpty, _, _ = TcVal env.TraitFreshner true cenv env tpenv vref None None m + let _, _, _, vexpty, _, _ = TcVal env.TraitContext true cenv env tpenv vref None None m CheckValAccessible m env.AccessRights vref CheckFSharpAttributes cenv.g vref.Attribs m |> CommitOperationResult checkNoArgsForLiteral() @@ -5557,7 +5571,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | SynPat.Record (flds, m) -> let tcref, fldsmap, _fldsList = BuildFieldMap cenv env true ty flds m // REVIEW: use _fldsList to type check pattern in code order not field defn order - let _, inst, tinst, gtyp = FreshenTyconRef2 env.TraitFreshner m tcref + let _, inst, tinst, gtyp = FreshenTyconRef2 env.TraitContext m tcref UnifyTypes cenv env m ty gtyp let fields = tcref.TrueInstanceFieldsAsList let ftys = fields |> List.map (fun fsp -> actualTyOfRecdField inst fsp, fsp) @@ -6711,7 +6725,7 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implty: TType) virtNameAndArit | [(_, absSlot)] -> let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot - = FreshenAbstractSlot env.TraitFreshner cenv.g cenv.amap mBinding synTyparDecls absSlot + = FreshenAbstractSlot env.TraitContext cenv.g cenv.amap mBinding synTyparDecls absSlot // Work out the required type of the member let bindingTy = implty --> (mkMethodTy cenv.g argTysFromAbsSlot retTyFromAbsSlot) @@ -6974,7 +6988,7 @@ and TcObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, | Some x -> x | None -> error(Error(FSComp.SR.tcAtLeastOneOverrideIsInvalid(), synObjTy.Range)) - yield TObjExprMethod(overridden.GetSlotSig(cenv.amap, m), bindingAttribs, mtps, [thisVal] :: methodVars, bindingBody, id.idRange) ] + yield TObjExprMethod(overridden.GetSlotSig(cenv.amap, m, env.TraitContext), bindingAttribs, mtps, [thisVal] :: methodVars, bindingBody, id.idRange) ] (implty, overrides')) let (objTy', overrides') = allTypeImpls.Head @@ -7124,7 +7138,7 @@ and TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr | [] -> [] | _ -> let tcref, _, fldsList = BuildFieldMap cenv env hasOrigExpr overallTy flds mWholeExpr - let _, _, _, gtyp = FreshenTyconRef2 env.TraitFreshner mWholeExpr tcref + let _, _, _, gtyp = FreshenTyconRef2 env.TraitContext mWholeExpr tcref UnifyTypes cenv env mWholeExpr overallTy gtyp [ for n, v in fldsList do @@ -7381,7 +7395,7 @@ and TcForEachExpr cenv overallTy env tpenv (pat, enumSynExpr, bodySynExpr, mWhol // try optimize 'for i in span do' for span or readonlyspan match tryGetOptimizeSpanMethods cenv.g mWholeExpr enumExprTy with | ValueSome(struct(getItemMethInfo, getLengthMethInfo, isReadOnlySpan)) -> - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext let spanVar, spanExpr = mkCompGenLocal mEnumExpr "span" enumExprTy let idxVar, idxExpr = mkCompGenLocal mPat "idx" cenv.g.int32_ty let struct(_, elemTy) = if isReadOnlySpan then destReadOnlySpanTy cenv.g mWholeExpr enumExprTy else destSpanTy cenv.g mWholeExpr enumExprTy @@ -9151,7 +9165,7 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = () // resolved to a module or namespace, done with checks | _ -> let (TypeNameResolutionInfo(_, staticArgsInfo)) = GetLongIdentTypeNameInfo delayed - match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad longId staticArgsInfo PermitDirectReferenceToGeneratedType.No with + match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad env.TraitContext longId staticArgsInfo PermitDirectReferenceToGeneratedType.No with | Result tcref when IsEntityAccessible cenv.amap m ad tcref -> () // resolved to a type name, done with checks | _ -> @@ -9244,7 +9258,7 @@ and TcLongIdentThen cenv overallTy env tpenv (LongIdentWithDots(longId, _)) dela let ad = env.eAccessRights let typeNameResInfo = GetLongIdentTypeNameInfo delayed - let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId + let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.TraitContext env.eNameResEnv typeNameResInfo longId TcItemThen cenv overallTy env tpenv nameResolutionResult delayed //------------------------------------------------------------------------- @@ -9270,7 +9284,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del mkConstrApp, [ucaseAppTy], [ for (s, m) in apinfo.ActiveTagsWithRanges -> mkSynId m s ] | _ -> let ucref = mkChoiceCaseRef g mItem aparity n - let _, _, tinst, _ = FreshenTyconRef2 env.TraitFreshner mItem ucref.TyconRef + let _, _, tinst, _ = FreshenTyconRef2 env.TraitContext mItem ucref.TyconRef let ucinfo = UnionCaseInfo (tinst, ucref) ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) | _ -> @@ -9413,7 +9427,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Report information about the whole expression including type arguments to VS let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) - TcItemThen cenv overallTy env tpenv (ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId IgnoreOverrides true) otherDelayed + TcItemThen cenv overallTy env tpenv (ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.TraitContext env.eNameResEnv ty longId IgnoreOverrides true) otherDelayed | ((DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs)) :: _delayed') -> // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! @@ -9553,8 +9567,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let memberFlags = StaticMemberFlags MemberKind.Member let logicalCompiledName = ComputeLogicalName id memberFlags - let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, sln, [], None) - let traitInfo = FreshenTrait env.TraitFreshner traitInfo + let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, sln, env.TraitContext) let expr = Expr.Op (TOp.TraitCall traitInfo, [], ves, mItem) let expr = mkLambdas mItem [] vs (expr, retTy) @@ -9699,7 +9712,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // - it isn't a CtorValUsedAsSelfInit // - it isn't a VSlotDirectCall (uses of base values do not take type arguments let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem - let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitFreshner true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem + let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitContext true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here @@ -9707,7 +9720,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Value get | _ -> - let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitFreshner true cenv env tpenv vref None (Some afterResolution) mItem + let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitContext true cenv env tpenv vref None (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed @@ -9864,7 +9877,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela if isTyparTy cenv.g objExprTy then ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight cenv.g false objExprTy) false - let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId findFlag false + let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.TraitContext env.NameEnv objExprTy longId findFlag false let mExprAndItem = unionRanges mObjExpr mItem let delayed = delayRest rest mExprAndItem delayed @@ -10006,7 +10019,7 @@ and TcEventValueThen cenv overallTy env tpenv mItem mExprAndItem objDetails (ein // This checks for and drops the 'object' sender let argsTy = ArgsTypOfEventInfo cenv.infoReader mItem ad einfo - if not (slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(cenv.amap, mItem))) then errorR (nonStandardEventError einfo.EventName mItem) + if not (slotSigHasVoidReturnTy (invokeMethInfo.GetSlotSig(cenv.amap, mItem, env.TraitContext))) then errorR (nonStandardEventError einfo.EventName mItem) let delEventTy = mkIEventType cenv.g delegateType argsTy let bindObjArgs f = @@ -10028,7 +10041,7 @@ and TcEventValueThen cenv overallTy env tpenv mItem mExprAndItem objDetails (ein mkLambda mItem dv (callExpr, cenv.g.unit_ty)) (let fvty = (cenv.g.obj_ty --> (argsTy --> cenv.g.unit_ty)) let fv, fe = mkCompGenLocal mItem "callback" fvty - let createExpr = BuildNewDelegateExpr (Some einfo, cenv.g, cenv.amap, delegateType, invokeMethInfo, compiledViewOfDelArgTys, fe, fvty, mItem) + let createExpr = BuildNewDelegateExpr (Some einfo, cenv.g, cenv.amap, env.TraitContext, delegateType, invokeMethInfo, compiledViewOfDelArgTys, fe, fvty, mItem) mkLambda mItem fv (createExpr, delegateType))) let exprty = delEventTy @@ -10298,12 +10311,12 @@ and TcMethodApplication let callerArgs = List.zip unnamedCurriedCallerArgs namedCurriedCallerArgs let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = - let minst = FreshenMethInfo env.TraitFreshner mItem minfo + let minst = FreshenMethInfo env.TraitContext mItem minfo let callerTyArgs = match tyargsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitFreshner, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) let preArgumentTypeCheckingCalledMethGroup = [ for (minfo, pinfoOpt) in candidateMethsAndProps do @@ -10402,7 +10415,7 @@ and TcMethodApplication match tyargsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitFreshner, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) let callerArgCounts = (unnamedCurriedCallerArgs.Length, namedCurriedCallerArgs.Length) @@ -10501,7 +10514,7 @@ and TcMethodApplication /// STEP 5. Build the argument list. Adjust for optional arguments, byref arguments and coercions. let objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds = - AdjustCallerArgExprs TcFieldInit env.eCallerMemberName cenv.g cenv.amap cenv.infoReader ad finalCalledMeth objArgs lambdaVars mItem mMethExpr + AdjustCallerArgExprs TcFieldInit env.eCallerMemberName cenv.g cenv.amap env.TraitContext cenv.infoReader ad finalCalledMeth objArgs lambdaVars mItem mMethExpr // Record the resolution of the named argument for the Language Service allArgs |> List.iter (fun assignedArg -> @@ -10608,7 +10621,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal | AssignedPropSetter (pinfo, pminfo, pminst) -> MethInfoChecks cenv.g cenv.amap true None [objExpr] ad m pminfo let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] |> fst argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo]) @@ -10617,7 +10630,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal // Get or set instance IL field ILFieldInstanceChecks cenv.g cenv.amap ad m finfo let calledArgTy = finfo.FieldType (cenv.amap, m) - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildILFieldSet cenv.g m objExpr finfo argExpr argExprPrebinder, action, Item.ILField finfo @@ -10625,7 +10638,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal RecdFieldInstanceChecks cenv.g cenv.amap ad m rfinfo let calledArgTy = rfinfo.FieldType CheckRecdFieldMutation m denv rfinfo - let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildRecdFieldSet cenv.g m objExpr rfinfo argExpr argExprPrebinder, action, Item.RecdField rfinfo @@ -10727,7 +10740,7 @@ and TcNewDelegateThen cenv overallTy env tpenv mDelTy mExprAndArg delegateTy arg | [farg], [] -> let m = arg.Range let callerArg, (_, tpenv) = TcMethodArg cenv env (Array.empty, tpenv) (Array.empty, CallerArg(fty, m, false, farg)) - let expr = BuildNewDelegateExpr (None, cenv.g, cenv.amap, delegateTy, invokeMethInfo, delArgTys, callerArg.Expr, fty, m) + let expr = BuildNewDelegateExpr (None, cenv.g, cenv.amap, env.TraitContext, delegateTy, invokeMethInfo, delArgTys, callerArg.Expr, fty, m) PropagateThenTcDelayed cenv overallTy env tpenv m (MakeApplicableExprNoFlex cenv expr) delegateTy atomicFlag delayed | _ -> error(Error(FSComp.SR.tcDelegateConstructorMustBePassed(), mExprAndArg)) @@ -11187,7 +11200,7 @@ and TcAttribute canFail cenv (env: TcEnv) attrTgt (synAttr: SynAttribute) = let tyid = mkSynId tyid.idRange n let tycon = (typath @ [tyid]) let ad = env.eAccessRights - match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with + match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad env.TraitContext tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with | Exception err -> raze err | _ -> success(TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInAttribute env tpenv (SynType.App(SynType.LongIdent(LongIdentWithDots(tycon, [])), None, [], [], None, false, mAttr)) ) ForceRaise ((try1 (tyid.idText + "Attribute")) |> ResultOrException.otherwise (fun () -> (try1 tyid.idText))) @@ -11282,7 +11295,7 @@ and TcAttribute canFail cenv (env: TcEnv) attrTgt (synAttr: SynAttribute) = attributeAssignedNamedItems |> List.map (fun (CallerNamedArg(id, CallerArg(argtyv, m, isOpt, callerArgExpr))) -> if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m)) let m = callerArgExpr.Range - let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad id IgnoreOverrides TypeNameResolutionInfo.Default ty + let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad env.TraitContext id IgnoreOverrides TypeNameResolutionInfo.Default ty let nm, isProp, argty = match setterItem with | Item.Property (_, [pinfo]) -> @@ -11611,7 +11624,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot None cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot envinner.TraitContext cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth let declaredTypars = (if typarsFromAbsSlotAreRigid then typarsFromAbsSlot else declaredTypars) @@ -11668,7 +11681,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let _, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot None cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot envinner.TraitContext cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth if not (isNil typarsFromAbsSlot) then errorR(InternalError("Unexpected generic property", memberId.idRange)) @@ -11745,7 +11758,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl error(Error(FSComp.SR.tcConstructorsDisallowedInExceptionAugmentation(), id.idRange)) let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv None mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic @@ -11815,7 +11828,7 @@ and AnalyzeRecursiveInstanceMemberDecl // The type being augmented tells us the type of 'this' let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv None mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner @@ -13770,8 +13783,7 @@ module MutRecBindingChecking = AddLocalTyconRefs true g cenv.amap tcref.Range [tcref] initialEnvForTycon // Make fresh version of the class type for type checking the members and lets * - let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv None tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars - + let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv envMutRec.TraitContext tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars // The basic iteration over the declarations in a single type definition let initialInnerState = (None, envForTycon, tpenv, recBindIdx, uncheckedBindsRev) @@ -15065,7 +15077,7 @@ module TcExceptionDeclarations = let repr = match reprIdOpt with | Some longId -> - match ResolveExprLongIdent cenv.tcSink cenv.nameResolver m ad env.eNameResEnv TypeNameResolutionInfo.Default longId with + match ResolveExprLongIdent cenv.tcSink cenv.nameResolver m ad env.TraitContext env.eNameResEnv TypeNameResolutionInfo.Default longId with | Item.ExnCase exnc, [] -> CheckTyconAccessible cenv.amap m env.eAccessRights exnc |> ignore if not (isNil args') then @@ -15493,7 +15505,7 @@ module EstablishTypeDefinitionCores = | None -> None | Some (tc, args, m) -> let ad = envinner.eAccessRights - match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInType OpenQualified envinner.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.Yes with + match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInType OpenQualified envinner.eNameResEnv ad envinner.TraitContext tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.Yes with | Result tcrefBeforeStaticArguments when tcrefBeforeStaticArguments.IsProvided && not tcrefBeforeStaticArguments.IsErased -> @@ -15937,7 +15949,7 @@ module EstablishTypeDefinitionCores = let info = RecdFieldInfo(thisTyInst, thisTyconRef.MakeNestedRecdFieldRef fspec) let nenv' = AddFakeNameToNameEnv fspec.Name nenv (Item.RecdField info) // Name resolution gives better info for tooltips - let item = FreshenRecdFieldRef cenv.nameResolver m (thisTyconRef.MakeNestedRecdFieldRef fspec) + let item = FreshenRecdFieldRef cenv.nameResolver envinner.TraitContext m (thisTyconRef.MakeNestedRecdFieldRef fspec) CallNameResolutionSink cenv.tcSink (fspec.Range, nenv, item, item, emptyTyparInst, ItemOccurence.Binding, envinner.DisplayEnv, ad) // Environment is needed for completions CallEnvSink cenv.tcSink (fspec.Range, nenv', ad) @@ -16580,14 +16592,14 @@ module TcDeclarations = // This records a name resolution of the type at the location let resInfo = TypeNameResolutionStaticArgsInfo.FromTyArgs synTypars.Length - ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Binding OpenQualified envForDecls.eNameResEnv ad longPath resInfo PermitDirectReferenceToGeneratedType.No + ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Binding OpenQualified envForDecls.eNameResEnv ad envForDecls.TraitContext longPath resInfo PermitDirectReferenceToGeneratedType.No |> ignore mkLocalTyconRef tycon | _ -> let resInfo = TypeNameResolutionStaticArgsInfo.FromTyArgs synTypars.Length - match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Binding OpenQualified envForDecls.eNameResEnv ad longPath resInfo PermitDirectReferenceToGeneratedType.No with + match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Binding OpenQualified envForDecls.eNameResEnv ad envForDecls.TraitContext longPath resInfo PermitDirectReferenceToGeneratedType.No with | Result res -> res | res when inSig && longPath.Length = 1 -> errorR(Deprecated(FSComp.SR.tcReservedSyntaxForAugmentation(), m)) @@ -17850,10 +17862,10 @@ let TypeCheckOneImplFile (ParsedImplFileInput (_, isScript, qualNameOfFile, scopedPragmas, _, implFileFrags, isLastCompiland)) = eventually { - let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) - let envinner, mtypeAcc = MakeInitialEnv env + let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g envinner.TraitContext), isInternalTestSpanStackReferring) + let defs = [ for x in implFileFrags -> SynModuleDecl.NamespaceFragment x ] let! mexpr, topAttrs, envAtEnd = TcModuleOrNamespaceElements cenv ParentNone qualNameOfFile.Range envinner PreXmlDocEmpty None defs @@ -17951,9 +17963,10 @@ let TypeCheckOneImplFile /// Check an entire signature file let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) tcEnv (ParsedSigFileInput (_, qualNameOfFile, _, _, sigFileFrags)) = eventually { - let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) let envinner, mtypeAcc = MakeInitialEnv tcEnv + let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g envinner.TraitContext), isInternalTestSpanStackReferring) + let specs = [ for x in sigFileFrags -> SynModuleSigDecl.NamespaceFragment x ] let! tcEnv = TcSignatureElements cenv ParentNone qualNameOfFile.Range envinner PreXmlDocEmpty None specs diff --git a/src/fsharp/TypeChecker.fsi b/src/fsharp/TypeChecker.fsi index 09856e04895..bf8104e8a17 100644 --- a/src/fsharp/TypeChecker.fsi +++ b/src/fsharp/TypeChecker.fsi @@ -22,6 +22,8 @@ type TcEnv = member NameEnv : NameResolution.NameResolutionEnv member AccessRights : AccessorDomain + interface ITraitContext + val CreateInitialTcEnv : TcGlobals * ImportMap * range * assemblyName: string * (CcuThunk * string list * string list) list -> TcEnv val AddCcuToTcEnv : TcGlobals * ImportMap * range * TcEnv * assemblyName: string * ccu: CcuThunk * autoOpens: string list * internalsVisibleToAttributes: string list -> TcEnv val AddLocalRootModuleOrNamespace : NameResolution.TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> ModuleOrNamespaceType -> TcEnv @@ -106,4 +108,4 @@ exception InvalidInternalsVisibleToAssemblyName of (*badName*)string * (*fileNam val TcFieldInit : range -> ILFieldInit -> Tast.Const -val LightweightTcValForUsingInBuildMethodCall : g : TcGlobals -> vref:ValRef -> vrefFlags : ValUseFlag -> vrefTypeInst : TTypes -> m : range -> Expr * TType \ No newline at end of file +val LightweightTcValForUsingInBuildMethodCall : g: TcGlobals -> traitCtxt: ITraitContext option -> vref:ValRef -> vrefFlags : ValUseFlag -> vrefTypeInst : TTypes -> m : range -> Expr * TType \ No newline at end of file diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index c717d9b6e3a..885634bd2ce 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -41,6 +41,7 @@ open FSharp.Compiler.CompileOptions open FSharp.Compiler.ErrorLogger open FSharp.Compiler.InfoReader open FSharp.Compiler.Lib +open FSharp.Compiler.NameResolution open FSharp.Compiler.Range open FSharp.Compiler.Tast open FSharp.Compiler.Tastops @@ -2036,7 +2037,7 @@ let main2a(Args (ctok, tcConfig, tcImports, frameworkTcImports: TcImports, tcGlo let optimizedImpls, optimizationData, _ = ApplyAllOptimizations - (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, + (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), outfile, importMap, false, optEnv0, generatedCcu, typedImplFiles) AbortOnError(errorLogger, exiter) @@ -2070,7 +2071,7 @@ let main2b // Generate IL code ReportTime tcConfig "TAST -> IL" use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.IlxGen - let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), generatedCcu) + let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), generatedCcu) let codegenBackend = (if Option.isSome dynamicAssemblyCreator then IlReflectBackend else IlWriteBackend) let codegenResults = GenerateIlxCode (codegenBackend, Option.isSome dynamicAssemblyCreator, false, tcConfig, topAttrs, optimizedImpls, generatedCcu.AssemblyName, ilxGenerator) diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 97259cd3723..abaf5f0ece4 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -1014,7 +1014,7 @@ type internal FsiDynamicCompiler let importMap = tcImports.GetImportMap() // optimize: note we collect the incremental optimization environment - let optimizedImpls, _optData, optEnv = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, isIncrementalFragment, optEnv, tcState.Ccu, declaredImpls) + let optimizedImpls, _optData, optEnv = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), outfile, importMap, isIncrementalFragment, optEnv, tcState.Ccu, declaredImpls) errorLogger.AbortOnError(fsiConsoleOutput); let fragName = textOfLid prefixPath @@ -1384,7 +1384,7 @@ type internal FsiDynamicCompiler let tcState = GetInitialTcState (rangeStdin, ccuName, tcConfig, tcGlobals, tcImports, niceNameGen, tcEnv) - let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), tcState.Ccu) + let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), tcState.Ccu) {optEnv = optEnv0 emEnv = emEnv tcGlobals = tcGlobals @@ -2430,12 +2430,12 @@ type internal FsiInteractionProcessor let tcState = istate.tcState let amap = istate.tcImports.GetImportMap() - let infoReader = new InfoReader(istate.tcGlobals,amap) - let ncenv = new NameResolver(istate.tcGlobals,amap,infoReader,FakeInstantiationGenerator) + let infoReader = new InfoReader(istate.tcGlobals, amap) + let ncenv = new NameResolver(istate.tcGlobals, amap, infoReader, FakeInstantiationGenerator) let ad = tcState.TcEnvFromImpls.AccessRights let nenv = tcState.TcEnvFromImpls.NameEnv - let nItems = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox istate.tcGlobals amap rangeStdin) rangeStdin ad lid false + let nItems = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox istate.tcGlobals amap rangeStdin traitCtxtNone) rangeStdin ad lid false let names = nItems |> List.map (fun d -> d.DisplayName) let names = names |> List.filter (fun name -> name.StartsWithOrdinal(stem)) names diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 1eec142bd27..586d7669442 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -297,22 +297,14 @@ let ImportReturnTypeFromMetadata amap m ilty cattrs scoref tinst minst = | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst retTy cattrs) - /// Search for the relevant extension values again if a name resolution environment is provided /// Basically, if you use a generic thing, then the extension members in scope at the point of _use_ /// are the ones available to solve the constraint -let FreshenTrait traitFreshner traitInfo = - let (TTrait(typs, nm, mf, argtys, rty, slnCell, extSlns, ad)) = traitInfo - - // Call the trait freshner if it is provided - let extSlns2, ad2 = - match traitFreshner with - | None -> extSlns, ad - | Some freshner -> - let extSlns2, ad2 = freshner traitInfo - extSlns2, Some ad2 +let FreshenTrait (traitCtxt: ITraitContext option) traitInfo = + let (TTrait(typs, nm, mf, argtys, rty, slnCell, traitCtxtOld)) = traitInfo + let traitCtxtNew = match traitCtxt with None -> traitCtxtOld | Some _ -> traitCtxt - TTrait(typs, nm, mf, argtys, rty, slnCell, extSlns2, ad2) + TTrait(typs, nm, mf, argtys, rty, slnCell, traitCtxtNew) /// Copy constraints. If the constraint comes from a type parameter associated /// with a type constructor then we are simply renaming type variables. If it comes @@ -322,7 +314,7 @@ let FreshenTrait traitFreshner traitInfo = /// /// Note: this now looks identical to constraint instantiation. -let CopyTyparConstraints traitFreshner m tprefInst (tporig: Typar) = +let CopyTyparConstraints traitCtxt m tprefInst (tporig: Typar) = tporig.Constraints |> List.map (fun tpc -> match tpc with @@ -351,12 +343,12 @@ let CopyTyparConstraints traitFreshner m tprefInst (tporig: Typar) = | TyparConstraint.RequiresDefaultConstructor _ -> TyparConstraint.RequiresDefaultConstructor m | TyparConstraint.MayResolveMember(traitInfo, _) -> - let traitInfo2 = FreshenTrait traitFreshner traitInfo + let traitInfo2 = FreshenTrait traitCtxt traitInfo TyparConstraint.MayResolveMember (instTrait tprefInst traitInfo2, m)) /// The constraints for each typar copied from another typar can only be fixed up once /// we have generated all the new constraints, e.g. f List, B :> List> ... -let FixupNewTypars traitFreshner m (formalEnclosingTypars:Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = +let FixupNewTypars traitCtxt m (formalEnclosingTypars:Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = // Checks.. These are defensive programming against early reported errors. let n0 = formalEnclosingTypars.Length let n1 = tinst.Length @@ -368,7 +360,7 @@ let FixupNewTypars traitFreshner m (formalEnclosingTypars:Typars) (tinst: TType // The real code.. let renaming, tptys = mkTyparToTyparRenaming tpsorig tps let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitFreshner m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitCtxt m tprefInst tporig)) renaming, tptys @@ -910,6 +902,9 @@ type MethInfo = | ProvidedMeth of Import.ImportMap * Tainted * ExtensionMethodPriority option * range #endif + // Marker interface + interface ITraitExtensionMember + /// Get the enclosing type of the method info. /// /// If this is an extension member, then this is the apparent parent, i.e. the type the method appears to extend. @@ -1515,7 +1510,7 @@ type MethInfo = // // This code has grown organically over time. We've managed to unify the ILMeth+ProvidedMeth paths. // The FSMeth, ILMeth+ProvidedMeth paths can probably be unified too. - member x.GetSlotSig(amap, m) = + member x.GetSlotSig(amap, m, traitCtxt) = match x with | FSMeth(g, _, vref, _) -> match vref.RecursiveValInfo with @@ -1545,9 +1540,9 @@ type MethInfo = let tcref = tcrefOfAppTy g x.ApparentEnclosingAppType let formalEnclosingTyparsOrig = tcref.Typars m let formalEnclosingTypars = copyTypars formalEnclosingTyparsOrig - let _, formalEnclosingTyparTys = FixupNewTypars None m [] [] formalEnclosingTyparsOrig formalEnclosingTypars + let _, formalEnclosingTyparTys = FixupNewTypars traitCtxt m [] [] formalEnclosingTyparsOrig formalEnclosingTypars let formalMethTypars = copyTypars x.FormalMethodTypars - let _, formalMethTyparTys = FixupNewTypars None m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars + let _, formalMethTyparTys = FixupNewTypars traitCtxt m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars let formalRetTy, formalParams = match x with | ILMeth(_, ilminfo, _) -> diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs index 13517c0375f..9e59338b9f2 100644 --- a/src/fsharp/service/FSharpCheckerResults.fs +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -167,7 +167,7 @@ type internal TypeCheckInfo let amap = tcImports.GetImportMap() let infoReader = new InfoReader(g,amap) - let ncenv = new NameResolver(g,amap,infoReader,NameResolution.FakeInstantiationGenerator) + let ncenv = new NameResolver(g, amap, infoReader, NameResolution.FakeInstantiationGenerator) let cenv = SymbolEnv(g, thisCcu, Some ccuSigForFile, tcImports, amap, infoReader) /// Find the most precise naming environment for the given line and column @@ -275,7 +275,7 @@ type internal TypeCheckInfo // If we're looking for members using a residue, we'd expect only // a single item (pick the first one) and we need the residue (which may be "") | CNR(_,Item.Types(_,(ty::_)), _, denv, nenv, ad, m)::_, Some _ -> - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad true ty + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone)) m ad true ty let items = List.map ItemWithNoInst items ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck @@ -308,7 +308,7 @@ type internal TypeCheckInfo AccessibleFrom(paths, None) | _ -> ad - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone)) m ad false ty let items = List.map ItemWithNoInst items ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck @@ -452,7 +452,7 @@ type internal TypeCheckInfo match bestQual with | Some bestQual -> let (_,ty,denv,nenv,ad,m) = bestQual - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone)) m ad false ty let items = items |> List.map ItemWithNoInst let items = items |> RemoveDuplicateItems g let items = items |> RemoveExplicitlySuppressed g @@ -464,7 +464,7 @@ type internal TypeCheckInfo /// Find items in the best naming environment. let GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, showObsolete) = - let items = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox g amap m) m ad plid showObsolete + let items = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone) m ad plid showObsolete let items = items |> List.map ItemWithNoInst let items = items |> RemoveDuplicateItems g let items = items |> RemoveExplicitlySuppressed g @@ -2133,7 +2133,7 @@ type FSharpCheckProjectResults let importMap = tcImports.GetImportMap() let optEnv0 = GetInitialOptimizationEnv (tcImports, tcGlobals) let tcConfig = getTcConfig() - let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, false, optEnv0, thisCcu, mimpls) + let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), outfile, importMap, false, optEnv0, thisCcu, mimpls) let mimpls = match optimizedImpls with | TypedAssemblyAfterOptimization files -> diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index fbd6660baa2..3b6be0dc719 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -827,7 +827,7 @@ module FSharpExprConvert = let typR = ConvType cenv (mkAppTy tycr tyargs) E.UnionCaseTag(ConvExpr cenv env arg1, typR) - | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution, _extSlns, _ad)), _, _ -> + | TOp.TraitCall (TTrait(tys, nm, memFlags, argtys, _rty, _solution, _traitCtxt)), _, _ -> let tysR = ConvTypes cenv tys let tyargsR = ConvTypes cenv tyargs let argtysR = ConvTypes cenv argtys diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 60eeb589122..a5fb69857fd 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1219,7 +1219,7 @@ and FSharpAbstractSignature(cenv, info: SlotSig) = member __.DeclaringType = FSharpType(cenv, info.ImplementedType) and FSharpGenericParameterMemberConstraint(cenv, info: TraitConstraintInfo) = - let (TTrait(tys, nm, flags, atys, rty, _, _extSlns, _ad)) = info + let (TTrait(tys, nm, flags, atys, rty, _, _traitCtxt)) = info member __.MemberSources = tys |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 4a91d212c2b..f90873c9f18 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2344,14 +2344,6 @@ and override x.ToString() = x.Name -and TraitPossibleExtensionMemberSolutions = TraitPossibleExtensionMemberSolution list - -/// Only satisfied by type 'ExtensionMember'. Not stored in TastPickle. -and TraitPossibleExtensionMemberSolution = interface end - -/// Only satisfied by 'AccessorDomain'. Not stored in TastPickle. -and TraitAccessorDomain = interface end - and [] TyparConstraint = @@ -2401,7 +2393,20 @@ and //member x.DebugText = x.ToString() override x.ToString() = sprintf "%+A" x - + +/// Only satisfied by elsewhere. Not stored in TastPickle. +and ITraitContext = + /// Used to select the extension methods in the context relevant to solving the constraint + /// given the current support types + abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> ITraitExtensionMember list + + /// Gives the access rights (e.g. InternalsVisibleTo, Protected) at the point the trait is being solved + abstract AccessRights: ITraitAccessorDomain + +/// Only satisfied by elsewhere. Not stored in TastPickle. +and ITraitExtensionMember = interface end +and ITraitAccessorDomain = interface end + /// The specification of a member constraint that must be solved and [] @@ -2411,30 +2416,27 @@ and /// /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of TTypes * string * MemberFlags * TTypes * TType option * TraitConstraintSln option ref * extSlns: TraitPossibleExtensionMemberSolutions * ad: TraitAccessorDomain option + | TTrait of supportTys: TTypes * memberName: string * memFlags: MemberFlags * argTys: TTypes * retTy: TType option * traitSln: TraitConstraintSln option ref * traitContext: ITraitContext option /// Get the support types that can help provide members to solve the constraint - member x.SupportTypes= (let (TTrait(tys,_,_,_,_,_,_,_)) = x in tys) + member x.SupportTypes = (let (TTrait(tys,_,_,_,_,_,_)) = x in tys) /// Get the member name associated with the member constraint. - member x.MemberName = (let (TTrait(_, nm, _, _, _, _, _, _)) = x in nm) + member x.MemberName = (let (TTrait(_, nm, _, _, _, _, _)) = x in nm) /// Get the argument types required of a member in order to solve the constraint - member x.ArgumentTypes = (let (TTrait(_, _, _, argtys, _, _, _, _)) = x in argtys) + member x.ArgumentTypes = (let (TTrait(_, _, _, argtys, _, _, _)) = x in argtys) /// Get the return type recorded in the member constraint. - member x.ReturnType = (let (TTrait(_, _, _, _, rty, _, _, _)) = x in rty) + member x.ReturnType = (let (TTrait(_, _, _, _, rty, _, _)) = x in rty) /// Get or set the solution of the member constraint during inference member x.Solution - with get() = (let (TTrait(_, _, _, _, _, sln, _, _)) = x in sln.Value) - and set v = (let (TTrait(_, _, _, _, _, sln, _, _)) = x in sln.Value <- v) - - /// Get possible extension member solutions available for a use of a trait at a particular location - member x.PossibleExtensionSolutions = (let (TTrait(_, _, _, _, _, _, extSlns, _)) = x in extSlns) + with get() = (let (TTrait(_, _, _, _, _, sln, _)) = x in sln.Value) + and set v = (let (TTrait(_, _, _, _, _, sln, _)) = x in sln.Value <- v) - /// Get access rights for a use of a trait at a particular location - member x.AccessorDomain = (let (TTrait(_, _, _, _, _, _, _, ad)) = x in ad) + /// Get the context used to help determine possible extension member solutions + member x.TraitContext = (let (TTrait(_, _, _, _, _, _, traitCtxt)) = x in traitCtxt) [] member x.DebugText = x.ToString() From f52f54ec1cb0955f9c98cd72351f063b7e8a65d9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 7 Feb 2020 11:06:25 +0000 Subject: [PATCH 27/82] remove tests that no longer apply --- src/fsharp/NameResolution.fs | 10 ++++++++++ src/fsharp/NameResolution.fsi | 2 ++ src/fsharp/TypeChecker.fs | 10 ++-------- tests/fsharp/core/extconstraint/test.fsx | 25 ++++-------------------- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index d82e92bd935..1f7d4635193 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -635,6 +635,16 @@ let AllMethInfosOfTypeInScope collectionSettings infoReader nenv optFilter ad fi else intrinsic @ ExtensionMethInfosOfTypeInScope collectionSettings infoReader nenv optFilter m ty +let SelectExtensionMethInfosForTrait(traitInfo: TraitConstraintInfo, m, nenv: NameResolutionEnv, infoReader: InfoReader) = + let g = infoReader.g + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + [ for traitSupportTy in traitInfo.SupportTypes do + if not (isTyparTy g traitSupportTy) then + let extMethInfos = ExtensionMethInfosOfTypeInScope ResultCollectionSettings.AllResults infoReader nenv (Some traitInfo.MemberName) m traitSupportTy + for extMethInfo in extMethInfos do + yield extMethInfo ] + else + [] //------------------------------------------------------------------------- // Helpers to do with building environments //------------------------------------------------------------------------- diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 0e2dd0ed3b6..dcc3cfac84d 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -492,6 +492,8 @@ val internal ExtensionPropInfosOfTypeInScope : ResultCollectionSettings -> InfoR /// Get the available methods of a type (both declared and inherited) val internal AllMethInfosOfTypeInScope : ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> AccessorDomain -> FindMemberFlag -> range -> TType -> MethInfo list +val internal SelectExtensionMethInfosForTrait: traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> MethInfo list + /// Used to report an error condition where name resolution failed due to an indeterminate type exception internal IndeterminateType of range diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index c5418ac9755..a3aa22cc1c3 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -228,14 +228,8 @@ type TcEnv = member tenv.SelectExtensionMethods(traitInfo, m, infoReader) = let infoReader = unbox(infoReader) - if tenv.g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then - [ for traitSupportTy in traitInfo.SupportTypes do - if not (isTyparTy tenv.g traitSupportTy) then - let extMethInfos = ExtensionMethInfosOfTypeInScope ResultCollectionSettings.AllResults infoReader tenv.eNameResEnv (Some traitInfo.MemberName) m traitSupportTy - for extMethInfo in extMethInfos do - yield (extMethInfo :> ITraitExtensionMember) ] - else - [] + SelectExtensionMethInfosForTrait(traitInfo, m, tenv.eNameResEnv, infoReader) + |> List.map (fun minfo -> minfo :> ITraitExtensionMember) member tenv.AccessRights = (tenv.eAccessRights :> ITraitAccessorDomain) diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index f2ff8c1c378..dd34a6cbd39 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -361,10 +361,11 @@ module ExtenstionAttributeMembers = let v = bleh "a" do check "cojkicjkc" 1 v -module ExtendingOnConstraint = +module ExtendingGenericType1 = open System - type System.Int32 with - static member inline (+)(a, b) = Array.map2 (+) a b + type ``[]``<'T> with + // The generic type parameter must not be the same as the enclosing, which is unconstrained + static member inline (+)(a:'T1[], b: 'T2[]) = Array.map2 (+) a b let v1 = [|1;2;3|] + [|2;3;4|] //Okay do check "kldjfdo1" [|3;5;7|] v1 @@ -387,24 +388,6 @@ module ExtendingOnConstraint = //let v10 = [|1.f|] + [|2.f|] //error FS0001 //let v11 = [|1.0|] + [|2.0|] //error FS0001 -module TupleOps = - type System.Int32 with - static member inline (+)(struct(a,b), struct(c,d)) = struct(a + c, b + d) - static member inline (+)((a,b), (c,d)) = (a + c, b + d) - let v1 = (1,2) + (3,4) - do check "fmjkslo1" ((4,6)) v1 - //let v2 = struct(1,2) + struct(3,4) - //do check "fmjkslo2" (struct(4,6)) v2 - //Runtime Errors: - (* --------------------- - Unhandled Exception: System.TypeInitializationException: The type initializer for 'AdditionDynamicImplTable`3' threw an exception. ---> System.NotSupportedException: Dynamic invocation of op_Addition involving coercions is not supported. - at Microsoft.FSharp.Core.LanguagePrimitives.dyn@2578TTT.Invoke(Unit unitVar0) - at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamicImplTable`3..cctor() - --- End of inner exception stack trace --- - at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamicImplTable`3.get_Impl() - at Microsoft.FSharp.Core.LanguagePrimitives.AdditionDynamic[T1,T2,TResult](T1 x, T2 y) - at .$Test$fsx.main@() - --------------------------*) (*--------------------------------------------------------------------------- !* wrap up *--------------------------------------------------------------------------- *) From 0af746d6882da7e2dc16a29c975e42ac0dcb51da Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 7 Feb 2020 16:56:13 +0000 Subject: [PATCH 28/82] fix f# extension members --- src/fsharp/ConstraintSolver.fs | 27 +++++--- src/fsharp/NameResolution.fs | 2 +- src/fsharp/PostInferenceChecks.fs | 2 +- src/fsharp/TastOps.fs | 6 +- src/fsharp/TastPickle.fs | 12 +++- src/fsharp/service/FSharpCheckerResults.fs | 2 +- src/fsharp/symbols/SymbolHelpers.fs | 8 +-- src/fsharp/symbols/Symbols.fs | 2 +- src/fsharp/tast.fs | 5 +- tests/fsharp/core/extconstraint/test.fsx | 78 +++++++++++++++++----- 10 files changed, 102 insertions(+), 42 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 902c438f5f4..fbee5ecfa18 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -1687,8 +1687,8 @@ and MemberConstraintSolutionOfMethInfo css m traitCtxt minfo minst = let iltref = ilMeth.ILExtensionMethodDeclaringTyconRef |> Option.map (fun tcref -> tcref.CompiledRepresentationForNamedType) ILMethSln(ilMeth.ApparentEnclosingType, iltref, mref, minst) - | FSMeth(_, ty, vref, _) -> - FSMethSln(ty, vref, minst) + | FSMeth(_, ty, vref, extInfo) -> + FSMethSln(ty, vref, minst, extInfo.IsSome) | MethInfo.DefaultStructCtor _ -> error(InternalError("the default struct constructor was the unexpected solution to a trait constraint", m)) @@ -3152,16 +3152,27 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra | Some ilActualTypeRef -> Import.ImportILTypeRef amap m ilActualTypeRef let mdef = IL.resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref - - let ilMethInfo = + + let minfo = match extOpt with | None -> MethInfo.CreateILMeth(amap, m, apparentTy, mdef) - | Some _ -> MethInfo.CreateILExtensionMeth(amap, m, apparentTy, actualTyconRef, None, mdef) + | Some _ -> + + let pri = 0UL // irrelevant for post-typecheck processing of solution + MethInfo.CreateILExtensionMeth(amap, m, apparentTy, actualTyconRef, Some pri, mdef) - Choice1Of5 (ilMethInfo, minst) + Choice1Of5 (minfo, minst) - | FSMethSln(ty, vref, minst) -> - Choice1Of5 (FSMeth(g, ty, vref, None), minst) + | FSMethSln(ty, vref, minst, isExt) -> + let minfo = + if isExt then + let pri = 0UL // irrelevant for post-typecheck processing of solution + FSMeth(g, ty, vref, Some pri) + else + FSMeth(g, ty, vref, None) + + Choice1Of5 (minfo, minst) + | FSRecdFieldSln(tinst, rfref, isSetProp) -> Choice2Of5 (tinst, rfref, isSetProp) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 1f7d4635193..a33c4b40e50 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -3386,7 +3386,7 @@ let NeedsWorkAfterResolution namedItem = | Item.MethodGroup(_, minfos, _) | Item.CtorGroup(_, minfos) -> minfos.Length > 1 || minfos |> List.exists (fun minfo -> not (isNil minfo.FormalMethodInst)) | Item.Property(_, pinfos) -> pinfos.Length > 1 - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> not (List.isEmpty vref.Typars) | Item.CustomOperation (_, _, Some minfo) -> not (isNil minfo.FormalMethodInst) | Item.ActivePatternCase apref -> not (List.isEmpty apref.ActivePatternVal.Typars) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 456db3a5927..0b1aa72df49 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -627,7 +627,7 @@ let CheckTypeAux permitByRefLike (cenv: cenv) env m ty onInnerByrefError = let visitTraitSolution info = match info with - | FSMethSln(_, vref, _) -> + | FSMethSln(_, vref, _, _) -> //printfn "considering %s..." vref.DisplayName if valRefInThisAssembly cenv.g.compilingFslib vref && not (cenv.boundVals.ContainsKey(vref.Stamp)) then //printfn "recording %s..." vref.DisplayName diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index f6c929e0ba3..04e16ef5fd5 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -277,8 +277,8 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell, traitCtxt)) = match sln with | ILMethSln(ty, extOpt, ilMethRef, minst) -> ILMethSln(remapTypeAux tyenv ty, extOpt, ilMethRef, remapTypesAux tyenv minst) - | FSMethSln(ty, vref, minst) -> - FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst) + | FSMethSln(ty, vref, minst, isExt) -> + FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, isExt) | FSRecdFieldSln(tinst, rfref, isSet) -> FSRecdFieldSln(remapTypesAux tyenv tinst, remapRecdFieldRef tyenv.tyconRefRemap rfref, isSet) | FSAnonRecdFieldSln(anonInfo, tinst, n) -> @@ -2057,7 +2057,7 @@ and accFreeInTraitSln opts sln acc = | ILMethSln(ty, _, _, minst) -> accFreeInType opts ty (accFreeInTypes opts minst acc) - | FSMethSln(ty, vref, minst) -> + | FSMethSln(ty, vref, minst, _isExt) -> accFreeInType opts ty (accFreeValRefInTraitSln opts vref (accFreeInTypes opts minst acc)) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index e9bb6e3231a..0814e51dd8f 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1492,8 +1492,11 @@ let p_trait_sln sln st = match sln with | ILMethSln(a, b, c, d) -> p_byte 0 st; p_tup4 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys (a, b, c, d) st - | FSMethSln(a, b, c) -> - p_byte 1 st; p_tup3 p_ty (p_vref "trait") p_tys (a, b, c) st + | FSMethSln(a, b, c, isExt) -> + if isExt then + p_byte 6 st; p_tup4 p_ty (p_vref "trait") p_tys p_bool (a, b, c, isExt) st + else + p_byte 1 st; p_tup3 p_ty (p_vref "trait") p_tys (a, b, c) st | BuiltInSln -> p_byte 2 st | ClosedExprSln expr -> @@ -1524,7 +1527,7 @@ let u_trait_sln st = ILMethSln(a, b, c, d) | 1 -> let (a, b, c) = u_tup3 u_ty u_vref u_tys st - FSMethSln(a, b, c) + FSMethSln(a, b, c, false) | 2 -> BuiltInSln | 3 -> @@ -1535,6 +1538,9 @@ let u_trait_sln st = | 5 -> let (a, b, c) = u_tup3 u_anonInfo u_tys u_int st FSAnonRecdFieldSln(a, b, c) + | 6 -> + let (a, b, c, d) = u_tup4 u_ty u_vref u_tys u_bool st + FSMethSln(a, b, c, d) | _ -> ufailwith st "u_trait_sln" let u_trait st = diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs index 9e59338b9f2..30a6a16efb2 100644 --- a/src/fsharp/service/FSharpCheckerResults.fs +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -1197,7 +1197,7 @@ type internal TypeCheckInfo Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None - | Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _))}) -> + | Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _, _))}) -> //Item.Value(vref) None diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index 39ca96934b2..946565d5646 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -375,7 +375,7 @@ module internal SymbolHelpers = | Item.SetterArg (_, item) -> rangeOfItem g preferFlag item | Item.ArgName (id, _, _) -> Some id.idRange | Item.CustomOperation (_, _, implOpt) -> implOpt |> Option.bind (rangeOfMethInfo g preferFlag) - | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(_, vref, _))}) -> Some vref.Range + | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _))}) -> Some vref.Range | Item.ImplicitOp _ -> None | Item.UnqualifiedType tcrefs -> tcrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) | Item.DelegateCtor ty @@ -875,7 +875,7 @@ module internal SymbolHelpers = let rec FullNameOfItem g item = let denv = DisplayEnv.Empty g match item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> fullDisplayTextOfValRef vref | Item.UnionCase (ucinfo, _) -> fullDisplayTextOfUnionCaseRef ucinfo.UnionCaseRef | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.Names.[idx] @@ -917,7 +917,7 @@ module internal SymbolHelpers = let rec GetXmlCommentForItem (infoReader: InfoReader) m item = let g = infoReader.g match item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _)) }) -> GetXmlCommentForItem infoReader m (Item.Value vref) | Item.Value vref | Item.CustomBuilder (_, vref) -> @@ -1000,7 +1000,7 @@ module internal SymbolHelpers = let denv = SimplerDisplayEnv denv let xml = GetXmlCommentForItem infoReader m item.Item match item.Item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _)) }) -> // operator with solution FormatItemDescriptionToToolTipElement isListItem infoReader m denv { item with Item = Item.Value vref } diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index a5fb69857fd..239a7173129 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -295,7 +295,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol - | Item.ArgName(id, ty, _) -> FSharpParameter(cenv, ty, {Attribs=[]; Name=Some id}, Some id.idRange, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) :> _ - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _, _)) }) -> FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _ // TODO: the following don't currently return any interesting subtype diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index f90873c9f18..bf8440f366e 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2451,10 +2451,11 @@ and /// FSMethSln(ty, vref, minst) /// /// Indicates a trait is solved by an F# method. - /// ty -- the type and its instantiation + /// ty -- the apparent type and its instantiation /// vref -- the method that solves the trait constraint /// minst -- the generic method instantiation - | FSMethSln of TType * ValRef * TypeInst + /// isExt -- is this a use of an extension method + | FSMethSln of apparentType: TType * valRef: ValRef * methodInst: TypeInst * isExt: bool /// FSRecdFieldSln(tinst, rfref, isSetProp) /// diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index dd34a6cbd39..2fc674c427f 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -340,16 +340,34 @@ module LinqExtensionMethodsProvideSolutions_Count = let v1 = countm seqv do check "fivjixjvd" 1 v1 -(* -/// Not implemented -module MapExample = - let inline map (f: ^T -> ^U) (a : ^A when ^A : (val map : (^T -> ^U) -> ^A -> ^A2)) = - (^A : (val map : (^T -> ^U) -> ^A -> ^A2) (f, a)) - let v5 = map (fun x -> x + 1) [ 1 .. 100 ] -*) -module ExtenstionAttributeMembers = +/// Solving using F#-defined extensions +module CSharpStyleExtensionMethodsProvideSolutions_Count2 = + + // Note this looks for a _method_ called `Count` taking a single argument + // It is _not_ considered the same as a property called `Count` + let inline countm (a : ^A when ^A : (member Count : unit -> int)) = + (^A : (member Count : unit -> int) (a)) + + type TwoIntegers(a:int, b:int) = + member x.A = a + member x.B = b + + [] + type Extension() = + [] + static member Count(c: TwoIntegers) = 2 + + let two = TwoIntegers(2,3) + let v0 = two.Count() // sanity check + do check "fivjijvd33" 2 v0 + + let v1 = countm two + do check "fivjixjvd33" 2 v1 + +/// Solving using F#-defined extensions +module CSharpStyleExtensionMethodsProvideSolutions_Count3 = open System.Runtime.CompilerServices [] type Ext2() = @@ -361,6 +379,30 @@ module ExtenstionAttributeMembers = let v = bleh "a" do check "cojkicjkc" 1 v +/// Solving using F#-defined extensions (generic) +module CSharpStyleExtensionMethodsProvideSolutions_Count4 = + + // Note this looks for a _method_ called `Count` taking a single argument + // It is _not_ considered the same as a property called `Count` + let inline countm (a : ^A when ^A : (member Count : unit -> int)) = + (^A : (member Count : unit -> int) (a)) + + type Two<'T1, 'T2>(a: 'T1, b: 'T2) = + member x.A = a + member x.B = b + + [] + type Extension() = + [] + static member Count(c: Two<'T1, 'T2>) = 2 + + let two = Two(2,3) + let v0 = two.Count() // sanity check + do check "fivjijvd33" 2 v0 + + let v1 = countm two + do check "fivjixjvd33" 2 v1 + module ExtendingGenericType1 = open System type ``[]``<'T> with @@ -487,11 +529,11 @@ module SystematicTests = type R = { F : int } - static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } - static member op_Addition (x: R, y: string) = { F = x.F + y.Length + 6 } - static member op_Addition (x: R, y: int) = { F = x.F + y + 6 } - static member op_Addition (x: string, y: R) = { F = x.Length + y.F + 9 } - static member op_Addition (x: int, y: R) = { F = x + y.F + 102 } + static member (+) (x: R, y: R) = { F = x.F + y.F + 4 } + static member (+) (x: R, y: string) = { F = x.F + y.Length + 6 } + static member (+) (x: R, y: int) = { F = x.F + y + 6 } + static member (+) (x: string, y: R) = { F = x.Length + y.F + 9 } + static member (+) (x: int, y: R) = { F = x + y.F + 102 } let r3 = { F = 3 } let r4 = { F = 4 } @@ -511,11 +553,11 @@ module SystematicTests = [] module Extensions = type R with - static member op_Addition (x: R, y: R) = { F = x.F + y.F + 4 } - static member op_Addition (x: R, y: string) = { F = x.F + y.Length + 6 } - static member op_Addition (x: R, y: int) = { F = x.F + y + 6 } - static member op_Addition (x: string, y: R) = { F = x.Length + y.F + 9 } - static member op_Addition (x: int, y: R) = { F = x + y.F + 102 } + static member (+) (x: R, y: R) = { F = x.F + y.F + 4 } + static member (+) (x: R, y: string) = { F = x.F + y.Length + 6 } + static member (+) (x: R, y: int) = { F = x.F + y + 6 } + static member (+) (x: string, y: R) = { F = x.Length + y.F + 9 } + static member (+) (x: int, y: R) = { F = x + y.F + 102 } let r3 = { F = 3 } let r4 = { F = 4 } From 3eb1e90ec9c7da94670806e5417aa78951196651 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 7 Feb 2020 17:31:47 +0000 Subject: [PATCH 29/82] integrate master --- src/fsharp/MethodCalls.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 470b21983fd..4e3de2bfa3e 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -1825,7 +1825,7 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = | None -> tcrefOfAppTy g metadataTy | Some ilActualTypeRef -> Import.ImportILTypeRef amap m ilActualTypeRef - let mdef = IL.resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref + let mdef = resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref let minfo = match extOpt with From 062859723362cbdbbc75ea2f2cf0d85dfc5d7a88 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 10 Feb 2020 17:06:43 +0000 Subject: [PATCH 30/82] add tests for compat problem --- tests/fsharp/core/extconstraint/test.fsx | 15 ++++++++++ tests/fsharp/tests.fs | 13 +++++++++ tests/fsharp/typecheck/sigs/neg132.fs | 28 +++++++++++++++++++ .../fsharp/typecheck/sigs/neg132.preview.bsl | 6 ++++ 4 files changed, 62 insertions(+) create mode 100644 tests/fsharp/typecheck/sigs/neg132.fs create mode 100644 tests/fsharp/typecheck/sigs/neg132.preview.bsl diff --git a/tests/fsharp/core/extconstraint/test.fsx b/tests/fsharp/core/extconstraint/test.fsx index 2fc674c427f..2d43bec389c 100644 --- a/tests/fsharp/core/extconstraint/test.fsx +++ b/tests/fsharp/core/extconstraint/test.fsx @@ -646,6 +646,21 @@ module Test2 = let z = "Bar".Foo("foo") let z0 = (Bar "Bar").Foo("foo") +module PositiveTestOfFSharpPlusDesignPattern1 = + let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + (^I : (static member Map : ^I * ^F -> ^R) source, mapping) + + // A simulated collection with a'Map' witness + type Coll<'T>(x: 'T) = + member _.X = x + static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>(mapping source.X) + + let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + InvokeMap ((+) v) (InvokeMap ((+) v) x) + + check "vrejklervjlr1" (AddTwice (Coll(3)) 2).X 7 + check "vrejklervjlr2" (AddTwice (Coll(3y)) 2y).X 7y + #if TESTS_AS_APP let RUN() = !failures #else diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index e1a583c017d..b3c6de25eb1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2991,6 +2991,19 @@ module TypecheckTests = let ``type check neg131 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg131" + [] + // This code must pass compilation with /langversion:4.7 on because RFC FS-1043 is not supported + let ``type check neg132 4_7`` () = + let cfg = testConfig "typecheck/sigs" + fsc cfg "%s -o:neg132-4.7.exe --langversion:4.7 --warnaserror" cfg.fsc_flags ["neg132.fs"] + peverify cfg "neg132-4.7.exe" + exec cfg ("." ++ "neg132-4.7.exe") "" + + [] + // This code must not pass compilation with /langversion:preview on because RFC FS-1043 is supported + let ``type check neg132 preview`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg132" + [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg132.fs b/tests/fsharp/typecheck/sigs/neg132.fs new file mode 100644 index 00000000000..1730e25bbe6 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg132.fs @@ -0,0 +1,28 @@ + +module Neg132 + +// This code starts failing to compile once TFC-1043 is enabled +// +// This is because the constraint relies on return types in the set of support types. +// +// This leaves unexpected ambiguity in common code especially when the shape of internal collections is potentially +// ambiguous internally in function implementations. +// +// Prior to RFC-1043 this ambiguity was resolved by applying weak resolution eagerly. + +// See https://github.com/fsharp/fslang-design/issues/435#issuecomment-584192749 +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + +// A simulated collection with a'Map' witness +type Coll<'T>(x: 'T) = + member _.X = x + static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>(mapping source.X) + +// What's the return collection type of the inner `InvokeMap` call? We only know once we apply weak resolution. +let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + InvokeMap ((+) v) (InvokeMap ((+) v) x) + +let v1 = AddTwice (Coll(3)) 2 +let v2 = AddTwice (Coll(3uy)) 2uy + diff --git a/tests/fsharp/typecheck/sigs/neg132.preview.bsl b/tests/fsharp/typecheck/sigs/neg132.preview.bsl new file mode 100644 index 00000000000..6a87ecd0eef --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg132.preview.bsl @@ -0,0 +1,6 @@ + +neg132.fs(24,24,24,33): typecheck error FS0043: Type constraint mismatch. The type + ''d -> 'e' +is not compatible with type + ''a -> 'f' + From eb5b81b674c5a25628cd54644180c37bca892667 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 10 Feb 2020 23:03:20 +0000 Subject: [PATCH 31/82] Update tests/fsharp/typecheck/sigs/neg132.fs Co-Authored-By: Phillip Carter --- tests/fsharp/typecheck/sigs/neg132.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg132.fs b/tests/fsharp/typecheck/sigs/neg132.fs index 1730e25bbe6..719b4d02a41 100644 --- a/tests/fsharp/typecheck/sigs/neg132.fs +++ b/tests/fsharp/typecheck/sigs/neg132.fs @@ -1,7 +1,7 @@ module Neg132 -// This code starts failing to compile once TFC-1043 is enabled +// This code starts failing to compile once RFC-1043 is enabled // // This is because the constraint relies on return types in the set of support types. // @@ -25,4 +25,3 @@ let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = let v1 = AddTwice (Coll(3)) 2 let v2 = AddTwice (Coll(3uy)) 2uy - From 4d4402add6698dc982f754d19efa181291361896 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 19 Mar 2020 21:03:24 +0000 Subject: [PATCH 32/82] debug --- src/fsharp/FSComp.txt | 1 + src/fsharp/LanguageFeatures.fs | 1 + src/fsharp/TypeChecker.fs | 1 + .../neg_generic_known_argument_types.bsl | 2 +- .../fsharp/typecheck/sigs/neg116.preview.bsl | 20 +- tests/fsharp/typecheck/sigs/neg120.bsl | 10 +- .../fsharp/typecheck/sigs/neg120.preview.bsl | 38 +-- .../fsharp/typecheck/sigs/neg123.preview.bsl | 30 +- .../fsharp/typecheck/sigs/neg124.preview.bsl | 56 +--- .../fsharp/typecheck/sigs/neg125.preview.bsl | 273 +++++++++++++++++- .../fsharp/typecheck/sigs/neg127.preview.bsl | 273 +++++++++++++++++- tests/fsharp/typecheck/sigs/neg130.4.7.bsl | 20 +- 12 files changed, 583 insertions(+), 142 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index d4832f6357e..6438fe882ba 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1509,3 +1509,4 @@ featureFixedIndexSlice3d4d,"fixed-index slice 3d/4d" featureAndBang,"and bang" featureNullableOptionalInterop,"nullable optional interop" featureDefaultInterfaceMemberConsumption,"default interface member consumption" +featureExtensionConstraintSolutions,"extension constraint solutions" diff --git a/src/fsharp/LanguageFeatures.fs b/src/fsharp/LanguageFeatures.fs index 9fcfd597465..aed7dd60163 100644 --- a/src/fsharp/LanguageFeatures.fs +++ b/src/fsharp/LanguageFeatures.fs @@ -137,6 +137,7 @@ type LanguageVersion (specifiedVersionAsString) = | LanguageFeature.AndBang -> FSComp.SR.featureAndBang() | LanguageFeature.NullableOptionalInterop -> FSComp.SR.featureNullableOptionalInterop() | LanguageFeature.DefaultInterfaceMemberConsumption -> FSComp.SR.featureDefaultInterfaceMemberConsumption() + | LanguageFeature.ExtensionConstraintSolutions -> FSComp.SR.featureExtensionConstraintSolutions() /// Get a version string associated with the given feature. member _.GetFeatureVersionString feature = diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 25153b99977..3d793297b55 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -17877,6 +17877,7 @@ let ApplyDefaults cenv g denvAtEnd m mexpr extraAttribs = if not tp.IsSolved then if (tp.StaticReq <> NoStaticReq) then ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp) + with e -> errorRecovery e m let CheckValueRestriction denvAtEnd rootSigOpt implFileTypePriorToSig m = diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl index 8567bfa1055..ac05e9b846e 100644 --- a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -1,7 +1,7 @@ neg_generic_known_argument_types.fsx(9,16,9,49): typecheck error FS0041: A unique overload for method 'Foo' could not be determined based on type information prior to this program point. A type annotation may be needed. -Known types of arguments: ^fa * 'fb * 'a * argD:'c when ^fa : (member X : ^fa * ^b -> ^b) and ^b : (member BBBB : ^b -> unit) +Known types of arguments: ^fa * 'fb * 'a * argD:'c when ^fa : (member X : ^b -> ^b) and ^b : (member BBBB : unit -> unit) Candidates: - static member A.Foo : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b diff --git a/tests/fsharp/typecheck/sigs/neg116.preview.bsl b/tests/fsharp/typecheck/sigs/neg116.preview.bsl index 8bd4930a304..8613d44041c 100644 --- a/tests/fsharp/typecheck/sigs/neg116.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.preview.bsl @@ -1,12 +1,10 @@ -neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. The available overloads are shown below. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'Complex' -. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'decimal' -. +neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. + +Known return type: ^a + +Known type parameters: < float , Polynomial > + +Available overloads: + - static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial // Argument 's' doesn't match + - static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial // Argument 's' doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg120.bsl b/tests/fsharp/typecheck/sigs/neg120.bsl index 315d92239b0..5f6d6d3a783 100644 --- a/tests/fsharp/typecheck/sigs/neg120.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.bsl @@ -6,8 +6,8 @@ Known return type: obj Known type parameters: < Id , (int -> obj) > Available overloads: - - static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match - - static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints + - static member Bind.( >>= )<'T,'U> : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'a1> : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg120.preview.bsl b/tests/fsharp/typecheck/sigs/neg120.preview.bsl index 1d7137c417f..5f6d6d3a783 100644 --- a/tests/fsharp/typecheck/sigs/neg120.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.preview.bsl @@ -1,27 +1,13 @@ -neg120.fs(95,18,95,21): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_GreaterGreaterEquals'. The available overloads are shown below. Consider adding further type constraints -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U>'. Type constraint mismatch. The type - 'int -> obj' -is not compatible with type - ''a -> Id<'b>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Async<'a>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option'. Type constraint mismatch. The type - 'Id' -is not compatible with type - ''a option' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Task<'a>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Lazy<'a>' -. +neg120.fs(95,18,95,21): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_GreaterGreaterEquals'. + +Known return type: obj + +Known type parameters: < Id , (int -> obj) > + +Available overloads: + - static member Bind.( >>= )<'T,'U> : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'U> : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match + - static member Bind.( >>= )<'T,'a1> : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg123.preview.bsl b/tests/fsharp/typecheck/sigs/neg123.preview.bsl index f23c8006034..5ef27cddd28 100644 --- a/tests/fsharp/typecheck/sigs/neg123.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg123.preview.bsl @@ -1,22 +1,10 @@ -neg123.fs(19,49,19,51): typecheck error FS0001: No overloads match for method 'pass'. The available overloads are shown below. -neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : int -> unit'. Type constraint mismatch. The type - 'unit -> unit' -is not compatible with type - 'int' -. -neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : unit -> unit'. Type constraint mismatch. The type - 'unit -> unit' -is not compatible with type - 'unit' -. -neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit)'. Type constraint mismatch. The type - 'unit -> unit' -is not compatible with type - 'int -> 'a' -. -neg123.fs(19,49,19,51): typecheck error FS0001: Possible overload: 'static member Switcher.pass : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit)'. Type constraint mismatch. The type - 'unit -> unit' -is not compatible with type - 'string -> 'a' -. +neg123.fs(19,49,19,51): typecheck error FS0001: No overloads match for method 'pass'. + +Known type parameter: < (unit -> unit) > + +Available overloads: + - static member Switcher.pass : int -> unit // Argument at index 1 doesn't match + - static member Switcher.pass : unit -> unit // Argument at index 1 doesn't match + - static member Switcher.pass< ^r when (Switcher or ^r) : (static member pass : ^r -> unit)> : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match + - static member Switcher.pass< ^r when (Switcher or ^r) : (static member pass : ^r -> unit)> : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg124.preview.bsl b/tests/fsharp/typecheck/sigs/neg124.preview.bsl index b9c55eba735..356440c6eff 100644 --- a/tests/fsharp/typecheck/sigs/neg124.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg124.preview.bsl @@ -1,42 +1,16 @@ -neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. The available overloads are shown below. Consider adding further type constraints -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint64' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int64' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint32' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int32' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint16' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int16' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'byte' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'sbyte' -. +neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. + +Known return type: uint8 + +Known type parameter: < obj > + +Available overloads: + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64 // Argument 'x' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg125.preview.bsl b/tests/fsharp/typecheck/sigs/neg125.preview.bsl index 4c96bbcc15e..5c26683981b 100644 --- a/tests/fsharp/typecheck/sigs/neg125.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg125.preview.bsl @@ -1,26 +1,273 @@ -neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int32 -neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int64 -neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: bigint -neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: sbyte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: int16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: byte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint64 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: decimal + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: Complex + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg127.preview.bsl b/tests/fsharp/typecheck/sigs/neg127.preview.bsl index 0ab9e8c5348..39c91a61d5b 100644 --- a/tests/fsharp/typecheck/sigs/neg127.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg127.preview.bsl @@ -1,26 +1,273 @@ -neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int32 -neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int64 -neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: bigint -neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: sbyte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: int16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: byte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint64 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: decimal + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: Complex + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg130.4.7.bsl b/tests/fsharp/typecheck/sigs/neg130.4.7.bsl index 5efa2ece8d7..8dbddad69d4 100644 --- a/tests/fsharp/typecheck/sigs/neg130.4.7.bsl +++ b/tests/fsharp/typecheck/sigs/neg130.4.7.bsl @@ -1,15 +1,13 @@ -neg130.fs(15,31,15,35): typecheck error FS0043: No overloads match for method 'Method'. The available overloads are shown below. -neg130.fs(15,31,15,35): typecheck error FS0043: Possible overload: 'static member X.Method : a:int64 -> int'. Type constraint mismatch. The type - ''t' -is not compatible with type - 'int64' -. -neg130.fs(15,31,15,35): typecheck error FS0043: Possible overload: 'static member X.Method : a:int -> int'. Type constraint mismatch. The type - ''t' -is not compatible with type - 'int' -. +neg130.fs(15,31,15,35): typecheck error FS0043: No overloads match for method 'Method'. + +Known return type: int + +Known type parameter: < ^t > + +Available overloads: + - static member X.Method : a:int -> int // Argument 'a' doesn't match + - static member X.Method : a:int64 -> int // Argument 'a' doesn't match neg130.fs(17,8,17,13): typecheck error FS0039: The value or constructor 'Test2' is not defined. Maybe you want one of the following: Test From f57f9471b08aee19b6575b9b711bad1c7c868a91 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 12:11:04 +0000 Subject: [PATCH 33/82] squash unsolved variables arising from witness generation --- src/fsharp/CompileOptions.fs | 2 +- src/fsharp/ConstraintSolver.fs | 59 ++++++++++--------- .../FSharp.Compiler.Private.fsproj | 12 ++-- src/fsharp/FindUnsolved.fs | 9 +++ src/fsharp/FindUnsolved.fsi | 3 + src/fsharp/IlxGen.fs | 6 +- src/fsharp/TastOps.fs | 11 ++-- src/fsharp/TastOps.fsi | 3 + src/fsharp/TypeChecker.fs | 10 +++- src/fsharp/tast.fs | 7 ++- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.de.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.es.xlf | 7 ++- src/fsharp/xlf/FSComp.txt.fr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.it.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ja.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ko.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pl.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.tr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ tests/fsharp/typecheck/sigs/neg117.bsl | 4 +- tests/fsharp/typecheck/sigs/neg119.bsl | 8 +-- 25 files changed, 148 insertions(+), 53 deletions(-) diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 911f913f2f5..d2ce80e7927 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1055,7 +1055,7 @@ let internalFlags (tcConfigB:TcConfigBuilder) = [ CompilerOption ("stamps", tagNone, - OptionUnit ignore, + OptionSet Tastops.DebugPrint.layoutStamps, Some(InternalCommandLineOption("--stamps", rangeCmdArgs)), None) CompilerOption diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 380557400c8..8fc588b5532 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -106,13 +106,8 @@ let NewByRefKindInferenceType (g: TcGlobals) m = let NewInferenceTypes l = l |> List.map (fun _ -> NewInferenceType ()) -// QUERY: should 'rigid' ever really be 'true'? We set this when we know -// we are going to have to generalize a typar, e.g. when implementing a -// abstract generic method slot. But we later check the generalization -// condition anyway, so we could get away with a non-rigid typar. This -// would sort of be cleaner, though give errors later. let FreshenAndFixupTypars (traitCtxt: ITraitContext option) m rigid fctps tinst tpsorig = - let copy_tyvar (tp: Typar) = NewCompGenTypar (tp.Kind, rigid, tp.StaticReq, (if rigid=TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No), false) + let copy_tyvar (tp: Typar) = NewCompGenTypar (tp.Kind, rigid, tp.StaticReq, (if rigid=TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No), false) let tps = tpsorig |> List.map copy_tyvar let renaming, tinst = FixupNewTypars traitCtxt m fctps tinst tpsorig tps tps, renaming, tinst @@ -322,13 +317,13 @@ let rec occursCheck g un ty = type PermitWeakResolution = /// Represents the point where we are generalizing inline code - | YesAtInlineGeneralization + | LegacyYesAtInlineGeneralization /// Represents points where we are choosing a default solution to trait constraints | YesAtChooseSolution - /// Represents legacy invocations of the constraint solver during codegen - | YesAtCodeGen + /// Represents invocations of the constraint solver during codegen or inlining to determine witnesses + | LegacyYesAtCodeGen /// No weak resolution allowed | No @@ -339,15 +334,15 @@ type PermitWeakResolution = if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then match x with | YesAtChooseSolution -> true - | YesAtInlineGeneralization - | YesAtCodeGen + | LegacyYesAtCodeGen + | LegacyYesAtInlineGeneralization | No -> false else //legacy match x with - | YesAtChooseSolution -> true - | YesAtCodeGen -> true - | YesAtInlineGeneralization -> true + | YesAtChooseSolution + | LegacyYesAtCodeGen + | LegacyYesAtInlineGeneralization -> true | No -> false @@ -447,7 +442,7 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we // ignore the possibility that method overloads may resolve the constraint - | PermitWeakResolution.YesAtInlineGeneralization + | PermitWeakResolution.LegacyYesAtInlineGeneralization | PermitWeakResolution.YesAtChooseSolution -> // weak resolution lets the other type be a variable type isTyparTy g ty2 || @@ -457,7 +452,7 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = typeEquivAux EraseMeasures g ty1 ty2 // During codegen we only apply a builtin resolution if both the types are correct - | PermitWeakResolution.YesAtCodeGen -> + | PermitWeakResolution.LegacyYesAtCodeGen -> p2 ty2 && // All built-in rules only apply in cases where left and right operator types are equal (after // erasing units) @@ -1853,7 +1848,7 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (pe SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps isInline = - let permitWeakResolution = (if isInline then PermitWeakResolution.YesAtInlineGeneralization else PermitWeakResolution.YesAtChooseSolution) + let permitWeakResolution = (if isInline then PermitWeakResolution.LegacyYesAtInlineGeneralization else PermitWeakResolution.YesAtChooseSolution) SolveRelevantMemberConstraints csenv ndeep permitWeakResolution trace tps and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) traitInfo support (frees: Typar list) = @@ -3148,17 +3143,6 @@ let CreateCodegenState tcVal g amap = ExtraCxs = HashMultiMap(10, HashIdentity.Structural) InfoReader = new InfoReader(g, amap) } -let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { - let css = CreateCodegenState tcVal g amap - - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.YesAtCodeGen 0 m NoTrace traitInfo - - let sln = GenWitnessExpr amap g m traitInfo argExprs - return sln - } - let ChooseTyparSolutionAndSolve css denv tp = let g = css.g let amap = css.amap @@ -3169,6 +3153,25 @@ let ChooseTyparSolutionAndSolve css denv tp = (fun err -> ErrorD(ErrorFromApplyingDefault(g, denv, tp, max, err, m))) |> RaiseOperationResult +let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { + let css = CreateCodegenState tcVal g amap + let denv = DisplayEnv.Empty g + + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let sln = GenWitnessExpr amap g m traitInfo argExprs + + sln |> Option.iter (fun slnExpr -> + let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr + + unsolved |> List.iter (fun tp -> + if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then + ChooseTyparSolutionAndSolve css denv tp)) + + return sln + } + let CheckDeclaredTypars denv css m typars1 typars2 = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv TryD_IgnoreAbortForFailedOverloadResolution diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 5ef70c6e952..71d8430919f 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -446,6 +446,12 @@ Logic\PatternMatchCompilation.fs + + Logic\FindUnsolved.fsi + + + Logic\FindUnsolved.fs + Logic\ConstraintSolver.fsi @@ -458,12 +464,6 @@ Logic\CheckFormatStrings.fs - - Logic\FindUnsolved.fsi - - - Logic\FindUnsolved.fs - Logic\QuotationTranslator.fsi diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs index 903b4d2bec2..a342e6aecfd 100644 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -276,4 +276,13 @@ let UnsolvedTyparsOfModuleDef g amap denv (mdef, extraAttribs) = accAttribs cenv Nix extraAttribs List.rev cenv.unsolved +let UnsolvedTyparsOfExpr g amap denv expr = + let cenv = + { g =g + amap=amap + denv=denv + unsolved = [] } + accExpr cenv Nix expr + List.rev cenv.unsolved + diff --git a/src/fsharp/FindUnsolved.fsi b/src/fsharp/FindUnsolved.fsi index c7c63d8335e..9264884dcb7 100644 --- a/src/fsharp/FindUnsolved.fsi +++ b/src/fsharp/FindUnsolved.fsi @@ -10,3 +10,6 @@ open FSharp.Compiler.Import /// Find all unsolved inference variables after type inference for an entire file val UnsolvedTyparsOfModuleDef: g: TcGlobals -> amap: ImportMap -> denv: DisplayEnv -> mdef : ModuleOrNamespaceExpr * extraAttribs: Attrib list -> Typar list + +/// Find all unsolved inference variables after adhoc generation of witness +val UnsolvedTyparsOfExpr: g: TcGlobals -> amap: ImportMap -> denv: DisplayEnv -> expr: Expr -> Typar list diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index c5f7e8ece4f..b3ad9754bb9 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -389,7 +389,7 @@ let ComputeTypeAccess (tref: ILTypeRef) hidden = type TypeReprEnv(reprs: Map, count: int) = /// Lookup a type parameter - member __.Item (tp: Typar, m: range) = + member __.LookupTyparRepr (tp: Typar, m: range) = try reprs.[tp.Stamp] with :? KeyNotFoundException -> errorR(InternalError("Undefined or unsolved type variable: " + showL(typarL tp), m)) @@ -540,7 +540,7 @@ and GenTypeAux amap m (tyenv: TypeReprEnv) voidOK ptrsOK ty = if tps.IsEmpty then GenTypeAux amap m tyenv VoidNotOK ptrsOK tau else EraseClosures.mkILTyFuncTy g.ilxPubCloEnv - | TType_var tp -> mkILTyvarTy tyenv.[tp, m] + | TType_var tp -> mkILTyvarTy (tyenv.LookupTyparRepr(tp, m)) | TType_measure _ -> g.ilg.typ_Int32 @@ -4361,7 +4361,7 @@ and GenGenericParams cenv eenv tps = tps |> DropErasedTypars |> List.map (GenGenericParam cenv eenv) and GenGenericArgs m (tyenv: TypeReprEnv) tps = - tps |> DropErasedTypars |> List.map (fun c -> (mkILTyvarTy tyenv.[c, m])) + tps |> DropErasedTypars |> List.map (fun c -> mkILTyvarTy (tyenv.LookupTyparRepr(c, m))) /// Generate the closure class for a function and GenLambdaClosure cenv (cgbuf: CodeGenBuffer) eenv isLocalTypeFunc selfv expr = diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index e9bd37e7239..154b20909f6 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -2743,7 +2743,7 @@ type DisplayEnv = maxMembers = None showObsoleteMembers = false showHiddenMembers = false - showTyparBinding = false + showTyparBinding = true showImperativeTyparAnnotations = false suppressInlineKeyword = false suppressMutableKeyword = false @@ -3383,8 +3383,9 @@ module DebugPrint = else stat stat - let stampL _n w = - w + let layoutStamps = ref false + let stampL (n: int64) w = + if layoutStamps.Value then w ++ (wordL (tagText ("#" + string n))) else w let layoutTyconRef (tc: TyconRef) = wordL (tagText tc.DisplayNameWithStaticParameters) |> stampL tc.Stamp @@ -3901,7 +3902,7 @@ module DebugPrint = wordL(tagText "bytes++") | Expr.Op (TOp.UInt16s _, _, _, _) -> wordL(tagText "uint16++") | Expr.Op (TOp.RefAddrGet _, _tyargs, _args, _) -> wordL(tagText "GetRefLVal...") - | Expr.Op (TOp.TraitCall _, _tyargs, _args, _) -> wordL(tagText "traitcall...") + | Expr.Op (TOp.TraitCall traitInfo, _tyargs, _args, _) -> wordL(tagText "traitcall") ^^ auxTraitL SimplifyTypes.typeSimplificationInfo0 traitInfo | Expr.Op (TOp.ExnFieldGet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldGet...") | Expr.Op (TOp.ExnFieldSet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldSet...") | Expr.Op (TOp.TryFinally _, _tyargs, _args, _) -> wordL(tagText "TOp.TryFinally...") @@ -7499,7 +7500,7 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex let curriedInputTys, _ = stripFunTy g inputTy - assert (curriedActualArgTys.Length = curriedInputTys.Length) + if curriedActualArgTys.Length <> curriedInputTys.Length then None else let argTys = (curriedInputTys, curriedActualArgTys) ||> List.mapi2 (fun i x y -> (i, x, y)) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 4327ea43ed2..0e16092433a 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1303,6 +1303,9 @@ module DebugPrint = /// A global flag indicating whether debug output should include ranges val layoutRanges : bool ref + /// A global flag indicating whether debug output should include stamps + val layoutStamps : bool ref + /// Convert a type to a string for debugging purposes val showType : TType -> string diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 3d793297b55..c46e5aa2ae0 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -11481,7 +11481,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds let (ExplicitTyparInfo(_, declaredTypars, canInferTypars)) = flex let allDeclaredTypars = enclosingDeclaredTypars @ declaredTypars let generalizedTypars, prelimValSchemes2 = - let canInferTypars = GeneralizationHelpers. ComputeCanInferExtraGeneralizableTypars (containerInfo.ParentRef, canInferTypars, None) + let canInferTypars = GeneralizationHelpers.ComputeCanInferExtraGeneralizableTypars (containerInfo.ParentRef, canInferTypars, None) let maxInferredTypars = freeInTypeLeftToRight cenv.g false tauTy @@ -11494,6 +11494,10 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canConstrain, inlineFlag, Some rhsExpr, allDeclaredTypars, maxInferredTypars, tauTy, false) + //printfn "Generalizing 'let' at %A" m + //printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) + //printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g rhsExpr)) + let prelimValSchemes2 = GeneralizeVals cenv denv enclosingDeclaredTypars generalizedTypars nameToPrelimValSchemeMap generalizedTypars, prelimValSchemes2 @@ -12394,6 +12398,10 @@ and TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv (pgr let canGeneralizeConstrained = GeneralizationHelpers.CanGeneralizeConstrainedTyparsForDecl rbinfo.DeclKind let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars, tau, isCtor) + + printfn "Generalizing 'member/let-rec' at %A" m + printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) + printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g expr)) generalizedTypars /// Compute the type variables which may have member constraints that need to be canonicalized prior to generalization diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index abe4a6df82c..461b475a928 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -5714,7 +5714,6 @@ let MakeRecdFieldsTable ucs: TyconRecdFields = { FieldsByIndex = Array.ofList ucs FieldsByName = ucs |> NameMap.ofKeyedList (fun rfld -> rfld.Name) } - let MakeUnionCases ucs: TyconUnionData = { CasesTable=MakeUnionCasesTable ucs CompiledRepresentation=newCache() } @@ -5722,9 +5721,13 @@ let MakeUnionCases ucs: TyconUnionData = let MakeUnionRepr ucs = TUnionRepr (MakeUnionCases ucs) let NewTypar (kind, rigid, Typar(id, staticReq, isCompGen), isFromError, dynamicReq, attribs, eqDep, compDep) = + let stamp = newStamp() + //printfn "stamp = %d" stamp + //if stamp = 16193L then + // assert false Typar.New { typar_id = id - typar_stamp = newStamp() + typar_stamp = stamp typar_flags= TyparFlags(kind, rigid, isFromError, isCompGen, staticReq, dynamicReq, eqDep, compDep) typar_solution = None typar_astype = Unchecked.defaultof<_> diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index b5f6f432190..274fa0043b8 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index d72df609a41..525127f8be9 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 9e684510269..b5e04775fd6 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d @@ -329,7 +334,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index f70498d025d..67ba5a49efa 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index a845dce070d..1935212ba93 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index ff06396d42f..30168e01648 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 8d3cf3a2888..4217c1eb890 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 4ddac8a165f..e7d5a88944e 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index f5605be3f33..796a18aee9b 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 81be92df161..83df3e673bc 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index cec06557129..5efcc8f81eb 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index d3184726f05..92c2641dfb4 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 9387b84425a..4beec99bbd7 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -72,6 +72,11 @@ dotless float32 literal + + extension constraint solutions + extension constraint solutions + + fixed-index slice 3d/4d fixed-index slice 3d/4d diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl index 9d0fdfb84ec..d3235ea943b 100644 --- a/tests/fsharp/typecheck/sigs/neg117.bsl +++ b/tests/fsharp/typecheck/sigs/neg117.bsl @@ -6,5 +6,5 @@ Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[]) Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.[] , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > Available overloads: - - static member Neg117.Superpower.Transformer.Transform : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f) // Argument at index 1 doesn't match - - static member Neg117.Superpower.Transformer.Transform : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform< ^f when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f)> : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform< ^r when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r)> : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg119.bsl b/tests/fsharp/typecheck/sigs/neg119.bsl index 975fc46185a..5436ccf18fa 100644 --- a/tests/fsharp/typecheck/sigs/neg119.bsl +++ b/tests/fsharp/typecheck/sigs/neg119.bsl @@ -6,7 +6,7 @@ Known return type: ((int -> int -> int) -> obj) Known type parameters: < obj , Applicatives.Ap > Available overloads: - - static member Applicatives.Ap.Return : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match - - static member Applicatives.Ap.Return : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match - - static member Applicatives.Ap.Return : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R) // Argument 'r' doesn't match - - static member Applicatives.Ap.Return : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match Consider adding further type constraints + - static member Applicatives.Ap.Return< ^R,'a1 when ^R : (static member Return : 'a1 -> ^R)> : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R) // Argument 'r' doesn't match + - static member Applicatives.Ap.Return<'a> : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return<'a> : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return<'r,'a,'a2,'a3> : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match Consider adding further type constraints From f0287a17c79743c24c9c435da7de090632a8b6a6 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 13:49:59 +0000 Subject: [PATCH 34/82] add test --- src/fsharp/ConstraintSolver.fs | 69 ++++++++++++++----- src/fsharp/ConstraintSolver.fsi | 7 ++ src/fsharp/TypeChecker.fs | 35 +++------- tests/fsharp/tests.fs | 10 +++ .../neg_generic_known_argument_types.bsl | 4 +- tests/fsharp/typecheck/sigs/neg133.bsl | 6 ++ tests/fsharp/typecheck/sigs/neg133.fs | 47 +++++++++++++ .../fsharp/typecheck/sigs/neg133.preview.bsl | 6 ++ 8 files changed, 138 insertions(+), 46 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg133.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg133.fs create mode 100644 tests/fsharp/typecheck/sigs/neg133.preview.bsl diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 8fc588b5532..06dceeb778a 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3153,25 +3153,6 @@ let ChooseTyparSolutionAndSolve css denv tp = (fun err -> ErrorD(ErrorFromApplyingDefault(g, denv, tp, max, err, m))) |> RaiseOperationResult -let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { - let css = CreateCodegenState tcVal g amap - let denv = DisplayEnv.Empty g - - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo - let sln = GenWitnessExpr amap g m traitInfo argExprs - - sln |> Option.iter (fun slnExpr -> - let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr - - unsolved |> List.iter (fun tp -> - if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then - ChooseTyparSolutionAndSolve css denv tp)) - - return sln - } - let CheckDeclaredTypars denv css m typars1 typars2 = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv TryD_IgnoreAbortForFailedOverloadResolution @@ -3192,6 +3173,56 @@ let CanonicalizePartialInferenceProblem css denv m tps isInline = (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult +/// Apply defaults arising from 'default' constraints in FSharp.Core +/// for any unsolved free inference type variables. +/// Defaults get applied before the module signature is checked and before the implementation conditions on virtuals/overrides. +/// Defaults get applied in priority order. Defaults listed last get priority 0 (lowest), 2nd last priority 1 etc. +let ApplyDefaultsForUnsolved css denv (unsolved: Typar list) = + + // The priority order comes from the order of declaration of the defaults in FSharp.Core. + for priority = 10 downto 0 do + unsolved |> List.iter (fun tp -> + if not tp.IsSolved then + // Apply the first default. If we're defaulting one type variable to another then + // the defaults will be propagated to the new type variable. + ApplyTyparDefaultAtPriority denv css priority tp) + + // OK, now apply defaults for any unsolved HeadTypeStaticReq + unsolved |> List.iter (fun tp -> + if not tp.IsSolved then + if (tp.StaticReq <> NoStaticReq) then + ChooseTyparSolutionAndSolve css denv tp) + +/// Choose solutions for any remaining unsolved free inference type variables. +let ChooseSolutionsForUnsolved css denv (unsolved: Typar list) = + unsolved |> List.iter (fun tp -> + if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then + ChooseTyparSolutionAndSolve css denv tp) + +let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { + let css = CreateCodegenState tcVal g amap + let denv = DisplayEnv.Empty g + + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let sln = GenWitnessExpr amap g m traitInfo argExprs + + // The process of generating witnesses can cause free inference type variables to arise from use + // of generic methods as extension constraint solutions. We eliminate these using the same + // sequence (ApplyDefault, ChooseSolutions) used at the end of type inference. + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + sln |> Option.iter (fun slnExpr -> + // Apply all defaults + let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr + ApplyDefaultsForUnsolved css denv unsolved + + // Search again and choose solutions + let unsolved2 = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr + ChooseSolutionsForUnsolved css denv unsolved2) + + return sln + } /// An approximation used during name resolution for intellisense to eliminate extension members which will not /// apply to a particular object argument. This is given as the isApplicableMeth argument to the partial name resolution /// functions in nameres.fs. diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index ce0db31a72f..5576d705143 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -199,6 +199,13 @@ val CodegenWitnessThatTypeSupportsTraitConstraint: TcValF -> TcGlobals -> Import val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> unit +/// Apply defaults arising from 'default' constraints in FSharp.Core +/// for any unsolved free inference type variables. +val ApplyDefaultsForUnsolved: ConstraintSolverState -> DisplayEnv -> Typar list -> unit + +/// Choose solutions for any remaining unsolved free inference type variables. +val ChooseSolutionsForUnsolved: ConstraintSolverState -> DisplayEnv -> Typar list -> unit + val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> ITraitContext option -> MethInfo -> TType -> bool val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit \ No newline at end of file diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index c46e5aa2ae0..540c7fe875e 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -12399,9 +12399,9 @@ and TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv (pgr let canGeneralizeConstrained = GeneralizationHelpers.CanGeneralizeConstrainedTyparsForDecl rbinfo.DeclKind let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars, tau, isCtor) - printfn "Generalizing 'member/let-rec' at %A" m - printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) - printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g expr)) + //printfn "Generalizing 'member/let-rec' at %A" m + //printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) + //printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g expr)) generalizedTypars /// Compute the type variables which may have member constraints that need to be canonicalized prior to generalization @@ -14595,7 +14595,8 @@ module MutRecBindingChecking = freeInTypar.Exists(fun otherTypar -> genSet.Contains otherTypar)) //printfn "unsolvedTyparsInvolvingGeneralizedVariables.Length = %d" unsolvedTyparsInvolvingGeneralizedVariables.Length //for x in unsolvedTypars do - // printfn "unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" x.DisplayName x.Stamp + // + unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" x.DisplayName x.Stamp unsolvedTyparsInvolvingGeneralizedVariables for tp in unsolvedTyparsForRecursiveBlockInvolvingGeneralizedVariables do @@ -17864,27 +17865,13 @@ let rec IterTyconsOfModuleOrNamespaceType f (mty: ModuleOrNamespaceType) = IterTyconsOfModuleOrNamespaceType f v.ModuleOrNamespaceType) -// Defaults get applied before the module signature is checked and before the implementation conditions on virtuals/overrides. -// Defaults get applied in priority order. Defaults listed last get priority 0 (lowest), 2nd last priority 1 etc. let ApplyDefaults cenv g denvAtEnd m mexpr extraAttribs = try - let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) + let unsolved = FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) - ConstraintSolver.CanonicalizePartialInferenceProblem cenv.css denvAtEnd m unsolved false + CanonicalizePartialInferenceProblem cenv.css denvAtEnd m unsolved false - // The priority order comes from the order of declaration of the defaults in FSharp.Core. - for priority = 10 downto 0 do - unsolved |> List.iter (fun tp -> - if not tp.IsSolved then - // Apply the first default. If we're defaulting one type variable to another then - // the defaults will be propagated to the new type variable. - ConstraintSolver.ApplyTyparDefaultAtPriority denvAtEnd cenv.css priority tp) - - // OK, now apply defaults for any unsolved HeadTypeStaticReq - unsolved |> List.iter (fun tp -> - if not tp.IsSolved then - if (tp.StaticReq <> NoStaticReq) then - ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp) + ConstraintSolver.ApplyDefaultsForUnsolved cenv.css denvAtEnd unsolved with e -> errorRecovery e m @@ -17909,11 +17896,9 @@ let CheckValueRestriction denvAtEnd rootSigOpt implFileTypePriorToSig m = let SolveInternalUnknowns g cenv denvAtEnd mexpr extraAttribs = - let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) + let unsolved = FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) - unsolved |> List.iter (fun tp -> - if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then - ConstraintSolver.ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp) + ConstraintSolver.ChooseSolutionsForUnsolved cenv.css denvAtEnd unsolved let CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig mexpr = match rootSigOpt with diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index caf0b939326..6346d788b3a 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3004,6 +3004,16 @@ module TypecheckTests = let ``type check neg132 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg132" + // The code in this test does not compile (in any language version) + // + // We compile with both --langversion:default and no --langversion:preview + // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 + [] + let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" + + [] + let ``type check neg133 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg133" + [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl index ac05e9b846e..697b283ab78 100644 --- a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -4,5 +4,5 @@ neg_generic_known_argument_types.fsx(9,16,9,49): typecheck error FS0041: A uniqu Known types of arguments: ^fa * 'fb * 'a * argD:'c when ^fa : (member X : ^b -> ^b) and ^b : (member BBBB : unit -> unit) Candidates: - - static member A.Foo : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b - - static member A.Foo : argA2:'a * argB2:('a -> 'b) * argC2:('b -> 'c) * argD:('c -> 'd) * argZ2:'zzz -> 'd + - static member A.Foo<'a,'b,'c,'d> : argA2:'a * argB2:('a -> 'b) * argC2:('b -> 'c) * argD:('c -> 'd) * argZ2:'zzz -> 'd + - static member A.Foo<'a,'b> : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b diff --git a/tests/fsharp/typecheck/sigs/neg133.bsl b/tests/fsharp/typecheck/sigs/neg133.bsl new file mode 100644 index 00000000000..45f7ffaad98 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg133.bsl @@ -0,0 +1,6 @@ + +neg133.fs(47,5,47,58): optimize error FS0071: Type constraint mismatch when applying the default type 'Microsoft.FSharp.Core.obj' for a type inference variable. Type constraint mismatch. The type + 'Microsoft.FSharp.Core.obj' +is not compatible with type + ''a Microsoft.FSharp.Core.option' + Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg133.fs b/tests/fsharp/typecheck/sigs/neg133.fs new file mode 100644 index 00000000000..610d7706cb8 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg133.fs @@ -0,0 +1,47 @@ +module Neg133 + +// This code should fail to compile regardless RFC-1043 + +let inline CallReturn< ^M, ^R, 'T when (^M or ^R) : (static member Return : unit -> ('T -> ^R))> () = + ((^M or ^R) : (static member Return : unit -> ('T -> ^R)) ()) + +let inline CallApply< ^M, ^I1, ^I2, ^R when (^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R)> (input1: ^I1, input2: ^I2) = + ((^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R) input1, input2) + +let inline CallMap< ^M, ^F, ^I, ^R when (^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R)> (mapping: ^F, source: ^I) : ^R = + ((^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R) mapping, source) + +let inline CallSequence< ^M, ^I, ^R when (^M or ^I) : (static member Sequence : ^I -> ^R)> (b: ^I) : ^R = + ((^M or ^I) : (static member Sequence : ^I -> ^R) b) + +type Return = class end + +type Apply = class end + +type Map = class end + +type Sequence = class end + +let inline InvokeReturn (x: 'T) : ^R = + CallReturn< Return , ^R , 'T> () x + +let inline InvokeApply (f: ^I1) (x: ^I2) : ^R = + CallApply(f, x) + +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + CallMap (mapping, source) + +type Sequence with + static member inline Sequence (t: list>) : ^R = + List.foldBack (fun (x: 't option) (ys: ^R) -> InvokeApply (InvokeMap (fun x y -> x :: y) x) ys) t (InvokeReturn []) + +type Map with + static member Map (f: 'T->'U, x: option<_>) = Option.map f x + +type Apply with + static member Apply (f: option<_>, x: option<'T>) : option<'U> = failwith "" + +type Return with + static member Return () = fun x -> Some x : option<'a> +let res18() = + CallSequence [Some 3; Some 2; Some 1] diff --git a/tests/fsharp/typecheck/sigs/neg133.preview.bsl b/tests/fsharp/typecheck/sigs/neg133.preview.bsl new file mode 100644 index 00000000000..45f7ffaad98 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg133.preview.bsl @@ -0,0 +1,6 @@ + +neg133.fs(47,5,47,58): optimize error FS0071: Type constraint mismatch when applying the default type 'Microsoft.FSharp.Core.obj' for a type inference variable. Type constraint mismatch. The type + 'Microsoft.FSharp.Core.obj' +is not compatible with type + ''a Microsoft.FSharp.Core.option' + Consider adding further type constraints From a8c4dbac2d727565c5b716ade1dc3d58e0547fa9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 13:56:17 +0000 Subject: [PATCH 35/82] fix build --- src/fsharp/TypeChecker.fs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 540c7fe875e..0f534ba4d34 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -11494,10 +11494,6 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canConstrain, inlineFlag, Some rhsExpr, allDeclaredTypars, maxInferredTypars, tauTy, false) - //printfn "Generalizing 'let' at %A" m - //printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) - //printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g rhsExpr)) - let prelimValSchemes2 = GeneralizeVals cenv denv enclosingDeclaredTypars generalizedTypars nameToPrelimValSchemeMap generalizedTypars, prelimValSchemes2 @@ -12399,9 +12395,6 @@ and TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv (pgr let canGeneralizeConstrained = GeneralizationHelpers.CanGeneralizeConstrainedTyparsForDecl rbinfo.DeclKind let generalizedTypars = GeneralizationHelpers.ComputeAndGeneralizeGenericTypars (cenv, denv, m, freeInEnv, canInferTypars, canGeneralizeConstrained, inlineFlag, Some expr, allDeclaredTypars, maxInferredTypars, tau, isCtor) - //printfn "Generalizing 'member/let-rec' at %A" m - //printfn " generalizedTypars = %s" (Layout.showL (DebugPrint.typarsL generalizedTypars)) - //printfn " rhsExpr = %s" (Layout.showL (DebugPrint.exprL cenv.g expr)) generalizedTypars /// Compute the type variables which may have member constraints that need to be canonicalized prior to generalization @@ -14595,8 +14588,8 @@ module MutRecBindingChecking = freeInTypar.Exists(fun otherTypar -> genSet.Contains otherTypar)) //printfn "unsolvedTyparsInvolvingGeneralizedVariables.Length = %d" unsolvedTyparsInvolvingGeneralizedVariables.Length //for x in unsolvedTypars do + // printfn "unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" x.DisplayName x.Stamp // - unsolvedTyparsInvolvingGeneralizedVariable: %s #%d" x.DisplayName x.Stamp unsolvedTyparsInvolvingGeneralizedVariables for tp in unsolvedTyparsForRecursiveBlockInvolvingGeneralizedVariables do From 889fcdbe51c45b09f7f1d80f1741b4162d012cb0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 15:29:50 +0000 Subject: [PATCH 36/82] revert shwow typar --- .../FSharp.Compiler.Service.fsproj | 12 ++++++------ src/fsharp/TastOps.fs | 2 +- .../overloads/neg_generic_known_argument_types.bsl | 4 ++-- tests/fsharp/typecheck/sigs/neg117.bsl | 4 ++-- tests/fsharp/typecheck/sigs/neg119.bsl | 8 ++++---- tests/fsharp/typecheck/sigs/neg120.bsl | 10 +++++----- tests/fsharp/typecheck/sigs/neg120.preview.bsl | 10 +++++----- tests/fsharp/typecheck/sigs/neg123.preview.bsl | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index b033e63f1e8..e64dbec082a 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -447,6 +447,12 @@ Logic/PatternMatchCompilation.fs + + Logic/FindUnsolved.fsi + + + Logic/FindUnsolved.fs + Logic/ConstraintSolver.fsi @@ -459,12 +465,6 @@ Logic/CheckFormatStrings.fs - - Logic/FindUnsolved.fsi - - - Logic/FindUnsolved.fs - Logic/QuotationTranslator.fsi diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 154b20909f6..929d579a031 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -2743,7 +2743,7 @@ type DisplayEnv = maxMembers = None showObsoleteMembers = false showHiddenMembers = false - showTyparBinding = true + showTyparBinding = false showImperativeTyparAnnotations = false suppressInlineKeyword = false suppressMutableKeyword = false diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl index 697b283ab78..ac05e9b846e 100644 --- a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -4,5 +4,5 @@ neg_generic_known_argument_types.fsx(9,16,9,49): typecheck error FS0041: A uniqu Known types of arguments: ^fa * 'fb * 'a * argD:'c when ^fa : (member X : ^b -> ^b) and ^b : (member BBBB : unit -> unit) Candidates: - - static member A.Foo<'a,'b,'c,'d> : argA2:'a * argB2:('a -> 'b) * argC2:('b -> 'c) * argD:('c -> 'd) * argZ2:'zzz -> 'd - - static member A.Foo<'a,'b> : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b + - static member A.Foo : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b + - static member A.Foo : argA2:'a * argB2:('a -> 'b) * argC2:('b -> 'c) * argD:('c -> 'd) * argZ2:'zzz -> 'd diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl index d3235ea943b..9d0fdfb84ec 100644 --- a/tests/fsharp/typecheck/sigs/neg117.bsl +++ b/tests/fsharp/typecheck/sigs/neg117.bsl @@ -6,5 +6,5 @@ Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[]) Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.[] , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > Available overloads: - - static member Neg117.Superpower.Transformer.Transform< ^f when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f)> : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f) // Argument at index 1 doesn't match - - static member Neg117.Superpower.Transformer.Transform< ^r when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r)> : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg119.bsl b/tests/fsharp/typecheck/sigs/neg119.bsl index 5436ccf18fa..975fc46185a 100644 --- a/tests/fsharp/typecheck/sigs/neg119.bsl +++ b/tests/fsharp/typecheck/sigs/neg119.bsl @@ -6,7 +6,7 @@ Known return type: ((int -> int -> int) -> obj) Known type parameters: < obj , Applicatives.Ap > Available overloads: - - static member Applicatives.Ap.Return< ^R,'a1 when ^R : (static member Return : 'a1 -> ^R)> : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R) // Argument 'r' doesn't match - - static member Applicatives.Ap.Return<'a> : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match - - static member Applicatives.Ap.Return<'a> : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match - - static member Applicatives.Ap.Return<'r,'a,'a2,'a3> : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match Consider adding further type constraints + - static member Applicatives.Ap.Return : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R) // Argument 'r' doesn't match + - static member Applicatives.Ap.Return : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg120.bsl b/tests/fsharp/typecheck/sigs/neg120.bsl index 5f6d6d3a783..315d92239b0 100644 --- a/tests/fsharp/typecheck/sigs/neg120.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.bsl @@ -6,8 +6,8 @@ Known return type: obj Known type parameters: < Id , (int -> obj) > Available overloads: - - static member Bind.( >>= )<'T,'U> : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'a1> : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match Consider adding further type constraints + - static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg120.preview.bsl b/tests/fsharp/typecheck/sigs/neg120.preview.bsl index 5f6d6d3a783..315d92239b0 100644 --- a/tests/fsharp/typecheck/sigs/neg120.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.preview.bsl @@ -6,8 +6,8 @@ Known return type: obj Known type parameters: < Id , (int -> obj) > Available overloads: - - static member Bind.( >>= )<'T,'U> : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'U> : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match - - static member Bind.( >>= )<'T,'a1> : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match Consider adding further type constraints + - static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg123.preview.bsl b/tests/fsharp/typecheck/sigs/neg123.preview.bsl index 5ef27cddd28..59c9ab9aebf 100644 --- a/tests/fsharp/typecheck/sigs/neg123.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg123.preview.bsl @@ -6,5 +6,5 @@ Known type parameter: < (unit -> unit) > Available overloads: - static member Switcher.pass : int -> unit // Argument at index 1 doesn't match - static member Switcher.pass : unit -> unit // Argument at index 1 doesn't match - - static member Switcher.pass< ^r when (Switcher or ^r) : (static member pass : ^r -> unit)> : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match - - static member Switcher.pass< ^r when (Switcher or ^r) : (static member pass : ^r -> unit)> : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match + - static member Switcher.pass : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match + - static member Switcher.pass : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match From 149f290e4a261a21a1c6cfe8f320083fb391ea35 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 15:36:11 +0000 Subject: [PATCH 37/82] fix test baseline --- tests/fsharp/typecheck/sigs/neg123.preview.bsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg123.preview.bsl b/tests/fsharp/typecheck/sigs/neg123.preview.bsl index 59c9ab9aebf..440a1f74fa0 100644 --- a/tests/fsharp/typecheck/sigs/neg123.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg123.preview.bsl @@ -4,7 +4,7 @@ neg123.fs(19,49,19,51): typecheck error FS0001: No overloads match for method 'p Known type parameter: < (unit -> unit) > Available overloads: - - static member Switcher.pass : int -> unit // Argument at index 1 doesn't match - - static member Switcher.pass : unit -> unit // Argument at index 1 doesn't match - static member Switcher.pass : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match - static member Switcher.pass : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match + - static member Switcher.pass : int -> unit // Argument at index 1 doesn't match + - static member Switcher.pass : unit -> unit // Argument at index 1 doesn't match From d2a99d6b1a889951c1b4efba2526f29470f4d4eb Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 15:39:59 +0000 Subject: [PATCH 38/82] fix test baseline --- tests/fsharp/tests.fs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 6346d788b3a..db0698e1b42 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3004,12 +3004,12 @@ module TypecheckTests = let ``type check neg132 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg132" - // The code in this test does not compile (in any language version) - // - // We compile with both --langversion:default and no --langversion:preview - // because it is an SRTP test and we want to check it is not affected by RFC FS-1043 - [] - let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" + // The code in the neg133 test does not compile (in any language version). + // However it raises an internal error without RFC-1043 and so we don't + // run it under that configuration. + // + //[] + //let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" [] let ``type check neg133 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg133" From 194d7b357ef6345114ad0d7c2b28d2c0cf87a720 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 20 Mar 2020 16:47:43 +0000 Subject: [PATCH 39/82] fix options --- .../CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs | 2 +- .../CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs index 0c3c619c33e..3c4b5b7949d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs @@ -49,7 +49,7 @@ //section='- ADVANCED - ' ! option=subsystemversion kind=OptionString //section='- ADVANCED - ' ! option=targetprofile kind=OptionString //section='- ADVANCED - ' ! option=quotations-debug kind=OptionSwitch -//section='NoSection ' ! option=stamps kind=OptionUnit +//section='NoSection ' ! option=stamps kind=OptionSet //section='NoSection ' ! option=ranges kind=OptionSet //section='NoSection ' ! option=terms kind=OptionUnit //section='NoSection ' ! option=termsfile kind=OptionUnit diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index e0d7d42cc87..7ce8ae8cefd 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -34,7 +34,7 @@ //section='NoSection ' ! option=ranges kind=OptionSet //section='NoSection ' ! option=terms kind=OptionUnit //section='NoSection ' ! option=termsfile kind=OptionUnit -//section='NoSection ' ! option=stamps kind=OptionUnit +//section='NoSection ' ! option=stamps kind=OptionSet //section='NoSection ' ! option=pause kind=OptionUnit //section='NoSection ' ! option=detuple kind=OptionInt //section='NoSection ' ! option=simulateException kind=OptionString From fa2e6cc4d2319008578afd0bdb263feb02e38462 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 24 Mar 2020 13:32:53 +0000 Subject: [PATCH 40/82] reduce diff --- src/fsharp/NameResolution.fs | 9 ++++---- src/fsharp/NameResolution.fsi | 2 +- src/fsharp/NicePrint.fs | 23 +++++++++++-------- src/fsharp/fsi/fsi.fs | 4 ++-- src/fsharp/service/FSharpCheckerResults.fs | 2 +- .../basic/E_ExtensionOperator01.fs | 18 +++++++-------- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 063b50930df..3157b110b73 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -38,11 +38,6 @@ type NameResolver(g: TcGlobals, infoReader: InfoReader, instantiationGenerator: range -> Typars -> ITraitContext option -> TypeInst) = - member nr.g = g - member nr.amap = amap - member nr.InfoReader = infoReader - member nr.languageSupportsNameOf = g.langVersion.SupportsFeature LanguageFeature.NameOf - /// Used to transform typars into new inference typars /// instantiationGenerator is a function to help us create the /// type parameters by copying them from type parameter specifications read @@ -56,6 +51,10 @@ type NameResolver(g: TcGlobals, /// without further freshening. However it does mean we end up plumbing 'instantiationGenerator' /// around a bit more than we would like to, which is a bit annoying. member nr.InstantiationGenerator = instantiationGenerator + member nr.g = g + member nr.amap = amap + member nr.InfoReader = infoReader + member nr.languageSupportsNameOf = g.langVersion.SupportsFeature LanguageFeature.NameOf //------------------------------------------------------------------------- // Helpers for unionconstrs and recdfields diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 776dc0068b4..b1137d268c7 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -175,7 +175,7 @@ type NameResolutionEnv = /// Adding a module abbreviation adds it a local entry to this List.map. /// Likewise adding a ccu or opening a path adds entries to this List.map. eModulesAndNamespaces: NameMultiMap - + /// Fully qualified modules and namespaces. 'open' does not change this. eFullyQualifiedModulesAndNamespaces: NameMultiMap diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index d80924f0441..a5117122035 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -864,18 +864,18 @@ module private PrintTypes = WordL.arrow ^^ (layoutTyparRefWithInfo denv env tp)) |> longConstraintPrefix] - and private layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argtys, rty, _, _)) = + and private layoutTraitWithInfo denv env (TTrait(supportTys, nm, memFlags, argtys, rty, _, _)) = let nm = DemangleOperatorName nm if denv.shortConstraints then WordL.keywordMember ^^ wordL (tagMember nm) else let rty = GetFSharpViewOfReturnType denv.g rty let stat = layoutMemberFlags memFlags - let tys = ListSet.setify (typeEquiv denv.g) tys - let tysL = - match tys with + let supportTys = ListSet.setify (typeEquiv denv.g) supportTys + let supportTysL = + match supportTys with | [ty] -> layoutTypeWithInfo denv env ty - | tys -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) tys) + | _ -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) supportTys) let argtys = if memFlags.IsInstance then @@ -884,11 +884,16 @@ module private PrintTypes = | _ :: rest -> rest else argtys - let argtysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argtys + let rtyL = layoutTypeWithInfo denv env rty - tysL ^^ wordL (tagPunctuation ":") --- - bracketL (stat ++ wordL (tagMember nm) ^^ wordL (tagPunctuation ":") --- - ((argtysL --- wordL (tagPunctuation "->")) --- (layoutTypeWithInfo denv env rty))) + let tyL = + match argtys with + | [] -> rtyL + | _ -> + let argtysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argtys + argtysL --- wordL (tagPunctuation "->") --- rtyL + + supportTysL ^^ wordL (tagPunctuation ":") --- bracketL (stat ++ wordL (tagMember nm) ^^ wordL (tagPunctuation ":") --- tyL) /// Layout a unit expression diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 7804313476f..eeda6ed2897 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2315,8 +2315,8 @@ type internal FsiInteractionProcessor let tcState = istate.tcState let amap = istate.tcImports.GetImportMap() - let infoReader = new InfoReader(istate.tcGlobals, amap) - let ncenv = new NameResolver(istate.tcGlobals, amap, infoReader, FakeInstantiationGenerator) + let infoReader = new InfoReader(istate.tcGlobals,amap) + let ncenv = new NameResolver(istate.tcGlobals,amap,infoReader,FakeInstantiationGenerator) let ad = tcState.TcEnvFromImpls.AccessRights let nenv = tcState.TcEnvFromImpls.NameEnv diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs index 18e875bf4dc..ee9600ae960 100644 --- a/src/fsharp/service/FSharpCheckerResults.fs +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -147,7 +147,7 @@ type internal TypeCheckInfo let amap = tcImports.GetImportMap() let infoReader = new InfoReader(g,amap) - let ncenv = new NameResolver(g, amap, infoReader, NameResolution.FakeInstantiationGenerator) + let ncenv = new NameResolver(g,amap,infoReader,NameResolution.FakeInstantiationGenerator) let cenv = SymbolEnv(g, thisCcu, Some ccuSigForFile, tcImports, amap, infoReader) /// Find the most precise naming environment for the given line and column diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs index a2d10e07e4a..f9200a8b2f8 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/E_ExtensionOperator01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression for FSHARP1.0:3592 -// Can't use extension methods to define operators +// //The type 'Exception' does not support the operator '\+'$ //The type 'Exception' does not support the operator '\+'$ //The type 'MyType' does not support the operator '\+'$ @@ -13,14 +13,14 @@ open System type MyType() = member this.X = 1 -//module TestExtensions = -// type MyType with -// static member (+) (e1: MyType, e2: MyType) = -// new MyType() -// -// type System.Exception with -// static member (+) (e1: Exception, e2: Exception) = -// new Exception(e1.Message + " " + e2.Message) + + + + + + + + let e1 = Exception() let e2 = Exception() From 09a4a50eaec74b3b49add70672af399b5dc728f0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 25 Mar 2020 19:01:23 +0000 Subject: [PATCH 41/82] merge master --- src/fsharp/service/FSharpCheckerResults.fs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs index fd402bb87e0..57113731322 100644 --- a/src/fsharp/service/FSharpCheckerResults.fs +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -435,10 +435,8 @@ type internal TypeCheckInfo match bestQual with | Some bestQual -> - let (_,ty,denv,nenv,ad,m) = bestQual - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone)) m ad false ty let (_,ty,nenv,ad,m) = bestQual - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone)) m ad false ty let items = items |> List.map ItemWithNoInst let items = items |> RemoveDuplicateItems g let items = items |> RemoveExplicitlySuppressed g From d1a651c7fd27dcae664b2c37b654cd5fd80d9a95 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 27 Mar 2020 12:49:04 +0000 Subject: [PATCH 42/82] merge master, fix test --- .../neg_known_return_type_and_known_type_arguments.bsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl index 6c9ef4772e2..93dd0c84576 100644 --- a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl @@ -6,11 +6,11 @@ Known return type: MonoidSample Known type parameters: < MonoidSample , Zero > Available overloads: - - static member Zero.Zero : ^t * Default1 -> ^t when ^t : (static member get_Zero : -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default1 -> ^t when ^t : (static member get_Zero : ^t) // Argument at index 1 doesn't match - static member Zero.Zero : ^t * Default1 -> ('a1 -> 'a1) when ^t : null and ^t : struct // Argument at index 1 doesn't match - static member Zero.Zero : ^t * Default2 -> ^t when (FromInt32 or ^t) : (static member FromInt32 : ^t * FromInt32 -> int32 -> ^t) // Argument at index 1 doesn't match - static member Zero.Zero : ^t * Default2 -> ('a1 -> 'a1) when ^t : null and ^t : struct // Argument at index 1 doesn't match - - static member Zero.Zero : ^t * Default3 -> ^t when ^t : (static member get_Empty : -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default3 -> ^t when ^t : (static member get_Empty : ^t) // Argument at index 1 doesn't match - static member Zero.Zero : 'a array * Zero -> 'a array // Argument at index 1 doesn't match - static member Zero.Zero : 'a list * Zero -> 'a list // Argument at index 1 doesn't match - static member Zero.Zero : 'a option * Zero -> 'a option // Argument at index 1 doesn't match From e06f2689463e057dfb48089c001d4be7bf168bf7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 3 Jun 2020 15:11:55 +0100 Subject: [PATCH 43/82] integrate master --- src/fsharp/ConstraintSolver.fs | 80 ++++++++++++++------------- src/fsharp/MethodCalls.fs | 9 ++- src/fsharp/TypeChecker.fs | 2 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.de.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.es.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.fr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.it.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ja.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ko.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pl.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.tr.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ 16 files changed, 114 insertions(+), 42 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 7a76f3dafda..61d1c3e650c 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3155,33 +3155,6 @@ let CreateCodegenState tcVal g amap = InfoReader = new InfoReader(g, amap) codegen = true } -/// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code -let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { - let css = CreateCodegenState tcVal g amap - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo - let sln = GenWitnessExpr amap g m traitInfo argExprs - return sln - } - -/// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses -let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { - let css = CreateCodegenState tcVal g amap - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let ftps, _renaming, tinst = FreshenTypeInst m typars - let traitInfos = GetTraitConstraintInfosOfTypars g ftps - do! SolveTypeEqualsTypeEqns csenv 0 m NoTrace None tinst tyargs - return MethodCalls.GenWitnessArgs amap g m traitInfos - } - -/// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses -let CodegenWitnessesForTraitWitness tcVal g amap m traitInfo = trackErrors { - let css = CreateCodegenState tcVal g amap - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo - return MethodCalls.GenWitnessExprLambda amap g m traitInfo - } - /// For some code like "let f() = ([] = [])", a free choice is made for a type parameter /// for an interior type variable. This chooses a solution for a type parameter subject /// to its constraints and applies that solution by using a constraint. @@ -3241,17 +3214,7 @@ let ChooseSolutionsForUnsolved css denv (unsolved: Typar list) = if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then ChooseTyparSolutionAndSolve css denv tp) -/// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code -let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo: TraitConstraintInfo) argExprs = trackErrors { - let css = CreateCodegenState tcVal g amap - - let denv = DisplayEnv.Empty g - - let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo - let sln = GenWitnessExpr amap g m traitInfo argExprs - +let ApplyDefaultsAfterWitnessGeneration (g: TcGlobals) amap css denv sln = // The process of generating witnesses can cause free inference type variables to arise from use // of generic methods as extension constraint solutions. We eliminate these using the same // sequence (ApplyDefault, ChooseSolutions) used at the end of type inference. @@ -3265,9 +3228,50 @@ let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo: TraitConstraintI let unsolved2 = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr ChooseSolutionsForUnsolved css denv unsolved2) +/// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code +let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { + let css = CreateCodegenState tcVal g amap + let denv = DisplayEnv.Empty g + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let sln = GenWitnessExpr amap g m traitInfo argExprs + ApplyDefaultsAfterWitnessGeneration g amap css denv sln return sln } +/// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses +let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { + let css = CreateCodegenState tcVal g amap + let denv = DisplayEnv.Empty g + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + // TODO: check traitCtxtNone here, feels wrong. We should simply not be re-freshening here during codegen. + // This is invoked every time codegen or quotation calls a witness-accepting + // method. TBH the witnesses need to be generated during type checking and passed all the way down, + // or at least be left in the tree as WitnessArg nodes. + let ftps, _renaming, tinst = FreshenTypeInst traitCtxtNone m typars + let traitInfos = GetTraitConstraintInfosOfTypars g ftps + do! SolveTypeEqualsTypeEqns csenv 0 m NoTrace None tinst tyargs + let witnessArgs = MethodCalls.GenWitnessArgs amap g m traitInfos + for witnessArg in witnessArgs do + match witnessArg with + | Choice1Of2 _traitInfo -> () + | Choice2Of2 sln -> ApplyDefaultsAfterWitnessGeneration g amap css denv (Some sln) + return witnessArgs + } + +/// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses +let CodegenWitnessesForTraitWitness tcVal g amap m traitInfo = trackErrors { + let css = CreateCodegenState tcVal g amap + let denv = DisplayEnv.Empty g + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let witnessLambda = MethodCalls.GenWitnessExprLambda amap g m traitInfo + match witnessLambda with + | Choice1Of2 _traitInfo -> () + | Choice2Of2 sln -> ApplyDefaultsAfterWitnessGeneration g amap css denv (Some sln) + return witnessLambda + } + /// An approximation used during name resolution for intellisense to eliminate extension members which will not /// apply to a particular object argument. This is given as the isApplicableMeth argument to the partial name resolution /// functions in nameres.fs. diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index f27c4b70240..ca1163cbd21 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -1897,9 +1897,12 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = // Fix bug 1281: If we resolve to an instance method on a struct and we haven't yet taken // the address of the object then go do that if minfo.IsStruct && minfo.IsInstance && (minfo.ObjArgNeedsAddress(amap, m)) && ObjArgExprNeedsAddressOf g argExprs then - let h, t = List.headAndTail argExprs - let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m - Some (wrap (Expr.Op (TOp.TraitCall traitInfo, [], (h' :: t), m))) + match argExprs with + | h :: t -> + let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m + Some (wrap (Expr.Op (TOp.TraitCall traitInfo, [], (h' :: t), m))) + | _ -> + Some (MakeMethInfoCall amap m minfo methArgTys argExprs) else Some (MakeMethInfoCall amap m minfo methArgTys argExprs) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index d2a1edc5bc1..04605a88ae0 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -18090,7 +18090,7 @@ let TypeCheckOneImplFile try let reportErrors = not (checkForErrors()) - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g envAtEnd.TraitContext PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, tcVal, envAtEnd.DisplayEnv, diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index c8892818bf8..fbabd33d4c0 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} – {0} diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 17d150ce5d8..10141d6a8c2 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 7f5402d8695..4c432d6ee87 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index b137c8bc38e..9f0d2905b4a 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 59fe5a9b7a8..570a780416c 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index af88ac71f16..03ade5007b9 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 8c5559b715e..55da782d63d 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index a0b302e42a1..bc225a742f2 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} — {0} diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index b25030df260..dc7ff581e8f 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index ec679ef4b63..860362113e8 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 269e2053fc7..394befa2b84 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 64e5255ed6a..fa37ba32d32 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index dfa96c4fc52..b3d68aa64eb 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -142,6 +142,11 @@ wild card in for loop + + witness passing + witness passing + + - {0} - {0} From e800fc2be0b035fa13e74bdf89f3f6244dfce3a2 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 3 Jun 2020 17:54:05 +0100 Subject: [PATCH 44/82] fix tests --- tests/fsharp/tests.fs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 6a5d659279f..96012638879 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -538,7 +538,7 @@ module CoreTests = [] let ``extconstraint-fsc preview`` () = - let cfg = testConfig "core/extconstraint" + let cfg = testConfig' "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"] @@ -555,7 +555,7 @@ module CoreTests = [] let ``extconstraint-fsc-no-optimize preview`` () = - let cfg = testConfig "core/extconstraint" + let cfg = testConfig' "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:preview" } csc cfg """/nologo /target:library /out:cslib.dll""" ["cslib.cs"] @@ -572,7 +572,7 @@ module CoreTests = [] let ``extconstraint-fsi preview`` () = - let cfg = testConfig "core/extconstraint" + let cfg = testConfig' "core/extconstraint" let cfg = { cfg with fsi_flags = cfg.fsi_flags + " --langversion:preview" } use testOkFile = fileguard cfg "test.ok" @@ -583,7 +583,7 @@ module CoreTests = [] let ``extconstraint-compat preview`` () = - let cfg = testConfig "core/extconstraint" + let cfg = testConfig' "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --define:LANGVERSION_PREVIEW --langversion:preview" } let outFile = "test-compat.output.txt" @@ -600,7 +600,7 @@ module CoreTests = [] let ``extconstraint-compat2`` () = - let cfg = testConfig "core/extconstraint" + let cfg = testConfig' "core/extconstraint" let cfg = { cfg with fsc_flags = cfg.fsc_flags + " --langversion:4.6" } let outFile = "test-compat.output.feature-disabled.txt" @@ -2280,7 +2280,7 @@ module TypecheckTests = // We also run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs pos34 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:pos34-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["pos34.fs"] peverify cfg "pos34-preview.dll" @@ -2292,56 +2292,56 @@ module TypecheckTests = [] let ``sigs pos35 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:pos35.dll --warnaserror --langversion:preview" cfg.fsc_flags ["pos35.fs"] peverify cfg "pos35.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs pos36 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:pos36.dll --langversion:preview --warnaserror" cfg.fsc_flags ["pos36.fs"] peverify cfg "pos36.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen1 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen1.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen1.fs"] peverify cfg "widen1.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen2 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen2.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen2.fs"] peverify cfg "widen2.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen3 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen3.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen3.fs"] peverify cfg "widen3.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen4 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen4.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen4.fs"] peverify cfg "widen4.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen5 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen5.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen5.fs"] peverify cfg "widen5.dll" // We run this with --langversion:preview because it is an SRTP test and RFC FS-1043 is enabled in preview [] let ``sigs widen6 preview`` () = - let cfg = testConfig "typecheck/sigs" + let cfg = testConfig' "typecheck/sigs" fsc cfg "%s --target:library -o:widen6.dll --langversion:preview --warnaserror" cfg.fsc_flags ["widen6.fs"] peverify cfg "widen6.dll" From 8561fd762d241152d8390e7e461c3e00d9fed953 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 15 Jun 2020 16:14:37 +0100 Subject: [PATCH 45/82] fix build --- src/fsharp/TypeChecker.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 98d1b034e6f..bad50c02cec 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -3266,7 +3266,7 @@ let GetMethodArgs arg = //------------------------------------------------------------------------- let CompilePatternForMatch cenv (env: TcEnv) mExpr matchm warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy = - let dtree, targets = CompilePattern cenv.g env.DisplayEnv cenv.amap (LightweightTcValForUsingInBuildMethodCall cenv.g) cenv.infoReader mExpr matchm warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy + let dtree, targets = CompilePattern cenv.g env.DisplayEnv cenv.amap (LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext) cenv.infoReader mExpr matchm warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy mkAndSimplifyMatch NoDebugPointAtInvisibleBinding mExpr matchm resultTy dtree targets /// Compile a pattern From 6cdb9b4501e0773ec391afcf97b1c8b2614e4fc8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Jun 2020 00:54:06 +0100 Subject: [PATCH 46/82] alternative fix for 9449 --- src/fsharp/ConstraintSolver.fs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 4001b801aa5..725fd075392 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -245,11 +245,6 @@ type ConstraintSolverState = /// The function used to freshen values we encounter during trait constraint solving TcVal: TcValF - /// Indicates if the constraint solver is being run after type checking is complete, - /// e.g. during codegen to determine solutions and witnesses for trait constraints. - /// Suppresses the generation of certain errors such as missing constraint warnings. - codegen: bool - /// This table stores all unsolved, ungeneralized trait constraints, indexed by free type variable. /// That is, there will be one entry in this table for each free type variable in /// each outstanding, unsolved, ungeneralized trait constraint. Constraints are removed from the table and resolved @@ -262,7 +257,6 @@ type ConstraintSolverState = amap = amap ExtraCxs = HashMultiMap(10, HashIdentity.Structural) InfoReader = infoReader - codegen = false TcVal = tcVal } type ConstraintSolverEnv = @@ -1945,14 +1939,14 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint | (TyparRigidity.Rigid | TyparRigidity.WillBeRigid), TyparConstraint.DefaultsTo _ -> true | _ -> false) then () - elif tp.Rigidity = TyparRigidity.Rigid && not csenv.SolverState.codegen then + elif tp.Rigidity = TyparRigidity.Rigid then return! ErrorD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) else // It is important that we give a warning if a constraint is missing from a // will-be-made-rigid type variable. This is because the existence of these warnings // is relevant to the overload resolution rules (see 'candidateWarnCount' in the overload resolution // implementation). - if tp.Rigidity.WarnIfMissingConstraint && not csenv.SolverState.codegen then + if tp.Rigidity.WarnIfMissingConstraint then do! WarnD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) let newConstraints = @@ -3065,8 +3059,7 @@ let CreateCodegenState tcVal g amap = amap = amap TcVal = tcVal ExtraCxs = HashMultiMap(10, HashIdentity.Structural) - InfoReader = new InfoReader(g, amap) - codegen = true } + InfoReader = new InfoReader(g, amap) } /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { @@ -3140,7 +3133,6 @@ let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = amap = amap TcVal = (fun _ -> failwith "should not be called") ExtraCxs = HashMultiMap(10, HashIdentity.Structural) - codegen = false InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let minst = FreshenMethInfo m minfo From c38ebd87a76b19ee131e8c6ba7ef84cdd3eafb78 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Jun 2020 14:19:15 +0100 Subject: [PATCH 47/82] add test case --- tests/fsharp/tests.fs | 11 +++++++++- tests/fsharp/typecheck/sigs/pos36-srtp-app.fs | 11 ++++++++++ tests/fsharp/typecheck/sigs/pos36-srtp-lib.fs | 22 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/fsharp/typecheck/sigs/pos36-srtp-app.fs create mode 100644 tests/fsharp/typecheck/sigs/pos36-srtp-lib.fs diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 19e8c725f48..11a7463d663 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -5,7 +5,7 @@ #load "../FSharp.TestHelpers/TestFramework.fs" #load "single-test.fs" #else -module ``FSharp-Tests-Core`` +module FSharp.Tests.Core #endif open System @@ -2204,6 +2204,15 @@ module TypecheckTests = fsc cfg "%s --target:library -o:pos35.dll --warnaserror" cfg.fsc_flags ["pos35.fs"] peverify cfg "pos35.dll" + [] + let ``sigs pos36-srtp`` () = + let cfg = testConfig' "typecheck/sigs" + fsc cfg "%s --target:library -o:pos36-srtp-lib.dll --warnaserror" cfg.fsc_flags ["pos36-srtp-lib.fs"] + fsc cfg "%s --target:exe -r:pos36-srtp-lib.dll -o:pos36-srtp-app.exe --warnaserror" cfg.fsc_flags ["pos36-srtp-app.fs"] + peverify cfg "pos36-srtp-lib.dll" + peverify cfg "pos36-srtp-app.exe" + exec cfg ("." ++ "pos36-srtp-app.exe") "" + [] let ``sigs pos23`` () = let cfg = testConfig' "typecheck/sigs" diff --git a/tests/fsharp/typecheck/sigs/pos36-srtp-app.fs b/tests/fsharp/typecheck/sigs/pos36-srtp-app.fs new file mode 100644 index 00000000000..57c78b65fd1 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/pos36-srtp-app.fs @@ -0,0 +1,11 @@ +module Pos36 + +open Lib + +let check msg x y = if x = y then printfn "passed %s" msg else failwithf "failed '%s'" msg + +let tbind () = + check "vwknvewoiwvren1" (StaticMethods.M(C(3))) "M(C), x = 3" + check "vwknvewoiwvren2" (StaticMethods.M(3L)) "M(int64), x = 3" + +tbind() diff --git a/tests/fsharp/typecheck/sigs/pos36-srtp-lib.fs b/tests/fsharp/typecheck/sigs/pos36-srtp-lib.fs new file mode 100644 index 00000000000..f8b24122724 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/pos36-srtp-lib.fs @@ -0,0 +1,22 @@ + + +module Lib + +let inline RequireM< ^Witnesses, ^T when (^Witnesses or ^T): (static member M : ^T -> string) > (x: ^T) : string = + ((^Witnesses or ^T): (static member M : ^T -> string) x) + +type C(p:int) = + member x.P = p + +type Witnesses() = + + static member M (x: C) : string = sprintf "M(C), x = %d" x.P + + static member M (x: int64) : string = sprintf "M(int64), x = %d" x + +type StaticMethods = + + static member inline M< ^T when (Witnesses or ^T): (static member M: ^T -> string)> (x: ^T) : string = + + RequireM< Witnesses, ^T> (x) + From 150a2a58b57fa1106f5a3b053355f955571a0866 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Jun 2020 19:09:43 +0100 Subject: [PATCH 48/82] fix 9449 properly by assert type equations simultaneously --- src/fsharp/ConstraintSolver.fs | 75 +++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 725fd075392..0469946c180 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -861,34 +861,31 @@ let CheckWarnIfRigid (csenv: ConstraintSolverEnv) ty1 (r: Typar) ty = /// Add the constraint "ty1 = ty" to the constraint problem, where ty1 is a type variable. /// Propagate all effects of adding this constraint, e.g. to solve other variables -let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) ty1 ty = trackErrors { - let m = csenv.m - do! DepthCheck ndeep m - match ty1 with - | TType_var r | TType_measure (Measure.Var r) -> - // The types may still be equivalent due to abbreviations, which we are trying not to eliminate - if typeEquiv csenv.g ty1 ty then () else - // The famous 'occursCheck' check to catch "infinite types" like 'a = list<'a> - see also https://github.com/Microsoft/visualfsharp/issues/1170 - if occursCheck csenv.g r ty then return! ErrorD (ConstraintSolverInfiniteTypes(csenv.DisplayEnv, csenv.eContextInfo, ty1, ty, m, m2)) else - // Note: warn _and_ continue! - do! CheckWarnIfRigid csenv ty1 r ty - // Record the solution before we solve the constraints, since - // We may need to make use of the equation when solving the constraints. - // Record a entry in the undo trace if one is provided - trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None) - - // Only solve constraints if this is not an error var - if r.IsFromError then () else - - // Check to see if this type variable is relevant to any trait constraints. - // If so, re-solve the relevant constraints. - if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then - do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep PermitWeakResolution.No trace r) +let rec SolveTyparEqualsTypePart1 (csenv: ConstraintSolverEnv) m2 (trace: OptionalTrace) ty1 r ty = trackErrors { + // The types may still be equivalent due to abbreviations, which we are trying not to eliminate + if typeEquiv csenv.g ty1 ty then () else + // The famous 'occursCheck' check to catch "infinite types" like 'a = list<'a> - see also https://github.com/Microsoft/visualfsharp/issues/1170 + if occursCheck csenv.g r ty then return! ErrorD (ConstraintSolverInfiniteTypes(csenv.DisplayEnv, csenv.eContextInfo, ty1, ty, csenv.m, m2)) else + // Note: warn _and_ continue! + do! CheckWarnIfRigid csenv ty1 r ty + // Record the solution before we solve the constraints, since + // We may need to make use of the equation when solving the constraints. + // Record a entry in the undo trace if one is provided + trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None) + } + +and SolveTyparEqualsTypePart2 (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) (r: Typar) ty = trackErrors { + // Only solve constraints if this is not an error var + if r.IsFromError then () else + + // Check to see if this type variable is relevant to any trait constraints. + // If so, re-solve the relevant constraints. + if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then + do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep PermitWeakResolution.No trace r) + + // Re-solve the other constraints associated with this type variable + return! solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r - // Re-solve the other constraints associated with this type variable - return! solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r - - | _ -> failwith "SolveTyparEqualsType" } /// Apply the constraints on 'typar' to the type 'ty' @@ -933,6 +930,28 @@ and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty } +and SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) ty1 ty = trackErrors { + let m = csenv.m + do! DepthCheck ndeep m + match ty1 with + | TType_var r | TType_measure (Measure.Var r) -> + do! SolveTyparEqualsTypePart1 csenv m2 trace ty1 r ty + do! SolveTyparEqualsTypePart2 csenv ndeep m2 trace r ty + | _ -> failwith "SolveTyparEqualsType" + } + +// Like SolveTyparEqualsType but asserts all typar equalities simultaneously instead of one by one +and SolveTyparsEqualTypes (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) tptys tys = trackErrors { + do! (tptys, tys) ||> Iterate2D (fun tpty ty -> + match tpty with + | TType_var r | TType_measure (Measure.Var r) -> SolveTyparEqualsTypePart1 csenv m2 trace tpty r ty + | _ -> failwith "SolveTyparsEqualTypes") + do! (tptys, tys) ||> Iterate2D (fun tpty ty -> + match tpty with + | TType_var r | TType_measure (Measure.Var r) -> SolveTyparEqualsTypePart2 csenv ndeep m2 trace r ty + | _ -> failwith "SolveTyparsEqualTypes") + } + and SolveAnonInfoEqualsAnonInfo (csenv: ConstraintSolverEnv) m2 (anonInfo1: AnonRecdTypeInfo) (anonInfo2: AnonRecdTypeInfo) = if evalTupInfoIsStruct anonInfo1.TupInfo <> evalTupInfoIsStruct anonInfo2.TupInfo then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m,m2)) else (match anonInfo1.Assembly, anonInfo2.Assembly with @@ -3076,7 +3095,7 @@ let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let ftps, _renaming, tinst = FreshenTypeInst m typars let traitInfos = GetTraitConstraintInfosOfTypars g ftps - do! SolveTypeEqualsTypeEqns csenv 0 m NoTrace None tinst tyargs + do! SolveTyparsEqualTypes csenv 0 m NoTrace tinst tyargs return MethodCalls.GenWitnessArgs amap g m traitInfos } From aa41f569c6c4857fb43b6d98e30f74ac0058f8f5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 17 Jun 2020 14:33:21 +0100 Subject: [PATCH 49/82] fix build --- tests/fsharp/tests.fs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 575d0064acc..b922709a72d 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2354,15 +2354,6 @@ module TypecheckTests = peverify cfg "pos36-srtp-app.exe" exec cfg ("." ++ "pos36-srtp-app.exe") "" - [] - let ``sigs pos36-srtp`` () = - let cfg = testConfig' "typecheck/sigs" - fsc cfg "%s --target:library -o:pos36-srtp-lib.dll --warnaserror" cfg.fsc_flags ["pos36-srtp-lib.fs"] - fsc cfg "%s --target:exe -r:pos36-srtp-lib.dll -o:pos36-srtp-app.exe --warnaserror" cfg.fsc_flags ["pos36-srtp-app.fs"] - peverify cfg "pos36-srtp-lib.dll" - peverify cfg "pos36-srtp-app.exe" - exec cfg ("." ++ "pos36-srtp-app.exe") "" - [] let ``sigs pos23`` () = let cfg = testConfig' "typecheck/sigs" From 4639d766a3e05f5d5c6d533ac308983a739ae33c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 24 Oct 2020 18:22:12 +0100 Subject: [PATCH 50/82] fix test --- tests/fsharp/tests.fs | 18 ++++++--------- tests/fsharp/typecheck/sigs/neg134.4.7.bsl | 14 ----------- tests/fsharp/typecheck/sigs/neg134.fs | 27 ---------------------- 3 files changed, 7 insertions(+), 52 deletions(-) delete mode 100644 tests/fsharp/typecheck/sigs/neg134.4.7.bsl delete mode 100644 tests/fsharp/typecheck/sigs/neg134.fs diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 91198fd7240..fee8a6b6615 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3051,15 +3051,14 @@ module TypecheckTests = // The code in this test starts to compile once FS-1043 is enabled. [] - let ``type check neg134 4_7`` () = - singleVersionedNegTest (testConfig' "typecheck/sigs") "4.7" "neg134" - - [] - let ``type check neg134 preview`` () = + let ``type check neg130 preview`` () = let cfg = testConfig' "typecheck/sigs" - fsc cfg "%s -o:neg134-preview.exe --langversion:preview --warnaserror" cfg.fsc_flags ["neg134.fs"] - peverify cfg "neg134-preview.exe" - exec cfg ("." ++ "neg134-preview.exe") "" + fsc cfg "%s -o:neg130-preview.exe --langversion:preview --warnaserror" cfg.fsc_flags ["neg130.fs"] + peverify cfg "neg130-preview.exe" + exec cfg ("." ++ "neg130-preview.exe") "" + + [] + let ``type check neg130`` () = singleNegTest (testConfig' "typecheck/sigs") "neg130" [] let ``type check neg131 4_7`` () = @@ -3092,9 +3091,6 @@ module TypecheckTests = [] let ``type check neg133 preview`` () = singleVersionedNegTest (testConfig' "typecheck/sigs") "preview" "neg133" - [] - let ``type check neg130`` () = singleNegTest (testConfig' "typecheck/sigs") "neg130" - [] let ``type check neg_anon_1`` () = singleNegTest (testConfig' "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg134.4.7.bsl b/tests/fsharp/typecheck/sigs/neg134.4.7.bsl deleted file mode 100644 index 8dbddad69d4..00000000000 --- a/tests/fsharp/typecheck/sigs/neg134.4.7.bsl +++ /dev/null @@ -1,14 +0,0 @@ - -neg130.fs(15,31,15,35): typecheck error FS0043: No overloads match for method 'Method'. - -Known return type: int - -Known type parameter: < ^t > - -Available overloads: - - static member X.Method : a:int -> int // Argument 'a' doesn't match - - static member X.Method : a:int64 -> int // Argument 'a' doesn't match - -neg130.fs(17,8,17,13): typecheck error FS0039: The value or constructor 'Test2' is not defined. Maybe you want one of the following: - Test - Text diff --git a/tests/fsharp/typecheck/sigs/neg134.fs b/tests/fsharp/typecheck/sigs/neg134.fs deleted file mode 100644 index 05a2a2d4e15..00000000000 --- a/tests/fsharp/typecheck/sigs/neg134.fs +++ /dev/null @@ -1,27 +0,0 @@ -module Neg134 - -open System - -let PlaceDefaultConstructorConstraint<'T when 'T : (new : unit -> 'T)> (x : 'T) = x - -module TestVariableTypesForTuples = - - // The case for type variables (declared) where struct/reference is not known - type T3b<'T>(x : struct (int * 'T)) = - do x |> PlaceDefaultConstructorConstraint |> ignore - - // The case for type variables (inferred) where struct/reference is not known - let f3b (x : struct (int * 'T)) = - x |> PlaceDefaultConstructorConstraint |> ignore - -module TestVariableTypesForAnonRecords = - // Struct anon record are always considered to satisfy ValueType constraint - // - type T3b<'T>(x : struct {| X : int; Y : 'T |}) = - do x |> PlaceDefaultConstructorConstraint |> ignore - - // The case for type variables (inferred) where struct/reference is not known - let f3b (x : struct {| X : int; Y : 'T |}) = - x |> PlaceDefaultConstructorConstraint |> ignore - - From 9a2ab263be6686cbab98749679ff0230405bc47e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sun, 25 Oct 2020 18:51:05 +0000 Subject: [PATCH 51/82] fix test after merge --- tests/fsharp/tests.fs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index fee8a6b6615..17ac37efa41 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3049,14 +3049,6 @@ module TypecheckTests = fsc cfg "%s --target:library -o:neg129-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg129.fs"] peverify cfg "neg129-preview.dll" - // The code in this test starts to compile once FS-1043 is enabled. - [] - let ``type check neg130 preview`` () = - let cfg = testConfig' "typecheck/sigs" - fsc cfg "%s -o:neg130-preview.exe --langversion:preview --warnaserror" cfg.fsc_flags ["neg130.fs"] - peverify cfg "neg130-preview.exe" - exec cfg ("." ++ "neg130-preview.exe") "" - [] let ``type check neg130`` () = singleNegTest (testConfig' "typecheck/sigs") "neg130" From 7f7397a42c0f6bdd2e2f194c141b97fd4bcc6834 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Sun, 1 Nov 2020 06:02:00 -0800 Subject: [PATCH 52/82] Reduce number of typeEquiv checks (#10324) (#10373) Co-authored-by: Steffen Forkmann --- src/fsharp/CheckDeclarations.fs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/fsharp/CheckDeclarations.fs b/src/fsharp/CheckDeclarations.fs index 0507fac4ac1..909b8554fbc 100644 --- a/src/fsharp/CheckDeclarations.fs +++ b/src/fsharp/CheckDeclarations.fs @@ -2359,7 +2359,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env let interfacesFromTypeDefn envForTycon tyconMembersData = let (MutRecDefnsPhase2DataForTycon(_, _, declKind, tcref, _, _, declaredTyconTypars, members, _, _, _)) = tyconMembersData let overridesOK = DeclKind.CanOverrideOrImplement declKind - members |> List.collect (function + members |> List.collect (function | SynMemberDefn.Interface(ity, defnOpt, _) -> let _, ty = if tcref.Deref.IsExceptionDecl then [], g.exn_ty else generalizeTyconRef tcref let m = ity.Range @@ -2373,12 +2373,18 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env if not (tcref.HasInterface g ity') then error(Error(FSComp.SR.tcAllImplementedInterfacesShouldBeDeclared(), ity.Range)) - if (typeEquiv g ity' g.mk_IComparable_ty && Option.isSome tcref.GeneratedCompareToValues) || - (typeEquiv g ity' g.mk_IStructuralComparable_ty && Option.isSome tcref.GeneratedCompareToWithComparerValues) || - (typeEquiv g ity' ((mkAppTy g.system_GenericIComparable_tcref [ty])) && Option.isSome tcref.GeneratedCompareToValues) || - (typeEquiv g ity' ((mkAppTy g.system_GenericIEquatable_tcref [ty])) && Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues) || - (typeEquiv g ity' g.mk_IStructuralEquatable_ty && Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues) then + + let generatedCompareToValues = tcref.GeneratedCompareToValues.IsSome + let generatedHashAndEqualsWithComparerValues = tcref.GeneratedHashAndEqualsWithComparerValues.IsSome + let generatedCompareToWithComparerValues = tcref.GeneratedCompareToWithComparerValues.IsSome + + if (generatedCompareToValues && typeEquiv g ity' g.mk_IComparable_ty) || + (generatedCompareToWithComparerValues && typeEquiv g ity' g.mk_IStructuralComparable_ty) || + (generatedCompareToValues && typeEquiv g ity' ((mkAppTy g.system_GenericIComparable_tcref [ty]))) || + (generatedHashAndEqualsWithComparerValues && typeEquiv g ity' ((mkAppTy g.system_GenericIEquatable_tcref [ty]))) || + (generatedHashAndEqualsWithComparerValues && typeEquiv g ity' g.mk_IStructuralEquatable_ty) then errorR(Error(FSComp.SR.tcDefaultImplementationForInterfaceHasAlreadyBeenAdded(), ity.Range)) + if overridesOK = WarnOnOverrides then warning(IntfImplInIntrinsicAugmentation(ity.Range)) if overridesOK = ErrorOnOverrides then From c07e803356dea06dfb40c703955da7e62e76e1b9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 8 Dec 2020 13:11:07 +0000 Subject: [PATCH 53/82] fix merge --- src/fsharp/symbols/Symbols.fs | 3 ++- src/fsharp/xlf/FSComp.txt.ja.xlf | 20 -------------------- src/fsharp/xlf/FSComp.txt.ru.xlf | 5 ++--- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index ad50deac9e8..9b4855c9b45 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -57,7 +57,8 @@ type FSharpAccessibility(a:Accessibility, ?isProtected) = type SymbolEnv(g: TcGlobals, thisCcu: CcuThunk, thisCcuTyp: ModuleOrNamespaceType option, tcImports: TcImports, amap: Import.ImportMap, infoReader: InfoReader) = - let tcVal = CheckExpressions.LightweightTcValForUsingInBuildMethodCall g + // TODO: the use of traitCtxtNone is suspect. + let tcVal = CheckExpressions.LightweightTcValForUsingInBuildMethodCall g traitCtxtNone new(g: TcGlobals, thisCcu: CcuThunk, thisCcuTyp: ModuleOrNamespaceType option, tcImports: TcImports) = let amap = tcImports.GetImportMap() diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index fa12d93e1ea..f01d038bf22 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -102,11 +102,6 @@ extension constraint solutions - - fixed-index slice 3d/4d - fixed-index slice 3d/4d - - The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [<Sealed>] attribute to the implementation. The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [<Sealed>] attribute to the implementation. @@ -1947,21 +1942,11 @@ 演算子 '{0}' をサポートする型が必要ですが、タプル型が指定されました - - None of the types '{0}' support the operator '{1}' - 型 '{0}' はいずれも演算子 '{1}' をサポートしていません - - The type '{0}' does not support the operator '{1}' 型 '{0}' は演算子 '{1}' をサポートしていません - - None of the types '{0}' support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - 型 '{0}' はいずれも演算子 '{1}' をサポートしていません。'Microsoft.FSharp.Linq.NullableOperators' モジュールを開いてください。 - - The type '{0}' does not support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. 型 '{0}' は演算子 '{1}' をサポートしていません。'Microsoft.FSharp.Linq.NullableOperators' モジュールを開いてください。 @@ -2007,11 +1992,6 @@ 型 '{0}' は 'comparison' 制約をサポートしません。たとえば、'System.IComparable' インターフェイスをサポートしません。 - - from-end slicing - from-end slicing - - The type '{0}' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison 型 '{0}' は、'comparison' 制約をサポートしない 1 個または複数の構造体の要素型を持つレコード、共用体、または構造体なので、'comparison' 制約をサポートしません。この型では comparison を使用しないようにするか、または、comparison をサポートしないフィールド型を決定するために、'StructuralComparison' 属性を型に追加してください。 diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 8a274f920a3..6ee1a47f131 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -92,15 +92,14 @@ литерал float32 без точки -<<<<<<< HEAD extension constraint solutions extension constraint solutions -======= + + more types support units of measure more types support units of measure ->>>>>>> 512b1de3705a344df610dd9013532111724287e5 From f43d2fd55745bfa70e1138b0202fc8bec724c3bd Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 8 Dec 2020 14:10:45 +0000 Subject: [PATCH 54/82] fix test --- src/fsharp/ConstraintSolver.fs | 2 +- .../SurfaceArea.net40.fs | 2929 ----------------- 2 files changed, 1 insertion(+), 2930 deletions(-) delete mode 100644 tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 152e8d58c2f..9d4cc306561 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -416,7 +416,7 @@ let GetMeasureOfType g ty = let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty /// Checks the argument type for a built-in solution to an op_Addition, op_Subtraction or op_Modulus constraint. -let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) +let IsAddSubModType nm g ty = IsNonDecimalNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) /// Checks the argument type for a built-in solution to a bitwise operator constraint let IsBitwiseOpType g ty = IsIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs deleted file mode 100644 index dc0e47ac228..00000000000 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ /dev/null @@ -1,2929 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Core.UnitTests.SurfaceArea - -open NUnit.Framework -open FSharp.Core.UnitTests.LibraryTestFx - -type SurfaceAreaTest() = - [] - member this.VerifyArea() = - let expected = @" -Microsoft.FSharp.Collections.Array2DModule: Int32 Base1[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: Int32 Base2[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: Int32 Length1[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: Int32 Length2[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: T Get[T](T[,], Int32, Int32) -Microsoft.FSharp.Collections.Array2DModule: TResult[,] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]]], T[,]) -Microsoft.FSharp.Collections.Array2DModule: TResult[,] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[,]) -Microsoft.FSharp.Collections.Array2DModule: T[,] Copy[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: T[,] CreateBased[T](Int32, Int32, Int32, Int32, T) -Microsoft.FSharp.Collections.Array2DModule: T[,] Create[T](Int32, Int32, T) -Microsoft.FSharp.Collections.Array2DModule: T[,] InitializeBased[T](Int32, Int32, Int32, Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]]) -Microsoft.FSharp.Collections.Array2DModule: T[,] Initialize[T](Int32, Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]]) -Microsoft.FSharp.Collections.Array2DModule: T[,] Rebase[T](T[,]) -Microsoft.FSharp.Collections.Array2DModule: T[,] ZeroCreateBased[T](Int32, Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array2DModule: T[,] ZeroCreate[T](Int32, Int32) -Microsoft.FSharp.Collections.Array2DModule: Void CopyTo[T](T[,], Int32, Int32, T[,], Int32, Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array2DModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]]], T[,]) -Microsoft.FSharp.Collections.Array2DModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], T[,]) -Microsoft.FSharp.Collections.Array2DModule: Void Set[T](T[,], Int32, Int32, T) -Microsoft.FSharp.Collections.Array3DModule: Int32 Length1[T](T[,,]) -Microsoft.FSharp.Collections.Array3DModule: Int32 Length2[T](T[,,]) -Microsoft.FSharp.Collections.Array3DModule: Int32 Length3[T](T[,,]) -Microsoft.FSharp.Collections.Array3DModule: T Get[T](T[,,], Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array3DModule: TResult[,,] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]]]], T[,,]) -Microsoft.FSharp.Collections.Array3DModule: TResult[,,] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[,,]) -Microsoft.FSharp.Collections.Array3DModule: T[,,] Create[T](Int32, Int32, Int32, T) -Microsoft.FSharp.Collections.Array3DModule: T[,,] Initialize[T](Int32, Int32, Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]]]) -Microsoft.FSharp.Collections.Array3DModule: T[,,] ZeroCreate[T](Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array3DModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]]]], T[,,]) -Microsoft.FSharp.Collections.Array3DModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], T[,,]) -Microsoft.FSharp.Collections.Array3DModule: Void Set[T](T[,,], Int32, Int32, Int32, T) -Microsoft.FSharp.Collections.Array4DModule: Int32 Length1[T](T[,,,]) -Microsoft.FSharp.Collections.Array4DModule: Int32 Length2[T](T[,,,]) -Microsoft.FSharp.Collections.Array4DModule: Int32 Length3[T](T[,,,]) -Microsoft.FSharp.Collections.Array4DModule: Int32 Length4[T](T[,,,]) -Microsoft.FSharp.Collections.Array4DModule: T Get[T](T[,,,], Int32, Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array4DModule: T[,,,] Create[T](Int32, Int32, Int32, Int32, T) -Microsoft.FSharp.Collections.Array4DModule: T[,,,] Initialize[T](Int32, Int32, Int32, Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]]]]) -Microsoft.FSharp.Collections.Array4DModule: T[,,,] ZeroCreate[T](Int32, Int32, Int32, Int32) -Microsoft.FSharp.Collections.Array4DModule: Void Set[T](T[,,,], Int32, Int32, Int32, Int32, T) -Microsoft.FSharp.Collections.ArrayModule+Parallel: System.Tuple`2[T[],T[]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Collect[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult[]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: T[] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], T[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean Contains[T](T, T[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean ForAll2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Boolean IsEmpty[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: Int32 CompareWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], T[], T[]) -Microsoft.FSharp.Collections.ArrayModule: Int32 FindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Int32 FindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Int32 Length[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Collections.ArrayModule+Parallel -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Collections.Generic.IEnumerable`1[T] ToSeq[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[System.Int32,T][] Indexed[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T,T][] Pairwise[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1,T2][] AllPairs[T1,T2](T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1,T2][] Zip[T1,T2](T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1[],T2[]] Unzip[T1,T2](System.Tuple`2[T1,T2][]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TKey,System.Int32][] CountBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TKey,T[]][] GroupBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TResult[],TState] MapFoldBack[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,System.Tuple`2[TResult,TState]]], T[], TState) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TResult[],TState] MapFold[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Tuple`2[TResult,TState]]], TState, T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T[],T[]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T[],T[]] SplitAt[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`3[T1,T2,T3][] Zip3[T1,T2,T3](T1[], T2[], T3[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`3[T1[],T2[],T3[]] Unzip3[T1,T2,T3](System.Tuple`3[T1,T2,T3][]) -Microsoft.FSharp.Collections.ArrayModule: T Average[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T ExactlyOne[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Get[T](T[], Int32) -Microsoft.FSharp.Collections.ArrayModule: T Head[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T Item[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T Last[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T MaxBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Max[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T MinBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Min[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T ReduceBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Reduce[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Sum[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult AverageBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult Pick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult SumBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] Collect[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult[]], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], T1[], T2[], T3[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] MapIndexed2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult[] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: TState Fold2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TState]]], TState, T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: TState FoldBack2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], T1[], T2[], TState) -Microsoft.FSharp.Collections.ArrayModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], T[], TState) -Microsoft.FSharp.Collections.ArrayModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, T[]) -Microsoft.FSharp.Collections.ArrayModule: TState[] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], T[], TState) -Microsoft.FSharp.Collections.ArrayModule: TState[] Scan[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Append[T](T[], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Concat[T](System.Collections.Generic.IEnumerable`1[T[]]) -Microsoft.FSharp.Collections.ArrayModule: T[] Copy[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Create[T](Int32, T) -Microsoft.FSharp.Collections.ArrayModule: T[] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Distinct[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Empty[T]() -Microsoft.FSharp.Collections.ArrayModule: T[] Except[T](System.Collections.Generic.IEnumerable`1[T], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] GetSubArray[T](T[], Int32, Int32) -Microsoft.FSharp.Collections.ArrayModule: T[] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.ArrayModule: T[] OfList[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ArrayModule: T[] OfSeq[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.ArrayModule: T[] Permute[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Replicate[T](Int32, T) -Microsoft.FSharp.Collections.ArrayModule: T[] Reverse[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Singleton[T](T) -Microsoft.FSharp.Collections.ArrayModule: T[] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Skip[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] SortDescending[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Sort[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Tail[T](T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Take[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Truncate[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] Unfold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState) -Microsoft.FSharp.Collections.ArrayModule: T[] Where[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule: T[] ZeroCreate[T](Int32) -Microsoft.FSharp.Collections.ArrayModule: T[][] ChunkBySize[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[][] SplitInto[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: T[][] Transpose[T](System.Collections.Generic.IEnumerable`1[T[]]) -Microsoft.FSharp.Collections.ArrayModule: T[][] Windowed[T](Int32, T[]) -Microsoft.FSharp.Collections.ArrayModule: Void CopyTo[T](T[], Int32, T[], Int32, Int32) -Microsoft.FSharp.Collections.ArrayModule: Void Fill[T](T[], Int32, Int32, T) -Microsoft.FSharp.Collections.ArrayModule: Void Iterate2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: Void IterateIndexed2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]]], T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], T[]) -Microsoft.FSharp.Collections.ArrayModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], T[]) -Microsoft.FSharp.Collections.ArrayModule: Void Set[T](T[], Int32, T) -Microsoft.FSharp.Collections.ArrayModule: Void SortInPlaceBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) -Microsoft.FSharp.Collections.ArrayModule: Void SortInPlaceWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], T[]) -Microsoft.FSharp.Collections.ArrayModule: Void SortInPlace[T](T[]) -Microsoft.FSharp.Collections.ComparisonIdentity: System.Collections.Generic.IComparer`1[T] FromFunction[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]]) -Microsoft.FSharp.Collections.ComparisonIdentity: System.Collections.Generic.IComparer`1[T] NonStructural[T]() -Microsoft.FSharp.Collections.ComparisonIdentity: System.Collections.Generic.IComparer`1[T] Structural[T]() -Microsoft.FSharp.Collections.FSharpList`1+Tags[T]: Int32 Cons -Microsoft.FSharp.Collections.FSharpList`1+Tags[T]: Int32 Empty -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean Equals(Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean IsCons -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean IsEmpty -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean get_IsCons() -Microsoft.FSharp.Collections.FSharpList`1[T]: Boolean get_IsEmpty() -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 CompareTo(Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 GetReverseIndex(Int32, Int32) -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 Length -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 Tag -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 get_Length() -Microsoft.FSharp.Collections.FSharpList`1[T]: Int32 get_Tag() -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1+Tags[T] -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] Cons(T, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] Empty -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] GetSlice(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] Tail -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] TailOrNull -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] get_Empty() -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] get_Tail() -Microsoft.FSharp.Collections.FSharpList`1[T]: Microsoft.FSharp.Collections.FSharpList`1[T] get_TailOrNull() -Microsoft.FSharp.Collections.FSharpList`1[T]: System.String ToString() -Microsoft.FSharp.Collections.FSharpList`1[T]: T Head -Microsoft.FSharp.Collections.FSharpList`1[T]: T HeadOrDefault -Microsoft.FSharp.Collections.FSharpList`1[T]: T Item [Int32] -Microsoft.FSharp.Collections.FSharpList`1[T]: T get_Head() -Microsoft.FSharp.Collections.FSharpList`1[T]: T get_HeadOrDefault() -Microsoft.FSharp.Collections.FSharpList`1[T]: T get_Item(Int32) -Microsoft.FSharp.Collections.FSharpList`1[T]: Void .ctor(T, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean ContainsKey(TKey) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean Equals(System.Object) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean IsEmpty -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean TryGetValue(TKey, TValue ByRef) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean get_IsEmpty() -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 Count -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 GetHashCode() -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 get_Count() -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue] Add(TKey, TValue) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue] Remove(TKey) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Core.FSharpOption`1[TValue] TryFind(TKey) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: System.String ToString() -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: TValue Item [TKey] -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: TValue get_Item(TKey) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Void .ctor(System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,TValue]]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean Contains(T) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean IsEmpty -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean IsProperSubsetOf(Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean IsProperSupersetOf(Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean IsSubsetOf(Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean IsSupersetOf(Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Boolean get_IsEmpty() -Microsoft.FSharp.Collections.FSharpSet`1[T]: Int32 Count -Microsoft.FSharp.Collections.FSharpSet`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Collections.FSharpSet`1[T]: Int32 get_Count() -Microsoft.FSharp.Collections.FSharpSet`1[T]: Microsoft.FSharp.Collections.FSharpSet`1[T] Add(T) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Microsoft.FSharp.Collections.FSharpSet`1[T] Remove(T) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Microsoft.FSharp.Collections.FSharpSet`1[T] op_Addition(Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: Microsoft.FSharp.Collections.FSharpSet`1[T] op_Subtraction(Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.FSharpSet`1[T]: System.String ToString() -Microsoft.FSharp.Collections.FSharpSet`1[T]: T MaximumElement -Microsoft.FSharp.Collections.FSharpSet`1[T]: T MinimumElement -Microsoft.FSharp.Collections.FSharpSet`1[T]: T get_MaximumElement() -Microsoft.FSharp.Collections.FSharpSet`1[T]: T get_MinimumElement() -Microsoft.FSharp.Collections.FSharpSet`1[T]: Void .ctor(System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] FromFunctions[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]]) -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] LimitedStructural[T](Int32) -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] NonStructural[T]() -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] Reference[T]() -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] Structural[T]() -Microsoft.FSharp.Collections.ListModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Boolean ForAll2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Boolean IsEmpty[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Int32 CompareWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.FSharpList`1[T], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Int32 FindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Int32 FindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Int32 Length[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] ChunkBySize[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] SplitInto[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Transpose[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Windowed[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Int32,T]] Indexed[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T,T]] Pairwise[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T1,T2]] Zip[T1,T2](Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[TKey,Microsoft.FSharp.Collections.FSharpList`1[T]]] GroupBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[TKey,System.Int32]] CountBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[T1,T2,T3]] Zip3[T1,T2,T3](Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2], Microsoft.FSharp.Collections.FSharpList`1[T3]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Collect[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Collections.FSharpList`1[TResult]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2], Microsoft.FSharp.Collections.FSharpList`1[T3]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] MapIndexed2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.FSharpList`1[T], TState) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[TState] Scan[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Append[T](Microsoft.FSharp.Collections.FSharpList`1[T], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Concat[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Distinct[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Empty[T]() -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Except[T](System.Collections.Generic.IEnumerable`1[T], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] OfArray[T](T[]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] OfSeq[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Permute[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Replicate[T](Int32, T) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Reverse[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Singleton[T](T) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Skip[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortDescending[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Sort[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Tail[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Take[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Truncate[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Unfold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[T] Where[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: System.Collections.Generic.IEnumerable`1[T] ToSeq[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[T1],Microsoft.FSharp.Collections.FSharpList`1[T2]] Unzip[T1,T2](Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T1,T2]]) -Microsoft.FSharp.Collections.ListModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[TResult],TState] MapFoldBack[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,System.Tuple`2[TResult,TState]]], Microsoft.FSharp.Collections.FSharpList`1[T], TState) -Microsoft.FSharp.Collections.ListModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[TResult],TState] MapFold[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Tuple`2[TResult,TState]]], TState, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[T],Microsoft.FSharp.Collections.FSharpList`1[T]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[T],Microsoft.FSharp.Collections.FSharpList`1[T]] SplitAt[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: System.Tuple`3[Microsoft.FSharp.Collections.FSharpList`1[T1],Microsoft.FSharp.Collections.FSharpList`1[T2],Microsoft.FSharp.Collections.FSharpList`1[T3]] Unzip3[T1,T2,T3](Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[T1,T2,T3]]) -Microsoft.FSharp.Collections.ListModule: T Average[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T ExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Get[T](Microsoft.FSharp.Collections.FSharpList`1[T], Int32) -Microsoft.FSharp.Collections.ListModule: T Head[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Item[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Last[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T MaxBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Max[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T MinBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Min[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T ReduceBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Reduce[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Sum[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TResult AverageBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TResult Pick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TResult SumBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TState Fold2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TState]]], TState, Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: TState FoldBack2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2], TState) -Microsoft.FSharp.Collections.ListModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.FSharpList`1[T], TState) -Microsoft.FSharp.Collections.ListModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T[] ToArray[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Void Iterate2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Void IterateIndexed2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]]], Microsoft.FSharp.Collections.FSharpList`1[T1], Microsoft.FSharp.Collections.FSharpList`1[T2]) -Microsoft.FSharp.Collections.ListModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.MapModule: Boolean ContainsKey[TKey,T](TKey, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Boolean Exists[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Boolean ForAll[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Boolean IsEmpty[TKey,T](Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Int32 Count[TKey,T](Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[TKey,T]] ToList[TKey,T](Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,TResult] Map[TKey,T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] Add[TKey,T](TKey, T, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] Empty[TKey,T]() -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] Filter[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] OfArray[TKey,T](System.Tuple`2[TKey,T][]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] OfList[TKey,T](Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[TKey,T]]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] OfSeq[TKey,T](System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,T]]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Collections.FSharpMap`2[TKey,T] Remove[TKey,T](TKey, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Core.FSharpOption`1[TKey] TryFindKey[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[TKey,T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[TKey,T](TKey, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,T]] ToSeq[TKey,T](Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpMap`2[TKey,T],Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]] Partition[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: System.Tuple`2[TKey,T][] ToArray[TKey,T](Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: T Find[TKey,T](TKey, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: TKey FindKey[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: TResult Pick[TKey,T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: TState FoldBack[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T], TState) -Microsoft.FSharp.Collections.MapModule: TState Fold[TKey,T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]]], TState, Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.MapModule: Void Iterate[TKey,T](Microsoft.FSharp.Core.FSharpFunc`2[TKey,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Collections.FSharpMap`2[TKey,T]) -Microsoft.FSharp.Collections.SeqModule: Boolean Contains[T](T, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Boolean Exists2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Boolean ForAll2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,System.Boolean]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Boolean IsEmpty[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Int32 CompareWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], System.Collections.Generic.IEnumerable`1[T], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Int32 FindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Int32 FindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Int32 Length[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndexBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] TryFindIndex[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] TryPick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryFind[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[T]] Transpose[TCollection,T](System.Collections.Generic.IEnumerable`1[TCollection]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[System.Int32,T]] Indexed[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T,T]] Pairwise[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T1,T2]] Zip[T1,T2](System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,System.Collections.Generic.IEnumerable`1[T]]] GroupBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,System.Int32]] CountBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`3[T1,T2,T3]] Zip3[T1,T2,T3](System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2], System.Collections.Generic.IEnumerable`1[T3]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] Collect[T,TCollection,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TCollection], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2], System.Collections.Generic.IEnumerable`1[T3]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] MapIndexed2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TState] ScanBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], System.Collections.Generic.IEnumerable`1[T], TState) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[TState] Scan[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T[]] ChunkBySize[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T[]] SplitInto[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T[]] Windowed[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Append[T](System.Collections.Generic.IEnumerable`1[T], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Cache[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Cast[T](System.Collections.IEnumerable) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Concat[TCollection,T](System.Collections.Generic.IEnumerable`1[TCollection]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Delay[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,System.Collections.Generic.IEnumerable`1[T]]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] DistinctBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Distinct[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Empty[T]() -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Except[T](System.Collections.Generic.IEnumerable`1[T], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] InitializeInfinite[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] OfArray[T](T[]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] OfList[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Permute[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] ReadOnly[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Replicate[T](Int32, T) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Reverse[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Singleton[T](T) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SkipWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Skip[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortByDescending[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortDescending[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] SortWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Sort[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Tail[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] TakeWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Take[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Truncate[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Unfold[TState,T](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[T,TState]]], TState) -Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[T] Where[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: System.Tuple`2[System.Collections.Generic.IEnumerable`1[TResult],TState] MapFoldBack[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,System.Tuple`2[TResult,TState]]], System.Collections.Generic.IEnumerable`1[T], TState) -Microsoft.FSharp.Collections.SeqModule: System.Tuple`2[System.Collections.Generic.IEnumerable`1[TResult],TState] MapFold[T,TState,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Tuple`2[TResult,TState]]], TState, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Average[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T ExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Get[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Head[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Item[T](Int32, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Last[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T MaxBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Max[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T MinBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Min[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T ReduceBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Reduce[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Sum[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TResult AverageBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TResult Pick[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TResult SumBy[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TState Fold2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TState]]], TState, System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: TState FoldBack2[T1,T2,TState](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2], TState) -Microsoft.FSharp.Collections.SeqModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], System.Collections.Generic.IEnumerable`1[T], TState) -Microsoft.FSharp.Collections.SeqModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T[] ToArray[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Void Iterate2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: Void IterateIndexed2[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]]], System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) -Microsoft.FSharp.Collections.SeqModule: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean Contains[T](T, Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean IsEmpty[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean IsProperSubset[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean IsProperSuperset[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean IsSubset[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Boolean IsSuperset[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Int32 Count[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Add[T](T, Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Difference[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Empty[T]() -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] IntersectMany[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpSet`1[T]]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Intersect[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] OfArray[T](T[]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] OfList[T](Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] OfSeq[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Remove[T](T, Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Singleton[T](T) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] UnionMany[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpSet`1[T]]) -Microsoft.FSharp.Collections.SetModule: Microsoft.FSharp.Collections.FSharpSet`1[T] Union[T](Microsoft.FSharp.Collections.FSharpSet`1[T], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: System.Collections.Generic.IEnumerable`1[T] ToSeq[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: System.Tuple`2[Microsoft.FSharp.Collections.FSharpSet`1[T],Microsoft.FSharp.Collections.FSharpSet`1[T]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: T MaxElement[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: T MinElement[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Collections.FSharpSet`1[T], TState) -Microsoft.FSharp.Collections.SetModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: T[] ToArray[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Collections.SetModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.FSharpSet`1[T]) -Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean IsCancellationRequested -Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean get_IsCancellationRequested() -Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnCancellation() -Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnSuccess(T) -Microsoft.FSharp.Control.AsyncActivation`1[T]: Void OnExceptionRaised() -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Bind[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn CallThenInvoke[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], TResult, Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Invoke[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Control.AsyncActivation`1[T]) -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryFinally[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryWith[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]]) -Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.FSharpAsync`1[T] MakeAsync[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.AsyncActivation`1[T],Microsoft.FSharp.Control.AsyncReturn]) -Microsoft.FSharp.Control.CommonExtensions: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] AsyncWrite(System.IO.Stream, Byte[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.CommonExtensions: Microsoft.FSharp.Control.FSharpAsync`1[System.Byte[]] AsyncReadBytes(System.IO.Stream, Int32) -Microsoft.FSharp.Control.CommonExtensions: Microsoft.FSharp.Control.FSharpAsync`1[System.Int32] AsyncRead(System.IO.Stream, Byte[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.CommonExtensions: System.IDisposable SubscribeToObservable[T](System.IObservable`1[T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.CommonExtensions: Void AddToObservable[T](System.IObservable`1[T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[T,T]],System.Tuple`2[T,T]] Pairwise[TDel,T](Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[TResult],TResult] Choose[T,TResult,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[TResult],TResult] Map[T,TResult,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[TResult],TResult] Scan[TResult,T,TDel](Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], TResult, Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T] Filter[T,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T] Merge[TDel1,T,TDel2](Microsoft.FSharp.Control.IEvent`2[TDel1,T], Microsoft.FSharp.Control.IEvent`2[TDel2,T]) -Microsoft.FSharp.Control.EventModule: System.Tuple`2[Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[TResult1],TResult1],Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[TResult2],TResult2]] Split[T,TResult1,TResult2,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpChoice`2[TResult1,TResult2]], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: System.Tuple`2[Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T],Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T]] Partition[T,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.EventModule: Void Add[T,TDel](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Control.IEvent`2[TDel,T]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Control.FSharpAsync`1[T]] StartChild[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpChoice`2[T,System.Exception]] Catch[T](Microsoft.FSharp.Control.FSharpAsync`1[T]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpOption`1[T]] Choice[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpOption`1[T]]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] AwaitTask(System.Threading.Tasks.Task) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] Ignore[T](Microsoft.FSharp.Control.FSharpAsync`1[T]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] Sleep(Int32) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] Sleep(System.TimeSpan) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] SwitchToContext(System.Threading.SynchronizationContext) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] SwitchToNewThread() -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] SwitchToThreadPool() -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.Boolean] AwaitIAsyncResult(System.IAsyncResult, Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.Boolean] AwaitWaitHandle(System.Threading.WaitHandle, Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.IDisposable] OnCancel(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.Threading.CancellationToken] CancellationToken -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.Threading.CancellationToken] get_CancellationToken() -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[System.Threading.Tasks.Task`1[T]] StartChildAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.Tasks.TaskCreationOptions]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T[]] Parallel[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T[]] Parallel[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Control.FSharpAsync`1[T]], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T[]] Sequential[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] AwaitEvent[TDel,T](Microsoft.FSharp.Control.IEvent`2[TDel,T], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] AwaitTask[T](System.Threading.Tasks.Task`1[T]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] FromBeginEnd[TArg1,TArg2,TArg3,T](TArg1, TArg2, TArg3, Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`5[TArg1,TArg2,TArg3,System.AsyncCallback,System.Object],System.IAsyncResult], Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] FromBeginEnd[TArg1,TArg2,T](TArg1, TArg2, Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`4[TArg1,TArg2,System.AsyncCallback,System.Object],System.IAsyncResult], Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] FromBeginEnd[TArg1,T](TArg1, Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[TArg1,System.AsyncCallback,System.Object],System.IAsyncResult], Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] FromBeginEnd[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.AsyncCallback,System.Object],System.IAsyncResult], Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] FromContinuations[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit],Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Core.Unit],Microsoft.FSharp.Core.FSharpFunc`2[System.OperationCanceledException,Microsoft.FSharp.Core.Unit]],Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.FSharpAsync: Microsoft.FSharp.Control.FSharpAsync`1[T] TryCancelled[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[System.OperationCanceledException,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken DefaultCancellationToken -Microsoft.FSharp.Control.FSharpAsync: System.Threading.CancellationToken get_DefaultCancellationToken() -Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.Tasks.TaskCreationOptions], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsync: System.Threading.Tasks.Task`1[T] StartImmediateAsTask[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsync: System.Tuple`3[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[TArg,System.AsyncCallback,System.Object],System.IAsyncResult],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,T],Microsoft.FSharp.Core.FSharpFunc`2[System.IAsyncResult,Microsoft.FSharp.Core.Unit]] AsBeginEnd[TArg,T](Microsoft.FSharp.Core.FSharpFunc`2[TArg,Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.FSharpAsync: T RunSynchronously[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsync: Void CancelDefaultToken() -Microsoft.FSharp.Control.FSharpAsync: Void Start(Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsync: Void StartImmediate(Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsync: Void StartWithContinuations[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpFunc`2[System.OperationCanceledException,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] For[T](System.Collections.Generic.IEnumerable`1[T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit]]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] While(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,System.Boolean], Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] Zero() -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[TResult] Bind[T,TResult](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Control.FSharpAsync`1[TResult]]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[TResult] Using[T,TResult](T, Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Control.FSharpAsync`1[TResult]]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] Combine[T](Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Control.FSharpAsync`1[T]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] Delay[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] ReturnFrom[T](Microsoft.FSharp.Control.FSharpAsync`1[T]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] Return[T](T) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] TryFinally[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Control.FSharpAsyncBuilder: Microsoft.FSharp.Control.FSharpAsync`1[T] TryWith[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Control.FSharpAsync`1[T]]) -Microsoft.FSharp.Control.FSharpAsyncReplyChannel`1[TReply]: Void Reply(TReply) -Microsoft.FSharp.Control.FSharpDelegateEvent`1[TDelegate]: Microsoft.FSharp.Control.IDelegateEvent`1[TDelegate] Publish -Microsoft.FSharp.Control.FSharpDelegateEvent`1[TDelegate]: Microsoft.FSharp.Control.IDelegateEvent`1[TDelegate] get_Publish() -Microsoft.FSharp.Control.FSharpDelegateEvent`1[TDelegate]: Void .ctor() -Microsoft.FSharp.Control.FSharpDelegateEvent`1[TDelegate]: Void Trigger(System.Object[]) -Microsoft.FSharp.Control.FSharpEvent`1[T]: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T] Publish -Microsoft.FSharp.Control.FSharpEvent`1[T]: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[T],T] get_Publish() -Microsoft.FSharp.Control.FSharpEvent`1[T]: Void .ctor() -Microsoft.FSharp.Control.FSharpEvent`1[T]: Void Trigger(T) -Microsoft.FSharp.Control.FSharpEvent`2[TDelegate,TArgs]: Microsoft.FSharp.Control.IEvent`2[TDelegate,TArgs] Publish -Microsoft.FSharp.Control.FSharpEvent`2[TDelegate,TArgs]: Microsoft.FSharp.Control.IEvent`2[TDelegate,TArgs] get_Publish() -Microsoft.FSharp.Control.FSharpEvent`2[TDelegate,TArgs]: Void .ctor() -Microsoft.FSharp.Control.FSharpEvent`2[TDelegate,TArgs]: Void Trigger(System.Object, TArgs) -Microsoft.FSharp.Control.FSharpHandler`1[T]: System.IAsyncResult BeginInvoke(System.Object, T, System.AsyncCallback, System.Object) -Microsoft.FSharp.Control.FSharpHandler`1[T]: Void .ctor(System.Object, IntPtr) -Microsoft.FSharp.Control.FSharpHandler`1[T]: Void EndInvoke(System.IAsyncResult) -Microsoft.FSharp.Control.FSharpHandler`1[T]: Void Invoke(System.Object, T) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Int32 CurrentQueueLength -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Int32 DefaultTimeout -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Int32 get_CurrentQueueLength() -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Int32 get_DefaultTimeout() -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpOption`1[TMsg]] TryReceive(Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpOption`1[TReply]] PostAndTryAsyncReply[TReply](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpAsyncReplyChannel`1[TReply],TMsg], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.FSharpOption`1[T]] TryScan[T](Microsoft.FSharp.Core.FSharpFunc`2[TMsg,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[TMsg] Receive(Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[TReply] PostAndAsyncReply[TReply](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpAsyncReplyChannel`1[TReply],TMsg], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpAsync`1[T] Scan[T](Microsoft.FSharp.Core.FSharpFunc`2[TMsg,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpHandler`1[System.Exception] Error -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg] Start(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg],Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Microsoft.FSharp.Core.FSharpOption`1[TReply] TryPostAndReply[TReply](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpAsyncReplyChannel`1[TReply],TMsg], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: TReply PostAndReply[TReply](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpAsyncReplyChannel`1[TReply],TMsg], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void .ctor(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg],Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit]], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void Post(TMsg) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void Start() -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void add_Error(Microsoft.FSharp.Control.FSharpHandler`1[System.Exception]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void remove_Error(Microsoft.FSharp.Control.FSharpHandler`1[System.Exception]) -Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Void set_DefaultTimeout(Int32) -Microsoft.FSharp.Control.IDelegateEvent`1[TDelegate]: Void AddHandler(TDelegate) -Microsoft.FSharp.Control.IDelegateEvent`1[TDelegate]: Void RemoveHandler(TDelegate) -Microsoft.FSharp.Control.LazyExtensions: System.Lazy`1[T] CreateFromValue[T](T) -Microsoft.FSharp.Control.LazyExtensions: System.Lazy`1[T] Create[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) -Microsoft.FSharp.Control.LazyExtensions: T Force[T](System.Lazy`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IDisposable Subscribe[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[System.Tuple`2[T,T]] Pairwise[T](System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[TResult] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[TResult] Scan[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], TResult, System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.IObservable`1[T] Merge[T](System.IObservable`1[T], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.Tuple`2[System.IObservable`1[TResult1],System.IObservable`1[TResult2]] Split[T,TResult1,TResult2](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpChoice`2[TResult1,TResult2]], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: System.Tuple`2[System.IObservable`1[T],System.IObservable`1[T]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.IObservable`1[T]) -Microsoft.FSharp.Control.ObservableModule: Void Add[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], System.IObservable`1[T]) -Microsoft.FSharp.Control.WebExtensions: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] AsyncDownloadFile(System.Net.WebClient, System.Uri, System.String) -Microsoft.FSharp.Control.WebExtensions: Microsoft.FSharp.Control.FSharpAsync`1[System.Byte[]] AsyncDownloadData(System.Net.WebClient, System.Uri) -Microsoft.FSharp.Control.WebExtensions: Microsoft.FSharp.Control.FSharpAsync`1[System.Net.WebResponse] AsyncGetResponse(System.Net.WebRequest) -Microsoft.FSharp.Control.WebExtensions: Microsoft.FSharp.Control.FSharpAsync`1[System.String] AsyncDownloadString(System.Net.WebClient, System.Uri) -Microsoft.FSharp.Core.AbstractClassAttribute: Void .ctor() -Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value -Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() -Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() -Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.AllowOverloadByReturnTypeAttribute: Void .ctor() -Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path -Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() -Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() -Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean Value -Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean get_Value() -Microsoft.FSharp.Core.AutoSerializableAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+In -Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+InOut -Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+Out -Microsoft.FSharp.Core.CLIEventAttribute: Void .ctor() -Microsoft.FSharp.Core.CLIMutableAttribute: Void .ctor() -Microsoft.FSharp.Core.ClassAttribute: Void .ctor() -Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Void .ctor() -Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Collections.Generic.IEnumerable`1[System.Int32] Counts -Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Collections.Generic.IEnumerable`1[System.Int32] get_Counts() -Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Void .ctor(Int32[]) -Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 SequenceNumber -Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 VariantNumber -Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 get_SequenceNumber() -Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 get_VariantNumber() -Microsoft.FSharp.Core.CompilationMappingAttribute: Microsoft.FSharp.Core.SourceConstructFlags SourceConstructFlags -Microsoft.FSharp.Core.CompilationMappingAttribute: Microsoft.FSharp.Core.SourceConstructFlags get_SourceConstructFlags() -Microsoft.FSharp.Core.CompilationMappingAttribute: System.String ResourceName -Microsoft.FSharp.Core.CompilationMappingAttribute: System.String get_ResourceName() -Microsoft.FSharp.Core.CompilationMappingAttribute: System.Type[] TypeDefinitions -Microsoft.FSharp.Core.CompilationMappingAttribute: System.Type[] get_TypeDefinitions() -Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(Microsoft.FSharp.Core.SourceConstructFlags) -Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(Microsoft.FSharp.Core.SourceConstructFlags, Int32) -Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(Microsoft.FSharp.Core.SourceConstructFlags, Int32, Int32) -Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(System.String, System.Type[]) -Microsoft.FSharp.Core.CompilationRepresentationAttribute: Microsoft.FSharp.Core.CompilationRepresentationFlags Flags -Microsoft.FSharp.Core.CompilationRepresentationAttribute: Microsoft.FSharp.Core.CompilationRepresentationFlags get_Flags() -Microsoft.FSharp.Core.CompilationRepresentationAttribute: Void .ctor(Microsoft.FSharp.Core.CompilationRepresentationFlags) -Microsoft.FSharp.Core.CompilationRepresentationFlags: Int32 value__ -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags Event -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags Instance -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags ModuleSuffix -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags None -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags Static -Microsoft.FSharp.Core.CompilationRepresentationFlags: Microsoft.FSharp.Core.CompilationRepresentationFlags UseNullAsTrueValue -Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.String SourceName -Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.String get_SourceName() -Microsoft.FSharp.Core.CompilationSourceNameAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.CompiledNameAttribute: System.String CompiledName -Microsoft.FSharp.Core.CompiledNameAttribute: System.String get_CompiledName() -Microsoft.FSharp.Core.CompiledNameAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean IsError -Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean IsHidden -Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean get_IsError() -Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean get_IsHidden() -Microsoft.FSharp.Core.CompilerMessageAttribute: Int32 MessageNumber -Microsoft.FSharp.Core.CompilerMessageAttribute: Int32 get_MessageNumber() -Microsoft.FSharp.Core.CompilerMessageAttribute: System.String Message -Microsoft.FSharp.Core.CompilerMessageAttribute: System.String get_Message() -Microsoft.FSharp.Core.CompilerMessageAttribute: Void .ctor(System.String, Int32) -Microsoft.FSharp.Core.CompilerMessageAttribute: Void set_IsError(Boolean) -Microsoft.FSharp.Core.CompilerMessageAttribute: Void set_IsHidden(Boolean) -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean CheckClose -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Boolean get_CheckClose() -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Int32 GenerateNext(System.Collections.Generic.IEnumerable`1[T] ByRef) -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: System.Collections.Generic.IEnumerator`1[T] GetFreshEnumerator() -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: T LastGenerated -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: T get_LastGenerated() -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Void .ctor() -Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1[T]: Void Close() -Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace[] GetNestedNamespaces() -Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String NamespaceName -Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.String get_NamespaceName() -Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type ResolveTypeName(System.String) -Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace: System.Type[] GetTypes() -Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.MethodBase ApplyStaticArgumentsForMethod(System.Reflection.MethodBase, System.String, System.Object[]) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider2: System.Reflection.ParameterInfo[] GetStaticParametersForMethod(System.Reflection.MethodBase) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Byte[] GetGeneratedAssemblyContents(System.Reflection.Assembly) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Core.CompilerServices.IProvidedNamespace[] GetNamespaces() -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Microsoft.FSharp.Quotations.FSharpExpr GetInvokerExpression(System.Reflection.MethodBase, Microsoft.FSharp.Quotations.FSharpExpr[]) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: System.EventHandler Invalidate -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: System.Reflection.ParameterInfo[] GetStaticParameters(System.Type) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: System.Type ApplyStaticArguments(System.Type, System.String[], System.Object[]) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Void add_Invalidate(System.EventHandler) -Microsoft.FSharp.Core.CompilerServices.ITypeProvider: Void remove_Invalidate(System.EventHandler) -Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: Microsoft.FSharp.Control.IEvent`2[TDelegate,TArgs] CreateEvent[TDelegate,TArgs](Microsoft.FSharp.Core.FSharpFunc`2[TDelegate,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpFunc`2[TDelegate,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.FSharpFunc`2[System.Object,Microsoft.FSharp.Core.FSharpFunc`2[TArgs,Microsoft.FSharp.Core.Unit]],TDelegate]) -Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Collections.Generic.IEnumerable`1[TResult] EnumerateFromFunctions[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]) -Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Collections.Generic.IEnumerable`1[TResult] EnumerateUsing[T,TCollection,TResult](T, Microsoft.FSharp.Core.FSharpFunc`2[T,TCollection]) -Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Collections.Generic.IEnumerable`1[T] EnumerateThenFinally[T](System.Collections.Generic.IEnumerable`1[T], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Collections.Generic.IEnumerable`1[T] EnumerateWhile[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.String AssemblyName -Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.String get_AssemblyName() -Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Void .ctor() -Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Void .ctor() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Boolean IsHostedExecution -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Boolean IsInvalidationSupported -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Boolean SystemRuntimeContainsType(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Boolean get_IsHostedExecution() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Boolean get_IsInvalidationSupported() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String ResolutionFolder -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String RuntimeAssembly -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String TemporaryFolder -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String get_ResolutionFolder() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String get_RuntimeAssembly() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String get_TemporaryFolder() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String[] ReferencedAssemblies -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.String[] get_ReferencedAssemblies() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.Version SystemRuntimeAssemblyVersion -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: System.Version get_SystemRuntimeAssemblyVersion() -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void .ctor(Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.Boolean]) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_IsHostedExecution(Boolean) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_IsInvalidationSupported(Boolean) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_ReferencedAssemblies(System.String[]) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_ResolutionFolder(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_RuntimeAssembly(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_SystemRuntimeAssemblyVersion(System.Version) -Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_TemporaryFolder(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 Column -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 Line -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 get_Column() -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 get_Line() -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.String FilePath -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.String get_FilePath() -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void .ctor() -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void set_Column(Int32) -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void set_FilePath(System.String) -Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void set_Line(Int32) -Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Void .ctor() -Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: Int32 value__ -Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes IsErased -Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes SuppressRelocate -Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.String CommentText -Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.String get_CommentText() -Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.CustomComparisonAttribute: Void .ctor() -Microsoft.FSharp.Core.CustomEqualityAttribute: Void .ctor() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean AllowIntoPattern -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeGroupJoin -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeJoin -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeZip -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean MaintainsVariableSpace -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean MaintainsVariableSpaceUsingBind -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_AllowIntoPattern() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_IsLikeGroupJoin() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_IsLikeJoin() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_IsLikeZip() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_MaintainsVariableSpace() -Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_MaintainsVariableSpaceUsingBind() -Microsoft.FSharp.Core.CustomOperationAttribute: System.String JoinConditionWord -Microsoft.FSharp.Core.CustomOperationAttribute: System.String Name -Microsoft.FSharp.Core.CustomOperationAttribute: System.String get_JoinConditionWord() -Microsoft.FSharp.Core.CustomOperationAttribute: System.String get_Name() -Microsoft.FSharp.Core.CustomOperationAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_AllowIntoPattern(Boolean) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_IsLikeGroupJoin(Boolean) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_IsLikeJoin(Boolean) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_IsLikeZip(Boolean) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_JoinConditionWord(System.String) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_MaintainsVariableSpace(Boolean) -Microsoft.FSharp.Core.CustomOperationAttribute: Void set_MaintainsVariableSpaceUsingBind(Boolean) -Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean Value -Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean get_Value() -Microsoft.FSharp.Core.DefaultAugmentationAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.DefaultValueAttribute: Boolean Check -Microsoft.FSharp.Core.DefaultValueAttribute: Boolean get_Check() -Microsoft.FSharp.Core.DefaultValueAttribute: Void .ctor() -Microsoft.FSharp.Core.DefaultValueAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.EntryPointAttribute: Void .ctor() -Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Void .ctor() -Microsoft.FSharp.Core.ExperimentalAttribute: System.String Message -Microsoft.FSharp.Core.ExperimentalAttribute: System.String get_Message() -Microsoft.FSharp.Core.ExperimentalAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked: Byte ToByte[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked: SByte ToSByte[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Byte ToByte[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Double ToDouble[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Collections.FSharpSet`1[T] CreateSet[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Control.FSharpAsyncBuilder DefaultAsyncBuilder -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Control.FSharpAsyncBuilder get_DefaultAsyncBuilder() -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Linq.QueryBuilder get_query() -Microsoft.FSharp.Core.ExtraTopLevelOperators: Microsoft.FSharp.Linq.QueryBuilder query -Microsoft.FSharp.Core.ExtraTopLevelOperators: SByte ToSByte[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Single ToSingle[T](T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: System.Collections.Generic.IDictionary`2[TKey,TValue] CreateDictionary[TKey,TValue](System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,TValue]]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: System.Collections.Generic.IReadOnlyDictionary`2[TKey,TValue] CreateReadOnlyDictionary[TKey,TValue](System.Collections.Generic.IEnumerable`1[System.Tuple`2[TKey,TValue]]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T LazyPattern[T](System.Lazy`1[T]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLineToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLineToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToStringThenFail[T,TResult](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToString[T](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,System.String]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T SpliceExpression[T](Microsoft.FSharp.Quotations.FSharpExpr`1[T]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T SpliceUntypedExpression[T](Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T[,] CreateArray2D[?,T](System.Collections.Generic.IEnumerable`1[?]) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean IsChoice1Of2 -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean IsChoice2Of2 -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean get_IsChoice1Of2() -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Boolean get_IsChoice2Of2() -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean IsChoice1Of2 -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean IsChoice2Of2 -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean get_IsChoice1Of2() -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Boolean get_IsChoice2Of2() -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`2+Tags[T1,T2]: Int32 Choice1Of2 -Microsoft.FSharp.Core.FSharpChoice`2+Tags[T1,T2]: Int32 Choice2Of2 -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean IsChoice1Of2 -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean IsChoice2Of2 -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean get_IsChoice1Of2() -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Boolean get_IsChoice2Of2() -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Microsoft.FSharp.Core.FSharpChoice`2+Choice1Of2[T1,T2] -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Microsoft.FSharp.Core.FSharpChoice`2+Choice2Of2[T1,T2] -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Microsoft.FSharp.Core.FSharpChoice`2+Tags[T1,T2] -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Microsoft.FSharp.Core.FSharpChoice`2[T1,T2] NewChoice1Of2(T1) -Microsoft.FSharp.Core.FSharpChoice`2[T1,T2]: Microsoft.FSharp.Core.FSharpChoice`2[T1,T2] NewChoice2Of2(T2) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean IsChoice1Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean IsChoice2Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean IsChoice3Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean get_IsChoice1Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean get_IsChoice2Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Boolean get_IsChoice3Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean IsChoice1Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean IsChoice2Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean IsChoice3Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean get_IsChoice1Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean get_IsChoice2Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Boolean get_IsChoice3Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean IsChoice1Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean IsChoice2Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean IsChoice3Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean get_IsChoice1Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean get_IsChoice2Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Boolean get_IsChoice3Of3() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: T3 Item -Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3]: T3 get_Item() -Microsoft.FSharp.Core.FSharpChoice`3+Tags[T1,T2,T3]: Int32 Choice1Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Tags[T1,T2,T3]: Int32 Choice2Of3 -Microsoft.FSharp.Core.FSharpChoice`3+Tags[T1,T2,T3]: Int32 Choice3Of3 -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice1Of3 -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice2Of3 -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean IsChoice3Of3 -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice1Of3() -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice2Of3() -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Boolean get_IsChoice3Of3() -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3+Choice1Of3[T1,T2,T3] -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3+Choice2Of3[T1,T2,T3] -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3+Choice3Of3[T1,T2,T3] -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3+Tags[T1,T2,T3] -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3] NewChoice1Of3(T1) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3] NewChoice2Of3(T2) -Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3]: Microsoft.FSharp.Core.FSharpChoice`3[T1,T2,T3] NewChoice3Of3(T3) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean IsChoice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean IsChoice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean IsChoice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean IsChoice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean IsChoice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean IsChoice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean IsChoice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean IsChoice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean IsChoice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean IsChoice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean IsChoice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean IsChoice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: T3 Item -Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4]: T3 get_Item() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean IsChoice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean IsChoice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean IsChoice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean IsChoice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: T4 Item -Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4]: T4 get_Item() -Microsoft.FSharp.Core.FSharpChoice`4+Tags[T1,T2,T3,T4]: Int32 Choice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Tags[T1,T2,T3,T4]: Int32 Choice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Tags[T1,T2,T3,T4]: Int32 Choice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4+Tags[T1,T2,T3,T4]: Int32 Choice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice1Of4 -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice2Of4 -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice3Of4 -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean IsChoice4Of4 -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice1Of4() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice2Of4() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice3Of4() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Boolean get_IsChoice4Of4() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4+Choice1Of4[T1,T2,T3,T4] -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4+Choice2Of4[T1,T2,T3,T4] -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4+Choice3Of4[T1,T2,T3,T4] -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4+Choice4Of4[T1,T2,T3,T4] -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4+Tags[T1,T2,T3,T4] -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4] NewChoice1Of4(T1) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4] NewChoice2Of4(T2) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4] NewChoice3Of4(T3) -Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4]: Microsoft.FSharp.Core.FSharpChoice`4[T1,T2,T3,T4] NewChoice4Of4(T4) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: T3 Item -Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5]: T3 get_Item() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: T4 Item -Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5]: T4 get_Item() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: T5 Item -Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5]: T5 get_Item() -Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5]: Int32 Choice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5]: Int32 Choice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5]: Int32 Choice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5]: Int32 Choice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5]: Int32 Choice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice1Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice2Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice3Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice4Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean IsChoice5Of5 -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice1Of5() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice2Of5() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice3Of5() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice4Of5() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Boolean get_IsChoice5Of5() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Choice1Of5[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Choice2Of5[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Choice3Of5[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Choice4Of5[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Choice5Of5[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5+Tags[T1,T2,T3,T4,T5] -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5] NewChoice1Of5(T1) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5] NewChoice2Of5(T2) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5] NewChoice3Of5(T3) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5] NewChoice4Of5(T4) -Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5]: Microsoft.FSharp.Core.FSharpChoice`5[T1,T2,T3,T4,T5] NewChoice5Of5(T5) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: T3 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6]: T3 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: T4 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6]: T4 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: T5 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6]: T5 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: T6 Item -Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6]: T6 get_Item() -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6]: Int32 Choice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice1Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice2Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice3Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice4Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice5Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean IsChoice6Of6 -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice1Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice2Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice3Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice4Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice5Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Boolean get_IsChoice6Of6() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice1Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice2Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice3Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice4Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice5Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Choice6Of6[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6+Tags[T1,T2,T3,T4,T5,T6] -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice1Of6(T1) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice2Of6(T2) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice3Of6(T3) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice4Of6(T4) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice5Of6(T5) -Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6]: Microsoft.FSharp.Core.FSharpChoice`6[T1,T2,T3,T4,T5,T6] NewChoice6Of6(T6) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: T1 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7]: T1 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: T2 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7]: T2 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: T3 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7]: T3 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: T4 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7]: T4 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: T5 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7]: T5 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: T6 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7]: T6 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: T7 Item -Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7]: T7 get_Item() -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7]: Int32 Choice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice1Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice2Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice3Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice4Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice5Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice6Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean IsChoice7Of7 -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice1Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice2Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice3Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice4Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice5Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice6Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Boolean get_IsChoice7Of7() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 Tag -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice1Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice2Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice3Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice4Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice5Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice6Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Choice7Of7[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7+Tags[T1,T2,T3,T4,T5,T6,T7] -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice1Of7(T1) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice2Of7(T2) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice3Of7(T3) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice4Of7(T4) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice5Of7(T5) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice6Of7(T6) -Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7]: Microsoft.FSharp.Core.FSharpChoice`7[T1,T2,T3,T4,T5,T6,T7] NewChoice7Of7(T7) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] FromConverter(System.Converter`2[T,TResult]) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] op_Implicit(System.Converter`2[T,TResult]) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: System.Converter`2[T,TResult] ToConverter(Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: System.Converter`2[T,TResult] op_Implicit(Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: TResult Invoke(T) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: V InvokeFast[V](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,V]], T, TResult) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: Void .ctor() -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: W InvokeFast[V,W](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,W]]], T, TResult, V) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: X InvokeFast[V,W,X](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,Microsoft.FSharp.Core.FSharpFunc`2[W,X]]]], T, TResult, V, W) -Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: Y InvokeFast[V,W,X,Y](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,Microsoft.FSharp.Core.FSharpFunc`2[W,Microsoft.FSharp.Core.FSharpFunc`2[X,Y]]]]], T, TResult, V, W, X) -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 Major -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 Minor -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 Release -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Major() -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Minor() -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Release() -Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Void .ctor(Int32, Int32, Int32) -Microsoft.FSharp.Core.FSharpOption`1+Tags[T]: Int32 None -Microsoft.FSharp.Core.FSharpOption`1+Tags[T]: Int32 Some -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean IsNone -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean IsSome -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean get_IsNone(Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.FSharpOption`1[T]: Boolean get_IsSome(Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpOption`1[T]: Int32 GetTag(Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.FSharpOption`1[T]: Microsoft.FSharp.Core.FSharpOption`1+Tags[T] -Microsoft.FSharp.Core.FSharpOption`1[T]: Microsoft.FSharp.Core.FSharpOption`1[T] None -Microsoft.FSharp.Core.FSharpOption`1[T]: Microsoft.FSharp.Core.FSharpOption`1[T] Some(T) -Microsoft.FSharp.Core.FSharpOption`1[T]: Microsoft.FSharp.Core.FSharpOption`1[T] get_None() -Microsoft.FSharp.Core.FSharpOption`1[T]: Microsoft.FSharp.Core.FSharpOption`1[T] op_Implicit(T) -Microsoft.FSharp.Core.FSharpOption`1[T]: System.String ToString() -Microsoft.FSharp.Core.FSharpOption`1[T]: T Value -Microsoft.FSharp.Core.FSharpOption`1[T]: T get_Value() -Microsoft.FSharp.Core.FSharpOption`1[T]: Void .ctor(T) -Microsoft.FSharp.Core.FSharpRef`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpRef`1[T]) -Microsoft.FSharp.Core.FSharpRef`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpRef`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpRef`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpRef`1[T]) -Microsoft.FSharp.Core.FSharpRef`1[T]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpRef`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpRef`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpRef`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpRef`1[T]: T Value -Microsoft.FSharp.Core.FSharpRef`1[T]: T contents -Microsoft.FSharp.Core.FSharpRef`1[T]: T contents@ -Microsoft.FSharp.Core.FSharpRef`1[T]: T get_Value() -Microsoft.FSharp.Core.FSharpRef`1[T]: T get_contents() -Microsoft.FSharp.Core.FSharpRef`1[T]: Void .ctor(T) -Microsoft.FSharp.Core.FSharpRef`1[T]: Void set_Value(T) -Microsoft.FSharp.Core.FSharpRef`1[T]: Void set_contents(T) -Microsoft.FSharp.Core.FSharpResult`2+Tags[T,TError]: Int32 Error -Microsoft.FSharp.Core.FSharpResult`2+Tags[T,TError]: Int32 Ok -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean Equals(Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean IsError -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean IsOk -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean get_IsError() -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Boolean get_IsOk() -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 Tag -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Microsoft.FSharp.Core.FSharpResult`2+Tags[T,TError] -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Microsoft.FSharp.Core.FSharpResult`2[T,TError] NewError(TError) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: Microsoft.FSharp.Core.FSharpResult`2[T,TError] NewOk(T) -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T ResultValue -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T get_ResultValue() -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError ErrorValue -Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError get_ErrorValue() -Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() -Microsoft.FSharp.Core.FSharpTypeFunc: Void .ctor() -Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueNone -Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueSome -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsNone -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsSome -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsNone() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsSome() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 Tag -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 get_Tag() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T] -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] NewValueSome(T) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] None -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] Some(T) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] ValueNone -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_None() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_ValueNone() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] op_Implicit(T) -Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.String ToString() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Item -Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Value -Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Item() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Value() -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit] FromAction(System.Action) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T] FromFunc[T](System.Func`1[T]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] FromAction[T](System.Action`1[T]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] ToFSharpFunc[T](System.Action`1[T]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] FromFunc[T,TResult](System.Func`2[T,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] ToFSharpFunc[T,TResult](System.Converter`2[T,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,Microsoft.FSharp.Core.Unit]]]]] FromAction[T1,T2,T3,T4,T5](System.Action`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FromFunc[T1,T2,T3,T4,T5,TResult](System.Func`6[T1,T2,T3,T4,T5,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FuncFromTupled[T1,T2,T3,T4,T5,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`5[T1,T2,T3,T4,T5],TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.Unit]]]] FromAction[T1,T2,T3,T4](System.Action`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FromFunc[T1,T2,T3,T4,TResult](System.Func`5[T1,T2,T3,T4,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FuncFromTupled[T1,T2,T3,T4,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`4[T1,T2,T3,T4],TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.Unit]]] FromAction[T1,T2,T3](System.Action`3[T1,T2,T3]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FromFunc[T1,T2,T3,TResult](System.Func`4[T1,T2,T3,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FuncFromTupled[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[T1,T2,T3],TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]] FromAction[T1,T2](System.Action`2[T1,T2]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FromFunc[T1,T2,TResult](System.Func`3[T1,T2,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FuncFromTupled[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[T1,T2],TResult]) -Microsoft.FSharp.Core.GeneralizableValueAttribute: Void .ctor() -Microsoft.FSharp.Core.InterfaceAttribute: Void .ctor() -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String AddressOpNotFirstClassString -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String InputArrayEmptyString -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String InputMustBeNonNegativeString -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String InputSequenceEmptyString -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String NoNegateMinValueString -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String get_AddressOpNotFirstClassString() -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String get_InputArrayEmptyString() -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String get_InputMustBeNonNegativeString() -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String get_InputSequenceEmptyString() -Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings: System.String get_NoNegateMinValueString() -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean FastEqualsTuple2[T1,T2](System.Collections.IEqualityComparer, System.Tuple`2[T1,T2], System.Tuple`2[T1,T2]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean FastEqualsTuple3[T1,T2,T3](System.Collections.IEqualityComparer, System.Tuple`3[T1,T2,T3], System.Tuple`3[T1,T2,T3]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean FastEqualsTuple4[T1,T2,T3,T4](System.Collections.IEqualityComparer, System.Tuple`4[T1,T2,T3,T4], System.Tuple`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean FastEqualsTuple5[T1,T2,T3,T4,T5](System.Collections.IEqualityComparer, System.Tuple`5[T1,T2,T3,T4,T5], System.Tuple`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericEqualityERIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericEqualityIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericEqualityWithComparerIntrinsic[T](System.Collections.IEqualityComparer, T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericGreaterOrEqualIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericGreaterThanIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericLessOrEqualIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean GenericLessThanIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Boolean PhysicalEqualityIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastCompareTuple2[T1,T2](System.Collections.IComparer, System.Tuple`2[T1,T2], System.Tuple`2[T1,T2]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastCompareTuple3[T1,T2,T3](System.Collections.IComparer, System.Tuple`3[T1,T2,T3], System.Tuple`3[T1,T2,T3]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastCompareTuple4[T1,T2,T3,T4](System.Collections.IComparer, System.Tuple`4[T1,T2,T3,T4], System.Tuple`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastCompareTuple5[T1,T2,T3,T4,T5](System.Collections.IComparer, System.Tuple`5[T1,T2,T3,T4,T5], System.Tuple`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastHashTuple2[T1,T2](System.Collections.IEqualityComparer, System.Tuple`2[T1,T2]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastHashTuple3[T1,T2,T3](System.Collections.IEqualityComparer, System.Tuple`3[T1,T2,T3]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastHashTuple4[T1,T2,T3,T4](System.Collections.IEqualityComparer, System.Tuple`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 FastHashTuple5[T1,T2,T3,T4,T5](System.Collections.IEqualityComparer, System.Tuple`5[T1,T2,T3,T4,T5]) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 GenericComparisonIntrinsic[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 GenericComparisonWithComparerIntrinsic[T](System.Collections.IComparer, T, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 GenericHashIntrinsic[T](T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 GenericHashWithComparerIntrinsic[T](System.Collections.IEqualityComparer, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 LimitedGenericHashIntrinsic[T](Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives+HashCompare: Int32 PhysicalHashIntrinsic[T](T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Boolean TypeTestFast[T](System.Object) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Boolean TypeTestGeneric[T](System.Object) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Char GetString(System.String, Int32) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: System.Decimal MakeDecimal(Int32, Int32, Int32, Boolean, Byte) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T CheckThis[T](T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T CreateInstance[T]() -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T GetArray2D[T](T[,], Int32, Int32) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T GetArray3D[T](T[,,], Int32, Int32, Int32) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T GetArray4D[T](T[,,,], Int32, Int32, Int32, Int32) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T GetArray[T](T[], Int32) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T UnboxFast[T](System.Object) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: T UnboxGeneric[T](System.Object) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void Dispose[T](T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void FailInit() -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void FailStaticInit() -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void SetArray2D[T](T[,], Int32, Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void SetArray3D[T](T[,,], Int32, Int32, Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void SetArray4D[T](T[,,,], Int32, Int32, Int32, Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions: Void SetArray[T](T[], Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: Boolean Or(Boolean, Boolean) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: Boolean op_Amp(Boolean, Boolean) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: Boolean op_BooleanAnd(Boolean, Boolean) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: Boolean op_BooleanOr(Boolean, Boolean) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: IntPtr op_IntegerAddressOf[T](T) -Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators: T& op_AddressOf[T](T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericEqualityER[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericEqualityWithComparer[T](System.Collections.IEqualityComparer, T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericEquality[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericGreaterOrEqual[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericGreaterThan[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericLessOrEqual[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean GenericLessThan[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Boolean PhysicalEquality[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Double FloatWithMeasure(Double) -Microsoft.FSharp.Core.LanguagePrimitives: Int16 Int16WithMeasure(Int16) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 GenericComparisonWithComparer[T](System.Collections.IComparer, T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 GenericComparison[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 GenericHashWithComparer[T](System.Collections.IEqualityComparer, T) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 GenericHash[T](T) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 GenericLimitedHash[T](Int32, T) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 Int32WithMeasure(Int32) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 ParseInt32(System.String) -Microsoft.FSharp.Core.LanguagePrimitives: Int32 PhysicalHash[T](T) -Microsoft.FSharp.Core.LanguagePrimitives: Int64 Int64WithMeasure(Int64) -Microsoft.FSharp.Core.LanguagePrimitives: Int64 ParseInt64(System.String) -Microsoft.FSharp.Core.LanguagePrimitives: Microsoft.FSharp.Core.LanguagePrimitives+ErrorStrings -Microsoft.FSharp.Core.LanguagePrimitives: Microsoft.FSharp.Core.LanguagePrimitives+HashCompare -Microsoft.FSharp.Core.LanguagePrimitives: Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions -Microsoft.FSharp.Core.LanguagePrimitives: Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicOperators -Microsoft.FSharp.Core.LanguagePrimitives: SByte SByteWithMeasure(SByte) -Microsoft.FSharp.Core.LanguagePrimitives: Single Float32WithMeasure(Single) -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.Generic.IComparer`1[T] FastGenericComparerFromTable[T]() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.Generic.IComparer`1[T] FastGenericComparer[T]() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.Generic.IEqualityComparer`1[T] FastGenericEqualityComparerFromTable[T]() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.Generic.IEqualityComparer`1[T] FastGenericEqualityComparer[T]() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.Generic.IEqualityComparer`1[T] FastLimitedGenericEqualityComparer[T](Int32) -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IComparer GenericComparer -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IComparer get_GenericComparer() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IEqualityComparer GenericEqualityComparer -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IEqualityComparer GenericEqualityERComparer -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IEqualityComparer get_GenericEqualityComparer() -Microsoft.FSharp.Core.LanguagePrimitives: System.Collections.IEqualityComparer get_GenericEqualityERComparer() -Microsoft.FSharp.Core.LanguagePrimitives: System.Decimal DecimalWithMeasure(System.Decimal) -Microsoft.FSharp.Core.LanguagePrimitives: T DivideByIntDynamic[T](T, Int32) -Microsoft.FSharp.Core.LanguagePrimitives: T DivideByInt[T](T, Int32) -Microsoft.FSharp.Core.LanguagePrimitives: T EnumToValue[TEnum,T](TEnum) -Microsoft.FSharp.Core.LanguagePrimitives: T GenericMaximum[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: T GenericMinimum[T](T, T) -Microsoft.FSharp.Core.LanguagePrimitives: T GenericOneDynamic[T]() -Microsoft.FSharp.Core.LanguagePrimitives: T GenericOne[T]() -Microsoft.FSharp.Core.LanguagePrimitives: T GenericZeroDynamic[T]() -Microsoft.FSharp.Core.LanguagePrimitives: T GenericZero[T]() -Microsoft.FSharp.Core.LanguagePrimitives: TEnum EnumOfValue[T,TEnum](T) -Microsoft.FSharp.Core.LanguagePrimitives: TResult AdditionDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedAdditionDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedMultiplyDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult MultiplyDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: UInt32 ParseUInt32(System.String) -Microsoft.FSharp.Core.LanguagePrimitives: UInt64 ParseUInt64(System.String) -Microsoft.FSharp.Core.LiteralAttribute: Void .ctor() -Microsoft.FSharp.Core.MatchFailureException: Boolean Equals(System.Object) -Microsoft.FSharp.Core.MatchFailureException: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.MatchFailureException: Int32 Data1 -Microsoft.FSharp.Core.MatchFailureException: Int32 Data2 -Microsoft.FSharp.Core.MatchFailureException: Int32 GetHashCode() -Microsoft.FSharp.Core.MatchFailureException: Int32 GetHashCode(System.Collections.IEqualityComparer) -Microsoft.FSharp.Core.MatchFailureException: Int32 get_Data1() -Microsoft.FSharp.Core.MatchFailureException: Int32 get_Data2() -Microsoft.FSharp.Core.MatchFailureException: System.String Data0 -Microsoft.FSharp.Core.MatchFailureException: System.String Message -Microsoft.FSharp.Core.MatchFailureException: System.String get_Data0() -Microsoft.FSharp.Core.MatchFailureException: System.String get_Message() -Microsoft.FSharp.Core.MatchFailureException: Void .ctor() -Microsoft.FSharp.Core.MatchFailureException: Void .ctor(System.String, Int32, Int32) -Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Void .ctor() -Microsoft.FSharp.Core.MeasureAttribute: Void .ctor() -Microsoft.FSharp.Core.NoComparisonAttribute: Void .ctor() -Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Void .ctor() -Microsoft.FSharp.Core.NoEqualityAttribute: Void .ctor() -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: System.Object FromInt64Dynamic(Int64) -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: System.Object FromStringDynamic(System.String) -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: T FromInt32[T](Int32) -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: T FromInt64[T](Int64) -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: T FromOne[T]() -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: T FromString[T](System.String) -Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI: T FromZero[T]() -Microsoft.FSharp.Core.NumericLiterals: Microsoft.FSharp.Core.NumericLiterals+NumericLiteralI -Microsoft.FSharp.Core.Operators+ArrayExtensions: Int32 String.GetReverseIndex(System.String, Int32, Int32) -Microsoft.FSharp.Core.Operators+ArrayExtensions: Int32 [,,,]`1.GetReverseIndex[T](T[,,,], Int32, Int32) -Microsoft.FSharp.Core.Operators+ArrayExtensions: Int32 [,,]`1.GetReverseIndex[T](T[,,], Int32, Int32) -Microsoft.FSharp.Core.Operators+ArrayExtensions: Int32 [,]`1.GetReverseIndex[T](T[,], Int32, Int32) -Microsoft.FSharp.Core.Operators+ArrayExtensions: Int32 []`1.GetReverseIndex[T](T[], Int32, Int32) -Microsoft.FSharp.Core.Operators+Checked: Byte ToByte[T](T) -Microsoft.FSharp.Core.Operators+Checked: Char ToChar[T](T) -Microsoft.FSharp.Core.Operators+Checked: Int16 ToInt16[T](T) -Microsoft.FSharp.Core.Operators+Checked: Int32 ToInt32[T](T) -Microsoft.FSharp.Core.Operators+Checked: Int32 ToInt[T](T) -Microsoft.FSharp.Core.Operators+Checked: Int64 ToInt64[T](T) -Microsoft.FSharp.Core.Operators+Checked: IntPtr ToIntPtr[T](T) -Microsoft.FSharp.Core.Operators+Checked: SByte ToSByte[T](T) -Microsoft.FSharp.Core.Operators+Checked: T op_UnaryNegation[T](T) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Addition[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Multiply[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Subtraction[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators+Checked: UInt16 ToUInt16[T](T) -Microsoft.FSharp.Core.Operators+Checked: UInt32 ToUInt32[T](T) -Microsoft.FSharp.Core.Operators+Checked: UInt64 ToUInt64[T](T) -Microsoft.FSharp.Core.Operators+Checked: UIntPtr ToUIntPtr[T](T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_Equality[T](T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_GreaterThanOrEqual[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_GreaterThan[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_Inequality[T](T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_LessThanOrEqual[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_LessThan[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Int32 Compare[T](T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Int32 Hash[T](T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: T Max[T](T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: T Min[T](T, T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Byte PowByte(Byte, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Double PowDouble(Double, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Int16 PowInt16(Int16, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Int32 PowInt32(Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Int32 SignDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Int64 PowInt64(Int64, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: IntPtr PowIntPtr(IntPtr, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: SByte PowSByte(SByte, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Single PowSingle(Single, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Byte] RangeByte(Byte, Byte, Byte) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Char] RangeChar(Char, Char) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Double] RangeDouble(Double, Double, Double) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Int16] RangeInt16(Int16, Int16, Int16) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Int32] RangeInt32(Int32, Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Int64] RangeInt64(Int64, Int64, Int64) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.IntPtr] RangeIntPtr(IntPtr, IntPtr, IntPtr) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.SByte] RangeSByte(SByte, SByte, SByte) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.Single] RangeSingle(Single, Single, Single) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.UInt16] RangeUInt16(UInt16, UInt16, UInt16) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.UInt32] RangeUInt32(UInt32, UInt32, UInt32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.UInt64] RangeUInt64(UInt64, UInt64, UInt64) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[System.UIntPtr] RangeUIntPtr(UIntPtr, UIntPtr, UIntPtr) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[T] RangeGeneric[T](T, Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Collections.Generic.IEnumerable`1[T] RangeStepGeneric[TStep,T](TStep, Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TStep,T]], T, TStep, T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.Decimal PowDecimal(System.Decimal, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: System.String GetStringSlice(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T AbsDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T AcosDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T AsinDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T AtanDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T CeilingDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T CosDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T CoshDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T ExpDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T FloorDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T Log10Dynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T LogDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T PowDynamic[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T PowGeneric[T](T, Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T RoundDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T SinDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T SinhDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T TanDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T TanhDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T TruncateDynamic[T](T) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T2 Atan2Dynamic[T1,T2](T1, T1) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T2 SqrtDynamic[T1,T2](T1) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,,] GetArraySlice4D[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,] GetArraySlice3D[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice3DFixedSingle1[T](T[,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice3DFixedSingle2[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice3DFixedSingle3[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice3DFixedDouble1[T](T[,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice3DFixedDouble2[T](T[,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice3DFixedDouble3[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice2D[T](T[,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice2DFixed1[T](T[,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice2DFixed2[T](T[,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice[T](T[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: UInt16 PowUInt16(UInt16, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: UInt32 PowUInt32(UInt32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: UInt64 PowUInt64(UInt64, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: UIntPtr PowUIntPtr(UIntPtr, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice2DFixed1[T](T[,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice2DFixed2[T](T[,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice2D[T](T[,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3D[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedDouble1[T](T[,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedDouble2[T](T[,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedDouble3[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedSingle1[T](T[,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedSingle2[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice3DFixedSingle3[T](T[,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4D[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,] GetArraySlice4DFixedSingle1[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,] GetArraySlice4DFixedSingle2[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,] GetArraySlice4DFixedSingle3[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,,] GetArraySlice4DFixedSingle4[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble1[T](T[,,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble2[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble3[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble4[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble5[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[,] GetArraySlice4DFixedDouble6[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice4DFixedTriple1[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice4DFixedTriple2[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice4DFixedTriple3[T](T[,,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: T[] GetArraySlice4DFixedTriple4[T](T[,,,], Int32, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble1[T](T[,,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble2[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble3[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble4[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble5[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedDouble6[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, T[,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedSingle1[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedSingle2[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedSingle3[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedSingle4[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[,,]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedTriple1[T](T[,,,], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedTriple2[T](T[,,,], Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedTriple3[T](T[,,,], Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Int32, T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice4DFixedTriple4[T](T[,,,], Int32, Int32, Int32, Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[]) -Microsoft.FSharp.Core.Operators+OperatorIntrinsics: Void SetArraySlice[T](T[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], T[]) -Microsoft.FSharp.Core.Operators+Unchecked: Boolean Equals[T](T, T) -Microsoft.FSharp.Core.Operators+Unchecked: Int32 Compare[T](T, T) -Microsoft.FSharp.Core.Operators+Unchecked: Int32 Hash[T](T) -Microsoft.FSharp.Core.Operators+Unchecked: T DefaultOf[T]() -Microsoft.FSharp.Core.Operators+Unchecked: T Unbox[T](System.Object) -Microsoft.FSharp.Core.Operators: Boolean IsNull[T](T) -Microsoft.FSharp.Core.Operators: Boolean Not(Boolean) -Microsoft.FSharp.Core.Operators: Boolean op_Equality[T](T, T) -Microsoft.FSharp.Core.Operators: Boolean op_GreaterThanOrEqual[T](T, T) -Microsoft.FSharp.Core.Operators: Boolean op_GreaterThan[T](T, T) -Microsoft.FSharp.Core.Operators: Boolean op_Inequality[T](T, T) -Microsoft.FSharp.Core.Operators: Boolean op_LessThanOrEqual[T](T, T) -Microsoft.FSharp.Core.Operators: Boolean op_LessThan[T](T, T) -Microsoft.FSharp.Core.Operators: Byte ToByte[T](T) -Microsoft.FSharp.Core.Operators: Char ToChar[T](T) -Microsoft.FSharp.Core.Operators: Double Infinity -Microsoft.FSharp.Core.Operators: Double NaN -Microsoft.FSharp.Core.Operators: Double ToDouble[T](T) -Microsoft.FSharp.Core.Operators: Double get_Infinity() -Microsoft.FSharp.Core.Operators: Double get_NaN() -Microsoft.FSharp.Core.Operators: Int16 ToInt16[T](T) -Microsoft.FSharp.Core.Operators: Int32 Compare[T](T, T) -Microsoft.FSharp.Core.Operators: Int32 Hash[T](T) -Microsoft.FSharp.Core.Operators: Int32 Sign[T](T) -Microsoft.FSharp.Core.Operators: Int32 SizeOf[T]() -Microsoft.FSharp.Core.Operators: Int32 ToInt32[T](T) -Microsoft.FSharp.Core.Operators: Int32 ToInt[T](T) -Microsoft.FSharp.Core.Operators: UInt32 ToUInt[T](T) -Microsoft.FSharp.Core.Operators: Int32 limitedHash[T](Int32, T) -Microsoft.FSharp.Core.Operators: Int64 ToInt64[T](T) -Microsoft.FSharp.Core.Operators: IntPtr ToIntPtr[T](T) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Collections.FSharpList`1[T] op_Append[T](Microsoft.FSharp.Collections.FSharpList`1[T], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.FSharpFunc`2[T1,T3] op_ComposeLeft[T2,T3,T1](Microsoft.FSharp.Core.FSharpFunc`2[T2,T3], Microsoft.FSharp.Core.FSharpFunc`2[T1,T2]) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.FSharpFunc`2[T1,T3] op_ComposeRight[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,T2], Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.FSharpOption`1[System.String] FailurePattern(System.Exception) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.FSharpOption`1[T] TryUnbox[T](System.Object) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.FSharpRef`1[T] Ref[T](T) -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.Operators+ArrayExtensions -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.Operators+Checked -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.Operators+NonStructuralComparison -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.Operators+OperatorIntrinsics -Microsoft.FSharp.Core.Operators: Microsoft.FSharp.Core.Operators+Unchecked -Microsoft.FSharp.Core.Operators: SByte ToSByte[T](T) -Microsoft.FSharp.Core.Operators: Single InfinitySingle -Microsoft.FSharp.Core.Operators: Single NaNSingle -Microsoft.FSharp.Core.Operators: Single ToSingle[T](T) -Microsoft.FSharp.Core.Operators: Single get_InfinitySingle() -Microsoft.FSharp.Core.Operators: Single get_NaNSingle() -Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] CreateSequence[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_RangeStep[T,TStep](T, TStep, T) -Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_Range[T](T, T) -Microsoft.FSharp.Core.Operators: System.Decimal ToDecimal[T](T) -Microsoft.FSharp.Core.Operators: System.Exception Failure(System.String) -Microsoft.FSharp.Core.Operators: System.IO.TextReader ConsoleIn[T]() -Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleError[T]() -Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleOut[T]() -Microsoft.FSharp.Core.Operators: System.Object Box[T](T) -Microsoft.FSharp.Core.Operators: System.String NameOf[T](T) -Microsoft.FSharp.Core.Operators: System.String ToString[T](T) -Microsoft.FSharp.Core.Operators: System.String op_Concatenate(System.String, System.String) -Microsoft.FSharp.Core.Operators: System.Tuple`2[TKey,TValue] KeyValuePattern[TKey,TValue](System.Collections.Generic.KeyValuePair`2[TKey,TValue]) -Microsoft.FSharp.Core.Operators: System.Type TypeDefOf[T]() -Microsoft.FSharp.Core.Operators: System.Type TypeOf[T]() -Microsoft.FSharp.Core.Operators: T Abs[T](T) -Microsoft.FSharp.Core.Operators: T Acos[T](T) -Microsoft.FSharp.Core.Operators: T Asin[T](T) -Microsoft.FSharp.Core.Operators: T Atan[T](T) -Microsoft.FSharp.Core.Operators: T Ceiling[T](T) -Microsoft.FSharp.Core.Operators: T Cos[T](T) -Microsoft.FSharp.Core.Operators: T Cosh[T](T) -Microsoft.FSharp.Core.Operators: T DefaultArg[T](Microsoft.FSharp.Core.FSharpOption`1[T], T) -Microsoft.FSharp.Core.Operators: T DefaultValueArg[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], T) -Microsoft.FSharp.Core.Operators: T Exit[T](Int32) -Microsoft.FSharp.Core.Operators: T Exp[T](T) -Microsoft.FSharp.Core.Operators: T FailWith[T](System.String) -Microsoft.FSharp.Core.Operators: T Floor[T](T) -Microsoft.FSharp.Core.Operators: T Identity[T](T) -Microsoft.FSharp.Core.Operators: T InvalidArg[T](System.String, System.String) -Microsoft.FSharp.Core.Operators: T InvalidOp[T](System.String) -Microsoft.FSharp.Core.Operators: T Lock[TLock,T](TLock, Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) -Microsoft.FSharp.Core.Operators: T Log10[T](T) -Microsoft.FSharp.Core.Operators: T Log[T](T) -Microsoft.FSharp.Core.Operators: T Max[T](T, T) -Microsoft.FSharp.Core.Operators: T Min[T](T, T) -Microsoft.FSharp.Core.Operators: T NullArg[T](System.String) -Microsoft.FSharp.Core.Operators: T PowInteger[T](T, Int32) -Microsoft.FSharp.Core.Operators: T Raise[T](System.Exception) -Microsoft.FSharp.Core.Operators: T Reraise[T]() -Microsoft.FSharp.Core.Operators: T Rethrow[T]() -Microsoft.FSharp.Core.Operators: T Round[T](T) -Microsoft.FSharp.Core.Operators: T Sin[T](T) -Microsoft.FSharp.Core.Operators: T Sinh[T](T) -Microsoft.FSharp.Core.Operators: T Tan[T](T) -Microsoft.FSharp.Core.Operators: T Tanh[T](T) -Microsoft.FSharp.Core.Operators: T Truncate[T](T) -Microsoft.FSharp.Core.Operators: T Unbox[T](System.Object) -Microsoft.FSharp.Core.Operators: T op_BitwiseAnd[T](T, T) -Microsoft.FSharp.Core.Operators: T op_BitwiseOr[T](T, T) -Microsoft.FSharp.Core.Operators: T op_Dereference[T](Microsoft.FSharp.Core.FSharpRef`1[T]) -Microsoft.FSharp.Core.Operators: T op_ExclusiveOr[T](T, T) -Microsoft.FSharp.Core.Operators: T op_Exponentiation[T,TResult](T, TResult) -Microsoft.FSharp.Core.Operators: T op_LeftShift[T](T, Int32) -Microsoft.FSharp.Core.Operators: T op_LogicalNot[T](T) -Microsoft.FSharp.Core.Operators: T op_RightShift[T](T, Int32) -Microsoft.FSharp.Core.Operators: T op_UnaryNegation[T](T) -Microsoft.FSharp.Core.Operators: T op_UnaryPlus[T](T) -Microsoft.FSharp.Core.Operators: T1 Fst[T1,T2](System.Tuple`2[T1,T2]) -Microsoft.FSharp.Core.Operators: T2 Atan2[T1,T2](T1, T1) -Microsoft.FSharp.Core.Operators: T2 Snd[T1,T2](System.Tuple`2[T1,T2]) -Microsoft.FSharp.Core.Operators: T3 op_Addition[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Division[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Modulus[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Multiply[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Subtraction[T1,T2,T3](T1, T2) -Microsoft.FSharp.Core.Operators: TResult Sqrt[T,TResult](T) -Microsoft.FSharp.Core.Operators: TResult ToEnum[TResult](Int32) -Microsoft.FSharp.Core.Operators: TResult Using[T,TResult](T, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]) -Microsoft.FSharp.Core.Operators: TResult op_PipeLeft2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], T1, T2) -Microsoft.FSharp.Core.Operators: TResult op_PipeLeft3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], T1, T2, T3) -Microsoft.FSharp.Core.Operators: TResult op_PipeLeft[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T) -Microsoft.FSharp.Core.Operators: TResult op_PipeRight2[T1,T2,TResult](T1, T2, Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]]) -Microsoft.FSharp.Core.Operators: TResult op_PipeRight3[T1,T2,T3,TResult](T1, T2, T3, Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]]) -Microsoft.FSharp.Core.Operators: TResult op_PipeRight[T1,TResult](T1, Microsoft.FSharp.Core.FSharpFunc`2[T1,TResult]) -Microsoft.FSharp.Core.Operators: UInt16 ToUInt16[T](T) -Microsoft.FSharp.Core.Operators: UInt32 ToUInt32[T](T) -Microsoft.FSharp.Core.Operators: UInt64 ToUInt64[T](T) -Microsoft.FSharp.Core.Operators: UIntPtr ToUIntPtr[T](T) -Microsoft.FSharp.Core.Operators: Void Decrement(Microsoft.FSharp.Core.FSharpRef`1[System.Int32]) -Microsoft.FSharp.Core.Operators: Void Ignore[T](T) -Microsoft.FSharp.Core.Operators: Void Increment(Microsoft.FSharp.Core.FSharpRef`1[System.Int32]) -Microsoft.FSharp.Core.Operators: Void op_ColonEquals[T](Microsoft.FSharp.Core.FSharpRef`1[T], T) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`3[T1,T2,TResult]: FSharpFunc`3 Adapt(Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]]) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`3[T1,T2,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult] Invoke(T1) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`3[T1,T2,TResult]: TResult Invoke(T1, T2) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`3[T1,T2,TResult]: Void .ctor() -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`4[T1,T2,T3,TResult]: FSharpFunc`4 Adapt(Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]]) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`4[T1,T2,T3,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]] Invoke(T1) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`4[T1,T2,T3,TResult]: TResult Invoke(T1, T2, T3) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`4[T1,T2,T3,TResult]: Void .ctor() -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`5[T1,T2,T3,T4,TResult]: FSharpFunc`5 Adapt(Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]]) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`5[T1,T2,T3,T4,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]] Invoke(T1) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`5[T1,T2,T3,T4,TResult]: TResult Invoke(T1, T2, T3, T4) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`5[T1,T2,T3,T4,TResult]: Void .ctor() -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`6[T1,T2,T3,T4,T5,TResult]: FSharpFunc`6 Adapt(Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]]) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`6[T1,T2,T3,T4,T5,TResult]: Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]] Invoke(T1) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`6[T1,T2,T3,T4,T5,TResult]: TResult Invoke(T1, T2, T3, T4, T5) -Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`6[T1,T2,T3,T4,T5,TResult]: Void .ctor() -Microsoft.FSharp.Core.OptimizedClosures: Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`3[T1,T2,TResult] -Microsoft.FSharp.Core.OptimizedClosures: Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`4[T1,T2,T3,TResult] -Microsoft.FSharp.Core.OptimizedClosures: Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`5[T1,T2,T3,T4,TResult] -Microsoft.FSharp.Core.OptimizedClosures: Microsoft.FSharp.Core.OptimizedClosures+FSharpFunc`6[T1,T2,T3,T4,T5,TResult] -Microsoft.FSharp.Core.OptionModule: Boolean Contains[T](T, Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Boolean IsNone[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Boolean IsSome[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Int32 Count[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] Bind[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], Microsoft.FSharp.Core.FSharpOption`1[T1], Microsoft.FSharp.Core.FSharpOption`1[T2]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], Microsoft.FSharp.Core.FSharpOption`1[T1], Microsoft.FSharp.Core.FSharpOption`1[T2], Microsoft.FSharp.Core.FSharpOption`1[T3]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] Flatten[T](Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpOption`1[T]]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] OfNullable[T](System.Nullable`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] OfObj[T](T) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] OrElseWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.FSharpOption`1[T]], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Microsoft.FSharp.Core.FSharpOption`1[T] OrElse[T](Microsoft.FSharp.Core.FSharpOption`1[T], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: System.Nullable`1[T] ToNullable[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: T DefaultValue[T](T, Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: T DefaultWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: T GetValue[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: T ToObj[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Core.FSharpOption`1[T], TState) -Microsoft.FSharp.Core.OptionModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: T[] ToArray[T](Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[T]) -Microsoft.FSharp.Core.OptionalArgumentAttribute: Void .ctor() -Microsoft.FSharp.Core.PrintfFormat`4[TPrinter,TState,TResidue,TResult]: System.String ToString() -Microsoft.FSharp.Core.PrintfFormat`4[TPrinter,TState,TResidue,TResult]: System.String Value -Microsoft.FSharp.Core.PrintfFormat`4[TPrinter,TState,TResidue,TResult]: System.String get_Value() -Microsoft.FSharp.Core.PrintfFormat`4[TPrinter,TState,TResidue,TResult]: Void .ctor(System.String) -Microsoft.FSharp.Core.PrintfFormat`5[TPrinter,TState,TResidue,TResult,TTuple]: System.String ToString() -Microsoft.FSharp.Core.PrintfFormat`5[TPrinter,TState,TResidue,TResult,TTuple]: System.String Value -Microsoft.FSharp.Core.PrintfFormat`5[TPrinter,TState,TResidue,TResult,TTuple]: System.String get_Value() -Microsoft.FSharp.Core.PrintfFormat`5[TPrinter,TState,TResidue,TResult,TTuple]: Void .ctor(System.String) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatLineToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatLineToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[System.String,TResult], Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringBuilderThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], System.Text.StringBuilder, Microsoft.FSharp.Core.PrintfFormat`4[T,System.Text.StringBuilder,Microsoft.FSharp.Core.Unit,TResult]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringBuilder[T](System.Text.StringBuilder, Microsoft.FSharp.Core.PrintfFormat`4[T,System.Text.StringBuilder,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringThenFail[T,TResult](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[System.String,TResult], Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringThen[T](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,System.String]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToTextWriterThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,TResult]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ProjectionParameterAttribute: Void .ctor() -Microsoft.FSharp.Core.ReferenceEqualityAttribute: Void .ctor() -Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean IncludeValue -Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean get_IncludeValue() -Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Void .ctor() -Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Void .ctor() -Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Void .ctor() -Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpResult`2[T,TResult] MapError[TError,TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[TError,TResult], Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpResult`2[TResult,TError] Bind[T,TResult,TError](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpResult`2[TResult,TError]], Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpResult`2[TResult,TError] Map[T,TResult,TError](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.SealedAttribute: Boolean Value -Microsoft.FSharp.Core.SealedAttribute: Boolean get_Value() -Microsoft.FSharp.Core.SealedAttribute: Void .ctor() -Microsoft.FSharp.Core.SealedAttribute: Void .ctor(Boolean) -Microsoft.FSharp.Core.SourceConstructFlags: Int32 value__ -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags Closure -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags Exception -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags Field -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags KindMask -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags Module -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags NonPublicRepresentation -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags None -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags ObjectType -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags RecordType -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags SumType -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags UnionCase -Microsoft.FSharp.Core.SourceConstructFlags: Microsoft.FSharp.Core.SourceConstructFlags Value -Microsoft.FSharp.Core.StringModule: Boolean Exists(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.Boolean], System.String) -Microsoft.FSharp.Core.StringModule: Boolean ForAll(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.Boolean], System.String) -Microsoft.FSharp.Core.StringModule: Int32 Length(System.String) -Microsoft.FSharp.Core.StringModule: System.String Collect(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.String], System.String) -Microsoft.FSharp.Core.StringModule: System.String Concat(System.String, System.Collections.Generic.IEnumerable`1[System.String]) -Microsoft.FSharp.Core.StringModule: System.String Filter(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.Boolean], System.String) -Microsoft.FSharp.Core.StringModule: System.String Initialize(Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.String]) -Microsoft.FSharp.Core.StringModule: System.String Map(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.Char], System.String) -Microsoft.FSharp.Core.StringModule: System.String MapIndexed(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Char,System.Char]], System.String) -Microsoft.FSharp.Core.StringModule: System.String Replicate(Int32, System.String) -Microsoft.FSharp.Core.StringModule: Void Iterate(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,Microsoft.FSharp.Core.Unit], System.String) -Microsoft.FSharp.Core.StringModule: Void IterateIndexed(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Char,Microsoft.FSharp.Core.Unit]], System.String) -Microsoft.FSharp.Core.StructAttribute: Void .ctor() -Microsoft.FSharp.Core.StructuralComparisonAttribute: Void .ctor() -Microsoft.FSharp.Core.StructuralEqualityAttribute: Void .ctor() -Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.String Value -Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.String get_Value() -Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: Void .ctor(System.String) -Microsoft.FSharp.Core.Unit: Boolean Equals(System.Object) -Microsoft.FSharp.Core.Unit: Int32 GetHashCode() -Microsoft.FSharp.Core.UnverifiableAttribute: Void .ctor() -Microsoft.FSharp.Core.ValueOption: Boolean Contains[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Boolean IsNone[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Boolean IsSome[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Int32 Count[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Bind[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpValueOption`1[TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2], Microsoft.FSharp.Core.FSharpValueOption`1[T3]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Flatten[T](Microsoft.FSharp.Core.FSharpValueOption`1[Microsoft.FSharp.Core.FSharpValueOption`1[T]]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfNullable[T](System.Nullable`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfObj[T](T) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElseWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.FSharpValueOption`1[T]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElse[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: System.Nullable`1[T] ToNullable[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: T DefaultValue[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: T DefaultWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: T GetValue[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: T ToObj[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Core.FSharpValueOption`1[T], TState) -Microsoft.FSharp.Core.ValueOption: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: T[] ToArray[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.ValueOption: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpValueOption`1[T]) -Microsoft.FSharp.Core.VolatileFieldAttribute: Void .ctor() -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Byte] ToByte[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Byte] ToUInt8[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Char] ToChar[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Decimal] ToDecimal[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Double] ToDouble[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Double] ToFloat[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int16] ToInt16[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int32] ToInt32[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int32] ToInt[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int64] ToInt64[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.IntPtr] ToIntPtr[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.SByte] ToInt8[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.SByte] ToSByte[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Single] ToFloat32[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Single] ToSingle[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt16] ToUInt16[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt32] ToUInt32[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt32] ToUInt[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt64] ToUInt64[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UIntPtr] ToUIntPtr[T](System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[TResult] ToEnum[TResult](System.Nullable`1[System.Int32]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_EqualsQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_GreaterEqualsQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_GreaterQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_LessEqualsQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_LessGreaterQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_LessQmark[T](T, System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkEqualsQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkEquals[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkGreaterEqualsQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkGreaterEquals[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkGreaterQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkGreater[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLessEqualsQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLessEquals[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLessGreaterQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLessGreater[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLessQmark[T](System.Nullable`1[T], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: Boolean op_QmarkLess[T](System.Nullable`1[T], T) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_DivideQmark[T1,T2,T3](T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_MinusQmark[T1,T2,T3](T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_MultiplyQmark[T1,T2,T3](T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_PercentQmark[T1,T2,T3](T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_PlusQmark[T1,T2,T3](T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkDivideQmark[T1,T2,T3](System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkDivide[T1,T2,T3](System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMinusQmark[T1,T2,T3](System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMinus[T1,T2,T3](System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMultiplyQmark[T1,T2,T3](System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMultiply[T1,T2,T3](System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPercentQmark[T1,T2,T3](System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPercent[T1,T2,T3](System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPlusQmark[T1,T2,T3](System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPlus[T1,T2,T3](System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.QueryBuilder: Boolean All[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: Boolean Contains[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], T) -Microsoft.FSharp.Linq.QueryBuilder: Boolean Exists[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: Int32 Count[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[System.Linq.IGrouping`2[TKey,TValue],Q] GroupValBy[T,TKey,TValue,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[System.Linq.IGrouping`2[TKey,T],Q] GroupBy[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Distinct[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] SkipWhile[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Skip[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Int32) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] SortByDescending[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] SortByNullableDescending[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TKey]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] SortByNullable[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TKey]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] SortBy[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Source[T,Q](System.Linq.IQueryable`1[T]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] TakeWhile[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Take[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Int32) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] ThenByDescending[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] ThenByNullableDescending[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TKey]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] ThenByNullable[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TKey]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] ThenBy[T,Q,TKey](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TKey]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Where[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] YieldFrom[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Yield[T,Q](T) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,Q] Zero[T,Q]() -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[T,System.Collections.IEnumerable] Source[T](System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[TResult,Q] For[T,Q,TResult,Q2](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Linq.QuerySource`2[TResult,Q2]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[TResult,Q] GroupJoin[TOuter,Q,TInner,TKey,TResult](Microsoft.FSharp.Linq.QuerySource`2[TOuter,Q], Microsoft.FSharp.Linq.QuerySource`2[TInner,Q], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TInner,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,Microsoft.FSharp.Core.FSharpFunc`2[System.Collections.Generic.IEnumerable`1[TInner],TResult]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[TResult,Q] Join[TOuter,Q,TInner,TKey,TResult](Microsoft.FSharp.Linq.QuerySource`2[TOuter,Q], Microsoft.FSharp.Linq.QuerySource`2[TInner,Q], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TInner,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,Microsoft.FSharp.Core.FSharpFunc`2[TInner,TResult]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[TResult,Q] LeftOuterJoin[TOuter,Q,TInner,TKey,TResult](Microsoft.FSharp.Linq.QuerySource`2[TOuter,Q], Microsoft.FSharp.Linq.QuerySource`2[TInner,Q], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TInner,TKey], Microsoft.FSharp.Core.FSharpFunc`2[TOuter,Microsoft.FSharp.Core.FSharpFunc`2[System.Collections.Generic.IEnumerable`1[TInner],TResult]]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Linq.QuerySource`2[TResult,Q] Select[T,Q,TResult](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]) -Microsoft.FSharp.Linq.QueryBuilder: Microsoft.FSharp.Quotations.FSharpExpr`1[T] Quote[T](Microsoft.FSharp.Quotations.FSharpExpr`1[T]) -Microsoft.FSharp.Linq.QueryBuilder: System.Linq.IQueryable`1[T] Run[T](Microsoft.FSharp.Quotations.FSharpExpr`1[Microsoft.FSharp.Linq.QuerySource`2[T,System.Linq.IQueryable]]) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] AverageByNullable[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] MaxByNullable[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] MinByNullable[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] SumByNullable[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: T ExactlyOneOrDefault[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T ExactlyOne[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T Find[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]) -Microsoft.FSharp.Linq.QueryBuilder: T HeadOrDefault[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T Head[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T LastOrDefault[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T Last[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q]) -Microsoft.FSharp.Linq.QueryBuilder: T Nth[T,Q](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Int32) -Microsoft.FSharp.Linq.QueryBuilder: TValue AverageBy[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Linq.QueryBuilder: TValue MaxBy[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Linq.QueryBuilder: TValue MinBy[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Linq.QueryBuilder: TValue SumBy[T,Q,TValue](Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Linq.QueryBuilder: Void .ctor() -Microsoft.FSharp.Linq.QueryRunExtensions.HighPriority: System.Collections.Generic.IEnumerable`1[T] RunQueryAsEnumerable[T](Microsoft.FSharp.Linq.QueryBuilder, Microsoft.FSharp.Quotations.FSharpExpr`1[Microsoft.FSharp.Linq.QuerySource`2[T,System.Collections.IEnumerable]]) -Microsoft.FSharp.Linq.QueryRunExtensions.LowPriority: T RunQueryAsValue[T](Microsoft.FSharp.Linq.QueryBuilder, Microsoft.FSharp.Quotations.FSharpExpr`1[T]) -Microsoft.FSharp.Linq.QuerySource`2[T,Q]: System.Collections.Generic.IEnumerable`1[T] Source -Microsoft.FSharp.Linq.QuerySource`2[T,Q]: System.Collections.Generic.IEnumerable`1[T] get_Source() -Microsoft.FSharp.Linq.QuerySource`2[T,Q]: Void .ctor(System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`1[T1]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`1[T1]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`1[T1]: Void .ctor(T1) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[T1,T2]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[T1,T2]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[T1,T2]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[T1,T2]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[T1,T2]: Void .ctor(T1, T2) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`3[T1,T2,T3]: Void .ctor(T1, T2, T3) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T4 Item4 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: T4 get_Item4() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`4[T1,T2,T3,T4]: Void .ctor(T1, T2, T3, T4) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T4 Item4 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T4 get_Item4() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T5 Item5 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: T5 get_Item5() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`5[T1,T2,T3,T4,T5]: Void .ctor(T1, T2, T3, T4, T5) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T4 Item4 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T4 get_Item4() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T5 Item5 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T5 get_Item5() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T6 Item6 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: T6 get_Item6() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`6[T1,T2,T3,T4,T5,T6]: Void .ctor(T1, T2, T3, T4, T5, T6) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T4 Item4 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T4 get_Item4() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T5 Item5 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T5 get_Item5() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T6 Item6 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T6 get_Item6() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T7 Item7 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: T7 get_Item7() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`7[T1,T2,T3,T4,T5,T6,T7]: Void .ctor(T1, T2, T3, T4, T5, T6, T7) -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T1 Item1 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T1 get_Item1() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T2 Item2 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T2 get_Item2() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T3 Item3 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T3 get_Item3() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T4 Item4 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T4 get_Item4() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T5 Item5 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T5 get_Item5() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T6 Item6 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T6 get_Item6() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T7 Item7 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T7 get_Item7() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T8 Item8 -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: T8 get_Item8() -Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`8[T1,T2,T3,T4,T5,T6,T7,T8]: Void .ctor(T1, T2, T3, T4, T5, T6, T7, T8) -Microsoft.FSharp.Linq.RuntimeHelpers.Grouping`2[K,T]: Void .ctor(K, System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: Microsoft.FSharp.Quotations.FSharpExpr SubstHelperRaw(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar[], System.Object[]) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: Microsoft.FSharp.Quotations.FSharpExpr`1[T] SubstHelper[T](Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar[], System.Object[]) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.Linq.Expressions.Expression QuotationToExpression(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.Linq.Expressions.Expression`1[T] ImplicitExpressionConversionHelper[T](T) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.Linq.Expressions.Expression`1[T] QuotationToLambdaExpression[T](Microsoft.FSharp.Quotations.FSharpExpr`1[T]) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.Object EvaluateQuotation(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: T MemberInitializationHelper[T](T) -Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: T NewAnonymousObjectHelper[T](T) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr AddPointerInlined[T](IntPtr, Int32) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfNativeIntInlined[T](IntPtr) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfVoidPtrInlined[T](Void*) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr StackAllocate[T](Int32) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr ToNativeIntInlined[T](IntPtr) -Microsoft.FSharp.NativeInterop.NativePtrModule: T GetPointerInlined[T](IntPtr, Int32) -Microsoft.FSharp.NativeInterop.NativePtrModule: T ReadPointerInlined[T](IntPtr) -Microsoft.FSharp.NativeInterop.NativePtrModule: T& ToByRefInlined[T](IntPtr) -Microsoft.FSharp.NativeInterop.NativePtrModule: Void SetPointerInlined[T](IntPtr, Int32, T) -Microsoft.FSharp.NativeInterop.NativePtrModule: Void WritePointerInlined[T](IntPtr, T) -Microsoft.FSharp.NativeInterop.NativePtrModule: Void* ToVoidPtrInlined[T](IntPtr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Collections.FSharpList`1[System.Type],Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]]] SpecificCallPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.Unit] UnitPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] MethodWithReflectedDefinitionPattern(System.Reflection.MethodBase) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] PropertyGetterWithReflectedDefinitionPattern(System.Reflection.PropertyInfo) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] PropertySetterWithReflectedDefinitionPattern(System.Reflection.PropertyInfo) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Boolean] BoolPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Byte] BytePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Char] CharPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Decimal] DecimalPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Double] DoublePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int16] Int16Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int32] Int32Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Int64] Int64Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.SByte] SBytePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Single] SinglePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.String] StringPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpVar]],Microsoft.FSharp.Quotations.FSharpExpr]] LambdasPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]]] ApplicationsPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] AndAlsoPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] OrElsePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.UInt16] UInt16Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.UInt32] UInt32Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.UInt64] UInt64Pattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.ExprShapeModule: Microsoft.FSharp.Core.FSharpChoice`3[Microsoft.FSharp.Quotations.FSharpVar,System.Tuple`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr],System.Tuple`2[System.Object,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] ShapePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.ExprShapeModule: Microsoft.FSharp.Quotations.FSharpExpr RebuildShapeCombination(System.Object, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Boolean Equals(System.Object) -Microsoft.FSharp.Quotations.FSharpExpr: Int32 GetHashCode() -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr] CustomAttributes -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr] get_CustomAttributes() -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] TryGetReflectedDefinition(System.Reflection.MethodBase) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr AddressOf(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr AddressSet(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Application(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Applications(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Call(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.MethodInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Call(System.Reflection.MethodInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Coerce(Microsoft.FSharp.Quotations.FSharpExpr, System.Type) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr DefaultValue(System.Type) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Deserialize(System.Type, Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr], Byte[]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Deserialize40(System.Type, System.Type[], System.Type[], Microsoft.FSharp.Quotations.FSharpExpr[], Byte[]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr FieldGet(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.FieldInfo) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr FieldGet(System.Reflection.FieldInfo) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr FieldSet(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.FieldInfo, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr FieldSet(System.Reflection.FieldInfo, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr ForIntegerRangeLoop(Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr IfThenElse(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Lambda(Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Let(Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr LetRecursive(Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewArray(System.Type, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewDelegate(System.Type, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpVar], Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewObject(System.Reflection.ConstructorInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewRecord(System.Type, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewStructTuple(System.Reflection.Assembly, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewTuple(Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr NewUnionCase(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr PropertyGet(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.PropertyInfo, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr PropertyGet(System.Reflection.PropertyInfo, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr PropertySet(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.PropertyInfo, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr PropertySet(System.Reflection.PropertyInfo, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Quote(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr QuoteRaw(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr QuoteTyped(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Sequential(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Substitute(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr TryFinally(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr TryWith(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr TupleGet(Microsoft.FSharp.Quotations.FSharpExpr, Int32) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr TypeTest(Microsoft.FSharp.Quotations.FSharpExpr, System.Type) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr UnionCaseTest(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Reflection.UnionCaseInfo) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Value(System.Object, System.Type) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr ValueWithName(System.Object, System.Type, System.String) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr ValueWithName[T](T, System.String) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Value[T](T) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr Var(Microsoft.FSharp.Quotations.FSharpVar) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr VarSet(Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr WhileLoop(Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr WithValue(System.Object, System.Type, Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr`1[T] Cast[T](Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr`1[T] GlobalVar[T](System.String) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr`1[T] WithValue[T](T, Microsoft.FSharp.Quotations.FSharpExpr`1[T]) -Microsoft.FSharp.Quotations.FSharpExpr: System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Quotations.FSharpVar] GetFreeVars() -Microsoft.FSharp.Quotations.FSharpExpr: System.String ToString() -Microsoft.FSharp.Quotations.FSharpExpr: System.String ToString(Boolean) -Microsoft.FSharp.Quotations.FSharpExpr: System.Type Type -Microsoft.FSharp.Quotations.FSharpExpr: System.Type get_Type() -Microsoft.FSharp.Quotations.FSharpExpr: Void RegisterReflectedDefinitions(System.Reflection.Assembly, System.String, Byte[]) -Microsoft.FSharp.Quotations.FSharpExpr: Void RegisterReflectedDefinitions(System.Reflection.Assembly, System.String, Byte[], System.Type[]) -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Boolean Equals(System.Object) -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Int32 GetHashCode() -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr] CustomAttributes -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr] get_CustomAttributes() -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Microsoft.FSharp.Quotations.FSharpExpr Raw -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Microsoft.FSharp.Quotations.FSharpExpr Substitute(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr]]) -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: Microsoft.FSharp.Quotations.FSharpExpr get_Raw() -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Quotations.FSharpVar] GetFreeVars() -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: System.String ToString() -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: System.String ToString(Boolean) -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: System.Type Type -Microsoft.FSharp.Quotations.FSharpExpr`1[T]: System.Type get_Type() -Microsoft.FSharp.Quotations.FSharpVar: Boolean Equals(System.Object) -Microsoft.FSharp.Quotations.FSharpVar: Boolean IsMutable -Microsoft.FSharp.Quotations.FSharpVar: Boolean get_IsMutable() -Microsoft.FSharp.Quotations.FSharpVar: Int32 GetHashCode() -Microsoft.FSharp.Quotations.FSharpVar: Microsoft.FSharp.Quotations.FSharpVar Global(System.String, System.Type) -Microsoft.FSharp.Quotations.FSharpVar: System.String Name -Microsoft.FSharp.Quotations.FSharpVar: System.String ToString() -Microsoft.FSharp.Quotations.FSharpVar: System.String get_Name() -Microsoft.FSharp.Quotations.FSharpVar: System.Type Type -Microsoft.FSharp.Quotations.FSharpVar: System.Type get_Type() -Microsoft.FSharp.Quotations.FSharpVar: Void .ctor(System.String, System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]] NewStructTuplePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]] NewTuplePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] AddressOfPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] QuotePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] QuoteRawPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr] QuoteTypedPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpVar] VarPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr]],Microsoft.FSharp.Quotations.FSharpExpr]] LetRecursivePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.FieldInfo]] FieldGetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] AddressSetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] ApplicationPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] SequentialPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] TryFinallyPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] WhileLoopPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Reflection.UnionCaseInfo]] UnionCaseTestPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,System.Int32]] TupleGetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,System.Type]] CoercePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpExpr,System.Type]] TypeTestPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr]] LambdaPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr]] VarSetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[Microsoft.FSharp.Reflection.UnionCaseInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] NewUnionCasePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.Object,System.Type]] ValuePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.Reflection.ConstructorInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] NewObjectPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.Type,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] NewArrayPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.Type,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] NewRecordPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.FieldInfo,Microsoft.FSharp.Quotations.FSharpExpr]] FieldSetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.MethodInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] CallPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.PropertyInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] PropertyGetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] IfThenElsePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] LetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.Type,Microsoft.FSharp.Quotations.FSharpExpr]] WithValuePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.Type,System.String]] ValueWithNamePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Type,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpVar],Microsoft.FSharp.Quotations.FSharpExpr]] NewDelegatePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`4[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.PropertyInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Quotations.FSharpExpr]] PropertySetPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`4[Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpExpr]] ForIntegerRangeLoopPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`5[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr]] TryWithPattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Type] DefaultValuePattern(Microsoft.FSharp.Quotations.FSharpExpr) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Boolean FSharpType.IsExceptionRepresentation.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Boolean FSharpType.IsRecord.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Boolean FSharpType.IsUnion.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Int32] FSharpValue.PreComputeUnionTagReader.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object[]] FSharpValue.PreComputeRecordReader.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object[]] FSharpValue.PreComputeUnionReader.Static(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Core.FSharpFunc`2[System.Object[],System.Object] FSharpValue.PreComputeRecordConstructor.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Core.FSharpFunc`2[System.Object[],System.Object] FSharpValue.PreComputeUnionConstructor.Static(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: Microsoft.FSharp.Reflection.UnionCaseInfo[] FSharpType.GetUnionCases.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Object FSharpValue.MakeRecord.Static(System.Type, System.Object[], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Object FSharpValue.MakeUnion.Static(Microsoft.FSharp.Reflection.UnionCaseInfo, System.Object[], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Object[] FSharpValue.GetExceptionFields.Static(System.Object, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Object[] FSharpValue.GetRecordFields.Static(System.Object, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Reflection.ConstructorInfo FSharpValue.PreComputeRecordConstructorInfo.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Reflection.MemberInfo FSharpValue.PreComputeUnionTagMemberInfo.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Reflection.MethodInfo FSharpValue.PreComputeUnionConstructorInfo.Static(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Reflection.PropertyInfo[] FSharpType.GetExceptionFields.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Reflection.PropertyInfo[] FSharpType.GetRecordFields.Static(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpReflectionExtensions: System.Tuple`2[Microsoft.FSharp.Reflection.UnionCaseInfo,System.Object[]] FSharpValue.GetUnionFields.Static(System.Object, System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsExceptionRepresentation(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsFunction(System.Type) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsModule(System.Type) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsRecord(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsTuple(System.Type) -Microsoft.FSharp.Reflection.FSharpType: Boolean IsUnion(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: Microsoft.FSharp.Reflection.UnionCaseInfo[] GetUnionCases(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: System.Reflection.PropertyInfo[] GetExceptionFields(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: System.Reflection.PropertyInfo[] GetRecordFields(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpType: System.Tuple`2[System.Type,System.Type] GetFunctionElements(System.Type) -Microsoft.FSharp.Reflection.FSharpType: System.Type MakeFunctionType(System.Type, System.Type) -Microsoft.FSharp.Reflection.FSharpType: System.Type MakeStructTupleType(System.Reflection.Assembly, System.Type[]) -Microsoft.FSharp.Reflection.FSharpType: System.Type MakeTupleType(System.Reflection.Assembly, System.Type[]) -Microsoft.FSharp.Reflection.FSharpType: System.Type MakeTupleType(System.Type[]) -Microsoft.FSharp.Reflection.FSharpType: System.Type[] GetTupleElements(System.Type) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Int32] PreComputeUnionTagReader(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object[]] PreComputeRecordReader(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object[]] PreComputeTupleReader(System.Type) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object[]] PreComputeUnionReader(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object] PreComputeRecordFieldReader(System.Reflection.PropertyInfo) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object[],System.Object] PreComputeRecordConstructor(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object[],System.Object] PreComputeTupleConstructor(System.Type) -Microsoft.FSharp.Reflection.FSharpValue: Microsoft.FSharp.Core.FSharpFunc`2[System.Object[],System.Object] PreComputeUnionConstructor(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object GetRecordField(System.Object, System.Reflection.PropertyInfo) -Microsoft.FSharp.Reflection.FSharpValue: System.Object GetTupleField(System.Object, Int32) -Microsoft.FSharp.Reflection.FSharpValue: System.Object MakeFunction(System.Type, Microsoft.FSharp.Core.FSharpFunc`2[System.Object,System.Object]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object MakeRecord(System.Type, System.Object[], Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object MakeTuple(System.Object[], System.Type) -Microsoft.FSharp.Reflection.FSharpValue: System.Object MakeUnion(Microsoft.FSharp.Reflection.UnionCaseInfo, System.Object[], Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object[] GetExceptionFields(System.Object, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object[] GetRecordFields(System.Object, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Object[] GetTupleFields(System.Object) -Microsoft.FSharp.Reflection.FSharpValue: System.Reflection.ConstructorInfo PreComputeRecordConstructorInfo(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Reflection.MemberInfo PreComputeUnionTagMemberInfo(System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Reflection.MethodInfo PreComputeUnionConstructorInfo(Microsoft.FSharp.Reflection.UnionCaseInfo, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Tuple`2[Microsoft.FSharp.Reflection.UnionCaseInfo,System.Object[]] GetUnionFields(System.Object, System.Type, Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.BindingFlags]) -Microsoft.FSharp.Reflection.FSharpValue: System.Tuple`2[System.Reflection.ConstructorInfo,Microsoft.FSharp.Core.FSharpOption`1[System.Type]] PreComputeTupleConstructorInfo(System.Type) -Microsoft.FSharp.Reflection.FSharpValue: System.Tuple`2[System.Reflection.PropertyInfo,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.Type,System.Int32]]] PreComputeTuplePropertyInfo(System.Type, Int32) -Microsoft.FSharp.Reflection.UnionCaseInfo: Boolean Equals(System.Object) -Microsoft.FSharp.Reflection.UnionCaseInfo: Int32 GetHashCode() -Microsoft.FSharp.Reflection.UnionCaseInfo: Int32 Tag -Microsoft.FSharp.Reflection.UnionCaseInfo: Int32 get_Tag() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Collections.Generic.IList`1[System.Reflection.CustomAttributeData] GetCustomAttributesData() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Object[] GetCustomAttributes() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Object[] GetCustomAttributes(System.Type) -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Reflection.PropertyInfo[] GetFields() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.String Name -Microsoft.FSharp.Reflection.UnionCaseInfo: System.String ToString() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.String get_Name() -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Type DeclaringType -Microsoft.FSharp.Reflection.UnionCaseInfo: System.Type get_DeclaringType() -Microsoft.FSharp.Collections.ArrayModule: T Average$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T[]) -Microsoft.FSharp.Collections.ArrayModule: T Sum$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult AverageBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule: TResult SumBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ComparisonIdentity: System.Collections.Generic.IComparer`1[T] NonStructural$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]]) -Microsoft.FSharp.Collections.HashIdentity: System.Collections.Generic.IEqualityComparer`1[T] NonStructural$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]]) -Microsoft.FSharp.Collections.ListModule: T Average$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: T Sum$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TResult AverageBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.ListModule: TResult SumBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Collections.FSharpList`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Average$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: T Sum$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TResult AverageBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Collections.SeqModule: TResult SumBy$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[TResult,TResult]], Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], System.Collections.Generic.IEnumerable`1[T]) -Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked: Byte ToByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], T) -Microsoft.FSharp.Core.ExtraTopLevelOperators+Checked: SByte ToSByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Byte ToByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Double ToDouble$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Double], T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: SByte ToSByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], T) -Microsoft.FSharp.Core.ExtraTopLevelOperators: Single ToSingle$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Single], T) -Microsoft.FSharp.Core.LanguagePrimitives: T DivideByInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], T, Int32) -Microsoft.FSharp.Core.LanguagePrimitives: T GenericOne$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) -Microsoft.FSharp.Core.LanguagePrimitives: T GenericZero$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) -Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedSubtractionDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedUnaryNegationDynamic[T,TResult](T) -Microsoft.FSharp.Core.LanguagePrimitives: TResult DivisionDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult ModulusDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseAndDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult ExclusiveOrDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseOrDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult EqualityDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult ExplicitDynamic[T,TResult](T) -Microsoft.FSharp.Core.LanguagePrimitives: TResult GreaterThanDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult GreaterThanOrEqualDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult InequalityDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult LeftShiftDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult LessThanDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult LessThanOrEqualDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult LogicalNotDynamic[T,TResult](T) -Microsoft.FSharp.Core.LanguagePrimitives: TResult RightShiftDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult SubtractionDynamic[T1,T2,TResult](T1, T2) -Microsoft.FSharp.Core.LanguagePrimitives: TResult UnaryNegationDynamic[T,TResult](T) -Microsoft.FSharp.Core.Operators+Checked: Byte ToByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], T) -Microsoft.FSharp.Core.Operators+Checked: Char ToChar$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Char], T) -Microsoft.FSharp.Core.Operators+Checked: Int16 ToInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int16], T) -Microsoft.FSharp.Core.Operators+Checked: Int32 ToInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], T) -Microsoft.FSharp.Core.Operators+Checked: Int32 ToInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], T) -Microsoft.FSharp.Core.Operators+Checked: Int64 ToInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int64], T) -Microsoft.FSharp.Core.Operators+Checked: IntPtr ToIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.IntPtr], T) -Microsoft.FSharp.Core.Operators+Checked: SByte ToSByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], T) -Microsoft.FSharp.Core.Operators+Checked: T op_UnaryNegation$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Addition$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Multiply$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators+Checked: T3 op_Subtraction$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators+Checked: UInt16 ToUInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt16], T) -Microsoft.FSharp.Core.Operators+Checked: UInt32 ToUInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt32], T) -Microsoft.FSharp.Core.Operators+Checked: UInt64 ToUInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt64], T) -Microsoft.FSharp.Core.Operators+Checked: UIntPtr ToUIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UIntPtr], T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_Equality$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_GreaterThanOrEqual$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_GreaterThan$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_Inequality$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_LessThanOrEqual$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Boolean op_LessThan$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,System.Boolean]], T, TResult) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: Int32 Compare$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: T Max$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], T, T) -Microsoft.FSharp.Core.Operators+NonStructuralComparison: T Min$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean]], T, T) -Microsoft.FSharp.Core.Operators: Byte ToByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], T) -Microsoft.FSharp.Core.Operators: Char ToChar$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Char], T) -Microsoft.FSharp.Core.Operators: Double ToDouble$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Double], T) -Microsoft.FSharp.Core.Operators: Int16 ToInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int16], T) -Microsoft.FSharp.Core.Operators: Int32 Sign$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], T) -Microsoft.FSharp.Core.Operators: Int32 ToInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], T) -Microsoft.FSharp.Core.Operators: Int32 ToInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], T) -Microsoft.FSharp.Core.Operators: Int64 ToInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int64], T) -Microsoft.FSharp.Core.Operators: IntPtr ToIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.IntPtr], T) -Microsoft.FSharp.Core.Operators: SByte ToSByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], T) -Microsoft.FSharp.Core.Operators: Single ToSingle$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Single], T) -Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_RangeStep$W[T,TStep](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TStep], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TStep,T]], T, TStep, T) -Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_Range$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, T) -Microsoft.FSharp.Core.Operators: System.Decimal ToDecimal$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Decimal], T) -Microsoft.FSharp.Core.Operators: T Abs$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Acos$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Asin$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Atan$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Ceiling$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Cos$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Cosh$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Exp$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Floor$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Log10$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Log$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T PowInteger$W[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, Int32) -Microsoft.FSharp.Core.Operators: T Round$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Sin$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Sinh$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Tan$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Tanh$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T Truncate$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T op_BitwiseAnd$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, T) -Microsoft.FSharp.Core.Operators: T op_BitwiseOr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, T) -Microsoft.FSharp.Core.Operators: T op_ExclusiveOr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,T]], T, T) -Microsoft.FSharp.Core.Operators: T op_Exponentiation$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,T]], T, TResult) -Microsoft.FSharp.Core.Operators: T op_LeftShift$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], T, Int32) -Microsoft.FSharp.Core.Operators: T op_LogicalNot$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T op_RightShift$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]], T, Int32) -Microsoft.FSharp.Core.Operators: T op_UnaryNegation$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T op_UnaryPlus$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,T], T) -Microsoft.FSharp.Core.Operators: T2 Atan2$W[T1,T2](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T1,T2]], T1, T1) -Microsoft.FSharp.Core.Operators: T3 op_Addition$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Division$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Modulus$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Multiply$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators: T3 op_Subtraction$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, T2) -Microsoft.FSharp.Core.Operators: TResult Sqrt$W[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T) -Microsoft.FSharp.Core.Operators: UInt32 ToUInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt32], T) -Microsoft.FSharp.Core.Operators: UInt16 ToUInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt16], T) -Microsoft.FSharp.Core.Operators: UInt32 ToUInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt32], T) -Microsoft.FSharp.Core.Operators: UInt64 ToUInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt64], T) -Microsoft.FSharp.Core.Operators: UIntPtr ToUIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UIntPtr], T) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Byte] ToByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Byte] ToUInt8$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Byte], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Char] ToChar$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Char], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Decimal] ToDecimal$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Decimal], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Double] ToDouble$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Double], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Double] ToFloat$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Double], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int16] ToInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int16], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int32] ToInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int32] ToInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Int64] ToInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int64], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.IntPtr] ToIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.IntPtr], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.SByte] ToInt8$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.SByte] ToSByte$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.SByte], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Single] ToFloat32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Single], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.Single] ToSingle$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Single], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt16] ToUInt16$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt16], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt32] ToUInt32$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt32], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt32] ToUInt$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt32], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UInt64] ToUInt64$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UInt64], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableModule: System.Nullable`1[System.UIntPtr] ToUIntPtr$W[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.UIntPtr], System.Nullable`1[T]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_DivideQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_MinusQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_MultiplyQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_PercentQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_PlusQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], T1, System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkDivideQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkDivide$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMinusQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMinus$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMultiplyQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkMultiply$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPercentQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPercent$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPlusQmark$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], System.Nullable`1[T2]) -Microsoft.FSharp.Linq.NullableOperators: System.Nullable`1[T3] op_QmarkPlus$W[T1,T2,T3](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,T3]], System.Nullable`1[T1], T2) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] AverageByNullable$W[T,Q,TValue](Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,TValue]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TValue], Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[TValue,TValue]], Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: System.Nullable`1[TValue] SumByNullable$W[T,Q,TValue](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TValue], Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[TValue,TValue]], Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,System.Nullable`1[TValue]]) -Microsoft.FSharp.Linq.QueryBuilder: TValue AverageBy$W[T,Q,TValue](Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,TValue]], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TValue], Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[TValue,TValue]], Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Linq.QueryBuilder: TValue SumBy$W[T,Q,TValue](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TValue], Microsoft.FSharp.Core.FSharpFunc`2[TValue,Microsoft.FSharp.Core.FSharpFunc`2[TValue,TValue]], Microsoft.FSharp.Linq.QuerySource`2[T,Q], Microsoft.FSharp.Core.FSharpFunc`2[T,TValue]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr CallWithWitnesses(Microsoft.FSharp.Quotations.FSharpExpr, System.Reflection.MethodInfo, System.Reflection.MethodInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.FSharpExpr: Microsoft.FSharp.Quotations.FSharpExpr CallWithWitnesses(System.Reflection.MethodInfo, System.Reflection.MethodInfo, Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]) -Microsoft.FSharp.Quotations.PatternsModule: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`5[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],System.Reflection.MethodInfo,System.Reflection.MethodInfo,Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]] CallWithWitnessesPattern(Microsoft.FSharp.Quotations.FSharpExpr) -" -#if DEBUG - let expected = - expected + - @"Microsoft.FSharp.Core.Operators: System.RuntimeMethodHandle MethodHandleOf[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult])" -#endif -#if CROSS_PLATFORM_COMPILER - () - // disabled because of slight order and GetMember discrepencies -#else - SurfaceArea.verify expected "net40" (System.IO.Path.Combine(__SOURCE_DIRECTORY__,__SOURCE_FILE__)) -#endif From 2acbce35be370d0d3275993c1f38edaab3633ab3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 8 Dec 2020 20:00:16 +0000 Subject: [PATCH 55/82] Delete FSharp.Compiler.Service.fsproj --- .../FSharp.Compiler.Service.fsproj | 744 ------------------ 1 file changed, 744 deletions(-) delete mode 100644 fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj deleted file mode 100644 index 647a2fe909b..00000000000 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - $(FcsTargetNetFxFramework);netstandard2.0 - true - $(DefineConstants);COMPILER_SERVICE_AS_DLL - $(DefineConstants);COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - $(DefineConstants);NO_STRONG_NAMES - $(DefineConstants);LOCALIZATION_FSCOMP - $(TargetFramework)\ - $(TargetFramework)\ - $(OtherFlags) /warnon:1182 - $(OtherFlags) --times - $(NoWarn);44;62;69;65;54;61;75;62;9;2003;NU5125 - true - true - true - embedded - - - The F# compiler as library. For editors, for tools, for scripting. For you. - The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications. - false - Microsoft Corporation; F# community contributors - MIT - https://github.com/fsharp/FSharp.Compiler.Service - logo.png - F#, fsharp, interactive, compiler, editor - true - true - - - $(DefineConstants);FX_NO_PDB_READER - $(DefineConstants);FX_NO_PDB_WRITER - $(DefineConstants);FX_NO_SYMBOLSTORE - $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_WIN_REGISTRY - $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION - $(DefineConstants);FX_RESHAPED_REFEMIT - - - - - AssemblyInfo/AssemblyInfo.fs - - - FSComp.txt - - - DependencyManager.txt - - - FSIstrings.txt - - - FSStrings.resx - FSStrings.resources - - - --module FSharp.Compiler.AbstractIL.Internal.AsciiParser --open FSharp.Compiler.AbstractIL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ilpars.fsy - - - --module FSharp.Compiler.Parser --open FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - pars.fsy - - - Logger.fsi - - - Logger.fs - - - ErrorText/sformat.fsi - - - ErrorText/sformat.fs - - - ErrorText/sr.fsi - - - ErrorText/sr.fs - - - Driver\LanguageFeatures.fsi - - - Driver\LanguageFeatures.fs - - - LexYaccRuntime/prim-lexing.fsi - - - LexYaccRuntime/prim-lexing.fs - - - LexYaccRuntime/prim-parsing.fsi - - - LexYaccRuntime/prim-parsing.fs - - - Utilities/PathMap.fsi - - - Utilities/PathMap.fs - - - Utilities/ResizeArray.fsi - - - Utilities/ResizeArray.fs - - - Utilities/HashMultiMap.fsi - - - Utilities/HashMultiMap.fs - - - Utilities/EditDistance.fs - - - Utilities/TaggedCollections.fsi - - - Utilities/TaggedCollections.fs - - - Utilities/QueueList.fs - - - Utilities/ildiag.fsi - - - Utilities/ildiag.fs - - - Utilities/illib.fs - - - Utilities/filename.fsi - - - Utilities/filename.fs - - - Utilities/zmap.fsi - - - Utilities/zmap.fs - - - Utilities/zset.fsi - - - Utilities/zset.fs - - - Utilities/bytes.fsi - - - Utilities/bytes.fs - - - Utilities\XmlAdapters.fs - - - Utilities/lib.fs - - - Utilities/InternalCollections.fsi - - - Utilities/InternalCollections.fs - - - Utilities/rational.fsi - - - Utilities/rational.fs - - - ErrorLogging/range.fsi - - - ErrorLogging/range.fs - - - ErrorLogging/ErrorLogger.fs - - - ErrorLogging/ErrorResolutionHints.fs - - - --unicode --lexlib Internal.Utilities.Text.Lexing - AbsIL/illex.fsl - - - AbsIL/il.fsi - - - AbsIL/il.fs - - - AbsIL/ilx.fsi - - - AbsIL/ilx.fs - - - AbsIL/ilascii.fsi - - - AbsIL/ilascii.fs - - - AbsIL/ilprint.fsi - - - AbsIL/ilprint.fs - - - AbsIL/ilmorph.fsi - - - AbsIL/ilmorph.fs - - - - - AbsIL/ilsign.fs - - - - - AbsIL/ilnativeres.fsi - - - AbsIL/ilnativeres.fs - - - AbsIL/ilsupp.fsi - - - AbsIL/ilsupp.fs - - - AbsIL/ilpars.fs - - - AbsIL/illex.fs - - - AbsIL/ilbinary.fsi - - - AbsIL/ilbinary.fs - - - AbsIL/ilread.fsi - - - AbsIL/ilread.fs - - - AbsIL/ilwritepdb.fsi - - - AbsIL/ilwritepdb.fs - - - AbsIL/ilwrite.fsi - - - AbsIL/ilwrite.fs - - - AbsIL/ilreflect.fs - - - ReferenceResolution/reshapedmsbuild.fs - - - ReferenceResolution/ReferenceResolver.fs - - - ReferenceResolution/SimulatedMSBuildReferenceResolver.fs - - - CompilerLocation/CompilerLocationUtils.fs - - - PrettyNaming/PrettyNaming.fs - - - ILXErase/ilxsettings.fs - - - ILXErase/EraseClosures.fsi - - - ILXErase/EraseClosures.fs - - - ILXErase/EraseUnions.fsi - - - ILXErase/EraseUnions.fs - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/lex.fsl - - - --unicode --lexlib Internal.Utilities.Text.Lexing - ParserAndUntypedAST/pplex.fsl - - - --module FSharp.Compiler.PPParser --open FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ParserAndUntypedAST/pppars.fsy - - - ParserAndUntypedAST/UnicodeLexing.fsi - - - ParserAndUntypedAST/UnicodeLexing.fs - - - ParserAndUntypedAST/layout.fsi - - - ParserAndUntypedAST/layout.fs - - - ParserAndUntypedAST/XmlDoc.fs - - - ParserAndUntypedAST/SyntaxTree.fs - - - ParserAndUntypedAST/SyntaxTreeOps.fs - - - ParserAndUntypedAST/ParseHelpers.fs - - - ParserAndUntypedAST/pppars.fs - - - ParserAndUntypedAST/pars.fs - - - ParserAndUntypedAST/lexhelp.fsi - - - ParserAndUntypedAST/lexhelp.fs - - - ParserAndUntypedAST/pplex.fs - - - ParserAndUntypedAST/lex.fs - - - ParserAndUntypedAST/LexFilter.fs - - - TypedTree/tainted.fsi - - - TypedTree/tainted.fs - - - TypedTree/ExtensionTyping.fsi - - - TypedTree/ExtensionTyping.fs - - - TypedTree/QuotationPickler.fsi - - - TypedTree/QuotationPickler.fs - - - TypedTree/CompilerGlobalState.fs - - - TypedTree/TypedTree.fs - - - TypedTree/TypedTreeBasics.fs - - - TypedTree/TcGlobals.fs - - - TypedTree/TypedTreeOps.fsi - - - TypedTree/TypedTreeOps.fs - - - TypedTree/TypedTreePickle.fsi - - - TypedTree/TypedTreePickle.fs - - - Logic/import.fsi - - - Logic/import.fs - - - Logic/infos.fs - - - Logic/AccessibilityLogic.fs - - - Logic/AttributeChecking.fs - - - Logic/TypeRelations.fs - - - Logic/InfoReader.fs - - - Logic/NicePrint.fs - - - Logic/AugmentWithHashCompare.fsi - - - Logic/AugmentWithHashCompare.fs - - - Logic/NameResolution.fsi - - - Logic/NameResolution.fs - - - Logic/SignatureConformance.fs - - - Logic/MethodOverrides.fs - - - Logic/MethodCalls.fs - - - Logic/PatternMatchCompilation.fsi - - - Logic/PatternMatchCompilation.fs - - - Logic/FindUnsolved.fsi - - - Logic/FindUnsolved.fs - - - Logic/ConstraintSolver.fsi - - - Logic/ConstraintSolver.fs - - - Logic/CheckFormatStrings.fsi - - - Logic/CheckFormatStrings.fs - - - Logic/QuotationTranslator.fsi - - - Logic/QuotationTranslator.fs - - - Logic/PostInferenceChecks.fsi - - - Logic/PostInferenceChecks.fs - - - Logic/TypeChecker.fsi - - - Logic/TypeChecker.fs - - - Optimize/Optimizer.fsi - - - Optimize/Optimizer.fs - - - Optimize/DetupleArgs.fsi - - - Optimize/DetupleArgs.fs - - - Optimize/InnerLambdasToTopLevelFuncs.fsi - - - Optimize/InnerLambdasToTopLevelFuncs.fs - - - Optimize/LowerCallsAndSeqs.fsi - - - Optimize/LowerCallsAndSeqs.fs - - - Optimize/autobox.fsi - - - Optimize/autobox.fs - - - CodeGen/IlxGen.fsi - - - CodeGen/IlxGen.fs - - - Driver\DotNetFrameworkDependencies.fs - - - Driver\AssemblyResolveHandler.fsi - - - Driver\AssemblyResolveHandler.fs - - - Driver\NativeDllResolveHandler.fsi - - - Driver\NativeDllResolveHandler.fs - - - Driver/DependencyProvider.fsi - - - Driver/DependencyProvider.fs - - - Driver/CompileOps.fsi - - - Driver/CompileOps.fs - - - Driver/CompileOptions.fsi - - - Driver/CompileOptions.fs - - - Driver/fsc.fsi - - - Driver/fsc.fs - - - Symbols/SymbolHelpers.fsi - - - Symbols/SymbolHelpers.fs - - - Symbols/Symbols.fsi - - - Symbols/Symbols.fs - - - Symbols/Exprs.fsi - - - Symbols/Exprs.fs - - - Symbols/SymbolPatterns.fsi - - - Symbols/SymbolPatterns.fs - - - Service/Reactor.fsi - - - Service/Reactor.fs - - - Service/SemanticClassification.fsi - - - Service/SemanticClassification.fs - - - Service/ItemKey.fsi - - - Service/ItemKey.fs - - - Service/IncrementalBuild.fsi - - - Service/IncrementalBuild.fs - - - Service/ServiceConstants.fs - - - Service/ServiceLexing.fsi - - - Service/ServiceLexing.fs - - - Service/ServiceParseTreeWalk.fs - - - Service/ServiceNavigation.fsi - - - Service/ServiceNavigation.fs - - - Service/ServiceParamInfoLocations.fsi - - - Service/ServiceParamInfoLocations.fs - - - Service/ServiceUntypedParse.fsi - - - Service/ServiceUntypedParse.fs - - - Service/ServiceDeclarationLists.fsi - - - Service/ServiceDeclarationLists.fs - - - Service/ServiceAssemblyContent.fsi - - - Service/ServiceAssemblyContent.fs - - - Service/ServiceXmlDocParser.fsi - - - Service/ServiceXmlDocParser.fs - - - Service/ExternalSymbol.fsi - - - Service/ExternalSymbol.fs - - - Service/QuickParse.fsi - - - Service/QuickParse.fs - - - Service/FSharpCheckerResults.fsi - - - Service/FSharpCheckerResults.fs - - - Service/service.fsi - - - Service/service.fs - - - Service/ServiceInterfaceStubGenerator.fsi - - - Service/ServiceInterfaceStubGenerator.fs - - - Service/ServiceStructure.fsi - - - Service/ServiceStructure.fs - - - Service/ServiceAnalysis.fsi - - - Service/ServiceAnalysis.fs - - - Service/fsi.fsi - - - Service/fsi.fs - - - - - - - - - - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - - From 16ce5c50883f2595151e80d5bcc73148c05720ab Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 8 Dec 2020 20:02:04 +0000 Subject: [PATCH 56/82] Delete CompileOps.fs --- src/fsharp/CompileOps.fs | 5860 -------------------------------------- 1 file changed, 5860 deletions(-) delete mode 100644 src/fsharp/CompileOps.fs diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs deleted file mode 100644 index 837792e50f4..00000000000 --- a/src/fsharp/CompileOps.fs +++ /dev/null @@ -1,5860 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -/// Coordinating compiler operations - configuration, loading initial context, reporting errors etc. -module internal FSharp.Compiler.CompileOps - -open System -open System.Collections.Concurrent -open System.Collections.Generic -open System.Diagnostics -open System.IO -open System.Text - -open Internal.Utilities -open Internal.Utilities.Collections -open Internal.Utilities.Filename -open Internal.Utilities.Text - -open FSharp.Compiler -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.AbstractIL.ILPdbWriter -open FSharp.Compiler.AbstractIL.Internal -open FSharp.Compiler.AbstractIL.Internal.Library -open FSharp.Compiler.AbstractIL.Internal.Utils -open FSharp.Compiler.AbstractIL.Extensions.ILX -open FSharp.Compiler.AbstractIL.Diagnostics -open FSharp.Compiler.AttributeChecking -open FSharp.Compiler.CompilerGlobalState -open FSharp.Compiler.ConstraintSolver -open FSharp.Compiler.DiagnosticMessage -open FSharp.Compiler.DotNetFrameworkDependencies -open FSharp.Compiler.ErrorLogger -open FSharp.Compiler.Features -open FSharp.Compiler.Import -open FSharp.Compiler.Infos -open FSharp.Compiler.Lexhelp -open FSharp.Compiler.Lib -open FSharp.Compiler.MethodCalls -open FSharp.Compiler.MethodOverrides -open FSharp.Compiler.NameResolution -open FSharp.Compiler.ParseHelpers -open FSharp.Compiler.PrettyNaming -open FSharp.Compiler.SyntaxTree -open FSharp.Compiler.SyntaxTreeOps -open FSharp.Compiler.Range -open FSharp.Compiler.ReferenceResolver -open FSharp.Compiler.SignatureConformance -open FSharp.Compiler.TypedTreePickle -open FSharp.Compiler.TypeChecker -open FSharp.Compiler.TypedTree -open FSharp.Compiler.TypedTreeBasics -open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.TcGlobals -open FSharp.Compiler.Text -open FSharp.Compiler.XmlDoc - -open Microsoft.DotNet.DependencyManager - -#if !NO_EXTENSIONTYPING -open FSharp.Compiler.ExtensionTyping -open Microsoft.FSharp.Core.CompilerServices -#endif - -#if DEBUG -[] -module internal CompilerService = - let showAssertForUnexpectedException = ref true -#endif // DEBUG - -//---------------------------------------------------------------------------- -// Some Globals -//-------------------------------------------------------------------------- - -let FSharpSigFileSuffixes = [".mli";".fsi"] -let mlCompatSuffixes = [".mli";".ml"] -let FSharpImplFileSuffixes = [".ml";".fs";".fsscript";".fsx"] -let resSuffixes = [".resx"] -let FSharpScriptFileSuffixes = [".fsscript";".fsx"] -let doNotRequireNamespaceOrModuleSuffixes = [".mli";".ml"] @ FSharpScriptFileSuffixes -let FSharpLightSyntaxFileSuffixes: string list = [ ".fs";".fsscript";".fsx";".fsi" ] - -//---------------------------------------------------------------------------- -// ERROR REPORTING -//-------------------------------------------------------------------------- - -exception HashIncludeNotAllowedInNonScript of range -exception HashReferenceNotAllowedInNonScript of range -exception HashDirectiveNotAllowedInNonScript of range -exception FileNameNotResolved of (*filename*) string * (*description of searched locations*) string * range -exception AssemblyNotResolved of (*originalName*) string * range -exception LoadedSourceNotFoundIgnoring of (*filename*) string * range -exception MSBuildReferenceResolutionWarning of (*MSBuild warning code*)string * (*Message*)string * range -exception MSBuildReferenceResolutionError of (*MSBuild warning code*)string * (*Message*)string * range -exception DeprecatedCommandLineOptionFull of string * range -exception DeprecatedCommandLineOptionForHtmlDoc of string * range -exception DeprecatedCommandLineOptionSuggestAlternative of string * string * range -exception DeprecatedCommandLineOptionNoDescription of string * range -exception InternalCommandLineOption of string * range -exception HashLoadedSourceHasIssues of (*warnings*) exn list * (*errors*) exn list * range -exception HashLoadedScriptConsideredSource of range - - -let GetRangeOfDiagnostic(err: PhasedDiagnostic) = - let rec RangeFromException = function - | ErrorFromAddingConstraint(_, err2, _) -> RangeFromException err2 -#if !NO_EXTENSIONTYPING - | ExtensionTyping.ProvidedTypeResolutionNoRange e -> RangeFromException e - | ExtensionTyping.ProvidedTypeResolution(m, _) -#endif - | ReservedKeyword(_, m) - | IndentationProblem(_, m) - | ErrorFromAddingTypeEquation(_, _, _, _, _, m) - | ErrorFromApplyingDefault(_, _, _, _, _, m) - | ErrorsFromAddingSubsumptionConstraint(_, _, _, _, _, _, m) - | FunctionExpected(_, _, m) - | BakedInMemberConstraintName(_, m) - | StandardOperatorRedefinitionWarning(_, m) - | BadEventTransformation m - | ParameterlessStructCtor m - | FieldNotMutable (_, _, m) - | Recursion (_, _, _, _, m) - | InvalidRuntimeCoercion(_, _, _, m) - | IndeterminateRuntimeCoercion(_, _, _, m) - | IndeterminateStaticCoercion (_, _, _, m) - | StaticCoercionShouldUseBox (_, _, _, m) - | CoercionTargetSealed(_, _, m) - | UpcastUnnecessary m - | QuotationTranslator.IgnoringPartOfQuotedTermWarning (_, m) - - | TypeTestUnnecessary m - | RuntimeCoercionSourceSealed(_, _, m) - | OverrideDoesntOverride(_, _, _, _, _, m) - | UnionPatternsBindDifferentNames m - | UnionCaseWrongArguments (_, _, _, m) - | TypeIsImplicitlyAbstract m - | RequiredButNotSpecified (_, _, _, _, m) - | FunctionValueUnexpected (_, _, m) - | UnitTypeExpected (_, _, m) - | UnitTypeExpectedWithEquality (_, _, m) - | UnitTypeExpectedWithPossiblePropertySetter (_, _, _, _, m) - | UnitTypeExpectedWithPossibleAssignment (_, _, _, _, m) - | UseOfAddressOfOperator m - | DeprecatedThreadStaticBindingWarning m - | NonUniqueInferredAbstractSlot (_, _, _, _, _, m) - | DefensiveCopyWarning (_, m) - | LetRecCheckedAtRuntime m - | UpperCaseIdentifierInPattern m - | NotUpperCaseConstructor m - | RecursiveUseCheckedAtRuntime (_, _, m) - | LetRecEvaluatedOutOfOrder (_, _, _, m) - | Error (_, m) - | ErrorWithSuggestions (_, m, _, _) - | NumberedError (_, m) - | SyntaxError (_, m) - | InternalError (_, m) - | InterfaceNotRevealed(_, _, m) - | WrappedError (_, m) - | PatternMatchCompilation.MatchIncomplete (_, _, m) - | PatternMatchCompilation.EnumMatchIncomplete (_, _, m) - | PatternMatchCompilation.RuleNeverMatched m - | ValNotMutable(_, _, m) - | ValNotLocal(_, _, m) - | MissingFields(_, m) - | OverrideInIntrinsicAugmentation m - | IntfImplInIntrinsicAugmentation m - | OverrideInExtrinsicAugmentation m - | IntfImplInExtrinsicAugmentation m - | ValueRestriction(_, _, _, _, m) - | LetRecUnsound (_, _, m) - | ObsoleteError (_, m) - | ObsoleteWarning (_, m) - | Experimental (_, m) - | PossibleUnverifiableCode m - | UserCompilerMessage (_, _, m) - | Deprecated(_, m) - | LibraryUseOnly m - | FieldsFromDifferentTypes (_, _, _, m) - | IndeterminateType m - | TyconBadArgs(_, _, _, m) -> - Some m - - | FieldNotContained(_, arf, _, _) -> Some arf.Range - | ValueNotContained(_, _, aval, _, _) -> Some aval.Range - | ConstrNotContained(_, aval, _, _) -> Some aval.Id.idRange - | ExnconstrNotContained(_, aexnc, _, _) -> Some aexnc.Range - - | VarBoundTwice id - | UndefinedName(_, _, id, _) -> - Some id.idRange - - | Duplicate(_, _, m) - | NameClash(_, _, _, m, _, _, _) - | UnresolvedOverloading(_, _, _, m) - | UnresolvedConversionOperator (_, _, _, m) - | VirtualAugmentationOnNullValuedType m - | NonVirtualAugmentationOnNullValuedType m - | NonRigidTypar(_, _, _, _, _, m) - | ConstraintSolverTupleDiffLengths(_, _, _, m, _) - | ConstraintSolverInfiniteTypes(_, _, _, _, m, _) - | ConstraintSolverMissingConstraint(_, _, _, m, _) - | ConstraintSolverTypesNotInEqualityRelation(_, _, _, m, _, _) - | ConstraintSolverError(_, m, _) - | ConstraintSolverTypesNotInSubsumptionRelation(_, _, _, m, _) - | ConstraintSolverRelatedInformation(_, m, _) - | SelfRefObjCtor(_, m) -> - Some m - - | NotAFunction(_, _, mfun, _) -> - Some mfun - - | NotAFunctionButIndexer(_, _, _, mfun, _) -> - Some mfun - - | IllegalFileNameChar(_) -> Some rangeCmdArgs - - | UnresolvedReferenceError(_, m) - | UnresolvedPathReference(_, _, m) - | DeprecatedCommandLineOptionFull(_, m) - | DeprecatedCommandLineOptionForHtmlDoc(_, m) - | DeprecatedCommandLineOptionSuggestAlternative(_, _, m) - | DeprecatedCommandLineOptionNoDescription(_, m) - | InternalCommandLineOption(_, m) - | HashIncludeNotAllowedInNonScript m - | HashReferenceNotAllowedInNonScript m - | HashDirectiveNotAllowedInNonScript m - | FileNameNotResolved(_, _, m) - | LoadedSourceNotFoundIgnoring(_, m) - | MSBuildReferenceResolutionWarning(_, _, m) - | MSBuildReferenceResolutionError(_, _, m) - | AssemblyNotResolved(_, m) - | HashLoadedSourceHasIssues(_, _, m) - | HashLoadedScriptConsideredSource m -> - Some m - // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> - RangeFromException e.InnerException -#if !NO_EXTENSIONTYPING - | :? TypeProviderError as e -> e.Range |> Some -#endif - - | _ -> None - - RangeFromException err.Exception - -let GetDiagnosticNumber(err: PhasedDiagnostic) = - let rec GetFromException(e: exn) = - match e with - (* DO NOT CHANGE THESE NUMBERS *) - | ErrorFromAddingTypeEquation _ -> 1 - | FunctionExpected _ -> 2 - | NotAFunctionButIndexer _ -> 3217 - | NotAFunction _ -> 3 - | FieldNotMutable _ -> 5 - | Recursion _ -> 6 - | InvalidRuntimeCoercion _ -> 7 - | IndeterminateRuntimeCoercion _ -> 8 - | PossibleUnverifiableCode _ -> 9 - | SyntaxError _ -> 10 - // 11 cannot be reused - // 12 cannot be reused - | IndeterminateStaticCoercion _ -> 13 - | StaticCoercionShouldUseBox _ -> 14 - // 15 cannot be reused - | RuntimeCoercionSourceSealed _ -> 16 - | OverrideDoesntOverride _ -> 17 - | UnionPatternsBindDifferentNames _ -> 18 - | UnionCaseWrongArguments _ -> 19 - | UnitTypeExpected _ -> 20 - | UnitTypeExpectedWithEquality _ -> 20 - | UnitTypeExpectedWithPossiblePropertySetter _ -> 20 - | UnitTypeExpectedWithPossibleAssignment _ -> 20 - | RecursiveUseCheckedAtRuntime _ -> 21 - | LetRecEvaluatedOutOfOrder _ -> 22 - | NameClash _ -> 23 - // 24 cannot be reused - | PatternMatchCompilation.MatchIncomplete _ -> 25 - | PatternMatchCompilation.RuleNeverMatched _ -> 26 - | ValNotMutable _ -> 27 - | ValNotLocal _ -> 28 - | MissingFields _ -> 29 - | ValueRestriction _ -> 30 - | LetRecUnsound _ -> 31 - | FieldsFromDifferentTypes _ -> 32 - | TyconBadArgs _ -> 33 - | ValueNotContained _ -> 34 - | Deprecated _ -> 35 - | ConstrNotContained _ -> 36 - | Duplicate _ -> 37 - | VarBoundTwice _ -> 38 - | UndefinedName _ -> 39 - | LetRecCheckedAtRuntime _ -> 40 - | UnresolvedOverloading _ -> 41 - | LibraryUseOnly _ -> 42 - | ErrorFromAddingConstraint _ -> 43 - | ObsoleteWarning _ -> 44 - | ReservedKeyword _ -> 46 - | SelfRefObjCtor _ -> 47 - | VirtualAugmentationOnNullValuedType _ -> 48 - | UpperCaseIdentifierInPattern _ -> 49 - | InterfaceNotRevealed _ -> 50 - | UseOfAddressOfOperator _ -> 51 - | DefensiveCopyWarning _ -> 52 - | NotUpperCaseConstructor _ -> 53 - | TypeIsImplicitlyAbstract _ -> 54 - // 55 cannot be reused - | DeprecatedThreadStaticBindingWarning _ -> 56 - | Experimental _ -> 57 - | IndentationProblem _ -> 58 - | CoercionTargetSealed _ -> 59 - | OverrideInIntrinsicAugmentation _ -> 60 - | NonVirtualAugmentationOnNullValuedType _ -> 61 - | UserCompilerMessage (_, n, _) -> n - | ExnconstrNotContained _ -> 63 - | NonRigidTypar _ -> 64 - // 65 cannot be reused - | UpcastUnnecessary _ -> 66 - | TypeTestUnnecessary _ -> 67 - | QuotationTranslator.IgnoringPartOfQuotedTermWarning _ -> 68 - | IntfImplInIntrinsicAugmentation _ -> 69 - | NonUniqueInferredAbstractSlot _ -> 70 - | ErrorFromApplyingDefault _ -> 71 - | IndeterminateType _ -> 72 - | InternalError _ -> 73 - | UnresolvedReferenceNoRange _ - | UnresolvedReferenceError _ - | UnresolvedPathReferenceNoRange _ - | UnresolvedPathReference _ -> 74 - | DeprecatedCommandLineOptionFull _ - | DeprecatedCommandLineOptionForHtmlDoc _ - | DeprecatedCommandLineOptionSuggestAlternative _ - | DeprecatedCommandLineOptionNoDescription _ - | InternalCommandLineOption _ -> 75 - | HashIncludeNotAllowedInNonScript _ - | HashReferenceNotAllowedInNonScript _ - | HashDirectiveNotAllowedInNonScript _ -> 76 - | BakedInMemberConstraintName _ -> 77 - | FileNameNotResolved _ -> 78 - | LoadedSourceNotFoundIgnoring _ -> 79 - // 80 cannot be reused - | ParameterlessStructCtor _ -> 81 - | MSBuildReferenceResolutionWarning _ -> 82 - | MSBuildReferenceResolutionError _ -> 83 - | AssemblyNotResolved _ -> 84 - | HashLoadedSourceHasIssues _ -> 85 - | StandardOperatorRedefinitionWarning _ -> 86 - | InvalidInternalsVisibleToAssemblyName _ -> 87 - // 88 cannot be reused - | OverrideInExtrinsicAugmentation _ -> 89 - | IntfImplInExtrinsicAugmentation _ -> 90 - | BadEventTransformation _ -> 91 - | HashLoadedScriptConsideredSource _ -> 92 - | UnresolvedConversionOperator _ -> 93 - // avoid 94-100 for safety - | ObsoleteError _ -> 101 -#if !NO_EXTENSIONTYPING - | ExtensionTyping.ProvidedTypeResolutionNoRange _ - | ExtensionTyping.ProvidedTypeResolution _ -> 103 -#endif - | PatternMatchCompilation.EnumMatchIncomplete _ -> 104 - (* DO NOT CHANGE THE NUMBERS *) - - // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> - GetFromException e.InnerException - - | WrappedError(e, _) -> GetFromException e - - | Error ((n, _), _) -> n - | ErrorWithSuggestions ((n, _), _, _, _) -> n - | Failure _ -> 192 - | NumberedError((n, _), _) -> n - | IllegalFileNameChar(fileName, invalidChar) -> fst (FSComp.SR.buildUnexpectedFileNameCharacter(fileName, string invalidChar)) -#if !NO_EXTENSIONTYPING - | :? TypeProviderError as e -> e.Number -#endif - | ErrorsFromAddingSubsumptionConstraint (_, _, _, _, _, ContextInfo.DowncastUsedInsteadOfUpcast _, _) -> fst (FSComp.SR.considerUpcast("", "")) - | _ -> 193 - GetFromException err.Exception - -let GetWarningLevel err = - match err.Exception with - // Level 5 warnings - | RecursiveUseCheckedAtRuntime _ - | LetRecEvaluatedOutOfOrder _ - | DefensiveCopyWarning _ -> 5 - - | NumberedError((n, _), _) - | ErrorWithSuggestions((n, _), _, _, _) - | Error((n, _), _) -> - // 1178, tcNoComparisonNeeded1, "The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint..." - // 1178, tcNoComparisonNeeded2, "The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint...." - // 1178, tcNoEqualityNeeded1, "The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint..." - // 1178, tcNoEqualityNeeded2, "The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint...." - if (n = 1178) then 5 else 2 - // Level 2 - | _ -> 2 - -let warningOn err level specificWarnOn = - let n = GetDiagnosticNumber err - List.contains n specificWarnOn || - // Some specific warnings are never on by default, i.e. unused variable warnings - match n with - | 1182 -> false // chkUnusedValue - off by default - | 3218 -> false // ArgumentsInSigAndImplMismatch - off by default - | 3180 -> false // abImplicitHeapAllocation - off by default - | _ -> level >= GetWarningLevel err - -let SplitRelatedDiagnostics(err: PhasedDiagnostic) : PhasedDiagnostic * PhasedDiagnostic list = - let ToPhased e = {Exception=e; Phase = err.Phase} - let rec SplitRelatedException = function - | ConstraintSolverRelatedInformation(fopt, m2, e) -> - let e, related = SplitRelatedException e - ConstraintSolverRelatedInformation(fopt, m2, e.Exception)|>ToPhased, related - | ErrorFromAddingTypeEquation(g, denv, t1, t2, e, m) -> - let e, related = SplitRelatedException e - ErrorFromAddingTypeEquation(g, denv, t1, t2, e.Exception, m)|>ToPhased, related - | ErrorFromApplyingDefault(g, denv, tp, defaultType, e, m) -> - let e, related = SplitRelatedException e - ErrorFromApplyingDefault(g, denv, tp, defaultType, e.Exception, m)|>ToPhased, related - | ErrorsFromAddingSubsumptionConstraint(g, denv, t1, t2, e, contextInfo, m) -> - let e, related = SplitRelatedException e - ErrorsFromAddingSubsumptionConstraint(g, denv, t1, t2, e.Exception, contextInfo, m)|>ToPhased, related - | ErrorFromAddingConstraint(x, e, m) -> - let e, related = SplitRelatedException e - ErrorFromAddingConstraint(x, e.Exception, m)|>ToPhased, related - | WrappedError (e, m) -> - let e, related = SplitRelatedException e - WrappedError(e.Exception, m)|>ToPhased, related - // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> - SplitRelatedException e.InnerException - | e -> - ToPhased e, [] - SplitRelatedException err.Exception - - -let DeclareMessage = FSharp.Compiler.DiagnosticMessage.DeclareResourceString - -do FSComp.SR.RunStartupValidation() -let SeeAlsoE() = DeclareResourceString("SeeAlso", "%s") -let ConstraintSolverTupleDiffLengthsE() = DeclareResourceString("ConstraintSolverTupleDiffLengths", "%d%d") -let ConstraintSolverInfiniteTypesE() = DeclareResourceString("ConstraintSolverInfiniteTypes", "%s%s") -let ConstraintSolverMissingConstraintE() = DeclareResourceString("ConstraintSolverMissingConstraint", "%s") -let ConstraintSolverTypesNotInEqualityRelation1E() = DeclareResourceString("ConstraintSolverTypesNotInEqualityRelation1", "%s%s") -let ConstraintSolverTypesNotInEqualityRelation2E() = DeclareResourceString("ConstraintSolverTypesNotInEqualityRelation2", "%s%s") -let ConstraintSolverTypesNotInSubsumptionRelationE() = DeclareResourceString("ConstraintSolverTypesNotInSubsumptionRelation", "%s%s%s") -let ErrorFromAddingTypeEquation1E() = DeclareResourceString("ErrorFromAddingTypeEquation1", "%s%s%s") -let ErrorFromAddingTypeEquation2E() = DeclareResourceString("ErrorFromAddingTypeEquation2", "%s%s%s") -let ErrorFromApplyingDefault1E() = DeclareResourceString("ErrorFromApplyingDefault1", "%s") -let ErrorFromApplyingDefault2E() = DeclareResourceString("ErrorFromApplyingDefault2", "") -let ErrorsFromAddingSubsumptionConstraintE() = DeclareResourceString("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") -let UpperCaseIdentifierInPatternE() = DeclareResourceString("UpperCaseIdentifierInPattern", "") -let NotUpperCaseConstructorE() = DeclareResourceString("NotUpperCaseConstructor", "") -let FunctionExpectedE() = DeclareResourceString("FunctionExpected", "") -let BakedInMemberConstraintNameE() = DeclareResourceString("BakedInMemberConstraintName", "%s") -let BadEventTransformationE() = DeclareResourceString("BadEventTransformation", "") -let ParameterlessStructCtorE() = DeclareResourceString("ParameterlessStructCtor", "") -let InterfaceNotRevealedE() = DeclareResourceString("InterfaceNotRevealed", "%s") -let TyconBadArgsE() = DeclareResourceString("TyconBadArgs", "%s%d%d") -let IndeterminateTypeE() = DeclareResourceString("IndeterminateType", "") -let NameClash1E() = DeclareResourceString("NameClash1", "%s%s") -let NameClash2E() = DeclareResourceString("NameClash2", "%s%s%s%s%s") -let Duplicate1E() = DeclareResourceString("Duplicate1", "%s") -let Duplicate2E() = DeclareResourceString("Duplicate2", "%s%s") -let UndefinedName2E() = DeclareResourceString("UndefinedName2", "") -let FieldNotMutableE() = DeclareResourceString("FieldNotMutable", "") -let FieldsFromDifferentTypesE() = DeclareResourceString("FieldsFromDifferentTypes", "%s%s") -let VarBoundTwiceE() = DeclareResourceString("VarBoundTwice", "%s") -let RecursionE() = DeclareResourceString("Recursion", "%s%s%s%s") -let InvalidRuntimeCoercionE() = DeclareResourceString("InvalidRuntimeCoercion", "%s%s%s") -let IndeterminateRuntimeCoercionE() = DeclareResourceString("IndeterminateRuntimeCoercion", "%s%s") -let IndeterminateStaticCoercionE() = DeclareResourceString("IndeterminateStaticCoercion", "%s%s") -let StaticCoercionShouldUseBoxE() = DeclareResourceString("StaticCoercionShouldUseBox", "%s%s") -let TypeIsImplicitlyAbstractE() = DeclareResourceString("TypeIsImplicitlyAbstract", "") -let NonRigidTypar1E() = DeclareResourceString("NonRigidTypar1", "%s%s") -let NonRigidTypar2E() = DeclareResourceString("NonRigidTypar2", "%s%s") -let NonRigidTypar3E() = DeclareResourceString("NonRigidTypar3", "%s%s") -let OBlockEndSentenceE() = DeclareResourceString("BlockEndSentence", "") -let UnexpectedEndOfInputE() = DeclareResourceString("UnexpectedEndOfInput", "") -let UnexpectedE() = DeclareResourceString("Unexpected", "%s") -let NONTERM_interactionE() = DeclareResourceString("NONTERM.interaction", "") -let NONTERM_hashDirectiveE() = DeclareResourceString("NONTERM.hashDirective", "") -let NONTERM_fieldDeclE() = DeclareResourceString("NONTERM.fieldDecl", "") -let NONTERM_unionCaseReprE() = DeclareResourceString("NONTERM.unionCaseRepr", "") -let NONTERM_localBindingE() = DeclareResourceString("NONTERM.localBinding", "") -let NONTERM_hardwhiteLetBindingsE() = DeclareResourceString("NONTERM.hardwhiteLetBindings", "") -let NONTERM_classDefnMemberE() = DeclareResourceString("NONTERM.classDefnMember", "") -let NONTERM_defnBindingsE() = DeclareResourceString("NONTERM.defnBindings", "") -let NONTERM_classMemberSpfnE() = DeclareResourceString("NONTERM.classMemberSpfn", "") -let NONTERM_valSpfnE() = DeclareResourceString("NONTERM.valSpfn", "") -let NONTERM_tyconSpfnE() = DeclareResourceString("NONTERM.tyconSpfn", "") -let NONTERM_anonLambdaExprE() = DeclareResourceString("NONTERM.anonLambdaExpr", "") -let NONTERM_attrUnionCaseDeclE() = DeclareResourceString("NONTERM.attrUnionCaseDecl", "") -let NONTERM_cPrototypeE() = DeclareResourceString("NONTERM.cPrototype", "") -let NONTERM_objectImplementationMembersE() = DeclareResourceString("NONTERM.objectImplementationMembers", "") -let NONTERM_ifExprCasesE() = DeclareResourceString("NONTERM.ifExprCases", "") -let NONTERM_openDeclE() = DeclareResourceString("NONTERM.openDecl", "") -let NONTERM_fileModuleSpecE() = DeclareResourceString("NONTERM.fileModuleSpec", "") -let NONTERM_patternClausesE() = DeclareResourceString("NONTERM.patternClauses", "") -let NONTERM_beginEndExprE() = DeclareResourceString("NONTERM.beginEndExpr", "") -let NONTERM_recdExprE() = DeclareResourceString("NONTERM.recdExpr", "") -let NONTERM_tyconDefnE() = DeclareResourceString("NONTERM.tyconDefn", "") -let NONTERM_exconCoreE() = DeclareResourceString("NONTERM.exconCore", "") -let NONTERM_typeNameInfoE() = DeclareResourceString("NONTERM.typeNameInfo", "") -let NONTERM_attributeListE() = DeclareResourceString("NONTERM.attributeList", "") -let NONTERM_quoteExprE() = DeclareResourceString("NONTERM.quoteExpr", "") -let NONTERM_typeConstraintE() = DeclareResourceString("NONTERM.typeConstraint", "") -let NONTERM_Category_ImplementationFileE() = DeclareResourceString("NONTERM.Category.ImplementationFile", "") -let NONTERM_Category_DefinitionE() = DeclareResourceString("NONTERM.Category.Definition", "") -let NONTERM_Category_SignatureFileE() = DeclareResourceString("NONTERM.Category.SignatureFile", "") -let NONTERM_Category_PatternE() = DeclareResourceString("NONTERM.Category.Pattern", "") -let NONTERM_Category_ExprE() = DeclareResourceString("NONTERM.Category.Expr", "") -let NONTERM_Category_TypeE() = DeclareResourceString("NONTERM.Category.Type", "") -let NONTERM_typeArgsActualE() = DeclareResourceString("NONTERM.typeArgsActual", "") -let TokenName1E() = DeclareResourceString("TokenName1", "%s") -let TokenName1TokenName2E() = DeclareResourceString("TokenName1TokenName2", "%s%s") -let TokenName1TokenName2TokenName3E() = DeclareResourceString("TokenName1TokenName2TokenName3", "%s%s%s") -let RuntimeCoercionSourceSealed1E() = DeclareResourceString("RuntimeCoercionSourceSealed1", "%s") -let RuntimeCoercionSourceSealed2E() = DeclareResourceString("RuntimeCoercionSourceSealed2", "%s") -let CoercionTargetSealedE() = DeclareResourceString("CoercionTargetSealed", "%s") -let UpcastUnnecessaryE() = DeclareResourceString("UpcastUnnecessary", "") -let TypeTestUnnecessaryE() = DeclareResourceString("TypeTestUnnecessary", "") -let OverrideDoesntOverride1E() = DeclareResourceString("OverrideDoesntOverride1", "%s") -let OverrideDoesntOverride2E() = DeclareResourceString("OverrideDoesntOverride2", "%s") -let OverrideDoesntOverride3E() = DeclareResourceString("OverrideDoesntOverride3", "%s") -let OverrideDoesntOverride4E() = DeclareResourceString("OverrideDoesntOverride4", "%s") -let UnionCaseWrongArgumentsE() = DeclareResourceString("UnionCaseWrongArguments", "%d%d") -let UnionPatternsBindDifferentNamesE() = DeclareResourceString("UnionPatternsBindDifferentNames", "") -let RequiredButNotSpecifiedE() = DeclareResourceString("RequiredButNotSpecified", "%s%s%s") -let UseOfAddressOfOperatorE() = DeclareResourceString("UseOfAddressOfOperator", "") -let DefensiveCopyWarningE() = DeclareResourceString("DefensiveCopyWarning", "%s") -let DeprecatedThreadStaticBindingWarningE() = DeclareResourceString("DeprecatedThreadStaticBindingWarning", "") -let FunctionValueUnexpectedE() = DeclareResourceString("FunctionValueUnexpected", "%s") -let UnitTypeExpectedE() = DeclareResourceString("UnitTypeExpected", "%s") -let UnitTypeExpectedWithEqualityE() = DeclareResourceString("UnitTypeExpectedWithEquality", "%s") -let UnitTypeExpectedWithPossiblePropertySetterE() = DeclareResourceString("UnitTypeExpectedWithPossiblePropertySetter", "%s%s%s") -let UnitTypeExpectedWithPossibleAssignmentE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignment", "%s%s") -let UnitTypeExpectedWithPossibleAssignmentToMutableE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignmentToMutable", "%s%s") -let RecursiveUseCheckedAtRuntimeE() = DeclareResourceString("RecursiveUseCheckedAtRuntime", "") -let LetRecUnsound1E() = DeclareResourceString("LetRecUnsound1", "%s") -let LetRecUnsound2E() = DeclareResourceString("LetRecUnsound2", "%s%s") -let LetRecUnsoundInnerE() = DeclareResourceString("LetRecUnsoundInner", "%s") -let LetRecEvaluatedOutOfOrderE() = DeclareResourceString("LetRecEvaluatedOutOfOrder", "") -let LetRecCheckedAtRuntimeE() = DeclareResourceString("LetRecCheckedAtRuntime", "") -let SelfRefObjCtor1E() = DeclareResourceString("SelfRefObjCtor1", "") -let SelfRefObjCtor2E() = DeclareResourceString("SelfRefObjCtor2", "") -let VirtualAugmentationOnNullValuedTypeE() = DeclareResourceString("VirtualAugmentationOnNullValuedType", "") -let NonVirtualAugmentationOnNullValuedTypeE() = DeclareResourceString("NonVirtualAugmentationOnNullValuedType", "") -let NonUniqueInferredAbstractSlot1E() = DeclareResourceString("NonUniqueInferredAbstractSlot1", "%s") -let NonUniqueInferredAbstractSlot2E() = DeclareResourceString("NonUniqueInferredAbstractSlot2", "") -let NonUniqueInferredAbstractSlot3E() = DeclareResourceString("NonUniqueInferredAbstractSlot3", "%s%s") -let NonUniqueInferredAbstractSlot4E() = DeclareResourceString("NonUniqueInferredAbstractSlot4", "") -let Failure3E() = DeclareResourceString("Failure3", "%s") -let Failure4E() = DeclareResourceString("Failure4", "%s") -let MatchIncomplete1E() = DeclareResourceString("MatchIncomplete1", "") -let MatchIncomplete2E() = DeclareResourceString("MatchIncomplete2", "%s") -let MatchIncomplete3E() = DeclareResourceString("MatchIncomplete3", "%s") -let MatchIncomplete4E() = DeclareResourceString("MatchIncomplete4", "") -let RuleNeverMatchedE() = DeclareResourceString("RuleNeverMatched", "") -let EnumMatchIncomplete1E() = DeclareResourceString("EnumMatchIncomplete1", "") -let ValNotMutableE() = DeclareResourceString("ValNotMutable", "%s") -let ValNotLocalE() = DeclareResourceString("ValNotLocal", "") -let Obsolete1E() = DeclareResourceString("Obsolete1", "") -let Obsolete2E() = DeclareResourceString("Obsolete2", "%s") -let ExperimentalE() = DeclareResourceString("Experimental", "%s") -let PossibleUnverifiableCodeE() = DeclareResourceString("PossibleUnverifiableCode", "") -let DeprecatedE() = DeclareResourceString("Deprecated", "%s") -let LibraryUseOnlyE() = DeclareResourceString("LibraryUseOnly", "") -let MissingFieldsE() = DeclareResourceString("MissingFields", "%s") -let ValueRestriction1E() = DeclareResourceString("ValueRestriction1", "%s%s%s") -let ValueRestriction2E() = DeclareResourceString("ValueRestriction2", "%s%s%s") -let ValueRestriction3E() = DeclareResourceString("ValueRestriction3", "%s") -let ValueRestriction4E() = DeclareResourceString("ValueRestriction4", "%s%s%s") -let ValueRestriction5E() = DeclareResourceString("ValueRestriction5", "%s%s%s") -let RecoverableParseErrorE() = DeclareResourceString("RecoverableParseError", "") -let ReservedKeywordE() = DeclareResourceString("ReservedKeyword", "%s") -let IndentationProblemE() = DeclareResourceString("IndentationProblem", "%s") -let OverrideInIntrinsicAugmentationE() = DeclareResourceString("OverrideInIntrinsicAugmentation", "") -let OverrideInExtrinsicAugmentationE() = DeclareResourceString("OverrideInExtrinsicAugmentation", "") -let IntfImplInIntrinsicAugmentationE() = DeclareResourceString("IntfImplInIntrinsicAugmentation", "") -let IntfImplInExtrinsicAugmentationE() = DeclareResourceString("IntfImplInExtrinsicAugmentation", "") -let UnresolvedReferenceNoRangeE() = DeclareResourceString("UnresolvedReferenceNoRange", "%s") -let UnresolvedPathReferenceNoRangeE() = DeclareResourceString("UnresolvedPathReferenceNoRange", "%s%s") -let HashIncludeNotAllowedInNonScriptE() = DeclareResourceString("HashIncludeNotAllowedInNonScript", "") -let HashReferenceNotAllowedInNonScriptE() = DeclareResourceString("HashReferenceNotAllowedInNonScript", "") -let HashDirectiveNotAllowedInNonScriptE() = DeclareResourceString("HashDirectiveNotAllowedInNonScript", "") -let FileNameNotResolvedE() = DeclareResourceString("FileNameNotResolved", "%s%s") -let AssemblyNotResolvedE() = DeclareResourceString("AssemblyNotResolved", "%s") -let HashLoadedSourceHasIssues1E() = DeclareResourceString("HashLoadedSourceHasIssues1", "") -let HashLoadedSourceHasIssues2E() = DeclareResourceString("HashLoadedSourceHasIssues2", "") -let HashLoadedScriptConsideredSourceE() = DeclareResourceString("HashLoadedScriptConsideredSource", "") -let InvalidInternalsVisibleToAssemblyName1E() = DeclareResourceString("InvalidInternalsVisibleToAssemblyName1", "%s%s") -let InvalidInternalsVisibleToAssemblyName2E() = DeclareResourceString("InvalidInternalsVisibleToAssemblyName2", "%s") -let LoadedSourceNotFoundIgnoringE() = DeclareResourceString("LoadedSourceNotFoundIgnoring", "%s") -let MSBuildReferenceResolutionErrorE() = DeclareResourceString("MSBuildReferenceResolutionError", "%s%s") -let TargetInvocationExceptionWrapperE() = DeclareResourceString("TargetInvocationExceptionWrapper", "%s") - -let getErrorString key = SR.GetString key - -let (|InvalidArgument|_|) (exn: exn) = match exn with :? ArgumentException as e -> Some e.Message | _ -> None - -let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNames: bool) = - - let suggestNames suggestionsF idText = - if canSuggestNames then - let buffer = ErrorResolutionHints.SuggestionBuffer idText - if not buffer.Disabled then - suggestionsF buffer.Add - if not buffer.IsEmpty then - os.Append " " |> ignore - os.Append(FSComp.SR.undefinedNameSuggestionsIntro()) |> ignore - for value in buffer do - os.AppendLine() |> ignore - os.Append " " |> ignore - os.Append(DecompileOpName value) |> ignore - - let rec OutputExceptionR (os: StringBuilder) error = - - match error with - | ConstraintSolverTupleDiffLengths(_, tl1, tl2, m, m2) -> - os.Append(ConstraintSolverTupleDiffLengthsE().Format tl1.Length tl2.Length) |> ignore - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m)) |> ignore - - | ConstraintSolverInfiniteTypes(denv, contextInfo, t1, t2, m, m2) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - os.Append(ConstraintSolverInfiniteTypesE().Format t1 t2) |> ignore - - match contextInfo with - | ContextInfo.ReturnInComputationExpression -> - os.Append(" " + FSComp.SR.returnUsedInsteadOfReturnBang()) |> ignore - | ContextInfo.YieldInComputationExpression -> - os.Append(" " + FSComp.SR.yieldUsedInsteadOfYieldBang()) |> ignore - | _ -> () - - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m)) |> ignore - - | ConstraintSolverMissingConstraint(denv, tpr, tpc, m, m2) -> - os.Append(ConstraintSolverMissingConstraintE().Format (NicePrint.stringOfTyparConstraint denv (tpr, tpc))) |> ignore - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m)) |> ignore - - | ConstraintSolverTypesNotInEqualityRelation(denv, (TType_measure _ as t1), (TType_measure _ as t2), m, m2, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - - os.Append(ConstraintSolverTypesNotInEqualityRelation1E().Format t1 t2 ) |> ignore - - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m)) |> ignore - - | ConstraintSolverTypesNotInEqualityRelation(denv, t1, t2, m, m2, contextInfo) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - - match contextInfo with - | ContextInfo.IfExpression range when Range.equals range m -> os.Append(FSComp.SR.ifExpression(t1, t2)) |> ignore - | ContextInfo.CollectionElement (isArray, range) when Range.equals range m -> - if isArray then - os.Append(FSComp.SR.arrayElementHasWrongType(t1, t2)) |> ignore - else - os.Append(FSComp.SR.listElementHasWrongType(t1, t2)) |> ignore - | ContextInfo.OmittedElseBranch range when Range.equals range m -> os.Append(FSComp.SR.missingElseBranch(t2)) |> ignore - | ContextInfo.ElseBranchResult range when Range.equals range m -> os.Append(FSComp.SR.elseBranchHasWrongType(t1, t2)) |> ignore - | ContextInfo.FollowingPatternMatchClause range when Range.equals range m -> os.Append(FSComp.SR.followingPatternMatchClauseHasWrongType(t1, t2)) |> ignore - | ContextInfo.PatternMatchGuard range when Range.equals range m -> os.Append(FSComp.SR.patternMatchGuardIsNotBool(t2)) |> ignore - | _ -> os.Append(ConstraintSolverTypesNotInEqualityRelation2E().Format t1 t2) |> ignore - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m)) |> ignore - - | ConstraintSolverTypesNotInSubsumptionRelation(denv, t1, t2, m, m2) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, cxs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - os.Append(ConstraintSolverTypesNotInSubsumptionRelationE().Format t2 t1 cxs) |> ignore - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m2)) |> ignore - - | ConstraintSolverError(msg, m, m2) -> - os.Append msg |> ignore - if m.StartLine <> m2.StartLine then - os.Append(SeeAlsoE().Format (stringOfRange m2)) |> ignore - - | ConstraintSolverRelatedInformation(fopt, _, e) -> - match e with - | ConstraintSolverError _ -> OutputExceptionR os e - | _ -> () - fopt |> Option.iter (Printf.bprintf os " %s") - - | ErrorFromAddingTypeEquation(g, denv, t1, t2, ConstraintSolverTypesNotInEqualityRelation(_, t1', t2', m, _, contextInfo), _) - when typeEquiv g t1 t1' - && typeEquiv g t2 t2' -> - let t1, t2, tpcs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - match contextInfo with - | ContextInfo.IfExpression range when Range.equals range m -> os.Append(FSComp.SR.ifExpression(t1, t2)) |> ignore - | ContextInfo.CollectionElement (isArray, range) when Range.equals range m -> - if isArray then - os.Append(FSComp.SR.arrayElementHasWrongType(t1, t2)) |> ignore - else - os.Append(FSComp.SR.listElementHasWrongType(t1, t2)) |> ignore - | ContextInfo.OmittedElseBranch range when Range.equals range m -> os.Append(FSComp.SR.missingElseBranch(t2)) |> ignore - | ContextInfo.ElseBranchResult range when Range.equals range m -> os.Append(FSComp.SR.elseBranchHasWrongType(t1, t2)) |> ignore - | ContextInfo.FollowingPatternMatchClause range when Range.equals range m -> os.Append(FSComp.SR.followingPatternMatchClauseHasWrongType(t1, t2)) |> ignore - | ContextInfo.PatternMatchGuard range when Range.equals range m -> os.Append(FSComp.SR.patternMatchGuardIsNotBool(t2)) |> ignore - | ContextInfo.TupleInRecordFields -> - os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs) |> ignore - os.Append(System.Environment.NewLine + FSComp.SR.commaInsteadOfSemicolonInRecord()) |> ignore - | _ when t2 = "bool" && t1.EndsWithOrdinal(" ref") -> - os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs) |> ignore - os.Append(System.Environment.NewLine + FSComp.SR.derefInsteadOfNot()) |> ignore - | _ -> os.Append(ErrorFromAddingTypeEquation1E().Format t2 t1 tpcs) |> ignore - - | ErrorFromAddingTypeEquation(_, _, _, _, ((ConstraintSolverTypesNotInEqualityRelation (_, _, _, _, _, contextInfo) ) as e), _) - when (match contextInfo with ContextInfo.NoContext -> false | _ -> true) -> - OutputExceptionR os e - - | ErrorFromAddingTypeEquation(_, _, _, _, ((ConstraintSolverTypesNotInSubsumptionRelation _ | ConstraintSolverError _ ) as e), _) -> - OutputExceptionR os e - - | ErrorFromAddingTypeEquation(g, denv, t1, t2, e, _) -> - if not (typeEquiv g t1 t2) then - let t1, t2, tpcs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - if t1<>t2 + tpcs then os.Append(ErrorFromAddingTypeEquation2E().Format t1 t2 tpcs) |> ignore - - OutputExceptionR os e - - | ErrorFromApplyingDefault(_, denv, _, defaultType, e, _) -> - let defaultType = NicePrint.minimalStringOfType denv defaultType - os.Append(ErrorFromApplyingDefault1E().Format defaultType) |> ignore - OutputExceptionR os e - os.Append(ErrorFromApplyingDefault2E().Format) |> ignore - - | ErrorsFromAddingSubsumptionConstraint(g, denv, t1, t2, e, contextInfo, _) -> - match contextInfo with - | ContextInfo.DowncastUsedInsteadOfUpcast isOperator -> - let t1, t2, _ = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - if isOperator then - os.Append(FSComp.SR.considerUpcastOperator(t1, t2) |> snd) |> ignore - else - os.Append(FSComp.SR.considerUpcast(t1, t2) |> snd) |> ignore - | _ -> - if not (typeEquiv g t1 t2) then - let t1, t2, tpcs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 - if t1 <> (t2 + tpcs) then - os.Append(ErrorsFromAddingSubsumptionConstraintE().Format t2 t1 tpcs) |> ignore - else - OutputExceptionR os e - else - OutputExceptionR os e - - | UpperCaseIdentifierInPattern(_) -> - os.Append(UpperCaseIdentifierInPatternE().Format) |> ignore - - | NotUpperCaseConstructor(_) -> - os.Append(NotUpperCaseConstructorE().Format) |> ignore - - | ErrorFromAddingConstraint(_, e, _) -> - OutputExceptionR os e - -#if !NO_EXTENSIONTYPING - | ExtensionTyping.ProvidedTypeResolutionNoRange e - - | ExtensionTyping.ProvidedTypeResolution(_, e) -> - OutputExceptionR os e - - | :? TypeProviderError as e -> - os.Append(e.ContextualErrorMessage) |> ignore -#endif - - | UnresolvedOverloading(denv, callerArgs, failure, m) -> - - // extract eventual information (return type and type parameters) - // from ConstraintTraitInfo - let knownReturnType, genericParameterTypes = - match failure with - | NoOverloadsFound (cx=Some cx) - | PossibleCandidates (cx=Some cx) -> cx.ReturnType, cx.ArgumentTypes - | _ -> None, [] - - // prepare message parts (known arguments, known return type, known generic parameters) - let argsMessage, returnType, genericParametersMessage = - - let retTy = - knownReturnType - |> Option.defaultValue (TType.TType_var (Typar.NewUnlinked())) - - let argRepr = - callerArgs.ArgumentNamesAndTypes - |> List.map (fun (name,tTy) -> tTy, {ArgReprInfo.Name = name |> Option.map (fun name -> Ident(name, range.Zero)); ArgReprInfo.Attribs = []}) - - let argsL,retTyL,genParamTysL = NicePrint.prettyLayoutsOfUnresolvedOverloading denv argRepr retTy genericParameterTypes - - match callerArgs.ArgumentNamesAndTypes with - | [] -> None, Layout.showL retTyL, Layout.showL genParamTysL - | items -> - let args = Layout.showL argsL - let prefixMessage = - match items with - | [_] -> FSComp.SR.csNoOverloadsFoundArgumentsPrefixSingular - | _ -> FSComp.SR.csNoOverloadsFoundArgumentsPrefixPlural - Some (prefixMessage args) - , Layout.showL retTyL - , Layout.showL genParamTysL - - let knownReturnType = - match knownReturnType with - | None -> None - | Some _ -> Some (FSComp.SR.csNoOverloadsFoundReturnType returnType) - - let genericParametersMessage = - match genericParameterTypes with - | [] -> None - | [_] -> Some (FSComp.SR.csNoOverloadsFoundTypeParametersPrefixSingular genericParametersMessage) - | _ -> Some (FSComp.SR.csNoOverloadsFoundTypeParametersPrefixPlural genericParametersMessage) - - let overloadMethodInfo displayEnv m (x: OverloadInformation) = - let paramInfo = - match x.error with - | :? ArgDoesNotMatchError as x -> - let nameOrOneBasedIndexMessage = - x.calledArg.NameOpt - |> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText) - |> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((Lib.vsnd x.calledArg.Position) + 1)) //snd - sprintf " // %s" nameOrOneBasedIndexMessage - | _ -> "" - - (NicePrint.stringOfMethInfo x.amap m displayEnv x.methodSlot.Method) + paramInfo - - let nl = System.Environment.NewLine - let formatOverloads (overloads: OverloadInformation list) = - overloads - |> List.map (overloadMethodInfo denv m) - |> List.sort - |> List.map FSComp.SR.formatDashItem - |> String.concat nl - - // assemble final message composing the parts - let msg = - let optionalParts = - [knownReturnType; genericParametersMessage; argsMessage] - |> List.choose id - |> String.concat (nl + nl) - |> function | "" -> nl - | result -> nl + nl + result + nl + nl - - match failure with - | NoOverloadsFound (methodName, overloads, _) -> - FSComp.SR.csNoOverloadsFound methodName - + optionalParts - + (FSComp.SR.csAvailableOverloads (formatOverloads overloads)) - | PossibleCandidates (methodName, [], _) -> - FSComp.SR.csMethodIsOverloaded methodName - | PossibleCandidates (methodName, overloads, _) -> - FSComp.SR.csMethodIsOverloaded methodName - + optionalParts - + FSComp.SR.csCandidates (formatOverloads overloads) - - os.Append msg |> ignore - - | UnresolvedConversionOperator(denv, fromTy, toTy, _) -> - let t1, t2, _tpcs = NicePrint.minimalStringsOfTwoTypes denv fromTy toTy - os.Append(FSComp.SR.csTypeDoesNotSupportConversion(t1, t2)) |> ignore - - | FunctionExpected _ -> - os.Append(FunctionExpectedE().Format) |> ignore - - | BakedInMemberConstraintName(nm, _) -> - os.Append(BakedInMemberConstraintNameE().Format nm) |> ignore - - | StandardOperatorRedefinitionWarning(msg, _) -> - os.Append msg |> ignore - - | BadEventTransformation(_) -> - os.Append(BadEventTransformationE().Format) |> ignore - - | ParameterlessStructCtor(_) -> - os.Append(ParameterlessStructCtorE().Format) |> ignore - - | InterfaceNotRevealed(denv, ity, _) -> - os.Append(InterfaceNotRevealedE().Format (NicePrint.minimalStringOfType denv ity)) |> ignore - - | NotAFunctionButIndexer(_, _, name, _, _) -> - match name with - | Some name -> os.Append(FSComp.SR.notAFunctionButMaybeIndexerWithName name) |> ignore - | _ -> os.Append(FSComp.SR.notAFunctionButMaybeIndexer()) |> ignore - - | NotAFunction(_, _, _, marg) -> - if marg.StartColumn = 0 then - os.Append(FSComp.SR.notAFunctionButMaybeDeclaration()) |> ignore - else - os.Append(FSComp.SR.notAFunction()) |> ignore - - | TyconBadArgs(_, tcref, d, _) -> - let exp = tcref.TyparsNoRange.Length - if exp = 0 then - os.Append(FSComp.SR.buildUnexpectedTypeArgs(fullDisplayTextOfTyconRef tcref, d)) |> ignore - else - os.Append(TyconBadArgsE().Format (fullDisplayTextOfTyconRef tcref) exp d) |> ignore - - | IndeterminateType(_) -> - os.Append(IndeterminateTypeE().Format) |> ignore - - | NameClash(nm, k1, nm1, _, k2, nm2, _) -> - if nm = nm1 && nm1 = nm2 && k1 = k2 then - os.Append(NameClash1E().Format k1 nm1) |> ignore - else - os.Append(NameClash2E().Format k1 nm1 nm k2 nm2) |> ignore - - | Duplicate(k, s, _) -> - if k = "member" then - os.Append(Duplicate1E().Format (DecompileOpName s)) |> ignore - else - os.Append(Duplicate2E().Format k (DecompileOpName s)) |> ignore - - | UndefinedName(_, k, id, suggestionsF) -> - os.Append(k (DecompileOpName id.idText)) |> ignore - suggestNames suggestionsF id.idText - - | InternalUndefinedItemRef(f, smr, ccuName, s) -> - let _, errs = f(smr, ccuName, s) - os.Append errs |> ignore - - | FieldNotMutable _ -> - os.Append(FieldNotMutableE().Format) |> ignore - - | FieldsFromDifferentTypes (_, fref1, fref2, _) -> - os.Append(FieldsFromDifferentTypesE().Format fref1.FieldName fref2.FieldName) |> ignore - - | VarBoundTwice id -> - os.Append(VarBoundTwiceE().Format (DecompileOpName id.idText)) |> ignore - - | Recursion (denv, id, ty1, ty2, _) -> - let t1, t2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(RecursionE().Format (DecompileOpName id.idText) t1 t2 tpcs) |> ignore - - | InvalidRuntimeCoercion(denv, ty1, ty2, _) -> - let t1, t2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(InvalidRuntimeCoercionE().Format t1 t2 tpcs) |> ignore - - | IndeterminateRuntimeCoercion(denv, ty1, ty2, _) -> - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(IndeterminateRuntimeCoercionE().Format t1 t2) |> ignore - - | IndeterminateStaticCoercion(denv, ty1, ty2, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(IndeterminateStaticCoercionE().Format t1 t2) |> ignore - - | StaticCoercionShouldUseBox(denv, ty1, ty2, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(StaticCoercionShouldUseBoxE().Format t1 t2) |> ignore - - | TypeIsImplicitlyAbstract(_) -> - os.Append(TypeIsImplicitlyAbstractE().Format) |> ignore - - | NonRigidTypar(denv, tpnmOpt, typarRange, ty1, ty, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let (ty1, ty), _cxs = PrettyTypes.PrettifyTypePair denv.g (ty1, ty) - match tpnmOpt with - | None -> - os.Append(NonRigidTypar1E().Format (stringOfRange typarRange) (NicePrint.stringOfTy denv ty)) |> ignore - | Some tpnm -> - match ty1 with - | TType_measure _ -> - os.Append(NonRigidTypar2E().Format tpnm (NicePrint.stringOfTy denv ty)) |> ignore - | _ -> - os.Append(NonRigidTypar3E().Format tpnm (NicePrint.stringOfTy denv ty)) |> ignore - - | SyntaxError (ctxt, _) -> - let ctxt = unbox>(ctxt) - - let (|EndOfStructuredConstructToken|_|) token = - match token with - | Parser.TOKEN_ODECLEND - | Parser.TOKEN_OBLOCKSEP - | Parser.TOKEN_OEND - | Parser.TOKEN_ORIGHT_BLOCK_END - | Parser.TOKEN_OBLOCKEND | Parser.TOKEN_OBLOCKEND_COMING_SOON | Parser.TOKEN_OBLOCKEND_IS_HERE -> Some() - | _ -> None - - let tokenIdToText tid = - match tid with - | Parser.TOKEN_IDENT -> getErrorString("Parser.TOKEN.IDENT") - | Parser.TOKEN_BIGNUM - | Parser.TOKEN_INT8 - | Parser.TOKEN_UINT8 - | Parser.TOKEN_INT16 - | Parser.TOKEN_UINT16 - | Parser.TOKEN_INT32 - | Parser.TOKEN_UINT32 - | Parser.TOKEN_INT64 - | Parser.TOKEN_UINT64 - | Parser.TOKEN_UNATIVEINT - | Parser.TOKEN_NATIVEINT -> getErrorString("Parser.TOKEN.INT") - | Parser.TOKEN_IEEE32 - | Parser.TOKEN_IEEE64 -> getErrorString("Parser.TOKEN.FLOAT") - | Parser.TOKEN_DECIMAL -> getErrorString("Parser.TOKEN.DECIMAL") - | Parser.TOKEN_CHAR -> getErrorString("Parser.TOKEN.CHAR") - - | Parser.TOKEN_BASE -> getErrorString("Parser.TOKEN.BASE") - | Parser.TOKEN_LPAREN_STAR_RPAREN -> getErrorString("Parser.TOKEN.LPAREN.STAR.RPAREN") - | Parser.TOKEN_DOLLAR -> getErrorString("Parser.TOKEN.DOLLAR") - | Parser.TOKEN_INFIX_STAR_STAR_OP -> getErrorString("Parser.TOKEN.INFIX.STAR.STAR.OP") - | Parser.TOKEN_INFIX_COMPARE_OP -> getErrorString("Parser.TOKEN.INFIX.COMPARE.OP") - | Parser.TOKEN_COLON_GREATER -> getErrorString("Parser.TOKEN.COLON.GREATER") - | Parser.TOKEN_COLON_COLON ->getErrorString("Parser.TOKEN.COLON.COLON") - | Parser.TOKEN_PERCENT_OP -> getErrorString("Parser.TOKEN.PERCENT.OP") - | Parser.TOKEN_INFIX_AT_HAT_OP -> getErrorString("Parser.TOKEN.INFIX.AT.HAT.OP") - | Parser.TOKEN_INFIX_BAR_OP -> getErrorString("Parser.TOKEN.INFIX.BAR.OP") - | Parser.TOKEN_PLUS_MINUS_OP -> getErrorString("Parser.TOKEN.PLUS.MINUS.OP") - | Parser.TOKEN_PREFIX_OP -> getErrorString("Parser.TOKEN.PREFIX.OP") - | Parser.TOKEN_COLON_QMARK_GREATER -> getErrorString("Parser.TOKEN.COLON.QMARK.GREATER") - | Parser.TOKEN_INFIX_STAR_DIV_MOD_OP -> getErrorString("Parser.TOKEN.INFIX.STAR.DIV.MOD.OP") - | Parser.TOKEN_INFIX_AMP_OP -> getErrorString("Parser.TOKEN.INFIX.AMP.OP") - | Parser.TOKEN_AMP -> getErrorString("Parser.TOKEN.AMP") - | Parser.TOKEN_AMP_AMP -> getErrorString("Parser.TOKEN.AMP.AMP") - | Parser.TOKEN_BAR_BAR -> getErrorString("Parser.TOKEN.BAR.BAR") - | Parser.TOKEN_LESS -> getErrorString("Parser.TOKEN.LESS") - | Parser.TOKEN_GREATER -> getErrorString("Parser.TOKEN.GREATER") - | Parser.TOKEN_QMARK -> getErrorString("Parser.TOKEN.QMARK") - | Parser.TOKEN_QMARK_QMARK -> getErrorString("Parser.TOKEN.QMARK.QMARK") - | Parser.TOKEN_COLON_QMARK-> getErrorString("Parser.TOKEN.COLON.QMARK") - | Parser.TOKEN_INT32_DOT_DOT -> getErrorString("Parser.TOKEN.INT32.DOT.DOT") - | Parser.TOKEN_DOT_DOT -> getErrorString("Parser.TOKEN.DOT.DOT") - | Parser.TOKEN_DOT_DOT_HAT -> getErrorString("Parser.TOKEN.DOT.DOT") - | Parser.TOKEN_QUOTE -> getErrorString("Parser.TOKEN.QUOTE") - | Parser.TOKEN_STAR -> getErrorString("Parser.TOKEN.STAR") - | Parser.TOKEN_HIGH_PRECEDENCE_TYAPP -> getErrorString("Parser.TOKEN.HIGH.PRECEDENCE.TYAPP") - | Parser.TOKEN_COLON -> getErrorString("Parser.TOKEN.COLON") - | Parser.TOKEN_COLON_EQUALS -> getErrorString("Parser.TOKEN.COLON.EQUALS") - | Parser.TOKEN_LARROW -> getErrorString("Parser.TOKEN.LARROW") - | Parser.TOKEN_EQUALS -> getErrorString("Parser.TOKEN.EQUALS") - | Parser.TOKEN_GREATER_BAR_RBRACK -> getErrorString("Parser.TOKEN.GREATER.BAR.RBRACK") - | Parser.TOKEN_MINUS -> getErrorString("Parser.TOKEN.MINUS") - | Parser.TOKEN_ADJACENT_PREFIX_OP -> getErrorString("Parser.TOKEN.ADJACENT.PREFIX.OP") - | Parser.TOKEN_FUNKY_OPERATOR_NAME -> getErrorString("Parser.TOKEN.FUNKY.OPERATOR.NAME") - | Parser.TOKEN_COMMA-> getErrorString("Parser.TOKEN.COMMA") - | Parser.TOKEN_DOT -> getErrorString("Parser.TOKEN.DOT") - | Parser.TOKEN_BAR-> getErrorString("Parser.TOKEN.BAR") - | Parser.TOKEN_HASH -> getErrorString("Parser.TOKEN.HASH") - | Parser.TOKEN_UNDERSCORE -> getErrorString("Parser.TOKEN.UNDERSCORE") - | Parser.TOKEN_SEMICOLON -> getErrorString("Parser.TOKEN.SEMICOLON") - | Parser.TOKEN_SEMICOLON_SEMICOLON-> getErrorString("Parser.TOKEN.SEMICOLON.SEMICOLON") - | Parser.TOKEN_LPAREN-> getErrorString("Parser.TOKEN.LPAREN") - | Parser.TOKEN_RPAREN | Parser.TOKEN_RPAREN_COMING_SOON | Parser.TOKEN_RPAREN_IS_HERE -> getErrorString("Parser.TOKEN.RPAREN") - | Parser.TOKEN_LQUOTE -> getErrorString("Parser.TOKEN.LQUOTE") - | Parser.TOKEN_LBRACK -> getErrorString("Parser.TOKEN.LBRACK") - | Parser.TOKEN_LBRACE_BAR -> getErrorString("Parser.TOKEN.LBRACE.BAR") - | Parser.TOKEN_LBRACK_BAR -> getErrorString("Parser.TOKEN.LBRACK.BAR") - | Parser.TOKEN_LBRACK_LESS -> getErrorString("Parser.TOKEN.LBRACK.LESS") - | Parser.TOKEN_LBRACE -> getErrorString("Parser.TOKEN.LBRACE") - | Parser.TOKEN_BAR_RBRACK -> getErrorString("Parser.TOKEN.BAR.RBRACK") - | Parser.TOKEN_BAR_RBRACE -> getErrorString("Parser.TOKEN.BAR.RBRACE") - | Parser.TOKEN_GREATER_RBRACK -> getErrorString("Parser.TOKEN.GREATER.RBRACK") - | Parser.TOKEN_RQUOTE_DOT _ - | Parser.TOKEN_RQUOTE -> getErrorString("Parser.TOKEN.RQUOTE") - | Parser.TOKEN_RBRACK -> getErrorString("Parser.TOKEN.RBRACK") - | Parser.TOKEN_RBRACE | Parser.TOKEN_RBRACE_COMING_SOON | Parser.TOKEN_RBRACE_IS_HERE -> getErrorString("Parser.TOKEN.RBRACE") - | Parser.TOKEN_PUBLIC -> getErrorString("Parser.TOKEN.PUBLIC") - | Parser.TOKEN_PRIVATE -> getErrorString("Parser.TOKEN.PRIVATE") - | Parser.TOKEN_INTERNAL -> getErrorString("Parser.TOKEN.INTERNAL") - | Parser.TOKEN_CONSTRAINT -> getErrorString("Parser.TOKEN.CONSTRAINT") - | Parser.TOKEN_INSTANCE -> getErrorString("Parser.TOKEN.INSTANCE") - | Parser.TOKEN_DELEGATE -> getErrorString("Parser.TOKEN.DELEGATE") - | Parser.TOKEN_INHERIT -> getErrorString("Parser.TOKEN.INHERIT") - | Parser.TOKEN_CONSTRUCTOR-> getErrorString("Parser.TOKEN.CONSTRUCTOR") - | Parser.TOKEN_DEFAULT -> getErrorString("Parser.TOKEN.DEFAULT") - | Parser.TOKEN_OVERRIDE-> getErrorString("Parser.TOKEN.OVERRIDE") - | Parser.TOKEN_ABSTRACT-> getErrorString("Parser.TOKEN.ABSTRACT") - | Parser.TOKEN_CLASS-> getErrorString("Parser.TOKEN.CLASS") - | Parser.TOKEN_MEMBER -> getErrorString("Parser.TOKEN.MEMBER") - | Parser.TOKEN_STATIC -> getErrorString("Parser.TOKEN.STATIC") - | Parser.TOKEN_NAMESPACE-> getErrorString("Parser.TOKEN.NAMESPACE") - | Parser.TOKEN_OBLOCKBEGIN -> getErrorString("Parser.TOKEN.OBLOCKBEGIN") - | EndOfStructuredConstructToken -> getErrorString("Parser.TOKEN.OBLOCKEND") - | Parser.TOKEN_THEN - | Parser.TOKEN_OTHEN -> getErrorString("Parser.TOKEN.OTHEN") - | Parser.TOKEN_ELSE - | Parser.TOKEN_OELSE -> getErrorString("Parser.TOKEN.OELSE") - | Parser.TOKEN_LET(_) - | Parser.TOKEN_OLET(_) -> getErrorString("Parser.TOKEN.OLET") - | Parser.TOKEN_OBINDER - | Parser.TOKEN_BINDER -> getErrorString("Parser.TOKEN.BINDER") - | Parser.TOKEN_OAND_BANG - | Parser.TOKEN_AND_BANG -> getErrorString("Parser.TOKEN.AND.BANG") - | Parser.TOKEN_ODO -> getErrorString("Parser.TOKEN.ODO") - | Parser.TOKEN_OWITH -> getErrorString("Parser.TOKEN.OWITH") - | Parser.TOKEN_OFUNCTION -> getErrorString("Parser.TOKEN.OFUNCTION") - | Parser.TOKEN_OFUN -> getErrorString("Parser.TOKEN.OFUN") - | Parser.TOKEN_ORESET -> getErrorString("Parser.TOKEN.ORESET") - | Parser.TOKEN_ODUMMY -> getErrorString("Parser.TOKEN.ODUMMY") - | Parser.TOKEN_DO_BANG - | Parser.TOKEN_ODO_BANG -> getErrorString("Parser.TOKEN.ODO.BANG") - | Parser.TOKEN_YIELD -> getErrorString("Parser.TOKEN.YIELD") - | Parser.TOKEN_YIELD_BANG -> getErrorString("Parser.TOKEN.YIELD.BANG") - | Parser.TOKEN_OINTERFACE_MEMBER-> getErrorString("Parser.TOKEN.OINTERFACE.MEMBER") - | Parser.TOKEN_ELIF -> getErrorString("Parser.TOKEN.ELIF") - | Parser.TOKEN_RARROW -> getErrorString("Parser.TOKEN.RARROW") - | Parser.TOKEN_SIG -> getErrorString("Parser.TOKEN.SIG") - | Parser.TOKEN_STRUCT -> getErrorString("Parser.TOKEN.STRUCT") - | Parser.TOKEN_UPCAST -> getErrorString("Parser.TOKEN.UPCAST") - | Parser.TOKEN_DOWNCAST -> getErrorString("Parser.TOKEN.DOWNCAST") - | Parser.TOKEN_NULL -> getErrorString("Parser.TOKEN.NULL") - | Parser.TOKEN_RESERVED -> getErrorString("Parser.TOKEN.RESERVED") - | Parser.TOKEN_MODULE | Parser.TOKEN_MODULE_COMING_SOON | Parser.TOKEN_MODULE_IS_HERE -> getErrorString("Parser.TOKEN.MODULE") - | Parser.TOKEN_AND -> getErrorString("Parser.TOKEN.AND") - | Parser.TOKEN_AS -> getErrorString("Parser.TOKEN.AS") - | Parser.TOKEN_ASSERT -> getErrorString("Parser.TOKEN.ASSERT") - | Parser.TOKEN_OASSERT -> getErrorString("Parser.TOKEN.ASSERT") - | Parser.TOKEN_ASR-> getErrorString("Parser.TOKEN.ASR") - | Parser.TOKEN_DOWNTO -> getErrorString("Parser.TOKEN.DOWNTO") - | Parser.TOKEN_EXCEPTION -> getErrorString("Parser.TOKEN.EXCEPTION") - | Parser.TOKEN_FALSE -> getErrorString("Parser.TOKEN.FALSE") - | Parser.TOKEN_FOR -> getErrorString("Parser.TOKEN.FOR") - | Parser.TOKEN_FUN -> getErrorString("Parser.TOKEN.FUN") - | Parser.TOKEN_FUNCTION-> getErrorString("Parser.TOKEN.FUNCTION") - | Parser.TOKEN_FINALLY -> getErrorString("Parser.TOKEN.FINALLY") - | Parser.TOKEN_LAZY -> getErrorString("Parser.TOKEN.LAZY") - | Parser.TOKEN_OLAZY -> getErrorString("Parser.TOKEN.LAZY") - | Parser.TOKEN_MATCH -> getErrorString("Parser.TOKEN.MATCH") - | Parser.TOKEN_MATCH_BANG -> getErrorString("Parser.TOKEN.MATCH.BANG") - | Parser.TOKEN_MUTABLE -> getErrorString("Parser.TOKEN.MUTABLE") - | Parser.TOKEN_NEW -> getErrorString("Parser.TOKEN.NEW") - | Parser.TOKEN_OF -> getErrorString("Parser.TOKEN.OF") - | Parser.TOKEN_OPEN -> getErrorString("Parser.TOKEN.OPEN") - | Parser.TOKEN_OR -> getErrorString("Parser.TOKEN.OR") - | Parser.TOKEN_VOID -> getErrorString("Parser.TOKEN.VOID") - | Parser.TOKEN_EXTERN-> getErrorString("Parser.TOKEN.EXTERN") - | Parser.TOKEN_INTERFACE -> getErrorString("Parser.TOKEN.INTERFACE") - | Parser.TOKEN_REC -> getErrorString("Parser.TOKEN.REC") - | Parser.TOKEN_TO -> getErrorString("Parser.TOKEN.TO") - | Parser.TOKEN_TRUE -> getErrorString("Parser.TOKEN.TRUE") - | Parser.TOKEN_TRY -> getErrorString("Parser.TOKEN.TRY") - | Parser.TOKEN_TYPE | Parser.TOKEN_TYPE_COMING_SOON | Parser.TOKEN_TYPE_IS_HERE -> getErrorString("Parser.TOKEN.TYPE") - | Parser.TOKEN_VAL -> getErrorString("Parser.TOKEN.VAL") - | Parser.TOKEN_INLINE -> getErrorString("Parser.TOKEN.INLINE") - | Parser.TOKEN_WHEN -> getErrorString("Parser.TOKEN.WHEN") - | Parser.TOKEN_WHILE -> getErrorString("Parser.TOKEN.WHILE") - | Parser.TOKEN_WITH-> getErrorString("Parser.TOKEN.WITH") - | Parser.TOKEN_IF -> getErrorString("Parser.TOKEN.IF") - | Parser.TOKEN_DO -> getErrorString("Parser.TOKEN.DO") - | Parser.TOKEN_GLOBAL -> getErrorString("Parser.TOKEN.GLOBAL") - | Parser.TOKEN_DONE -> getErrorString("Parser.TOKEN.DONE") - | Parser.TOKEN_IN | Parser.TOKEN_JOIN_IN -> getErrorString("Parser.TOKEN.IN") - | Parser.TOKEN_HIGH_PRECEDENCE_PAREN_APP-> getErrorString("Parser.TOKEN.HIGH.PRECEDENCE.PAREN.APP") - | Parser.TOKEN_HIGH_PRECEDENCE_BRACK_APP-> getErrorString("Parser.TOKEN.HIGH.PRECEDENCE.BRACK.APP") - | Parser.TOKEN_BEGIN -> getErrorString("Parser.TOKEN.BEGIN") - | Parser.TOKEN_END -> getErrorString("Parser.TOKEN.END") - | Parser.TOKEN_HASH_LIGHT - | Parser.TOKEN_HASH_LINE - | Parser.TOKEN_HASH_IF - | Parser.TOKEN_HASH_ELSE - | Parser.TOKEN_HASH_ENDIF -> getErrorString("Parser.TOKEN.HASH.ENDIF") - | Parser.TOKEN_INACTIVECODE -> getErrorString("Parser.TOKEN.INACTIVECODE") - | Parser.TOKEN_LEX_FAILURE-> getErrorString("Parser.TOKEN.LEX.FAILURE") - | Parser.TOKEN_WHITESPACE -> getErrorString("Parser.TOKEN.WHITESPACE") - | Parser.TOKEN_COMMENT -> getErrorString("Parser.TOKEN.COMMENT") - | Parser.TOKEN_LINE_COMMENT -> getErrorString("Parser.TOKEN.LINE.COMMENT") - | Parser.TOKEN_STRING_TEXT -> getErrorString("Parser.TOKEN.STRING.TEXT") - | Parser.TOKEN_BYTEARRAY -> getErrorString("Parser.TOKEN.BYTEARRAY") - | Parser.TOKEN_STRING -> getErrorString("Parser.TOKEN.STRING") - | Parser.TOKEN_KEYWORD_STRING -> getErrorString("Parser.TOKEN.KEYWORD_STRING") - | Parser.TOKEN_EOF -> getErrorString("Parser.TOKEN.EOF") - | Parser.TOKEN_CONST -> getErrorString("Parser.TOKEN.CONST") - | Parser.TOKEN_FIXED -> getErrorString("Parser.TOKEN.FIXED") - | unknown -> - Debug.Assert(false, "unknown token tag") - let result = sprintf "%+A" unknown - Debug.Assert(false, result) - result - - match ctxt.CurrentToken with - | None -> os.Append(UnexpectedEndOfInputE().Format) |> ignore - | Some token -> - match (token |> Parser.tagOfToken |> Parser.tokenTagToTokenId), token with - | EndOfStructuredConstructToken, _ -> os.Append(OBlockEndSentenceE().Format) |> ignore - | Parser.TOKEN_LEX_FAILURE, Parser.LEX_FAILURE str -> Printf.bprintf os "%s" str (* Fix bug://2431 *) - | token, _ -> os.Append(UnexpectedE().Format (token |> tokenIdToText)) |> ignore - - (* Search for a state producing a single recognized non-terminal in the states on the stack *) - let foundInContext = - - (* Merge a bunch of expression non terminals *) - let (|NONTERM_Category_Expr|_|) = function - | Parser.NONTERM_argExpr|Parser.NONTERM_minusExpr|Parser.NONTERM_parenExpr|Parser.NONTERM_atomicExpr - | Parser.NONTERM_appExpr|Parser.NONTERM_tupleExpr|Parser.NONTERM_declExpr|Parser.NONTERM_braceExpr|Parser.NONTERM_braceBarExpr - | Parser.NONTERM_typedSeqExprBlock - | Parser.NONTERM_interactiveExpr -> Some() - | _ -> None - - (* Merge a bunch of pattern non terminals *) - let (|NONTERM_Category_Pattern|_|) = function - | Parser.NONTERM_constrPattern|Parser.NONTERM_parenPattern|Parser.NONTERM_atomicPattern -> Some() - | _ -> None - - (* Merge a bunch of if/then/else non terminals *) - let (|NONTERM_Category_IfThenElse|_|) = function - | Parser.NONTERM_ifExprThen|Parser.NONTERM_ifExprElifs|Parser.NONTERM_ifExprCases -> Some() - | _ -> None - - (* Merge a bunch of non terminals *) - let (|NONTERM_Category_SignatureFile|_|) = function - | Parser.NONTERM_signatureFile|Parser.NONTERM_moduleSpfn|Parser.NONTERM_moduleSpfns -> Some() - | _ -> None - let (|NONTERM_Category_ImplementationFile|_|) = function - | Parser.NONTERM_implementationFile|Parser.NONTERM_fileNamespaceImpl|Parser.NONTERM_fileNamespaceImpls -> Some() - | _ -> None - let (|NONTERM_Category_Definition|_|) = function - | Parser.NONTERM_fileModuleImpl|Parser.NONTERM_moduleDefn|Parser.NONTERM_interactiveDefns - |Parser.NONTERM_moduleDefns|Parser.NONTERM_moduleDefnsOrExpr -> Some() - | _ -> None - - let (|NONTERM_Category_Type|_|) = function - | Parser.NONTERM_typ|Parser.NONTERM_tupleType -> Some() - | _ -> None - - let (|NONTERM_Category_Interaction|_|) = function - | Parser.NONTERM_interactiveItemsTerminator|Parser.NONTERM_interaction|Parser.NONTERM__startinteraction -> Some() - | _ -> None - - - // Canonicalize the categories and check for a unique category - ctxt.ReducibleProductions |> List.exists (fun prods -> - match prods - |> List.map Parser.prodIdxToNonTerminal - |> List.map (function - | NONTERM_Category_Type -> Parser.NONTERM_typ - | NONTERM_Category_Expr -> Parser.NONTERM_declExpr - | NONTERM_Category_Pattern -> Parser.NONTERM_atomicPattern - | NONTERM_Category_IfThenElse -> Parser.NONTERM_ifExprThen - | NONTERM_Category_SignatureFile -> Parser.NONTERM_signatureFile - | NONTERM_Category_ImplementationFile -> Parser.NONTERM_implementationFile - | NONTERM_Category_Definition -> Parser.NONTERM_moduleDefn - | NONTERM_Category_Interaction -> Parser.NONTERM_interaction - | nt -> nt) - |> Set.ofList - |> Set.toList with - | [Parser.NONTERM_interaction] -> os.Append(NONTERM_interactionE().Format) |> ignore; true - | [Parser.NONTERM_hashDirective] -> os.Append(NONTERM_hashDirectiveE().Format) |> ignore; true - | [Parser.NONTERM_fieldDecl] -> os.Append(NONTERM_fieldDeclE().Format) |> ignore; true - | [Parser.NONTERM_unionCaseRepr] -> os.Append(NONTERM_unionCaseReprE().Format) |> ignore; true - | [Parser.NONTERM_localBinding] -> os.Append(NONTERM_localBindingE().Format) |> ignore; true - | [Parser.NONTERM_hardwhiteLetBindings] -> os.Append(NONTERM_hardwhiteLetBindingsE().Format) |> ignore; true - | [Parser.NONTERM_classDefnMember] -> os.Append(NONTERM_classDefnMemberE().Format) |> ignore; true - | [Parser.NONTERM_defnBindings] -> os.Append(NONTERM_defnBindingsE().Format) |> ignore; true - | [Parser.NONTERM_classMemberSpfn] -> os.Append(NONTERM_classMemberSpfnE().Format) |> ignore; true - | [Parser.NONTERM_valSpfn] -> os.Append(NONTERM_valSpfnE().Format) |> ignore; true - | [Parser.NONTERM_tyconSpfn] -> os.Append(NONTERM_tyconSpfnE().Format) |> ignore; true - | [Parser.NONTERM_anonLambdaExpr] -> os.Append(NONTERM_anonLambdaExprE().Format) |> ignore; true - | [Parser.NONTERM_attrUnionCaseDecl] -> os.Append(NONTERM_attrUnionCaseDeclE().Format) |> ignore; true - | [Parser.NONTERM_cPrototype] -> os.Append(NONTERM_cPrototypeE().Format) |> ignore; true - | [Parser.NONTERM_objExpr|Parser.NONTERM_objectImplementationMembers] -> os.Append(NONTERM_objectImplementationMembersE().Format) |> ignore; true - | [Parser.NONTERM_ifExprThen|Parser.NONTERM_ifExprElifs|Parser.NONTERM_ifExprCases] -> os.Append(NONTERM_ifExprCasesE().Format) |> ignore; true - | [Parser.NONTERM_openDecl] -> os.Append(NONTERM_openDeclE().Format) |> ignore; true - | [Parser.NONTERM_fileModuleSpec] -> os.Append(NONTERM_fileModuleSpecE().Format) |> ignore; true - | [Parser.NONTERM_patternClauses] -> os.Append(NONTERM_patternClausesE().Format) |> ignore; true - | [Parser.NONTERM_beginEndExpr] -> os.Append(NONTERM_beginEndExprE().Format) |> ignore; true - | [Parser.NONTERM_recdExpr] -> os.Append(NONTERM_recdExprE().Format) |> ignore; true - | [Parser.NONTERM_tyconDefn] -> os.Append(NONTERM_tyconDefnE().Format) |> ignore; true - | [Parser.NONTERM_exconCore] -> os.Append(NONTERM_exconCoreE().Format) |> ignore; true - | [Parser.NONTERM_typeNameInfo] -> os.Append(NONTERM_typeNameInfoE().Format) |> ignore; true - | [Parser.NONTERM_attributeList] -> os.Append(NONTERM_attributeListE().Format) |> ignore; true - | [Parser.NONTERM_quoteExpr] -> os.Append(NONTERM_quoteExprE().Format) |> ignore; true - | [Parser.NONTERM_typeConstraint] -> os.Append(NONTERM_typeConstraintE().Format) |> ignore; true - | [NONTERM_Category_ImplementationFile] -> os.Append(NONTERM_Category_ImplementationFileE().Format) |> ignore; true - | [NONTERM_Category_Definition] -> os.Append(NONTERM_Category_DefinitionE().Format) |> ignore; true - | [NONTERM_Category_SignatureFile] -> os.Append(NONTERM_Category_SignatureFileE().Format) |> ignore; true - | [NONTERM_Category_Pattern] -> os.Append(NONTERM_Category_PatternE().Format) |> ignore; true - | [NONTERM_Category_Expr] -> os.Append(NONTERM_Category_ExprE().Format) |> ignore; true - | [NONTERM_Category_Type] -> os.Append(NONTERM_Category_TypeE().Format) |> ignore; true - | [Parser.NONTERM_typeArgsActual] -> os.Append(NONTERM_typeArgsActualE().Format) |> ignore; true - | _ -> - false) - -#if DEBUG - if not foundInContext then - Printf.bprintf os ". (no 'in' context found: %+A)" (List.map (List.map Parser.prodIdxToNonTerminal) ctxt.ReducibleProductions) -#else - foundInContext |> ignore // suppress unused variable warning in RELEASE -#endif - let fix (s: string) = s.Replace(SR.GetString("FixKeyword"), "").Replace(SR.GetString("FixSymbol"), "").Replace(SR.GetString("FixReplace"), "") - match (ctxt.ShiftTokens - |> List.map Parser.tokenTagToTokenId - |> List.filter (function Parser.TOKEN_error | Parser.TOKEN_EOF -> false | _ -> true) - |> List.map tokenIdToText - |> Set.ofList - |> Set.toList) with - | [tokenName1] -> os.Append(TokenName1E().Format (fix tokenName1)) |> ignore - | [tokenName1;tokenName2] -> os.Append(TokenName1TokenName2E().Format (fix tokenName1) (fix tokenName2)) |> ignore - | [tokenName1;tokenName2;tokenName3] -> os.Append(TokenName1TokenName2TokenName3E().Format (fix tokenName1) (fix tokenName2) (fix tokenName3)) |> ignore - | _ -> () - (* - Printf.bprintf os ".\n\n state = %A\n token = %A\n expect (shift) %A\n expect (reduce) %A\n prods=%A\n non terminals: %A" - ctxt.StateStack - ctxt.CurrentToken - (List.map Parser.tokenTagToTokenId ctxt.ShiftTokens) - (List.map Parser.tokenTagToTokenId ctxt.ReduceTokens) - ctxt.ReducibleProductions - (List.mapSquared Parser.prodIdxToNonTerminal ctxt.ReducibleProductions) - *) - - | RuntimeCoercionSourceSealed(denv, ty, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - if isTyparTy denv.g ty - then os.Append(RuntimeCoercionSourceSealed1E().Format (NicePrint.stringOfTy denv ty)) |> ignore - else os.Append(RuntimeCoercionSourceSealed2E().Format (NicePrint.stringOfTy denv ty)) |> ignore - - | CoercionTargetSealed(denv, ty, _) -> - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let ty, _cxs= PrettyTypes.PrettifyType denv.g ty - os.Append(CoercionTargetSealedE().Format (NicePrint.stringOfTy denv ty)) |> ignore - - | UpcastUnnecessary(_) -> - os.Append(UpcastUnnecessaryE().Format) |> ignore - - | TypeTestUnnecessary(_) -> - os.Append(TypeTestUnnecessaryE().Format) |> ignore - - | QuotationTranslator.IgnoringPartOfQuotedTermWarning (msg, _) -> - Printf.bprintf os "%s" msg - - | OverrideDoesntOverride(denv, impl, minfoVirtOpt, g, amap, m) -> - let sig1 = DispatchSlotChecking.FormatOverride denv impl - match minfoVirtOpt with - | None -> - os.Append(OverrideDoesntOverride1E().Format sig1) |> ignore - | Some minfoVirt -> - // https://github.com/Microsoft/visualfsharp/issues/35 - // Improve error message when attempting to override generic return type with unit: - // we need to check if unit was used as a type argument - let rec hasUnitTType_app (types: TType list) = - match types with - | TType_app (maybeUnit, []) :: ts -> - match maybeUnit.TypeAbbrev with - | Some ttype when isUnitTy g ttype -> true - | _ -> hasUnitTType_app ts - | _ :: ts -> hasUnitTType_app ts - | [] -> false - - match minfoVirt.ApparentEnclosingType with - | TType_app (t, types) when t.IsFSharpInterfaceTycon && hasUnitTType_app types -> - // match abstract member with 'unit' passed as generic argument - os.Append(OverrideDoesntOverride4E().Format sig1) |> ignore - | _ -> - os.Append(OverrideDoesntOverride2E().Format sig1) |> ignore - let sig2 = DispatchSlotChecking.FormatMethInfoSig g amap m denv minfoVirt - if sig1 <> sig2 then - os.Append(OverrideDoesntOverride3E().Format sig2) |> ignore - - | UnionCaseWrongArguments (_, n1, n2, _) -> - os.Append(UnionCaseWrongArgumentsE().Format n2 n1) |> ignore - - | UnionPatternsBindDifferentNames _ -> - os.Append(UnionPatternsBindDifferentNamesE().Format) |> ignore - - | ValueNotContained (denv, mref, implVal, sigVal, f) -> - let text1, text2 = NicePrint.minimalStringsOfTwoValues denv implVal sigVal - os.Append(f((fullDisplayTextOfModRef mref), text1, text2)) |> ignore - - | ConstrNotContained (denv, v1, v2, f) -> - os.Append(f((NicePrint.stringOfUnionCase denv v1), (NicePrint.stringOfUnionCase denv v2))) |> ignore - - | ExnconstrNotContained (denv, v1, v2, f) -> - os.Append(f((NicePrint.stringOfExnDef denv v1), (NicePrint.stringOfExnDef denv v2))) |> ignore - - | FieldNotContained (denv, v1, v2, f) -> - os.Append(f((NicePrint.stringOfRecdField denv v1), (NicePrint.stringOfRecdField denv v2))) |> ignore - - | RequiredButNotSpecified (_, mref, k, name, _) -> - let nsb = new System.Text.StringBuilder() - name nsb; - os.Append(RequiredButNotSpecifiedE().Format (fullDisplayTextOfModRef mref) k (nsb.ToString())) |> ignore - - | UseOfAddressOfOperator _ -> - os.Append(UseOfAddressOfOperatorE().Format) |> ignore - - | DefensiveCopyWarning(s, _) -> os.Append(DefensiveCopyWarningE().Format s) |> ignore - - | DeprecatedThreadStaticBindingWarning(_) -> - os.Append(DeprecatedThreadStaticBindingWarningE().Format) |> ignore - - | FunctionValueUnexpected (denv, ty, _) -> - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - let errorText = FunctionValueUnexpectedE().Format (NicePrint.stringOfTy denv ty) - os.Append errorText |> ignore - - | UnitTypeExpected (denv, ty, _) -> - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - let warningText = UnitTypeExpectedE().Format (NicePrint.stringOfTy denv ty) - os.Append warningText |> ignore - - | UnitTypeExpectedWithEquality (denv, ty, _) -> - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - let warningText = UnitTypeExpectedWithEqualityE().Format (NicePrint.stringOfTy denv ty) - os.Append warningText |> ignore - - | UnitTypeExpectedWithPossiblePropertySetter (denv, ty, bindingName, propertyName, _) -> - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - let warningText = UnitTypeExpectedWithPossiblePropertySetterE().Format (NicePrint.stringOfTy denv ty) bindingName propertyName - os.Append warningText |> ignore - - | UnitTypeExpectedWithPossibleAssignment (denv, ty, isAlreadyMutable, bindingName, _) -> - let ty, _cxs = PrettyTypes.PrettifyType denv.g ty - let warningText = - if isAlreadyMutable then - UnitTypeExpectedWithPossibleAssignmentToMutableE().Format (NicePrint.stringOfTy denv ty) bindingName - else - UnitTypeExpectedWithPossibleAssignmentE().Format (NicePrint.stringOfTy denv ty) bindingName - os.Append warningText |> ignore - - | RecursiveUseCheckedAtRuntime _ -> - os.Append(RecursiveUseCheckedAtRuntimeE().Format) |> ignore - - | LetRecUnsound (_, [v], _) -> - os.Append(LetRecUnsound1E().Format v.DisplayName) |> ignore - - | LetRecUnsound (_, path, _) -> - let bos = new System.Text.StringBuilder() - (path.Tail @ [path.Head]) |> List.iter (fun (v: ValRef) -> bos.Append(LetRecUnsoundInnerE().Format v.DisplayName) |> ignore) - os.Append(LetRecUnsound2E().Format (List.head path).DisplayName (bos.ToString())) |> ignore - - | LetRecEvaluatedOutOfOrder (_, _, _, _) -> - os.Append(LetRecEvaluatedOutOfOrderE().Format) |> ignore - - | LetRecCheckedAtRuntime _ -> - os.Append(LetRecCheckedAtRuntimeE().Format) |> ignore - - | SelfRefObjCtor(false, _) -> - os.Append(SelfRefObjCtor1E().Format) |> ignore - - | SelfRefObjCtor(true, _) -> - os.Append(SelfRefObjCtor2E().Format) |> ignore - - | VirtualAugmentationOnNullValuedType(_) -> - os.Append(VirtualAugmentationOnNullValuedTypeE().Format) |> ignore - - | NonVirtualAugmentationOnNullValuedType(_) -> - os.Append(NonVirtualAugmentationOnNullValuedTypeE().Format) |> ignore - - | NonUniqueInferredAbstractSlot(_, denv, bindnm, bvirt1, bvirt2, _) -> - os.Append(NonUniqueInferredAbstractSlot1E().Format bindnm) |> ignore - let ty1 = bvirt1.ApparentEnclosingType - let ty2 = bvirt2.ApparentEnclosingType - // REVIEW: consider if we need to show _cxs (the type parameter constraints) - let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(NonUniqueInferredAbstractSlot2E().Format) |> ignore - if t1 <> t2 then - os.Append(NonUniqueInferredAbstractSlot3E().Format t1 t2) |> ignore - os.Append(NonUniqueInferredAbstractSlot4E().Format) |> ignore - - | Error ((_, s), _) -> os.Append s |> ignore - - | ErrorWithSuggestions ((_, s), _, idText, suggestionF) -> - os.Append(DecompileOpName s) |> ignore - suggestNames suggestionF idText - - | NumberedError ((_, s), _) -> os.Append s |> ignore - - | InternalError (s, _) - - | InvalidArgument s - - | Failure s as exn -> - ignore exn // use the argument, even in non DEBUG - let f1 = SR.GetString("Failure1") - let f2 = SR.GetString("Failure2") - match s with - | f when f = f1 -> os.Append(Failure3E().Format s) |> ignore - | f when f = f2 -> os.Append(Failure3E().Format s) |> ignore - | _ -> os.Append(Failure4E().Format s) |> ignore -#if DEBUG - Printf.bprintf os "\nStack Trace\n%s\n" (exn.ToString()) - if !showAssertForUnexpectedException then - System.Diagnostics.Debug.Assert(false, sprintf "Unexpected exception seen in compiler: %s\n%s" s (exn.ToString())) -#endif - - | WrappedError (exn, _) -> OutputExceptionR os exn - - | PatternMatchCompilation.MatchIncomplete (isComp, cexOpt, _) -> - os.Append(MatchIncomplete1E().Format) |> ignore - match cexOpt with - | None -> () - | Some (cex, false) -> os.Append(MatchIncomplete2E().Format cex) |> ignore - | Some (cex, true) -> os.Append(MatchIncomplete3E().Format cex) |> ignore - if isComp then - os.Append(MatchIncomplete4E().Format) |> ignore - - | PatternMatchCompilation.EnumMatchIncomplete (isComp, cexOpt, _) -> - os.Append(EnumMatchIncomplete1E().Format) |> ignore - match cexOpt with - | None -> () - | Some (cex, false) -> os.Append(MatchIncomplete2E().Format cex) |> ignore - | Some (cex, true) -> os.Append(MatchIncomplete3E().Format cex) |> ignore - if isComp then - os.Append(MatchIncomplete4E().Format) |> ignore - - | PatternMatchCompilation.RuleNeverMatched _ -> os.Append(RuleNeverMatchedE().Format) |> ignore - - | ValNotMutable(_, valRef, _) -> os.Append(ValNotMutableE().Format(valRef.DisplayName)) |> ignore - - | ValNotLocal _ -> os.Append(ValNotLocalE().Format) |> ignore - - | ObsoleteError (s, _) - - | ObsoleteWarning (s, _) -> - os.Append(Obsolete1E().Format) |> ignore - if s <> "" then os.Append(Obsolete2E().Format s) |> ignore - - | Experimental (s, _) -> os.Append(ExperimentalE().Format s) |> ignore - - | PossibleUnverifiableCode _ -> os.Append(PossibleUnverifiableCodeE().Format) |> ignore - - | UserCompilerMessage (msg, _, _) -> os.Append msg |> ignore - - | Deprecated(s, _) -> os.Append(DeprecatedE().Format s) |> ignore - - | LibraryUseOnly(_) -> os.Append(LibraryUseOnlyE().Format) |> ignore - - | MissingFields(sl, _) -> os.Append(MissingFieldsE().Format (String.concat "," sl + ".")) |> ignore - - | ValueRestriction(denv, hassig, v, _, _) -> - let denv = { denv with showImperativeTyparAnnotations=true } - let tau = v.TauType - if hassig then - if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then - os.Append(ValueRestriction1E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv v) - v.DisplayName) |> ignore - else - os.Append(ValueRestriction2E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv v) - v.DisplayName) |> ignore - else - match v.MemberInfo with - | Some membInfo when - begin match membInfo.MemberFlags.MemberKind with - | MemberKind.PropertyGet - | MemberKind.PropertySet - | MemberKind.Constructor -> true (* can't infer extra polymorphism *) - | _ -> false (* can infer extra polymorphism *) - end -> - os.Append(ValueRestriction3E().Format (NicePrint.stringOfQualifiedValOrMember denv v)) |> ignore - | _ -> - if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then - os.Append(ValueRestriction4E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv v) - v.DisplayName) |> ignore - else - os.Append(ValueRestriction5E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv v) - v.DisplayName) |> ignore - - - | Parsing.RecoverableParseError -> os.Append(RecoverableParseErrorE().Format) |> ignore - - | ReservedKeyword (s, _) -> os.Append(ReservedKeywordE().Format s) |> ignore - - | IndentationProblem (s, _) -> os.Append(IndentationProblemE().Format s) |> ignore - - | OverrideInIntrinsicAugmentation(_) -> os.Append(OverrideInIntrinsicAugmentationE().Format) |> ignore - - | OverrideInExtrinsicAugmentation(_) -> os.Append(OverrideInExtrinsicAugmentationE().Format) |> ignore - - | IntfImplInIntrinsicAugmentation(_) -> os.Append(IntfImplInIntrinsicAugmentationE().Format) |> ignore - - | IntfImplInExtrinsicAugmentation(_) -> os.Append(IntfImplInExtrinsicAugmentationE().Format) |> ignore - - | UnresolvedReferenceError(assemblyName, _) - - | UnresolvedReferenceNoRange assemblyName -> - os.Append(UnresolvedReferenceNoRangeE().Format assemblyName) |> ignore - - | UnresolvedPathReference(assemblyName, pathname, _) - - | UnresolvedPathReferenceNoRange(assemblyName, pathname) -> - os.Append(UnresolvedPathReferenceNoRangeE().Format pathname assemblyName) |> ignore - - | DeprecatedCommandLineOptionFull(fullText, _) -> - os.Append fullText |> ignore - - | DeprecatedCommandLineOptionForHtmlDoc(optionName, _) -> - os.Append(FSComp.SR.optsDCLOHtmlDoc optionName) |> ignore - - | DeprecatedCommandLineOptionSuggestAlternative(optionName, altOption, _) -> - os.Append(FSComp.SR.optsDCLODeprecatedSuggestAlternative(optionName, altOption)) |> ignore - - | InternalCommandLineOption(optionName, _) -> - os.Append(FSComp.SR.optsInternalNoDescription optionName) |> ignore - - | DeprecatedCommandLineOptionNoDescription(optionName, _) -> - os.Append(FSComp.SR.optsDCLONoDescription optionName) |> ignore - - | HashIncludeNotAllowedInNonScript(_) -> - os.Append(HashIncludeNotAllowedInNonScriptE().Format) |> ignore - - | HashReferenceNotAllowedInNonScript(_) -> - os.Append(HashReferenceNotAllowedInNonScriptE().Format) |> ignore - - | HashDirectiveNotAllowedInNonScript(_) -> - os.Append(HashDirectiveNotAllowedInNonScriptE().Format) |> ignore - - | FileNameNotResolved(filename, locations, _) -> - os.Append(FileNameNotResolvedE().Format filename locations) |> ignore - - | AssemblyNotResolved(originalName, _) -> - os.Append(AssemblyNotResolvedE().Format originalName) |> ignore - - | IllegalFileNameChar(fileName, invalidChar) -> - os.Append(FSComp.SR.buildUnexpectedFileNameCharacter(fileName, string invalidChar)|>snd) |> ignore - - | HashLoadedSourceHasIssues(warnings, errors, _) -> - let Emit(l: exn list) = - OutputExceptionR os (List.head l) - if errors=[] then - os.Append(HashLoadedSourceHasIssues1E().Format) |> ignore - Emit warnings - else - os.Append(HashLoadedSourceHasIssues2E().Format) |> ignore - Emit errors - - | HashLoadedScriptConsideredSource(_) -> - os.Append(HashLoadedScriptConsideredSourceE().Format) |> ignore - - | InvalidInternalsVisibleToAssemblyName(badName, fileNameOption) -> - match fileNameOption with - | Some file -> os.Append(InvalidInternalsVisibleToAssemblyName1E().Format badName file) |> ignore - | None -> os.Append(InvalidInternalsVisibleToAssemblyName2E().Format badName) |> ignore - - | LoadedSourceNotFoundIgnoring(filename, _) -> - os.Append(LoadedSourceNotFoundIgnoringE().Format filename) |> ignore - - | MSBuildReferenceResolutionWarning(code, message, _) - - | MSBuildReferenceResolutionError(code, message, _) -> - os.Append(MSBuildReferenceResolutionErrorE().Format message code) |> ignore - - // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> - OutputExceptionR os e.InnerException - - | :? FileNotFoundException as e -> Printf.bprintf os "%s" e.Message - - | :? DirectoryNotFoundException as e -> Printf.bprintf os "%s" e.Message - - | :? System.ArgumentException as e -> Printf.bprintf os "%s" e.Message - - | :? System.NotSupportedException as e -> Printf.bprintf os "%s" e.Message - - | :? IOException as e -> Printf.bprintf os "%s" e.Message - - | :? System.UnauthorizedAccessException as e -> Printf.bprintf os "%s" e.Message - - | e -> - os.Append(TargetInvocationExceptionWrapperE().Format e.Message) |> ignore -#if DEBUG - Printf.bprintf os "\nStack Trace\n%s\n" (e.ToString()) - if !showAssertForUnexpectedException then - System.Diagnostics.Debug.Assert(false, sprintf "Unknown exception seen in compiler: %s" (e.ToString())) -#endif - - OutputExceptionR os err.Exception - - -// remove any newlines and tabs -let OutputPhasedDiagnostic (os: System.Text.StringBuilder) (err: PhasedDiagnostic) (flattenErrors: bool) (canSuggestNames: bool) = - let buf = new System.Text.StringBuilder() - - OutputPhasedErrorR buf err canSuggestNames - let s = if flattenErrors then ErrorLogger.NormalizeErrorString (buf.ToString()) else buf.ToString() - - os.Append s |> ignore - -let SanitizeFileName fileName implicitIncludeDir = - // The assert below is almost ok, but it fires in two cases: - // - fsi.exe sometimes passes "stdin" as a dummy filename - // - if you have a #line directive, e.g. - // # 1000 "Line01.fs" - // then it also asserts. But these are edge cases that can be fixed later, e.g. in bug 4651. - //System.Diagnostics.Debug.Assert(FileSystem.IsPathRootedShim fileName, sprintf "filename should be absolute: '%s'" fileName) - try - let fullPath = FileSystem.GetFullPathShim fileName - let currentDir = implicitIncludeDir - - // if the file name is not rooted in the current directory, return the full path - if not(fullPath.StartsWithOrdinal currentDir) then - fullPath - // if the file name is rooted in the current directory, return the relative path - else - fullPath.Replace(currentDir+"\\", "") - with _ -> - fileName - -[] -type DiagnosticLocation = - { Range: range - File: string - TextRepresentation: string - IsEmpty: bool } - -[] -type DiagnosticCanonicalInformation = - { ErrorNumber: int - Subcategory: string - TextRepresentation: string } - -[] -type DiagnosticDetailedInfo = - { Location: DiagnosticLocation option - Canonical: DiagnosticCanonicalInformation - Message: string } - -[] -type Diagnostic = - | Short of bool * string - | Long of bool * DiagnosticDetailedInfo - -/// returns sequence that contains Diagnostic for the given error + Diagnostic for all related errors -let CollectDiagnostic (implicitIncludeDir, showFullPaths, flattenErrors, errorStyle, isError, err: PhasedDiagnostic, canSuggestNames: bool) = - let outputWhere (showFullPaths, errorStyle) m: DiagnosticLocation = - if Range.equals m rangeStartup || Range.equals m rangeCmdArgs then - { Range = m; TextRepresentation = ""; IsEmpty = true; File = "" } - else - let file = m.FileName - let file = if showFullPaths then - Filename.fullpath implicitIncludeDir file - else - SanitizeFileName file implicitIncludeDir - let text, m, file = - match errorStyle with - | ErrorStyle.EmacsErrors -> - let file = file.Replace("\\", "/") - (sprintf "File \"%s\", line %d, characters %d-%d: " file m.StartLine m.StartColumn m.EndColumn), m, file - - // We're adjusting the columns here to be 1-based - both for parity with C# and for MSBuild, which assumes 1-based columns for error output - | ErrorStyle.DefaultErrors -> - let file = file.Replace('/', System.IO.Path.DirectorySeparatorChar) - let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) m.End - (sprintf "%s(%d,%d): " file m.StartLine m.StartColumn), m, file - - // We may also want to change TestErrors to be 1-based - | ErrorStyle.TestErrors -> - let file = file.Replace("/", "\\") - let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1) ) - sprintf "%s(%d,%d-%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file - - | ErrorStyle.GccErrors -> - let file = file.Replace('/', System.IO.Path.DirectorySeparatorChar) - let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1) ) - sprintf "%s:%d:%d: " file m.StartLine m.StartColumn, m, file - - // Here, we want the complete range information so Project Systems can generate proper squiggles - | ErrorStyle.VSErrors -> - // Show prefix only for real files. Otherwise, we just want a truncated error like: - // parse error FS0031: blah blah - if not (Range.equals m range0) && not (Range.equals m rangeStartup) && not (Range.equals m rangeCmdArgs) then - let file = file.Replace("/", "\\") - let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1) ) - sprintf "%s(%d,%d,%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file - else - "", m, file - { Range = m; TextRepresentation = text; IsEmpty = false; File = file } - - match err.Exception with - | ReportedError _ -> - assert ("" = "Unexpected ReportedError") // this should never happen - Seq.empty - | StopProcessing -> - assert ("" = "Unexpected StopProcessing") // this should never happen - Seq.empty - | _ -> - let errors = ResizeArray() - let report err = - let OutputWhere err = - match GetRangeOfDiagnostic err with - | Some m -> Some(outputWhere (showFullPaths, errorStyle) m) - | None -> None - - let OutputCanonicalInformation(subcategory, errorNumber) : DiagnosticCanonicalInformation = - let text = - match errorStyle with - // Show the subcategory for --vserrors so that we can fish it out in Visual Studio and use it to determine error stickiness. - | ErrorStyle.VSErrors -> sprintf "%s %s FS%04d: " subcategory (if isError then "error" else "warning") errorNumber - | _ -> sprintf "%s FS%04d: " (if isError then "error" else "warning") errorNumber - { ErrorNumber = errorNumber; Subcategory = subcategory; TextRepresentation = text} - - let mainError, relatedErrors = SplitRelatedDiagnostics err - let where = OutputWhere mainError - let canonical = OutputCanonicalInformation(err.Subcategory(), GetDiagnosticNumber mainError) - let message = - let os = System.Text.StringBuilder() - OutputPhasedDiagnostic os mainError flattenErrors canSuggestNames - os.ToString() - - let entry: DiagnosticDetailedInfo = { Location = where; Canonical = canonical; Message = message } - - errors.Add ( Diagnostic.Long(isError, entry ) ) - - let OutputRelatedError(err: PhasedDiagnostic) = - match errorStyle with - // Give a canonical string when --vserror. - | ErrorStyle.VSErrors -> - let relWhere = OutputWhere mainError // mainError? - let relCanonical = OutputCanonicalInformation(err.Subcategory(), GetDiagnosticNumber mainError) // Use main error for code - let relMessage = - let os = System.Text.StringBuilder() - OutputPhasedDiagnostic os err flattenErrors canSuggestNames - os.ToString() - - let entry: DiagnosticDetailedInfo = { Location = relWhere; Canonical = relCanonical; Message = relMessage} - errors.Add( Diagnostic.Long (isError, entry) ) - - | _ -> - let os = System.Text.StringBuilder() - OutputPhasedDiagnostic os err flattenErrors canSuggestNames - errors.Add( Diagnostic.Short(isError, os.ToString()) ) - - relatedErrors |> List.iter OutputRelatedError - - match err with -#if !NO_EXTENSIONTYPING - | {Exception = (:? TypeProviderError as tpe)} -> - tpe.Iter (fun e -> - let newErr = {err with Exception = e} - report newErr - ) -#endif - | x -> report x - - errors:> seq<_> - -/// used by fsc.exe and fsi.exe, but not by VS -/// prints error and related errors to the specified StringBuilder -let rec OutputDiagnostic (implicitIncludeDir, showFullPaths, flattenErrors, errorStyle, isError) os (err: PhasedDiagnostic) = - - // 'true' for "canSuggestNames" is passed last here because we want to report suggestions in fsc.exe and fsi.exe, just not in regular IDE usage. - let errors = CollectDiagnostic (implicitIncludeDir, showFullPaths, flattenErrors, errorStyle, isError, err, true) - for e in errors do - Printf.bprintf os "\n" - match e with - | Diagnostic.Short(_, txt) -> - os.Append txt |> ignore - | Diagnostic.Long(_, details) -> - match details.Location with - | Some l when not l.IsEmpty -> os.Append l.TextRepresentation |> ignore - | _ -> () - os.Append( details.Canonical.TextRepresentation ) |> ignore - os.Append( details.Message ) |> ignore - -let OutputDiagnosticContext prefix fileLineFn os err = - match GetRangeOfDiagnostic err with - | None -> () - | Some m -> - let filename = m.FileName - let lineA = m.StartLine - let lineB = m.EndLine - let line = fileLineFn filename lineA - if line<>"" then - let iA = m.StartColumn - let iB = m.EndColumn - let iLen = if lineA = lineB then max (iB - iA) 1 else 1 - Printf.bprintf os "%s%s\n" prefix line - Printf.bprintf os "%s%s%s\n" prefix (String.make iA '-') (String.make iLen '^') - -let (++) x s = x @ [s] - -//-------------------------------------------------------------------------- -// General file name resolver -//-------------------------------------------------------------------------- - -/// Will return None if the filename is not found. -let TryResolveFileUsingPaths(paths, m, name) = - let () = - try FileSystem.IsPathRootedShim name |> ignore - with :? System.ArgumentException as e -> error(Error(FSComp.SR.buildProblemWithFilename(name, e.Message), m)) - if FileSystem.IsPathRootedShim name && FileSystem.SafeExists name - then Some name - else - let res = paths |> List.tryPick (fun path -> - let n = Path.Combine (path, name) - if FileSystem.SafeExists n then Some n - else None) - res - -/// Will raise FileNameNotResolved if the filename was not found -let ResolveFileUsingPaths(paths, m, name) = - match TryResolveFileUsingPaths(paths, m, name) with - | Some res -> res - | None -> - let searchMessage = String.concat "\n " paths - raise (FileNameNotResolved(name, searchMessage, m)) - -let GetWarningNumber(m, s: string) = - try - // Okay so ... - // #pragma strips FS of the #pragma "FS0004" and validates the warning number - // therefore if we have warning id that starts with a numeric digit we convert it to Some (int32) - // anything else is ignored None - if Char.IsDigit(s.[0]) then Some (int32 s) - elif s.StartsWithOrdinal("FS") = true then raise (new ArgumentException()) - else None - with err -> - warning(Error(FSComp.SR.buildInvalidWarningNumber s, m)) - None - -let ComputeMakePathAbsolute implicitIncludeDir (path: string) = - try - // remove any quotation marks from the path first - let path = path.Replace("\"", "") - if not (FileSystem.IsPathRootedShim path) - then Path.Combine (implicitIncludeDir, path) - else path - with - :? System.ArgumentException -> path - -//---------------------------------------------------------------------------- -// Configuration -//---------------------------------------------------------------------------- - -[] -type CompilerTarget = - | WinExe - | ConsoleExe - | Dll - | Module - member x.IsExe = (match x with ConsoleExe | WinExe -> true | _ -> false) - -[] -type ResolveAssemblyReferenceMode = Speculative | ReportErrors - -[] -type CopyFSharpCoreFlag = Yes | No - -/// Represents the file or string used for the --version flag -type VersionFlag = - | VersionString of string - | VersionFile of string - | VersionNone - member x.GetVersionInfo implicitIncludeDir = - let vstr = x.GetVersionString implicitIncludeDir - try - IL.parseILVersion vstr - with _ -> errorR(Error(FSComp.SR.buildInvalidVersionString vstr, rangeStartup)); IL.parseILVersion "0.0.0.0" - - member x.GetVersionString implicitIncludeDir = - match x with - | VersionString s -> s - | VersionFile s -> - let s = if FileSystem.IsPathRootedShim s then s else Path.Combine(implicitIncludeDir, s) - if not(FileSystem.SafeExists s) then - errorR(Error(FSComp.SR.buildInvalidVersionFile s, rangeStartup)); "0.0.0.0" - else - use is = System.IO.File.OpenText s - is.ReadLine() - | VersionNone -> "0.0.0.0" - - -/// Represents a reference to an assembly. May be backed by a real assembly on disk, or a cross-project -/// reference backed by information generated by the the compiler service. -type IRawFSharpAssemblyData = - /// The raw list AutoOpenAttribute attributes in the assembly - abstract GetAutoOpenAttributes: ILGlobals -> string list - /// The raw list InternalsVisibleToAttribute attributes in the assembly - abstract GetInternalsVisibleToAttributes: ILGlobals -> string list - /// The raw IL module definition in the assembly, if any. This is not present for cross-project references - /// in the language service - abstract TryGetILModuleDef: unit -> ILModuleDef option - /// The raw F# signature data in the assembly, if any - abstract GetRawFSharpSignatureData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list - /// The raw F# optimization data in the assembly, if any - abstract GetRawFSharpOptimizationData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list - /// The table of type forwarders in the assembly - abstract GetRawTypeForwarders: unit -> ILExportedTypesAndForwarders - /// The identity of the module - abstract ILScopeRef: ILScopeRef - abstract ILAssemblyRefs: ILAssemblyRef list - abstract ShortAssemblyName: string - abstract HasAnyFSharpSignatureDataAttribute: bool - abstract HasMatchingFSharpSignatureDataAttribute: ILGlobals -> bool - -/// Cache of time stamps as we traverse a project description -type TimeStampCache(defaultTimeStamp: DateTime) = - let files = Dictionary() - let projects = Dictionary(HashIdentity.Reference) - member cache.GetFileTimeStamp fileName = - let ok, v = files.TryGetValue fileName - if ok then v else - let v = - try - FileSystem.GetLastWriteTimeShim fileName - with - | :? FileNotFoundException -> - defaultTimeStamp - files.[fileName] <- v - v - - member cache.GetProjectReferenceTimeStamp (pr: IProjectReference, ctok) = - let ok, v = projects.TryGetValue pr - if ok then v else - let v = defaultArg (pr.TryGetLogicalTimeStamp (cache, ctok)) defaultTimeStamp - projects.[pr] <- v - v - -and IProjectReference = - /// The name of the assembly file generated by the project - abstract FileName: string - - /// Evaluate raw contents of the assembly file generated by the project - abstract EvaluateRawContents: CompilationThreadToken -> Cancellable - - /// Get the logical timestamp that would be the timestamp of the assembly file generated by the project - /// - /// For project references this is maximum of the timestamps of all dependent files. - /// The project is not actually built, nor are any assemblies read, but the timestamps for each dependent file - /// are read via the FileSystem. If the files don't exist, then a default timestamp is used. - /// - /// The operation returns None only if it is not possible to create an IncrementalBuilder for the project at all, e.g. if there - /// are fatal errors in the options for the project. - abstract TryGetLogicalTimeStamp: TimeStampCache * CompilationThreadToken -> System.DateTime option - -type AssemblyReference = - | AssemblyReference of range * string * IProjectReference option - - member x.Range = (let (AssemblyReference(m, _, _)) = x in m) - - member x.Text = (let (AssemblyReference(_, text, _)) = x in text) - - member x.ProjectReference = (let (AssemblyReference(_, _, contents)) = x in contents) - - member x.SimpleAssemblyNameIs name = - (String.Compare(fileNameWithoutExtensionWithValidate false x.Text, name, StringComparison.OrdinalIgnoreCase) = 0) || - (let text = x.Text.ToLowerInvariant() - not (text.Contains "/") && not (text.Contains "\\") && not (text.Contains ".dll") && not (text.Contains ".exe") && - try let aname = System.Reflection.AssemblyName x.Text in aname.Name = name - with _ -> false) - - override x.ToString() = sprintf "AssemblyReference(%s)" x.Text - -type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list -#if !NO_EXTENSIONTYPING -type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list -#endif - -/// The thread in which compilation calls will be enqueued and done work on. -/// Note: This is currently only used when disposing of type providers and will be extended to all the other type provider calls when compilations can be done in parallel. -/// Right now all calls in FCS to type providers are single-threaded through use of the reactor thread. -type ICompilationThread = - - /// Enqueue work to be done on a compilation thread. - abstract EnqueueWork: (CompilationThreadToken -> unit) -> unit - -type ImportedBinary = - { FileName: string - RawMetadata: IRawFSharpAssemblyData -#if !NO_EXTENSIONTYPING - ProviderGeneratedAssembly: System.Reflection.Assembly option - IsProviderGenerated: bool - ProviderGeneratedStaticLinkMap: ProvidedAssemblyStaticLinkingMap option -#endif - ILAssemblyRefs: ILAssemblyRef list - ILScopeRef: ILScopeRef } - -type ImportedAssembly = - { ILScopeRef: ILScopeRef - FSharpViewOfMetadata: CcuThunk - AssemblyAutoOpenAttributes: string list - AssemblyInternalsVisibleToAttributes: string list -#if !NO_EXTENSIONTYPING - IsProviderGenerated: bool - mutable TypeProviders: Tainted list -#endif - FSharpOptimizationData: Microsoft.FSharp.Control.Lazy> } - -type AvailableImportedAssembly = - | ResolvedImportedAssembly of ImportedAssembly - | UnresolvedImportedAssembly of string - -type CcuLoadFailureAction = - | RaiseError - | ReturnNone - -[] -type TcConfigBuilder = - { mutable primaryAssembly: PrimaryAssembly - mutable noFeedback: bool - mutable stackReserveSize: int32 option - mutable implicitIncludeDir: string (* normally "." *) - mutable openDebugInformationForLaterStaticLinking: bool (* only for --standalone *) - defaultFSharpBinariesDir: string - mutable compilingFslib: bool - mutable useIncrementalBuilder: bool - mutable includes: string list - mutable implicitOpens: string list - mutable useFsiAuxLib: bool - mutable framework: bool - mutable resolutionEnvironment: ReferenceResolver.ResolutionEnvironment - mutable implicitlyResolveAssemblies: bool - mutable light: bool option - mutable conditionalCompilationDefines: string list - mutable loadedSources: (range * string * string) list - mutable compilerToolPaths: string list - mutable referencedDLLs: AssemblyReference list - mutable packageManagerLines: Map - mutable projectReferences: IProjectReference list - mutable knownUnresolvedReferences: UnresolvedAssemblyReference list - reduceMemoryUsage: ReduceMemoryFlag - mutable subsystemVersion: int * int - mutable useHighEntropyVA: bool - mutable inputCodePage: int option - mutable embedResources: string list - mutable errorSeverityOptions: FSharpErrorSeverityOptions - mutable mlCompatibility: bool - mutable checkOverflow: bool - mutable showReferenceResolutions: bool - mutable outputDir : string option - mutable outputFile: string option - mutable platform: ILPlatform option - mutable prefer32Bit: bool - mutable useSimpleResolution: bool - mutable target: CompilerTarget - mutable debuginfo: bool - mutable testFlagEmitFeeFeeAs100001: bool - mutable dumpDebugInfo: bool - mutable debugSymbolFile: string option - (* Backend configuration *) - mutable typeCheckOnly: bool - mutable parseOnly: bool - mutable importAllReferencesOnly: bool - mutable simulateException: string option - mutable printAst: bool - mutable tokenizeOnly: bool - mutable testInteractionParser: bool - mutable reportNumDecls: bool - mutable printSignature: bool - mutable printSignatureFile: string - mutable xmlDocOutputFile: string option - mutable stats: bool - mutable generateFilterBlocks: bool (* don't generate filter blocks due to bugs on Mono *) - - mutable signer: string option - mutable container: string option - - mutable delaysign: bool - mutable publicsign: bool - mutable version: VersionFlag - mutable metadataVersion: string option - mutable standalone: bool - mutable extraStaticLinkRoots: string list - mutable noSignatureData: bool - mutable onlyEssentialOptimizationData: bool - mutable useOptimizationDataFile: bool - mutable jitTracking: bool - mutable portablePDB: bool - mutable embeddedPDB: bool - mutable embedAllSource: bool - mutable embedSourceList: string list - mutable sourceLink: string - - mutable ignoreSymbolStoreSequencePoints: bool - mutable internConstantStrings: bool - mutable extraOptimizationIterations: int - - mutable win32res: string - mutable win32manifest: string - mutable includewin32manifest: bool - mutable linkResources: string list - mutable legacyReferenceResolver: ReferenceResolver.Resolver - - mutable showFullPaths: bool - mutable errorStyle: ErrorStyle - mutable utf8output: bool - mutable flatErrors: bool - - mutable maxErrors: int - mutable abortOnError: bool (* intended for fsi scripts that should exit on first error *) - mutable baseAddress: int32 option - mutable checksumAlgorithm: HashAlgorithm -#if DEBUG - mutable showOptimizationData: bool -#endif - mutable showTerms: bool (* show terms between passes? *) - mutable writeTermsToFiles: bool (* show terms to files? *) - mutable doDetuple: bool (* run detuple pass? *) - mutable doTLR: bool (* run TLR pass? *) - mutable doFinalSimplify: bool (* do final simplification pass *) - mutable optsOn: bool (* optimizations are turned on *) - mutable optSettings: Optimizer.OptimizationSettings - mutable emitTailcalls: bool - mutable deterministic: bool - mutable preferredUiLang: string option - mutable lcid: int option - mutable productNameForBannerText: string - /// show the MS (c) notice, e.g. with help or fsi? - mutable showBanner: bool - - /// show times between passes? - mutable showTimes: bool - mutable showLoadedAssemblies: bool - mutable continueAfterParseFailure: bool -#if !NO_EXTENSIONTYPING - /// show messages about extension type resolution? - mutable showExtensionTypeMessages: bool -#endif - mutable compilationThread: ICompilationThread - - /// pause between passes? - mutable pause: bool - /// whenever possible, emit callvirt instead of call - mutable alwaysCallVirt: bool - - /// if true, strip away data that would not be of use to end users, but is useful to us for debugging - // REVIEW: "stripDebugData"? - mutable noDebugData: bool - - /// if true, indicates all type checking and code generation is in the context of fsi.exe - isInteractive: bool - isInvalidationSupported: bool - - /// used to log sqm data - - /// if true - every expression in quotations will be augmented with full debug info (filename, location in file) - mutable emitDebugInfoInQuotations: bool - - mutable exename: string option - - // If true - the compiler will copy FSharp.Core.dll along the produced binaries - mutable copyFSharpCore: CopyFSharpCoreFlag - - /// When false FSI will lock referenced assemblies requiring process restart, false = disable Shadow Copy false (*default*) - mutable shadowCopyReferences: bool - mutable useSdkRefs: bool - - /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, - /// and from which we can read the metadata. Only used when metadataOnly=true. - mutable tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot - - mutable internalTestSpanStackReferring: bool - - mutable noConditionalErasure: bool - - mutable pathMap: PathMap - - mutable langVersion: LanguageVersion - - mutable dependencyProvider: DependencyProvider - } - - static member Initial = - { - primaryAssembly = PrimaryAssembly.Mscorlib // default value, can be overridden using the command line switch - light = None - noFeedback = false - stackReserveSize = None - conditionalCompilationDefines = [] - implicitIncludeDir = String.Empty - openDebugInformationForLaterStaticLinking = false - defaultFSharpBinariesDir = String.Empty - compilingFslib = false - useIncrementalBuilder = false - useFsiAuxLib = false - implicitOpens = [] - includes = [] - resolutionEnvironment = ResolutionEnvironment.EditingOrCompilation false - framework = true - implicitlyResolveAssemblies = true - compilerToolPaths = [] - referencedDLLs = [] - packageManagerLines = Map.empty - projectReferences = [] - knownUnresolvedReferences = [] - loadedSources = [] - errorSeverityOptions = FSharpErrorSeverityOptions.Default - embedResources = [] - inputCodePage = None - reduceMemoryUsage = ReduceMemoryFlag.Yes // always gets set explicitly - subsystemVersion = 4, 0 // per spec for 357994 - useHighEntropyVA = false - mlCompatibility = false - checkOverflow = false - showReferenceResolutions = false - outputDir = None - outputFile = None - platform = None - prefer32Bit = false - useSimpleResolution = runningOnMono - target = CompilerTarget.ConsoleExe - debuginfo = false - testFlagEmitFeeFeeAs100001 = false - dumpDebugInfo = false - debugSymbolFile = None - - (* Backend configuration *) - typeCheckOnly = false - parseOnly = false - importAllReferencesOnly = false - simulateException = None - printAst = false - tokenizeOnly = false - testInteractionParser = false - reportNumDecls = false - printSignature = false - printSignatureFile = "" - xmlDocOutputFile = None - stats = false - generateFilterBlocks = false (* don't generate filter blocks *) - - signer = None - container = None - maxErrors = 100 - abortOnError = false - baseAddress = None - checksumAlgorithm = HashAlgorithm.Sha256 - - delaysign = false - publicsign = false - version = VersionNone - metadataVersion = None - standalone = false - extraStaticLinkRoots = [] - noSignatureData = false - onlyEssentialOptimizationData = false - useOptimizationDataFile = false - jitTracking = true - portablePDB = true - embeddedPDB = false - embedAllSource = false - embedSourceList = [] - sourceLink = "" - ignoreSymbolStoreSequencePoints = false - internConstantStrings = true - extraOptimizationIterations = 0 - - win32res = "" - win32manifest = "" - includewin32manifest = true - linkResources = [] - legacyReferenceResolver = null - showFullPaths = false - errorStyle = ErrorStyle.DefaultErrors - - utf8output = false - flatErrors = false - - #if DEBUG - showOptimizationData = false - #endif - showTerms = false - writeTermsToFiles = false - - doDetuple = false - doTLR = false - doFinalSimplify = false - optsOn = false - optSettings = Optimizer.OptimizationSettings.Defaults - emitTailcalls = true - deterministic = false - preferredUiLang = None - lcid = None - // See bug 6071 for product banner spec - productNameForBannerText = FSComp.SR.buildProductName(FSharpEnvironment.FSharpBannerVersion) - showBanner = true - showTimes = false - showLoadedAssemblies = false - continueAfterParseFailure = false -#if !NO_EXTENSIONTYPING - showExtensionTypeMessages = false -#endif - compilationThread = - let ctok = CompilationThreadToken () - { new ICompilationThread with member __.EnqueueWork work = work ctok } - pause = false - alwaysCallVirt = true - noDebugData = false - isInteractive = false - isInvalidationSupported = false - emitDebugInfoInQuotations = false - exename = None - copyFSharpCore = CopyFSharpCoreFlag.No - shadowCopyReferences = false - useSdkRefs = true - tryGetMetadataSnapshot = (fun _ -> None) - internalTestSpanStackReferring = false - noConditionalErasure = false - pathMap = PathMap.empty - langVersion = LanguageVersion("default") - dependencyProvider = Unchecked.defaultof - } - - // Directories to start probing in - // Algorithm: - // Search for native libraries using: - // 1. Include directories - // 2. compilerToolPath directories - // 3. reference dll's - // 4. The implicit include directory - member private tcConfigB.nativeProbingRoots () = - seq { - yield! tcConfigB.includes - yield! tcConfigB.compilerToolPaths - yield! (tcConfigB.referencedDLLs |> Seq.map(fun ref -> Path.GetDirectoryName(ref.Text))) - yield tcConfigB.implicitIncludeDir - } |> Seq.distinct - - static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, implicitIncludeDir, - isInteractive, isInvalidationSupported, defaultCopyFSharpCore, tryGetMetadataSnapshot) = - - Debug.Assert(FileSystem.IsPathRootedShim implicitIncludeDir, sprintf "implicitIncludeDir should be absolute: '%s'" implicitIncludeDir) - - if (String.IsNullOrEmpty defaultFSharpBinariesDir) then - failwith "Expected a valid defaultFSharpBinariesDir" - - let tcConfigBuilder = - { TcConfigBuilder.Initial with - implicitIncludeDir = implicitIncludeDir - defaultFSharpBinariesDir = defaultFSharpBinariesDir - reduceMemoryUsage = reduceMemoryUsage - legacyReferenceResolver = legacyReferenceResolver - isInteractive = isInteractive - isInvalidationSupported = isInvalidationSupported - copyFSharpCore = defaultCopyFSharpCore - tryGetMetadataSnapshot = tryGetMetadataSnapshot - useFsiAuxLib = isInteractive - } - tcConfigBuilder.dependencyProvider <- new DependencyProvider(NativeResolutionProbe(tcConfigBuilder.nativeProbingRoots)) - tcConfigBuilder - - member tcConfigB.ResolveSourceFile(m, nm, pathLoadedFrom) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - ResolveFileUsingPaths(tcConfigB.includes @ [pathLoadedFrom], m, nm) - - /// Decide names of output file, pdb and assembly - member tcConfigB.DecideNames (sourceFiles) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - if sourceFiles = [] then errorR(Error(FSComp.SR.buildNoInputsSpecified(), rangeCmdArgs)) - let ext() = match tcConfigB.target with CompilerTarget.Dll -> ".dll" | CompilerTarget.Module -> ".netmodule" | CompilerTarget.ConsoleExe | CompilerTarget.WinExe -> ".exe" - let implFiles = sourceFiles |> List.filter (fun lower -> List.exists (Filename.checkSuffix (String.lowercase lower)) FSharpImplFileSuffixes) - let outfile = - match tcConfigB.outputFile, List.rev implFiles with - | None, [] -> "out" + ext() - | None, h :: _ -> - let basic = fileNameOfPath h - let modname = try Filename.chopExtension basic with _ -> basic - modname+(ext()) - | Some f, _ -> f - let assemblyName = - let baseName = fileNameOfPath outfile - (fileNameWithoutExtension baseName) - - let pdbfile = - if tcConfigB.debuginfo then - Some (match tcConfigB.debugSymbolFile with - | None -> FSharp.Compiler.AbstractIL.ILPdbWriter.getDebugFileName outfile tcConfigB.portablePDB -#if ENABLE_MONO_SUPPORT - | Some _ when runningOnMono -> - // On Mono, the name of the debug file has to be ".mdb" so specifying it explicitly is an error - warning(Error(FSComp.SR.ilwriteMDBFileNameCannotBeChangedWarning(), rangeCmdArgs)) - FSharp.Compiler.AbstractIL.ILPdbWriter.getDebugFileName outfile tcConfigB.portablePDB -#endif - | Some f -> f) - elif (tcConfigB.debugSymbolFile <> None) && (not (tcConfigB.debuginfo)) then - error(Error(FSComp.SR.buildPdbRequiresDebug(), rangeStartup)) - else - None - tcConfigB.outputFile <- Some outfile - outfile, pdbfile, assemblyName - - member tcConfigB.TurnWarningOff(m, s: string) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - match GetWarningNumber(m, s) with - | None -> () - | Some n -> - // nowarn:62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- true - tcConfigB.errorSeverityOptions <- - { tcConfigB.errorSeverityOptions with WarnOff = ListSet.insert (=) n tcConfigB.errorSeverityOptions.WarnOff } - - member tcConfigB.TurnWarningOn(m, s: string) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - match GetWarningNumber(m, s) with - | None -> () - | Some n -> - // warnon 62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- false - tcConfigB.errorSeverityOptions <- - { tcConfigB.errorSeverityOptions with WarnOn = ListSet.insert (=) n tcConfigB.errorSeverityOptions.WarnOn } - - member tcConfigB.AddIncludePath (m, path, pathIncludedFrom) = - let absolutePath = ComputeMakePathAbsolute pathIncludedFrom path - let ok = - let existsOpt = - try Some(Directory.Exists absolutePath) - with e -> warning(Error(FSComp.SR.buildInvalidSearchDirectory path, m)); None - match existsOpt with - | Some exists -> - if not exists then warning(Error(FSComp.SR.buildSearchDirectoryNotFound absolutePath, m)) - exists - | None -> false - if ok && not (List.contains absolutePath tcConfigB.includes) then - tcConfigB.includes <- tcConfigB.includes ++ absolutePath - - member tcConfigB.AddLoadedSource(m, originalPath, pathLoadedFrom) = - if FileSystem.IsInvalidPathShim originalPath then - warning(Error(FSComp.SR.buildInvalidFilename originalPath, m)) - else - let path = - match TryResolveFileUsingPaths(tcConfigB.includes @ [pathLoadedFrom], m, originalPath) with - | Some path -> path - | None -> - // File doesn't exist in the paths. Assume it will be in the load-ed from directory. - ComputeMakePathAbsolute pathLoadedFrom originalPath - if not (List.contains path (List.map (fun (_, _, path) -> path) tcConfigB.loadedSources)) then - tcConfigB.loadedSources <- tcConfigB.loadedSources ++ (m, originalPath, path) - - member tcConfigB.AddEmbeddedSourceFile (file) = - tcConfigB.embedSourceList <- tcConfigB.embedSourceList ++ file - - member tcConfigB.AddEmbeddedResource filename = - tcConfigB.embedResources <- tcConfigB.embedResources ++ filename - - member tcConfigB.AddCompilerToolsByPath (path) = - if not (tcConfigB.compilerToolPaths |> List.exists (fun text -> path = text)) then // NOTE: We keep same paths if range is different. - let compilerToolPath = tcConfigB.compilerToolPaths |> List.tryPick (fun text -> if text = path then Some text else None) - if compilerToolPath.IsNone then - tcConfigB.compilerToolPaths <- tcConfigB.compilerToolPaths ++ path - - member tcConfigB.AddReferencedAssemblyByPath (m, path) = - if FileSystem.IsInvalidPathShim path then - warning(Error(FSComp.SR.buildInvalidAssemblyName(path), m)) - elif not (tcConfigB.referencedDLLs |> List.exists (fun ar2 -> Range.equals m ar2.Range && path=ar2.Text)) then // NOTE: We keep same paths if range is different. - let projectReference = tcConfigB.projectReferences |> List.tryPick (fun pr -> if pr.FileName = path then Some pr else None) - tcConfigB.referencedDLLs <- tcConfigB.referencedDLLs ++ AssemblyReference(m, path, projectReference) - - member tcConfigB.AddDependencyManagerText (packageManager:IDependencyManagerProvider, m, path:string) = - let path = tcConfigB.dependencyProvider.RemoveDependencyManagerKey(packageManager.Key, path) - - match tcConfigB.packageManagerLines |> Map.tryFind packageManager.Key with - | Some lines -> tcConfigB.packageManagerLines <- Map.add packageManager.Key (lines ++ (false, path, m)) tcConfigB.packageManagerLines - | _ -> tcConfigB.packageManagerLines <- Map.add packageManager.Key [false, path, m] tcConfigB.packageManagerLines - - member tcConfigB.RemoveReferencedAssemblyByPath (m, path) = - tcConfigB.referencedDLLs <- tcConfigB.referencedDLLs |> List.filter (fun ar -> not (Range.equals ar.Range m) || ar.Text <> path) - - member tcConfigB.AddPathMapping (oldPrefix, newPrefix) = - tcConfigB.pathMap <- tcConfigB.pathMap |> PathMap.addMapping oldPrefix newPrefix - - static member SplitCommandLineResourceInfo (ri: string) = - let p = ri.IndexOf ',' - if p <> -1 then - let file = String.sub ri 0 p - let rest = String.sub ri (p+1) (String.length ri - p - 1) - let p = rest.IndexOf ',' - if p <> -1 then - let name = String.sub rest 0 p+".resources" - let pubpri = String.sub rest (p+1) (rest.Length - p - 1) - if pubpri = "public" then file, name, ILResourceAccess.Public - elif pubpri = "private" then file, name, ILResourceAccess.Private - else error(Error(FSComp.SR.buildInvalidPrivacy pubpri, rangeStartup)) - else - file, rest, ILResourceAccess.Public - else - ri, fileNameOfPath ri, ILResourceAccess.Public - - -let OpenILBinary(filename, reduceMemoryUsage, pdbDirPath, shadowCopyReferences, tryGetMetadataSnapshot) = - let opts: ILReaderOptions = - { metadataOnly = MetadataOnlyFlag.Yes - reduceMemoryUsage = reduceMemoryUsage - pdbDirPath = pdbDirPath - tryGetMetadataSnapshot = tryGetMetadataSnapshot } - - let location = -#if FX_NO_APP_DOMAINS - // In order to use memory mapped files on the shadow copied version of the Assembly, we `preload the assembly - // We swallow all exceptions so that we do not change the exception contract of this API - if shadowCopyReferences then - try - System.Reflection.Assembly.ReflectionOnlyLoadFrom(filename).Location - with e -> filename - else -#else - ignore shadowCopyReferences -#endif - filename - AssemblyReader.GetILModuleReader(location, opts) - -#if DEBUG -[] -#endif -type AssemblyResolution = - { originalReference: AssemblyReference - resolvedPath: string - prepareToolTip: unit -> string - sysdir: bool - mutable ilAssemblyRef: ILAssemblyRef option - } - override this.ToString() = sprintf "%s%s" (if this.sysdir then "[sys]" else "") this.resolvedPath - - member this.ProjectReference = this.originalReference.ProjectReference - - /// Compute the ILAssemblyRef for a resolved assembly. This is done by reading the binary if necessary. The result - /// is cached. - /// - /// For project references in the language service, this would result in a build of the project. - /// This is because ``EvaluateRawContents ctok`` is used. However this path is only currently used - /// in fsi.fs, which does not use project references. - // - member this.GetILAssemblyRef(ctok, reduceMemoryUsage, tryGetMetadataSnapshot) = - cancellable { - match this.ilAssemblyRef with - | Some assemblyRef -> return assemblyRef - | None -> - let! assemblyRefOpt = - cancellable { - match this.ProjectReference with - | Some r -> - let! contents = r.EvaluateRawContents ctok - match contents with - | None -> return None - | Some contents -> - match contents.ILScopeRef with - | ILScopeRef.Assembly aref -> return Some aref - | _ -> return None - | None -> return None - } - let assemblyRef = - match assemblyRefOpt with - | Some aref -> aref - | None -> - let readerSettings: ILReaderOptions = - { pdbDirPath=None - reduceMemoryUsage = reduceMemoryUsage - metadataOnly = MetadataOnlyFlag.Yes - tryGetMetadataSnapshot = tryGetMetadataSnapshot } - use reader = OpenILModuleReader this.resolvedPath readerSettings - mkRefToILAssembly reader.ILModuleDef.ManifestOfAssembly - this.ilAssemblyRef <- Some assemblyRef - return assemblyRef - } - -//---------------------------------------------------------------------------- -// Names to match up refs and defs for assemblies and modules -//-------------------------------------------------------------------------- - -let GetNameOfILModule (m: ILModuleDef) = - match m.Manifest with - | Some manifest -> manifest.Name - | None -> m.Name - - -let MakeScopeRefForILModule (ilModule: ILModuleDef) = - match ilModule.Manifest with - | Some m -> ILScopeRef.Assembly (mkRefToILAssembly m) - | None -> ILScopeRef.Module (mkRefToILModule ilModule) - -let GetCustomAttributesOfILModule (ilModule: ILModuleDef) = - (match ilModule.Manifest with Some m -> m.CustomAttrs | None -> ilModule.CustomAttrs).AsList - -let GetAutoOpenAttributes ilg ilModule = - ilModule |> GetCustomAttributesOfILModule |> List.choose (TryFindAutoOpenAttr ilg) - -let GetInternalsVisibleToAttributes ilg ilModule = - ilModule |> GetCustomAttributesOfILModule |> List.choose (TryFindInternalsVisibleToAttr ilg) - -//---------------------------------------------------------------------------- -// TcConfig -//-------------------------------------------------------------------------- - -[] -/// This type is immutable and must be kept as such. Do not extract or mutate the underlying data except by cloning it. -type TcConfig private (data: TcConfigBuilder, validate: bool) = - - // Validate the inputs - this helps ensure errors in options are shown in visual studio rather than only when built - // However we only validate a minimal number of options at the moment - do if validate then try data.version.GetVersionInfo(data.implicitIncludeDir) |> ignore with e -> errorR e - - // clone the input builder to ensure nobody messes with it. - let data = { data with pause = data.pause } - - let computeKnownDllReference libraryName = - let defaultCoreLibraryReference = AssemblyReference(range0, libraryName+".dll", None) - let nameOfDll(r: AssemblyReference) = - let filename = ComputeMakePathAbsolute data.implicitIncludeDir r.Text - if FileSystem.SafeExists filename then - r, Some filename - else - // If the file doesn't exist, let reference resolution logic report the error later... - defaultCoreLibraryReference, if Range.equals r.Range rangeStartup then Some(filename) else None - match data.referencedDLLs |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) with - | [] -> defaultCoreLibraryReference, None - | [r] - | r :: _ -> nameOfDll r - - // Look for an explicit reference to mscorlib/netstandard.dll or System.Runtime.dll and use that to compute clrRoot and targetFrameworkVersion - let primaryAssemblyReference, primaryAssemblyExplicitFilenameOpt = computeKnownDllReference(data.primaryAssembly.Name) - let fslibReference = - // Look for explicit FSharp.Core reference otherwise use version that was referenced by compiler - let dllReference, fileNameOpt = computeKnownDllReference getFSharpCoreLibraryName - match fileNameOpt with - | Some _ -> dllReference - | None -> AssemblyReference(range0, getDefaultFSharpCoreLocation, None) - - // clrRoot: the location of the primary assembly (mscorlib.dll or netstandard.dll or System.Runtime.dll) - // - // targetFrameworkVersionValue: Normally just HighestInstalledNetFrameworkVersion() - // - // Note, when mscorlib.dll has been given explicitly the actual value of - // targetFrameworkVersion shouldn't matter since resolution has already happened. - // In those cases where it does matter (e.g. --noframework is not being used or we are processing further - // resolutions for a script) then it is correct to just use HighestInstalledNetFrameworkVersion(). - let clrRootValue, targetFrameworkVersionValue = - match primaryAssemblyExplicitFilenameOpt with - | Some primaryAssemblyFilename -> - let filename = ComputeMakePathAbsolute data.implicitIncludeDir primaryAssemblyFilename - try - let clrRoot = Some(Path.GetDirectoryName(FileSystem.GetFullPathShim filename)) - clrRoot, data.legacyReferenceResolver.HighestInstalledNetFrameworkVersion() - with e -> - // We no longer expect the above to fail but leaving this just in case - error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) - | None -> -#if !ENABLE_MONO_SUPPORT - // TODO: we have to get msbuild out of this - if data.useSimpleResolution then - None, "" - else -#endif - None, data.legacyReferenceResolver.HighestInstalledNetFrameworkVersion() - - let systemAssemblies = systemAssemblies - - member x.primaryAssembly = data.primaryAssembly - member x.noFeedback = data.noFeedback - member x.stackReserveSize = data.stackReserveSize - member x.implicitIncludeDir = data.implicitIncludeDir - member x.openDebugInformationForLaterStaticLinking = data.openDebugInformationForLaterStaticLinking - member x.fsharpBinariesDir = data.defaultFSharpBinariesDir - member x.compilingFslib = data.compilingFslib - member x.useIncrementalBuilder = data.useIncrementalBuilder - member x.includes = data.includes - member x.implicitOpens = data.implicitOpens - member x.useFsiAuxLib = data.useFsiAuxLib - member x.framework = data.framework - member x.implicitlyResolveAssemblies = data.implicitlyResolveAssemblies - member x.resolutionEnvironment = data.resolutionEnvironment - member x.light = data.light - member x.conditionalCompilationDefines = data.conditionalCompilationDefines - member x.loadedSources = data.loadedSources - member x.compilerToolPaths = data.compilerToolPaths - member x.referencedDLLs = data.referencedDLLs - member x.knownUnresolvedReferences = data.knownUnresolvedReferences - member x.clrRoot = clrRootValue - member x.reduceMemoryUsage = data.reduceMemoryUsage - member x.subsystemVersion = data.subsystemVersion - member x.useHighEntropyVA = data.useHighEntropyVA - member x.inputCodePage = data.inputCodePage - member x.embedResources = data.embedResources - member x.errorSeverityOptions = data.errorSeverityOptions - member x.mlCompatibility = data.mlCompatibility - member x.checkOverflow = data.checkOverflow - member x.showReferenceResolutions = data.showReferenceResolutions - member x.outputDir = data.outputDir - member x.outputFile = data.outputFile - member x.platform = data.platform - member x.prefer32Bit = data.prefer32Bit - member x.useSimpleResolution = data.useSimpleResolution - member x.target = data.target - member x.debuginfo = data.debuginfo - member x.testFlagEmitFeeFeeAs100001 = data.testFlagEmitFeeFeeAs100001 - member x.dumpDebugInfo = data.dumpDebugInfo - member x.debugSymbolFile = data.debugSymbolFile - member x.typeCheckOnly = data.typeCheckOnly - member x.parseOnly = data.parseOnly - member x.importAllReferencesOnly = data.importAllReferencesOnly - member x.simulateException = data.simulateException - member x.printAst = data.printAst - member x.targetFrameworkVersion = targetFrameworkVersionValue - member x.tokenizeOnly = data.tokenizeOnly - member x.testInteractionParser = data.testInteractionParser - member x.reportNumDecls = data.reportNumDecls - member x.printSignature = data.printSignature - member x.printSignatureFile = data.printSignatureFile - member x.xmlDocOutputFile = data.xmlDocOutputFile - member x.stats = data.stats - member x.generateFilterBlocks = data.generateFilterBlocks - member x.signer = data.signer - member x.container = data.container - member x.delaysign = data.delaysign - member x.publicsign = data.publicsign - member x.version = data.version - member x.metadataVersion = data.metadataVersion - member x.standalone = data.standalone - member x.extraStaticLinkRoots = data.extraStaticLinkRoots - member x.noSignatureData = data.noSignatureData - member x.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData - member x.useOptimizationDataFile = data.useOptimizationDataFile - member x.jitTracking = data.jitTracking - member x.portablePDB = data.portablePDB - member x.embeddedPDB = data.embeddedPDB - member x.embedAllSource = data.embedAllSource - member x.embedSourceList = data.embedSourceList - member x.sourceLink = data.sourceLink - member x.packageManagerLines = data.packageManagerLines - member x.ignoreSymbolStoreSequencePoints = data.ignoreSymbolStoreSequencePoints - member x.internConstantStrings = data.internConstantStrings - member x.extraOptimizationIterations = data.extraOptimizationIterations - member x.win32res = data.win32res - member x.win32manifest = data.win32manifest - member x.includewin32manifest = data.includewin32manifest - member x.linkResources = data.linkResources - member x.showFullPaths = data.showFullPaths - member x.errorStyle = data.errorStyle - member x.utf8output = data.utf8output - member x.flatErrors = data.flatErrors - member x.maxErrors = data.maxErrors - member x.baseAddress = data.baseAddress - member x.checksumAlgorithm = data.checksumAlgorithm - #if DEBUG - member x.showOptimizationData = data.showOptimizationData -#endif - member x.showTerms = data.showTerms - member x.writeTermsToFiles = data.writeTermsToFiles - member x.doDetuple = data.doDetuple - member x.doTLR = data.doTLR - member x.doFinalSimplify = data.doFinalSimplify - member x.optSettings = data.optSettings - member x.emitTailcalls = data.emitTailcalls - member x.deterministic = data.deterministic - member x.pathMap = data.pathMap - member x.langVersion = data.langVersion - member x.preferredUiLang = data.preferredUiLang - member x.lcid = data.lcid - member x.optsOn = data.optsOn - member x.productNameForBannerText = data.productNameForBannerText - member x.showBanner = data.showBanner - member x.showTimes = data.showTimes - member x.showLoadedAssemblies = data.showLoadedAssemblies - member x.continueAfterParseFailure = data.continueAfterParseFailure -#if !NO_EXTENSIONTYPING - member x.showExtensionTypeMessages = data.showExtensionTypeMessages -#endif - member x.compilationThread = data.compilationThread - member x.pause = data.pause - member x.alwaysCallVirt = data.alwaysCallVirt - member x.noDebugData = data.noDebugData - member x.isInteractive = data.isInteractive - member x.isInvalidationSupported = data.isInvalidationSupported - member x.emitDebugInfoInQuotations = data.emitDebugInfoInQuotations - member x.copyFSharpCore = data.copyFSharpCore - member x.shadowCopyReferences = data.shadowCopyReferences - member x.useSdkRefs = data.useSdkRefs - member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot - member x.internalTestSpanStackReferring = data.internalTestSpanStackReferring - member x.noConditionalErasure = data.noConditionalErasure - - static member Create(builder, validate) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - TcConfig(builder, validate) - - member x.legacyReferenceResolver = data.legacyReferenceResolver - - member x.dependencyProvider = data.dependencyProvider - - member tcConfig.CloneOfOriginalBuilder = - { data with conditionalCompilationDefines=data.conditionalCompilationDefines } - - member tcConfig.ComputeCanContainEntryPoint(sourceFiles: string list) = - let n = sourceFiles.Length in - (sourceFiles |> List.mapi (fun i _ -> (i = n-1)), tcConfig.target.IsExe) - - // This call can fail if no CLR is found (this is the path to mscorlib) - member tcConfig.GetTargetFrameworkDirectories() = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - try - [ - // Check if we are given an explicit framework root - if so, use that - match tcConfig.clrRoot with - | Some x -> - let clrRoot = tcConfig.MakePathAbsolute x - yield clrRoot - let clrFacades = Path.Combine(clrRoot, "Facades") - if Directory.Exists(clrFacades) then yield clrFacades - - | None -> -// "there is no really good notion of runtime directory on .NETCore" -#if NETSTANDARD - let runtimeRoot = Path.GetDirectoryName(typeof.Assembly.Location) -#else - let runtimeRoot = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() -#endif - let runtimeRootWithoutSlash = runtimeRoot.TrimEnd('/', '\\') - let runtimeRootFacades = Path.Combine(runtimeRootWithoutSlash, "Facades") - let runtimeRootWPF = Path.Combine(runtimeRootWithoutSlash, "WPF") - - match tcConfig.resolutionEnvironment with - | ResolutionEnvironment.CompilationAndEvaluation -> - // Default compilation-and-execution-time references on .NET Framework and Mono, e.g. for F# Interactive - // - // In the current way of doing things, F# Interactive refers to implementation assemblies. - yield runtimeRoot - if Directory.Exists runtimeRootFacades then - yield runtimeRootFacades // System.Runtime.dll is in /usr/lib/mono/4.5/Facades - if Directory.Exists runtimeRootWPF then - yield runtimeRootWPF // PresentationCore.dll is in C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF - - match frameworkRefsPackDirectory with - | Some path when Directory.Exists(path) -> - yield path - | _ -> () - - | ResolutionEnvironment.EditingOrCompilation _ -> -#if ENABLE_MONO_SUPPORT - if runningOnMono then - // Default compilation-time references on Mono - // - // On Mono, the default references come from the implementation assemblies. - // This is because we have had trouble reliably using MSBuild APIs to compute DotNetFrameworkReferenceAssembliesRootDirectory on Mono. - yield runtimeRoot - if Directory.Exists runtimeRootFacades then - yield runtimeRootFacades // System.Runtime.dll is in /usr/lib/mono/4.5/Facades - if Directory.Exists runtimeRootWPF then - yield runtimeRootWPF // PresentationCore.dll is in C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF - // On Mono we also add a default reference to the 4.5-api and 4.5-api/Facades directories. - let runtimeRootApi = runtimeRootWithoutSlash + "-api" - let runtimeRootApiFacades = Path.Combine(runtimeRootApi, "Facades") - if Directory.Exists runtimeRootApi then - yield runtimeRootApi - if Directory.Exists runtimeRootApiFacades then - yield runtimeRootApiFacades - else -#endif - // Default compilation-time references on .NET Framework - // - // This is the normal case for "fsc.exe a.fs". We refer to the reference assemblies folder. - let frameworkRoot = tcConfig.legacyReferenceResolver.DotNetFrameworkReferenceAssembliesRootDirectory - let frameworkRootVersion = Path.Combine(frameworkRoot, tcConfig.targetFrameworkVersion) - yield frameworkRootVersion - let facades = Path.Combine(frameworkRootVersion, "Facades") - if Directory.Exists facades then - yield facades - match frameworkRefsPackDirectory with - | Some path when Directory.Exists(path) -> - yield path - | _ -> () - ] - with e -> - errorRecovery e range0; [] - - member tcConfig.ComputeLightSyntaxInitialStatus filename = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - let lower = String.lowercase filename - let lightOnByDefault = List.exists (Filename.checkSuffix lower) FSharpLightSyntaxFileSuffixes - if lightOnByDefault then (tcConfig.light <> Some false) else (tcConfig.light = Some true ) - - member tcConfig.GetAvailableLoadedSources() = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - let resolveLoadedSource (m, originalPath, path) = - try - if not(FileSystem.SafeExists(path)) then - let secondTrial = - tcConfig.includes - |> List.tryPick (fun root -> - let path = ComputeMakePathAbsolute root originalPath - if FileSystem.SafeExists(path) then Some path else None) - - match secondTrial with - | Some path -> Some(m,path) - | None -> - error(LoadedSourceNotFoundIgnoring(path,m)) - None - else Some(m,path) - with e -> errorRecovery e m; None - - tcConfig.loadedSources - |> List.choose resolveLoadedSource - |> List.distinct - - /// A closed set of assemblies where, for any subset S: - /// - the TcImports object built for S (and thus the F# Compiler CCUs for the assemblies in S) - /// is a resource that can be shared between any two IncrementalBuild objects that reference - /// precisely S - /// - /// Determined by looking at the set of assemblies referenced by f# . - /// - /// Returning true may mean that the file is locked and/or placed into the - /// 'framework' reference set that is potentially shared across multiple compilations. - member tcConfig.IsSystemAssembly (filename: string) = - try - FileSystem.SafeExists filename && - ((tcConfig.GetTargetFrameworkDirectories() |> List.exists (fun clrRoot -> clrRoot = Path.GetDirectoryName filename)) || - (systemAssemblies.Contains (fileNameWithoutExtension filename)) || - isInReferenceAssemblyPackDirectory filename) - with _ -> - false - - // This is not the complete set of search paths, it is just the set - // that is special to F# (as compared to MSBuild resolution) - member tcConfig.GetSearchPathsForLibraryFiles() = - [ yield! tcConfig.GetTargetFrameworkDirectories() - yield! List.map (tcConfig.MakePathAbsolute) tcConfig.includes - yield tcConfig.implicitIncludeDir - yield tcConfig.fsharpBinariesDir ] - - member tcConfig.MakePathAbsolute path = - let result = ComputeMakePathAbsolute tcConfig.implicitIncludeDir path - result - - member tcConfig.TryResolveLibWithDirectories (r: AssemblyReference) = - let m, nm = r.Range, r.Text - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - // Only want to resolve certain extensions (otherwise, 'System.Xml' is ambiguous). - // MSBuild resolution is limited to .exe and .dll so do the same here. - let ext = System.IO.Path.GetExtension nm - let isNetModule = String.Compare(ext, ".netmodule", StringComparison.OrdinalIgnoreCase)=0 - - // See if the language service has already produced the contents of the assembly for us, virtually - match r.ProjectReference with - | Some _ -> - let resolved = r.Text - let sysdir = tcConfig.IsSystemAssembly resolved - Some - { originalReference = r - resolvedPath = resolved - prepareToolTip = (fun () -> resolved) - sysdir = sysdir - ilAssemblyRef = None } - | None -> - - if String.Compare(ext, ".dll", StringComparison.OrdinalIgnoreCase)=0 - || String.Compare(ext, ".exe", StringComparison.OrdinalIgnoreCase)=0 - || isNetModule then - - let searchPaths = - // if this is a #r reference (not from dummy range), make sure the directory of the declaring - // file is included in the search path. This should ideally already be one of the search paths, but - // during some global checks it won't be. We append to the end of the search list so that this is the last - // place that is checked. - let isPoundRReference (r: range) = - not (Range.equals r range0) && - not (Range.equals r rangeStartup) && - not (Range.equals r rangeCmdArgs) && - FileSystem.IsPathRootedShim r.FileName - - if isPoundRReference m then - tcConfig.GetSearchPathsForLibraryFiles() @ [Path.GetDirectoryName(m.FileName)] - else - tcConfig.GetSearchPathsForLibraryFiles() - - let resolved = TryResolveFileUsingPaths(searchPaths, m, nm) - match resolved with - | Some resolved -> - let sysdir = tcConfig.IsSystemAssembly resolved - Some - { originalReference = r - resolvedPath = resolved - prepareToolTip = (fun () -> - let fusionName = System.Reflection.AssemblyName.GetAssemblyName(resolved).ToString() - let line(append: string) = append.Trim([|' '|])+"\n" - line resolved + line fusionName) - sysdir = sysdir - ilAssemblyRef = None } - | None -> None - else None - - member tcConfig.ResolveLibWithDirectories (ccuLoadFailureAction, r: AssemblyReference) = - let m, nm = r.Range, r.Text - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - // test for both libraries and executables - let ext = System.IO.Path.GetExtension nm - let isExe = (String.Compare(ext, ".exe", StringComparison.OrdinalIgnoreCase) = 0) - let isDLL = (String.Compare(ext, ".dll", StringComparison.OrdinalIgnoreCase) = 0) - let isNetModule = (String.Compare(ext, ".netmodule", StringComparison.OrdinalIgnoreCase) = 0) - - let rs = - if isExe || isDLL || isNetModule then - [r] - else - [AssemblyReference(m, nm+".dll", None);AssemblyReference(m, nm+".exe", None);AssemblyReference(m, nm+".netmodule", None)] - - match rs |> List.tryPick (fun r -> tcConfig.TryResolveLibWithDirectories r) with - | Some res -> Some res - | None -> - match ccuLoadFailureAction with - | CcuLoadFailureAction.RaiseError -> - let searchMessage = String.concat "\n " (tcConfig.GetSearchPathsForLibraryFiles()) - raise (FileNameNotResolved(nm, searchMessage, m)) - | CcuLoadFailureAction.ReturnNone -> None - - member tcConfig.ResolveSourceFile(m, nm, pathLoadedFrom) = - data.ResolveSourceFile(m, nm, pathLoadedFrom) - - // NOTE!! if mode=Speculative then this method must not report ANY warnings or errors through 'warning' or 'error'. Instead - // it must return warnings and errors as data - // - // NOTE!! if mode=ReportErrors then this method must not raise exceptions. It must just report the errors and recover - static member TryResolveLibsUsingMSBuildRules (tcConfig: TcConfig, - originalReferences: AssemblyReference list, - errorAndWarningRange: range, - mode: ResolveAssemblyReferenceMode) : AssemblyResolution list * UnresolvedAssemblyReference list = - - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - if tcConfig.useSimpleResolution then - failwith "MSBuild resolution is not supported." - if originalReferences=[] then [], [] - else - // Group references by name with range values in the grouped value list. - // In the grouped reference, store the index of the last use of the reference. - let groupedReferences = - originalReferences - |> List.indexed - |> Seq.groupBy(fun (_, reference) -> reference.Text) - |> Seq.map(fun (assemblyName, assemblyAndIndexGroup)-> - let assemblyAndIndexGroup = assemblyAndIndexGroup |> List.ofSeq - let highestPosition = assemblyAndIndexGroup |> List.maxBy fst |> fst - let assemblyGroup = assemblyAndIndexGroup |> List.map snd - assemblyName, highestPosition, assemblyGroup) - |> Array.ofSeq - - let logMessage showMessages = - if showMessages && tcConfig.showReferenceResolutions then (fun (message: string)->dprintf "%s\n" message) - else ignore - - let logDiagnostic showMessages = - (fun isError code message-> - if showMessages && mode = ResolveAssemblyReferenceMode.ReportErrors then - if isError then - errorR(MSBuildReferenceResolutionError(code, message, errorAndWarningRange)) - else - match code with - // These are warnings that mean 'not resolved' for some assembly. - // Note that we don't get to know the name of the assembly that couldn't be resolved. - // Ignore these and rely on the logic below to emit an error for each unresolved reference. - | "MSB3246" // Resolved file has a bad image, no metadata, or is otherwise inaccessible. - | "MSB3106" - -> () - | _ -> - if code = "MSB3245" then - errorR(MSBuildReferenceResolutionWarning(code, message, errorAndWarningRange)) - else - warning(MSBuildReferenceResolutionWarning(code, message, errorAndWarningRange))) - - let targetProcessorArchitecture = - match tcConfig.platform with - | None -> "MSIL" - | Some X86 -> "x86" - | Some AMD64 -> "amd64" - | Some IA64 -> "ia64" - - // First, try to resolve everything as a file using simple resolution - let resolvedAsFile = - groupedReferences - |> Array.map(fun (_filename, maxIndexOfReference, references)-> - let assemblyResolution = references |> List.choose (fun r -> tcConfig.TryResolveLibWithDirectories r) - (maxIndexOfReference, assemblyResolution)) - |> Array.filter(fun (_, refs)->refs |> isNil |> not) - - - // Whatever is left, pass to MSBuild. - let Resolve(references, showMessages) = - try - tcConfig.legacyReferenceResolver.Resolve - (tcConfig.resolutionEnvironment, - references, - tcConfig.targetFrameworkVersion, - tcConfig.GetTargetFrameworkDirectories(), - targetProcessorArchitecture, - tcConfig.fsharpBinariesDir, // FSharp binaries directory - tcConfig.includes, // Explicit include directories - tcConfig.implicitIncludeDir, // Implicit include directory (likely the project directory) - logMessage showMessages, logDiagnostic showMessages) - with - ReferenceResolver.ResolutionFailure -> error(Error(FSComp.SR.buildAssemblyResolutionFailed(), errorAndWarningRange)) - - let toMsBuild = [|0..groupedReferences.Length-1|] - |> Array.map(fun i->(p13 groupedReferences.[i]), (p23 groupedReferences.[i]), i) - |> Array.filter (fun (_, i0, _)->resolvedAsFile|>Array.exists(fun (i1, _) -> i0=i1)|>not) - |> Array.map(fun (ref, _, i)->ref, string i) - - let resolutions = Resolve(toMsBuild, (*showMessages*)true) - - // Map back to original assembly resolutions. - let resolvedByMsbuild = - resolutions - |> Array.map(fun resolvedFile -> - let i = int resolvedFile.baggage - let _, maxIndexOfReference, ms = groupedReferences.[i] - let assemblyResolutions = - ms|>List.map(fun originalReference -> - System.Diagnostics.Debug.Assert(FileSystem.IsPathRootedShim(resolvedFile.itemSpec), sprintf "msbuild-resolved path is not absolute: '%s'" resolvedFile.itemSpec) - let canonicalItemSpec = FileSystem.GetFullPathShim(resolvedFile.itemSpec) - { originalReference=originalReference - resolvedPath=canonicalItemSpec - prepareToolTip = (fun () -> resolvedFile.prepareToolTip (originalReference.Text, canonicalItemSpec)) - sysdir= tcConfig.IsSystemAssembly canonicalItemSpec - ilAssemblyRef = None }) - (maxIndexOfReference, assemblyResolutions)) - - // When calculating the resulting resolutions, we're going to use the index of the reference - // in the original specification and resort it to match the ordering that we had. - let resultingResolutions = - [resolvedByMsbuild;resolvedAsFile] - |> Array.concat - |> Array.sortBy fst - |> Array.map snd - |> List.ofArray - |> List.concat - - // O(N^2) here over a small set of referenced assemblies. - let IsResolved(originalName: string) = - if resultingResolutions |> List.exists(fun resolution -> resolution.originalReference.Text = originalName) then true - else - // MSBuild resolution may have unified the result of two duplicate references. Try to re-resolve now. - // If re-resolution worked then this was a removed duplicate. - Resolve([|originalName, ""|], (*showMessages*)false).Length<>0 - - let unresolvedReferences = - groupedReferences - //|> Array.filter(p13 >> IsNotFileOrIsAssembly) - |> Array.filter(p13 >> IsResolved >> not) - |> List.ofArray - - // If mode=Speculative, then we haven't reported any errors. - // We report the error condition by returning an empty list of resolutions - if mode = ResolveAssemblyReferenceMode.Speculative && (List.length unresolvedReferences) > 0 then - [], (List.ofArray groupedReferences) |> List.map (fun (name, _, r) -> (name, r)) |> List.map UnresolvedAssemblyReference - else - resultingResolutions, unresolvedReferences |> List.map (fun (name, _, r) -> (name, r)) |> List.map UnresolvedAssemblyReference - - member tcConfig.PrimaryAssemblyDllReference() = primaryAssemblyReference - - member tcConfig.CoreLibraryDllReference() = fslibReference - - -let ReportWarning options err = - warningOn err (options.WarnLevel) (options.WarnOn) && not (List.contains (GetDiagnosticNumber err) (options.WarnOff)) - -let ReportWarningAsError options err = - warningOn err (options.WarnLevel) (options.WarnOn) && - not (List.contains (GetDiagnosticNumber err) (options.WarnAsWarn)) && - ((options.GlobalWarnAsError && not (List.contains (GetDiagnosticNumber err) options.WarnOff)) || - List.contains (GetDiagnosticNumber err) (options.WarnAsError)) - -//---------------------------------------------------------------------------- -// Scoped #nowarn pragmas - - -let GetScopedPragmasForHashDirective hd = - [ match hd with - | ParsedHashDirective("nowarn", numbers, m) -> - for s in numbers do - match GetWarningNumber(m, s) with - | None -> () - | Some n -> yield ScopedPragma.WarningOff(m, n) - | _ -> () ] - - -let GetScopedPragmasForInput input = - - match input with - | ParsedInput.SigFile (ParsedSigFileInput (scopedPragmas=pragmas)) -> pragmas - | ParsedInput.ImplFile (ParsedImplFileInput (scopedPragmas=pragmas)) -> pragmas - - - -/// Build an ErrorLogger that delegates to another ErrorLogger but filters warnings turned off by the given pragma declarations -// -// NOTE: we allow a flag to turn of strict file checking. This is because file names sometimes don't match due to use of -// #line directives, e.g. for pars.fs/pars.fsy. In this case we just test by line number - in most cases this is sufficient -// because we install a filtering error handler on a file-by-file basis for parsing and type-checking. -// However this is indicative of a more systematic problem where source-line -// sensitive operations (lexfilter and warning filtering) do not always -// interact well with #line directives. -type ErrorLoggerFilteringByScopedPragmas (checkFile, scopedPragmas, errorLogger: ErrorLogger) = - inherit ErrorLogger("ErrorLoggerFilteringByScopedPragmas") - - override x.DiagnosticSink (phasedError, isError) = - if isError then - errorLogger.DiagnosticSink (phasedError, isError) - else - let report = - let warningNum = GetDiagnosticNumber phasedError - match GetRangeOfDiagnostic phasedError with - | Some m -> - not (scopedPragmas |> List.exists (fun pragma -> - match pragma with - | ScopedPragma.WarningOff(pragmaRange, warningNumFromPragma) -> - warningNum = warningNumFromPragma && - (not checkFile || m.FileIndex = pragmaRange.FileIndex) && - Range.posGeq m.Start pragmaRange.Start)) - | None -> true - if report then errorLogger.DiagnosticSink(phasedError, false) - - override x.ErrorCount = errorLogger.ErrorCount - -let GetErrorLoggerFilteringByScopedPragmas(checkFile, scopedPragmas, errorLogger) = - (ErrorLoggerFilteringByScopedPragmas(checkFile, scopedPragmas, errorLogger) :> ErrorLogger) - - -//---------------------------------------------------------------------------- -// Parsing -//-------------------------------------------------------------------------- - - -let CanonicalizeFilename filename = - let basic = fileNameOfPath filename - String.capitalize (try Filename.chopExtension basic with _ -> basic) - -let IsScript filename = - let lower = String.lowercase filename - FSharpScriptFileSuffixes |> List.exists (Filename.checkSuffix lower) - -// Give a unique name to the different kinds of inputs. Used to correlate signature and implementation files -// QualFileNameOfModuleName - files with a single module declaration or an anonymous module -let QualFileNameOfModuleName m filename modname = QualifiedNameOfFile(mkSynId m (textOfLid modname + (if IsScript filename then "$fsx" else ""))) -let QualFileNameOfFilename m filename = QualifiedNameOfFile(mkSynId m (CanonicalizeFilename filename + (if IsScript filename then "$fsx" else ""))) - -// Interactive fragments -let ComputeQualifiedNameOfFileFromUniquePath (m, p: string list) = QualifiedNameOfFile(mkSynId m (String.concat "_" p)) - -let QualFileNameOfSpecs filename specs = - match specs with - | [SynModuleOrNamespaceSig(modname, _, kind, _, _, _, _, m)] when kind.IsModule -> QualFileNameOfModuleName m filename modname - | [SynModuleOrNamespaceSig(_, _, kind, _, _, _, _, m)] when not kind.IsModule -> QualFileNameOfFilename m filename - | _ -> QualFileNameOfFilename (mkRange filename pos0 pos0) filename - -let QualFileNameOfImpls filename specs = - match specs with - | [SynModuleOrNamespace(modname, _, kind, _, _, _, _, m)] when kind.IsModule -> QualFileNameOfModuleName m filename modname - | [SynModuleOrNamespace(_, _, kind, _, _, _, _, m)] when not kind.IsModule -> QualFileNameOfFilename m filename - | _ -> QualFileNameOfFilename (mkRange filename pos0 pos0) filename - -let PrependPathToQualFileName x (QualifiedNameOfFile q) = ComputeQualifiedNameOfFileFromUniquePath (q.idRange, pathOfLid x@[q.idText]) -let PrependPathToImpl x (SynModuleOrNamespace(p, b, c, d, e, f, g, h)) = SynModuleOrNamespace(x@p, b, c, d, e, f, g, h) -let PrependPathToSpec x (SynModuleOrNamespaceSig(p, b, c, d, e, f, g, h)) = SynModuleOrNamespaceSig(x@p, b, c, d, e, f, g, h) - -let PrependPathToInput x inp = - match inp with - | ParsedInput.ImplFile (ParsedImplFileInput (b, c, q, d, hd, impls, e)) -> - ParsedInput.ImplFile (ParsedImplFileInput (b, c, PrependPathToQualFileName x q, d, hd, List.map (PrependPathToImpl x) impls, e)) - - | ParsedInput.SigFile (ParsedSigFileInput (b, q, d, hd, specs)) -> - ParsedInput.SigFile (ParsedSigFileInput (b, PrependPathToQualFileName x q, d, hd, List.map (PrependPathToSpec x) specs)) - -let ComputeAnonModuleName check defaultNamespace filename (m: range) = - let modname = CanonicalizeFilename filename - if check && not (modname |> String.forall (fun c -> System.Char.IsLetterOrDigit c || c = '_')) then - if not (filename.EndsWith("fsx", StringComparison.OrdinalIgnoreCase) || filename.EndsWith("fsscript", StringComparison.OrdinalIgnoreCase)) then - warning(Error(FSComp.SR.buildImplicitModuleIsNotLegalIdentifier(modname, (fileNameOfPath filename)), m)) - let combined = - match defaultNamespace with - | None -> modname - | Some ns -> textOfPath [ns;modname] - - let anonymousModuleNameRange = - let filename = m.FileName - mkRange filename pos0 pos0 - pathToSynLid anonymousModuleNameRange (splitNamespace combined) - -let PostParseModuleImpl (_i, defaultNamespace, isLastCompiland, filename, impl) = - match impl with - | ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, isRec, kind, decls, xmlDoc, attribs, access, m)) -> - let lid = - match lid with - | [id] when kind.IsModule && id.idText = MangledGlobalName -> - error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) - | id :: rest when id.idText = MangledGlobalName -> rest - | _ -> lid - SynModuleOrNamespace(lid, isRec, kind, decls, xmlDoc, attribs, access, m) - - | ParsedImplFileFragment.AnonModule (defs, m)-> - let isLast, isExe = isLastCompiland - let lower = String.lowercase filename - if not (isLast && isExe) && not (doNotRequireNamespaceOrModuleSuffixes |> List.exists (Filename.checkSuffix lower)) then - match defs with - | SynModuleDecl.NestedModule(_) :: _ -> errorR(Error(FSComp.SR.noEqualSignAfterModule(), trimRangeToLine m)) - | _ -> errorR(Error(FSComp.SR.buildMultiFileRequiresNamespaceOrModule(), trimRangeToLine m)) - - let modname = ComputeAnonModuleName (not (isNil defs)) defaultNamespace filename (trimRangeToLine m) - SynModuleOrNamespace(modname, false, AnonModule, defs, PreXmlDoc.Empty, [], None, m) - - | ParsedImplFileFragment.NamespaceFragment (lid, a, kind, c, d, e, m)-> - let lid, kind = - match lid with - | id :: rest when id.idText = MangledGlobalName -> - rest, if List.isEmpty rest then GlobalNamespace else kind - | _ -> lid, kind - SynModuleOrNamespace(lid, a, kind, c, d, e, None, m) - -let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, filename, intf) = - match intf with - | ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, isRec, kind, decls, xmlDoc, attribs, access, m)) -> - let lid = - match lid with - | [id] when kind.IsModule && id.idText = MangledGlobalName -> - error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) - | id :: rest when id.idText = MangledGlobalName -> rest - | _ -> lid - SynModuleOrNamespaceSig(lid, isRec, NamedModule, decls, xmlDoc, attribs, access, m) - - | ParsedSigFileFragment.AnonModule (defs, m) -> - let isLast, isExe = isLastCompiland - let lower = String.lowercase filename - if not (isLast && isExe) && not (doNotRequireNamespaceOrModuleSuffixes |> List.exists (Filename.checkSuffix lower)) then - match defs with - | SynModuleSigDecl.NestedModule(_) :: _ -> errorR(Error(FSComp.SR.noEqualSignAfterModule(), m)) - | _ -> errorR(Error(FSComp.SR.buildMultiFileRequiresNamespaceOrModule(), m)) - - let modname = ComputeAnonModuleName (not (isNil defs)) defaultNamespace filename (trimRangeToLine m) - SynModuleOrNamespaceSig(modname, false, AnonModule, defs, PreXmlDoc.Empty, [], None, m) - - | ParsedSigFileFragment.NamespaceFragment (lid, a, kind, c, d, e, m)-> - let lid, kind = - match lid with - | id :: rest when id.idText = MangledGlobalName -> - rest, if List.isEmpty rest then GlobalNamespace else kind - | _ -> lid, kind - SynModuleOrNamespaceSig(lid, a, kind, c, d, e, None, m) - - - -let PostParseModuleImpls (defaultNamespace, filename, isLastCompiland, ParsedImplFile (hashDirectives, impls)) = - match impls |> List.rev |> List.tryPick (function ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, _, _, _, _, _, _, _)) -> Some lid | _ -> None) with - | Some lid when impls.Length > 1 -> - errorR(Error(FSComp.SR.buildMultipleToplevelModules(), rangeOfLid lid)) - | _ -> - () - let impls = impls |> List.mapi (fun i x -> PostParseModuleImpl (i, defaultNamespace, isLastCompiland, filename, x)) - let qualName = QualFileNameOfImpls filename impls - let isScript = IsScript filename - - let scopedPragmas = - [ for (SynModuleOrNamespace(_, _, _, decls, _, _, _, _)) in impls do - for d in decls do - match d with - | SynModuleDecl.HashDirective (hd, _) -> yield! GetScopedPragmasForHashDirective hd - | _ -> () - for hd in hashDirectives do - yield! GetScopedPragmasForHashDirective hd ] - ParsedInput.ImplFile (ParsedImplFileInput (filename, isScript, qualName, scopedPragmas, hashDirectives, impls, isLastCompiland)) - -let PostParseModuleSpecs (defaultNamespace, filename, isLastCompiland, ParsedSigFile (hashDirectives, specs)) = - match specs |> List.rev |> List.tryPick (function ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, _, _, _, _, _, _, _)) -> Some lid | _ -> None) with - | Some lid when specs.Length > 1 -> - errorR(Error(FSComp.SR.buildMultipleToplevelModules(), rangeOfLid lid)) - | _ -> - () - - let specs = specs |> List.mapi (fun i x -> PostParseModuleSpec(i, defaultNamespace, isLastCompiland, filename, x)) - let qualName = QualFileNameOfSpecs filename specs - let scopedPragmas = - [ for (SynModuleOrNamespaceSig(_, _, _, decls, _, _, _, _)) in specs do - for d in decls do - match d with - | SynModuleSigDecl.HashDirective(hd, _) -> yield! GetScopedPragmasForHashDirective hd - | _ -> () - for hd in hashDirectives do - yield! GetScopedPragmasForHashDirective hd ] - - ParsedInput.SigFile (ParsedSigFileInput (filename, qualName, scopedPragmas, hashDirectives, specs)) - -type ModuleNamesDict = Map> - -/// Checks if a module name is already given and deduplicates the name if needed. -let DeduplicateModuleName (moduleNamesDict: ModuleNamesDict) fileName (qualNameOfFile: QualifiedNameOfFile) = - let path = Path.GetDirectoryName fileName - let path = if FileSystem.IsPathRootedShim path then try FileSystem.GetFullPathShim path with _ -> path else path - match moduleNamesDict.TryGetValue qualNameOfFile.Text with - | true, paths -> - if paths.ContainsKey path then - paths.[path], moduleNamesDict - else - let count = paths.Count + 1 - let id = qualNameOfFile.Id - let qualNameOfFileT = if count = 1 then qualNameOfFile else QualifiedNameOfFile(Ident(id.idText + "___" + count.ToString(), id.idRange)) - let moduleNamesDictT = moduleNamesDict.Add(qualNameOfFile.Text, paths.Add(path, qualNameOfFileT)) - qualNameOfFileT, moduleNamesDictT - | _ -> - let moduleNamesDictT = moduleNamesDict.Add(qualNameOfFile.Text, Map.empty.Add(path, qualNameOfFile)) - qualNameOfFile, moduleNamesDictT - -/// Checks if a ParsedInput is using a module name that was already given and deduplicates the name if needed. -let DeduplicateParsedInputModuleName (moduleNamesDict: ModuleNamesDict) input = - match input with - | ParsedInput.ImplFile (ParsedImplFileInput.ParsedImplFileInput (fileName, isScript, qualNameOfFile, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) -> - let qualNameOfFileT, moduleNamesDictT = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile - let inputT = ParsedInput.ImplFile (ParsedImplFileInput.ParsedImplFileInput (fileName, isScript, qualNameOfFileT, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) - inputT, moduleNamesDictT - | ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput (fileName, qualNameOfFile, scopedPragmas, hashDirectives, modules)) -> - let qualNameOfFileT, moduleNamesDictT = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile - let inputT = ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput (fileName, qualNameOfFileT, scopedPragmas, hashDirectives, modules)) - inputT, moduleNamesDictT - -let ParseInput (lexer, errorLogger: ErrorLogger, lexbuf: UnicodeLexing.Lexbuf, defaultNamespace, filename, isLastCompiland) = - // The assert below is almost ok, but it fires in two cases: - // - fsi.exe sometimes passes "stdin" as a dummy filename - // - if you have a #line directive, e.g. - // # 1000 "Line01.fs" - // then it also asserts. But these are edge cases that can be fixed later, e.g. in bug 4651. - //System.Diagnostics.Debug.Assert(System.IO.Path.IsPathRooted filename, sprintf "should be absolute: '%s'" filename) - let lower = String.lowercase filename - // Delay sending errors and warnings until after the file is parsed. This gives us a chance to scrape the - // #nowarn declarations for the file - let delayLogger = CapturingErrorLogger("Parsing") - use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayLogger) - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - let mutable scopedPragmas = [] - try - let input = - if mlCompatSuffixes |> List.exists (Filename.checkSuffix lower) then - mlCompatWarning (FSComp.SR.buildCompilingExtensionIsForML()) rangeStartup - - if FSharpImplFileSuffixes |> List.exists (Filename.checkSuffix lower) then - let impl = Parser.implementationFile lexer lexbuf - PostParseModuleImpls (defaultNamespace, filename, isLastCompiland, impl) - elif FSharpSigFileSuffixes |> List.exists (Filename.checkSuffix lower) then - let intfs = Parser.signatureFile lexer lexbuf - PostParseModuleSpecs (defaultNamespace, filename, isLastCompiland, intfs) - else - delayLogger.Error(Error(FSComp.SR.buildInvalidSourceFileExtension filename, Range.rangeStartup)) - scopedPragmas <- GetScopedPragmasForInput input - input - finally - // OK, now commit the errors, since the ScopedPragmas will (hopefully) have been scraped - let filteringErrorLogger = ErrorLoggerFilteringByScopedPragmas(false, scopedPragmas, errorLogger) - delayLogger.CommitDelayedDiagnostics filteringErrorLogger - -//---------------------------------------------------------------------------- -// parsing - ParseOneInputFile -// Filename is (ml/mli/fs/fsi source). Parse it to AST. -//---------------------------------------------------------------------------- -let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, conditionalCompilationDefines, lexbuf, filename, isLastCompiland, errorLogger) = - use unwindbuildphase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - try - let skip = true in (* don't report whitespace from lexer *) - let lightSyntaxStatus = LightSyntaxStatus (tcConfig.ComputeLightSyntaxInitialStatus filename, true) - let lexargs = mkLexargs (filename, conditionalCompilationDefines@tcConfig.conditionalCompilationDefines, lightSyntaxStatus, lexResourceManager, [], errorLogger, tcConfig.pathMap) - let shortFilename = SanitizeFileName filename tcConfig.implicitIncludeDir - let input = - Lexhelp.usingLexbufForParsing (lexbuf, filename) (fun lexbuf -> - if verbose then dprintn ("Parsing... "+shortFilename) - let tokenizer = LexFilter.LexFilter(lightSyntaxStatus, tcConfig.compilingFslib, Lexer.token lexargs skip, lexbuf) - - if tcConfig.tokenizeOnly then - while true do - printf "tokenize - getting one token from %s\n" shortFilename - let t = tokenizer.Lexer lexbuf - printf "tokenize - got %s @ %a\n" (Parser.token_to_string t) outputRange lexbuf.LexemeRange - (match t with Parser.EOF _ -> exit 0 | _ -> ()) - if lexbuf.IsPastEndOfStream then printf "!!! at end of stream\n" - - if tcConfig.testInteractionParser then - while true do - match (Parser.interaction tokenizer.Lexer lexbuf) with - | IDefns(l, m) -> dprintf "Parsed OK, got %d defs @ %a\n" l.Length outputRange m - | IHash (_, m) -> dprintf "Parsed OK, got hash @ %a\n" outputRange m - exit 0 - - let res = ParseInput(tokenizer.Lexer, errorLogger, lexbuf, None, filename, isLastCompiland) - - if tcConfig.reportNumDecls then - let rec flattenSpecs specs = - specs |> List.collect (function (SynModuleSigDecl.NestedModule (_, _, subDecls, _)) -> flattenSpecs subDecls | spec -> [spec]) - let rec flattenDefns specs = - specs |> List.collect (function (SynModuleDecl.NestedModule (_, _, subDecls, _, _)) -> flattenDefns subDecls | defn -> [defn]) - - let flattenModSpec (SynModuleOrNamespaceSig(_, _, _, decls, _, _, _, _)) = flattenSpecs decls - let flattenModImpl (SynModuleOrNamespace(_, _, _, decls, _, _, _, _)) = flattenDefns decls - match res with - | ParsedInput.SigFile (ParsedSigFileInput (_, _, _, _, specs)) -> - dprintf "parsing yielded %d specs" (List.collect flattenModSpec specs).Length - | ParsedInput.ImplFile (ParsedImplFileInput (modules = impls)) -> - dprintf "parsing yielded %d definitions" (List.collect flattenModImpl impls).Length - res - ) - if verbose then dprintn ("Parsed "+shortFilename) - Some input - with e -> (* errorR(Failure("parse failed")); *) errorRecovery e rangeStartup; None - - -let ParseOneInputFile (tcConfig: TcConfig, lexResourceManager, conditionalCompilationDefines, filename, isLastCompiland, errorLogger, retryLocked) = - try - let lower = String.lowercase filename - if List.exists (Filename.checkSuffix lower) (FSharpSigFileSuffixes@FSharpImplFileSuffixes) then - if not(FileSystem.SafeExists filename) then - error(Error(FSComp.SR.buildCouldNotFindSourceFile filename, rangeStartup)) - let isFeatureSupported featureId = tcConfig.langVersion.SupportsFeature featureId - use reader = File.OpenReaderAndRetry (filename, tcConfig.inputCodePage, retryLocked) - let lexbuf = UnicodeLexing.StreamReaderAsLexbuf(isFeatureSupported, reader) - ParseOneInputLexbuf(tcConfig, lexResourceManager, conditionalCompilationDefines, lexbuf, filename, isLastCompiland, errorLogger) - else error(Error(FSComp.SR.buildInvalidSourceFileExtension(SanitizeFileName filename tcConfig.implicitIncludeDir), rangeStartup)) - with e -> (* errorR(Failure("parse failed")); *) errorRecovery e rangeStartup; None - - -[] -type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, unresolved: UnresolvedAssemblyReference list) = - - let originalReferenceToResolution = results |> List.map (fun r -> r.originalReference.Text, r) |> Map.ofList - let resolvedPathToResolution = results |> List.map (fun r -> r.resolvedPath, r) |> Map.ofList - - /// Add some resolutions to the map of resolution results. - member tcResolutions.AddResolutionResults newResults = TcAssemblyResolutions(tcConfig, results @ newResults, unresolved) - - /// Add some unresolved results. - member tcResolutions.AddUnresolvedReferences newUnresolved = TcAssemblyResolutions(tcConfig, results, unresolved @ newUnresolved) - - /// Get information about referenced DLLs - member tcResolutions.GetAssemblyResolutions() = results - member tcResolutions.GetUnresolvedReferences() = unresolved - member tcResolutions.TryFindByOriginalReference(assemblyReference: AssemblyReference) = originalReferenceToResolution.TryFind assemblyReference.Text - - /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcResolution.TryFindByExactILAssemblyRef (ctok, assemblyRef) = - results |> List.tryFind (fun ar-> - let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation - r = assemblyRef) - - /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcResolution.TryFindBySimpleAssemblyName (ctok, simpleAssemName) = - results |> List.tryFind (fun ar-> - let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation - r.Name = simpleAssemName) - - member tcResolutions.TryFindByResolvedPath nm = resolvedPathToResolution.TryFind nm - member tcResolutions.TryFindByOriginalReferenceText nm = originalReferenceToResolution.TryFind nm - - static member ResolveAssemblyReferences (ctok, tcConfig: TcConfig, assemblyList: AssemblyReference list, knownUnresolved: UnresolvedAssemblyReference list) : TcAssemblyResolutions = - let resolved, unresolved = - if tcConfig.useSimpleResolution then - let resolutions = - assemblyList - |> List.map (fun assemblyReference -> - try - Choice1Of2 (tcConfig.ResolveLibWithDirectories (CcuLoadFailureAction.RaiseError, assemblyReference) |> Option.get) - with e -> - errorRecovery e assemblyReference.Range - Choice2Of2 assemblyReference) - let successes = resolutions |> List.choose (function Choice1Of2 x -> Some x | _ -> None) - let failures = resolutions |> List.choose (function Choice2Of2 x -> Some (UnresolvedAssemblyReference(x.Text, [x])) | _ -> None) - successes, failures - else - RequireCompilationThread ctok // we don't want to do assembly resolution concurrently, we assume MSBuild doesn't handle this - TcConfig.TryResolveLibsUsingMSBuildRules (tcConfig, assemblyList, rangeStartup, ResolveAssemblyReferenceMode.ReportErrors) - TcAssemblyResolutions(tcConfig, resolved, unresolved @ knownUnresolved) - - static member GetAllDllReferences (tcConfig: TcConfig) = [ - let primaryReference = tcConfig.PrimaryAssemblyDllReference() - //yield primaryReference - - if not tcConfig.compilingFslib then - yield tcConfig.CoreLibraryDllReference() - - let assumeDotNetFramework = primaryReference.SimpleAssemblyNameIs("mscorlib") - if tcConfig.framework then - for s in defaultReferencesForScriptsAndOutOfProjectSources tcConfig.useFsiAuxLib assumeDotNetFramework tcConfig.useSdkRefs do - yield AssemblyReference(rangeStartup, (if s.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) then s else s+".dll"), None) - - yield! tcConfig.referencedDLLs - ] - - static member SplitNonFoundationalResolutions (ctok, tcConfig: TcConfig) = - let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - let resolutions = TcAssemblyResolutions.ResolveAssemblyReferences (ctok, tcConfig, assemblyList, tcConfig.knownUnresolvedReferences) - let frameworkDLLs, nonFrameworkReferences = resolutions.GetAssemblyResolutions() |> List.partition (fun r -> r.sysdir) - let unresolved = resolutions.GetUnresolvedReferences() -#if DEBUG - let mutable itFailed = false - let addedText = "\nIf you want to debug this right now, attach a debugger, and put a breakpoint in 'CompileOps.fs' near the text '!itFailed', and you can re-step through the assembly resolution logic." - unresolved - |> List.iter (fun (UnresolvedAssemblyReference(referenceText, _ranges)) -> - if referenceText.Contains("mscorlib") then - System.Diagnostics.Debug.Assert(false, sprintf "whoops, did not resolve mscorlib: '%s'%s" referenceText addedText) - itFailed <- true) - frameworkDLLs - |> List.iter (fun x -> - if not(FileSystem.IsPathRootedShim(x.resolvedPath)) then - System.Diagnostics.Debug.Assert(false, sprintf "frameworkDLL should be absolute path: '%s'%s" x.resolvedPath addedText) - itFailed <- true) - nonFrameworkReferences - |> List.iter (fun x -> - if not(FileSystem.IsPathRootedShim(x.resolvedPath)) then - System.Diagnostics.Debug.Assert(false, sprintf "nonFrameworkReference should be absolute path: '%s'%s" x.resolvedPath addedText) - itFailed <- true) - if itFailed then - // idea is, put a breakpoint here and then step through - let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - let resolutions = TcAssemblyResolutions.ResolveAssemblyReferences (ctok, tcConfig, assemblyList, []) - let _frameworkDLLs, _nonFrameworkReferences = resolutions.GetAssemblyResolutions() |> List.partition (fun r -> r.sysdir) - () -#endif - frameworkDLLs, nonFrameworkReferences, unresolved - - static member BuildFromPriorResolutions (ctok, tcConfig: TcConfig, resolutions, knownUnresolved) = - let references = resolutions |> List.map (fun r -> r.originalReference) - TcAssemblyResolutions.ResolveAssemblyReferences (ctok, tcConfig, references, knownUnresolved) - - -//---------------------------------------------------------------------------- -// Typecheck and optimization environments on disk -//-------------------------------------------------------------------------- - -let IsSignatureDataResource (r: ILResource) = - r.Name.StartsWithOrdinal FSharpSignatureDataResourceName || - r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 - -let IsOptimizationDataResource (r: ILResource) = - r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName|| - r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 - -let GetSignatureDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then - String.dropPrefix r.Name FSharpSignatureDataResourceName - elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then - String.dropPrefix r.Name FSharpSignatureDataResourceName2 - else failwith "GetSignatureDataResourceName" - -let GetOptimizationDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then - String.dropPrefix r.Name FSharpOptimizationDataResourceName - elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then - String.dropPrefix r.Name FSharpOptimizationDataResourceName2 - else failwith "GetOptimizationDataResourceName" - -let IsReflectedDefinitionsResource (r: ILResource) = - r.Name.StartsWithOrdinal(QuotationPickler.SerializedReflectedDefinitionsResourceNameBase) - -let MakeILResource rName bytes = - { Name = rName - Location = ILResourceLocation.Local(ByteMemory.FromArray(bytes).AsReadOnly()) - Access = ILResourceAccess.Public - CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs - MetadataIndex = NoMetadataIdx } - -let PickleToResource inMem file (g: TcGlobals) scope rName p x = - let file = PathMap.apply g.pathMap file - - { Name = rName - Location = (let bytes = pickleObjWithDanglingCcus inMem file g scope p x in ILResourceLocation.Local(ByteMemory.FromArray(bytes).AsReadOnly())) - Access = ILResourceAccess.Public - CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs - MetadataIndex = NoMetadataIdx } - -let GetSignatureData (file, ilScopeRef, ilModule, byteReader) : PickledDataWithReferences = - unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo (byteReader()) - -let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: CcuThunk, file, inMem) : ILResource = - let mspec = ccu.Contents - let mspec = ApplyExportRemappingToEntity tcGlobals exportRemapping mspec - // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers - // don't complain when they see the resource. - let rName = if ccu.AssemblyName = getFSharpCoreLibraryName then FSharpSignatureDataResourceName2 else FSharpSignatureDataResourceName - - let includeDir = - if String.IsNullOrEmpty tcConfig.implicitIncludeDir then "" - else - tcConfig.implicitIncludeDir - |> System.IO.Path.GetFullPath - |> PathMap.applyDir tcGlobals.pathMap - - PickleToResource inMem file tcGlobals ccu (rName+ccu.AssemblyName) pickleCcuInfo - { mspec=mspec - compileTimeWorkingDir=includeDir - usesQuotations = ccu.UsesFSharp20PlusQuotations } - -let GetOptimizationData (file, ilScopeRef, ilModule, byteReader) = - unpickleObjWithDanglingCcus file ilScopeRef ilModule Optimizer.u_CcuOptimizationInfo (byteReader()) - -let WriteOptimizationData (tcGlobals, file, inMem, ccu: CcuThunk, modulInfo) = - // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers - // don't complain when they see the resource. - let rName = if ccu.AssemblyName = getFSharpCoreLibraryName then FSharpOptimizationDataResourceName2 else FSharpOptimizationDataResourceName - PickleToResource inMem file tcGlobals ccu (rName+ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo - -//---------------------------------------------------------------------------- -// Abstraction for project reference - -type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyRefs) = - let externalSigAndOptData = ["FSharp.Core"] - interface IRawFSharpAssemblyData with - member __.GetAutoOpenAttributes ilg = GetAutoOpenAttributes ilg ilModule - member __.GetInternalsVisibleToAttributes ilg = GetInternalsVisibleToAttributes ilg ilModule - member __.TryGetILModuleDef() = Some ilModule - member __.GetRawFSharpSignatureData(m, ilShortAssemName, filename) = - let resources = ilModule.Resources.AsList - let sigDataReaders = - [ for iresource in resources do - if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - yield (ccuName, fun () -> iresource.GetBytes()) ] - - let sigDataReaders = - if sigDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then - let sigFileName = Path.ChangeExtension(filename, "sigdata") - if not (FileSystem.SafeExists sigFileName) then - error(Error(FSComp.SR.buildExpectedSigdataFile (FileSystem.GetFullPathShim sigFileName), m)) - [ (ilShortAssemName, fun () -> ByteMemory.FromFile(sigFileName, FileAccess.Read, canShadowCopy=true).AsReadOnly())] - else - sigDataReaders - sigDataReaders - member __.GetRawFSharpOptimizationData(m, ilShortAssemName, filename) = - let optDataReaders = - ilModule.Resources.AsList - |> List.choose (fun r -> if IsOptimizationDataResource r then Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) else None) - - // Look for optimization data in a file - let optDataReaders = - if optDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then - let optDataFile = Path.ChangeExtension(filename, "optdata") - if not (FileSystem.SafeExists optDataFile) then - error(Error(FSComp.SR.buildExpectedFileAlongSideFSharpCore(optDataFile, FileSystem.GetFullPathShim optDataFile), m)) - [ (ilShortAssemName, (fun () -> ByteMemory.FromFile(optDataFile, FileAccess.Read, canShadowCopy=true).AsReadOnly()))] - else - optDataReaders - optDataReaders - member __.GetRawTypeForwarders() = - match ilModule.Manifest with - | Some manifest -> manifest.ExportedTypes - | None -> mkILExportedTypes [] - member __.ShortAssemblyName = GetNameOfILModule ilModule - member __.ILScopeRef = MakeScopeRefForILModule ilModule - member __.ILAssemblyRefs = ilAssemblyRefs - member __.HasAnyFSharpSignatureDataAttribute = - let attrs = GetCustomAttributesOfILModule ilModule - List.exists IsSignatureDataVersionAttr attrs - member __.HasMatchingFSharpSignatureDataAttribute ilg = - let attrs = GetCustomAttributesOfILModule ilModule - List.exists (IsMatchingSignatureDataVersionAttr ilg (IL.parseILVersion Internal.Utilities.FSharpEnvironment.FSharpBinaryMetadataFormatRevision)) attrs - - -//---------------------------------------------------------------------------- -// Relink blobs of saved data by fixing up ccus. -//-------------------------------------------------------------------------- - -let availableToOptionalCcu = function - | ResolvedCcu ccu -> Some ccu - | UnresolvedCcu _ -> None - - -//---------------------------------------------------------------------------- -// TcConfigProvider -//-------------------------------------------------------------------------- - -/// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig, -/// but for F# Interactive it may be based on an underlying mutable TcConfigBuilder. -type TcConfigProvider = - | TcConfigProvider of (CompilationThreadToken -> TcConfig) - member x.Get ctok = (let (TcConfigProvider f) = x in f ctok) - - /// Get a TcConfigProvider which will return only the exact TcConfig. - static member Constant tcConfig = TcConfigProvider(fun _ctok -> tcConfig) - - /// Get a TcConfigProvider which will continue to respect changes in the underlying - /// TcConfigBuilder rather than delivering snapshots. - static member BasedOnMutableBuilder tcConfigB = TcConfigProvider(fun _ctok -> TcConfig.Create(tcConfigB, validate=false)) - - -//---------------------------------------------------------------------------- -// TcImports -//-------------------------------------------------------------------------- - -[] -type TcImportsSafeDisposal - (disposeActions: ResizeArray unit>, -#if !NO_EXTENSIONTYPING - disposeTypeProviderActions: ResizeArray unit>, -#endif - compilationThread: ICompilationThread) = - - let mutable isDisposed = false - - let dispose () = - // disposing deliberately only closes this tcImports, not the ones up the chain - isDisposed <- true - if verbose then - dprintf "disposing of TcImports, %d binaries\n" disposeActions.Count -#if !NO_EXTENSIONTYPING - let actions = disposeTypeProviderActions - if actions.Count > 0 then - compilationThread.EnqueueWork (fun _ -> for action in actions do action()) -#endif - for action in disposeActions do action() - - override _.Finalize() = - dispose () - - interface IDisposable with - - member this.Dispose() = - if not isDisposed then - GC.SuppressFinalize this - dispose () - -#if !NO_EXTENSIONTYPING -// These are hacks in order to allow TcImports to be held as a weak reference inside a type provider. -// The reason is due to older type providers compiled using an older TypeProviderSDK, that SDK used reflection on fields and properties to determine the contract. -// The reflection code has now since been removed, see here: https://github.com/fsprojects/FSharp.TypeProviders.SDK/pull/305. But we still need to work on older type providers. -// One day we can remove these hacks when we deemed most if not all type providers were re-compiled using the newer TypeProviderSDK. -// Yuck. -type TcImportsDllInfoHack = - { - FileName: string - } - -and TcImportsWeakHack (tcImports: WeakReference) = - let mutable dllInfos: TcImportsDllInfoHack list = [] - - member __.SetDllInfos (value: ImportedBinary list) = - dllInfos <- value |> List.map (fun x -> { FileName = x.FileName }) - - member __.Base: TcImportsWeakHack option = - match tcImports.TryGetTarget() with - | true, strong -> - match strong.Base with - | Some (baseTcImports: TcImports) -> - Some baseTcImports.Weak - | _ -> - None - | _ -> - None - - member __.SystemRuntimeContainsType typeName = - match tcImports.TryGetTarget () with - | true, strong -> strong.SystemRuntimeContainsType typeName - | _ -> false -#endif -/// Represents a table of imported assemblies with their resolutions. -/// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. -/// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. -and [] TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, ilGlobalsOpt, compilationThread: ICompilationThread) as this = - - let mutable resolutions = initialResolutions - let mutable importsBase: TcImports option = importsBase - let mutable dllInfos: ImportedBinary list = [] - let mutable dllTable: NameMap = NameMap.empty - let mutable ccuInfos: ImportedAssembly list = [] - let mutable ccuTable: NameMap = NameMap.empty - - /// ccuThunks is a ConcurrentDictionary thus threadsafe - /// the key is a ccuThunk object, the value is a (unit->unit) func that when executed - /// the func is used to fix up the func and operates on data captured at the time the func is created. - /// func() is captured during phase2() of RegisterAndPrepareToImportReferencedDll(..) and PrepareToImportReferencedFSharpAssembly ( .. ) - let mutable ccuThunks = new ConcurrentDictionary unit)>() - - let disposeActions = ResizeArray() - let mutable disposed = false - let mutable ilGlobalsOpt = ilGlobalsOpt - let mutable tcGlobals = None -#if !NO_EXTENSIONTYPING - let disposeTypeProviderActions = ResizeArray() - let mutable generatedTypeRoots = new System.Collections.Generic.Dictionary() - let mutable tcImportsWeak = TcImportsWeakHack (WeakReference<_> this) -#endif - - let disposal = new TcImportsSafeDisposal(disposeActions, disposeTypeProviderActions, compilationThread) - - let CheckDisposed() = - if disposed then assert false - - let dispose () = - CheckDisposed() - (disposal :> IDisposable).Dispose() - - // This is used to fixe up unresolved ccuThunks that were created during assembly import. - // the ccuThunks dictionary is a ConcurrentDictionary and thus threadsafe. - // Algorithm: - // Get a snapshot of the current unFixedUp ccuThunks. - // for each of those thunks, remove them from the dictionary, so any parallel threads can't do this work - // If it successfully removed it from the dictionary then do the fixup - // If the thunk remains unresolved add it back to the ccuThunks dictionary for further processing - // If not then move on to the next thunk - let fixupOrphanCcus () = - let keys = ccuThunks.Keys - for ccuThunk in keys do - match ccuThunks.TryRemove(ccuThunk) with - | true, func -> - if ccuThunk.IsUnresolvedReference then - func() - if ccuThunk.IsUnresolvedReference then - ccuThunks.TryAdd(ccuThunk, func) |> ignore - | _ -> () - - static let ccuHasType (ccu: CcuThunk) (nsname: string list) (tname: string) = - let matchNameSpace (entityOpt: Entity option) n = - match entityOpt with - | None -> None - | Some entity -> - entity.ModuleOrNamespaceType.AllEntitiesByCompiledAndLogicalMangledNames.TryFind n - - match (Some ccu.Contents, nsname) ||> List.fold matchNameSpace with - | Some ns -> - match Map.tryFind tname ns.ModuleOrNamespaceType.TypesByMangledName with - | Some _ -> true - | None -> false - | None -> false - - member internal tcImports.Base = - CheckDisposed() - importsBase - - member tcImports.CcuTable = - CheckDisposed() - ccuTable - - member tcImports.DllTable = - CheckDisposed() - dllTable - -#if !NO_EXTENSIONTYPING - member tcImports.Weak = - CheckDisposed() - tcImportsWeak -#endif - - member tcImports.RegisterCcu ccuInfo = - CheckDisposed() - ccuInfos <- ccuInfos ++ ccuInfo - // Assembly Ref Resolution: remove this use of ccu.AssemblyName - ccuTable <- NameMap.add (ccuInfo.FSharpViewOfMetadata.AssemblyName) ccuInfo ccuTable - - member tcImports.RegisterDll dllInfo = - CheckDisposed() - dllInfos <- dllInfos ++ dllInfo -#if !NO_EXTENSIONTYPING - tcImportsWeak.SetDllInfos dllInfos -#endif - dllTable <- NameMap.add (getNameOfScopeRef dllInfo.ILScopeRef) dllInfo dllTable - - member tcImports.GetDllInfos() : ImportedBinary list = - CheckDisposed() - match importsBase with - | Some importsBase-> importsBase.GetDllInfos() @ dllInfos - | None -> dllInfos - - member tcImports.AllAssemblyResolutions() = - CheckDisposed() - let ars = resolutions.GetAssemblyResolutions() - match importsBase with - | Some importsBase-> importsBase.AllAssemblyResolutions() @ ars - | None -> ars - - member tcImports.TryFindDllInfo (ctok: CompilationThreadToken, m, assemblyName, lookupOnly) = - CheckDisposed() - let rec look (t: TcImports) = - match NameMap.tryFind assemblyName t.DllTable with - | Some res -> Some res - | None -> - match t.Base with - | Some t2 -> look t2 - | None -> None - match look tcImports with - | Some res -> Some res - | None -> - tcImports.ImplicitLoadIfAllowed(ctok, m, assemblyName, lookupOnly) - look tcImports - - - member tcImports.FindDllInfo (ctok, m, assemblyName) = - match tcImports.TryFindDllInfo (ctok, m, assemblyName, lookupOnly=false) with - | Some res -> res - | None -> error(Error(FSComp.SR.buildCouldNotResolveAssembly assemblyName, m)) - - member tcImports.GetImportedAssemblies() = - CheckDisposed() - match importsBase with - | Some importsBase-> List.append (importsBase.GetImportedAssemblies()) ccuInfos - | None -> ccuInfos - - member tcImports.GetCcusExcludingBase() = - CheckDisposed() - ccuInfos |> List.map (fun x -> x.FSharpViewOfMetadata) - - member tcImports.GetCcusInDeclOrder() = - CheckDisposed() - List.map (fun x -> x.FSharpViewOfMetadata) (tcImports.GetImportedAssemblies()) - - // This is the main "assembly reference --> assembly" resolution routine. - member tcImports.FindCcuInfo (ctok, m, assemblyName, lookupOnly) = - CheckDisposed() - let rec look (t: TcImports) = - match NameMap.tryFind assemblyName t.CcuTable with - | Some res -> Some res - | None -> - match t.Base with - | Some t2 -> look t2 - | None -> None - - match look tcImports with - | Some res -> ResolvedImportedAssembly res - | None -> - tcImports.ImplicitLoadIfAllowed(ctok, m, assemblyName, lookupOnly) - match look tcImports with - | Some res -> ResolvedImportedAssembly res - | None -> UnresolvedImportedAssembly assemblyName - - member tcImports.FindCcu (ctok, m, assemblyName, lookupOnly) = - CheckDisposed() - match tcImports.FindCcuInfo(ctok, m, assemblyName, lookupOnly) with - | ResolvedImportedAssembly importedAssembly -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) - | UnresolvedImportedAssembly assemblyName -> UnresolvedCcu assemblyName - - member tcImports.FindCcuFromAssemblyRef(ctok, m, assemblyRef: ILAssemblyRef) = - CheckDisposed() - match tcImports.FindCcuInfo(ctok, m, assemblyRef.Name, lookupOnly=false) with - | ResolvedImportedAssembly importedAssembly -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) - | UnresolvedImportedAssembly _ -> UnresolvedCcu(assemblyRef.QualifiedName) - - -#if !NO_EXTENSIONTYPING - member tcImports.GetProvidedAssemblyInfo(ctok, m, assembly: Tainted) = - let anameOpt = assembly.PUntaint((fun assembly -> match assembly with null -> None | a -> Some (a.GetName())), m) - match anameOpt with - | None -> false, None - | Some aname -> - let ilShortAssemName = aname.Name - match tcImports.FindCcu (ctok, m, ilShortAssemName, lookupOnly=true) with - | ResolvedCcu ccu -> - if ccu.IsProviderGenerated then - let dllinfo = tcImports.FindDllInfo(ctok, m, ilShortAssemName) - true, dllinfo.ProviderGeneratedStaticLinkMap - else - false, None - - | UnresolvedCcu _ -> - let g = tcImports.GetTcGlobals() - let ilScopeRef = ILScopeRef.Assembly (ILAssemblyRef.FromAssemblyName aname) - let fileName = aname.Name + ".dll" - let bytes = assembly.PApplyWithProvider((fun (assembly, provider) -> assembly.GetManifestModuleContents provider), m).PUntaint(id, m) - let tcConfig = tcConfigP.Get ctok - let ilModule, ilAssemblyRefs = - let opts: ILReaderOptions = - { reduceMemoryUsage = tcConfig.reduceMemoryUsage - pdbDirPath = None - metadataOnly = MetadataOnlyFlag.Yes - tryGetMetadataSnapshot = tcConfig.tryGetMetadataSnapshot } - let reader = OpenILModuleReaderFromBytes fileName bytes opts - reader.ILModuleDef, reader.ILAssemblyRefs - - let theActualAssembly = assembly.PUntaint((fun x -> x.Handle), m) - let dllinfo = - { RawMetadata= RawFSharpAssemblyDataBackedByFileOnDisk (ilModule, ilAssemblyRefs) - FileName=fileName - ProviderGeneratedAssembly=Some theActualAssembly - IsProviderGenerated=true - ProviderGeneratedStaticLinkMap= if g.isInteractive then None else Some (ProvidedAssemblyStaticLinkingMap.CreateNew()) - ILScopeRef = ilScopeRef - ILAssemblyRefs = ilAssemblyRefs } - tcImports.RegisterDll dllinfo - - let ccuContents = Construct.NewCcuContents ilScopeRef m ilShortAssemName (Construct.NewEmptyModuleOrNamespaceType Namespace) - - let ccuData: CcuData = - { IsFSharp=false - UsesFSharp20PlusQuotations=false - InvalidateEvent=(new Event<_>()).Publish - IsProviderGenerated = true - QualifiedName= Some (assembly.PUntaint((fun a -> a.FullName), m)) - Contents = ccuContents - ILScopeRef = ilScopeRef - Stamp = newStamp() - SourceCodeDirectory = "" - FileName = Some fileName - MemberSignatureEquality = (fun ty1 ty2 -> typeEquivAux EraseAll g ty1 ty2) - ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) - TryGetILModuleDef = (fun () -> Some ilModule) - TypeForwarders = Map.empty } - - let ccu = CcuThunk.Create(ilShortAssemName, ccuData) - let ccuinfo = - { FSharpViewOfMetadata=ccu - ILScopeRef = ilScopeRef - AssemblyAutoOpenAttributes = [] - AssemblyInternalsVisibleToAttributes = [] - IsProviderGenerated = true - TypeProviders=[] - FSharpOptimizationData = notlazy None } - tcImports.RegisterCcu ccuinfo - // Yes, it is generative - true, dllinfo.ProviderGeneratedStaticLinkMap - - member tcImports.RecordGeneratedTypeRoot root = - // checking if given ProviderGeneratedType was already recorded before (probably for another set of static parameters) - let (ProviderGeneratedType(_, ilTyRef, _)) = root - let index = - match generatedTypeRoots.TryGetValue ilTyRef with - | true, (index, _) -> index - | false, _ -> generatedTypeRoots.Count - generatedTypeRoots.[ilTyRef] <- (index, root) - - member tcImports.ProviderGeneratedTypeRoots = - generatedTypeRoots.Values - |> Seq.sortBy fst - |> Seq.map snd - |> Seq.toList -#endif - - member private tcImports.AttachDisposeAction action = - CheckDisposed() - disposeActions.Add action - -#if !NO_EXTENSIONTYPING - member private tcImports.AttachDisposeTypeProviderAction action = - CheckDisposed() - disposeTypeProviderActions.Add action -#endif - - // Note: the returned binary reader is associated with the tcImports, i.e. when the tcImports are closed - // then the reader is closed. - member tcImports.OpenILBinaryModule(ctok, filename, m) = - try - CheckDisposed() - let tcConfig = tcConfigP.Get ctok - let pdbDirPath = - // We open the pdb file if one exists parallel to the binary we - // are reading, so that --standalone will preserve debug information. - if tcConfig.openDebugInformationForLaterStaticLinking then - let pdbDir = try Filename.directoryName filename with _ -> "." - let pdbFile = (try Filename.chopExtension filename with _ -> filename) + ".pdb" - - if FileSystem.SafeExists pdbFile then - if verbose then dprintf "reading PDB file %s from directory %s\n" pdbFile pdbDir - Some pdbDir - else - None - else - None - - let ilILBinaryReader = - OpenILBinary (filename, tcConfig.reduceMemoryUsage, pdbDirPath, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot) - - tcImports.AttachDisposeAction(fun _ -> (ilILBinaryReader :> IDisposable).Dispose()) - ilILBinaryReader.ILModuleDef, ilILBinaryReader.ILAssemblyRefs - with e -> - error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), m)) - - (* auxModTable is used for multi-module assemblies *) - member tcImports.MkLoaderForMultiModuleILAssemblies ctok m = - CheckDisposed() - let auxModTable = HashMultiMap(10, HashIdentity.Structural) - fun viewedScopeRef -> - - let tcConfig = tcConfigP.Get ctok - match viewedScopeRef with - | ILScopeRef.Module modref -> - let key = modref.Name - if not (auxModTable.ContainsKey key) then - let resolution = tcConfig.ResolveLibWithDirectories (CcuLoadFailureAction.RaiseError, AssemblyReference(m, key, None)) |> Option.get - let ilModule, _ = tcImports.OpenILBinaryModule(ctok, resolution.resolvedPath, m) - auxModTable.[key] <- ilModule - auxModTable.[key] - - | _ -> - error(InternalError("Unexpected ILScopeRef.Local or ILScopeRef.Assembly in exported type table", m)) - - member tcImports.IsAlreadyRegistered nm = - CheckDisposed() - tcImports.GetDllInfos() |> List.exists (fun dll -> - match dll.ILScopeRef with - | ILScopeRef.Assembly a -> a.Name = nm - | _ -> false) - - member tcImports.GetImportMap() = - CheckDisposed() - let loaderInterface = - { new Import.AssemblyLoader with - member x.FindCcuFromAssemblyRef (ctok, m, ilAssemblyRef) = - tcImports.FindCcuFromAssemblyRef (ctok, m, ilAssemblyRef) -#if !NO_EXTENSIONTYPING - member x.GetProvidedAssemblyInfo (ctok, m, assembly) = tcImports.GetProvidedAssemblyInfo (ctok, m, assembly) - member x.RecordGeneratedTypeRoot root = tcImports.RecordGeneratedTypeRoot root -#endif - } - new Import.ImportMap (tcImports.GetTcGlobals(), loaderInterface) - - // Note the tcGlobals are only available once mscorlib and fslib have been established. For TcImports, - // they are logically only needed when converting AbsIL data structures into F# data structures, and - // when converting AbsIL types in particular, since these types are normalized through the tables - // in the tcGlobals (E.g. normalizing 'System.Int32' to 'int'). On the whole ImportILAssembly doesn't - // actually convert AbsIL types - it only converts the outer shell of type definitions - the vast majority of - // types such as those in method signatures are currently converted on-demand. However ImportILAssembly does have to - // convert the types that are constraints in generic parameters, which was the original motivation for making sure that - // ImportILAssembly had a tcGlobals available when it really needs it. - member tcImports.GetTcGlobals() : TcGlobals = - CheckDisposed() - match tcGlobals with - | Some g -> g - | None -> - match importsBase with - | Some b -> b.GetTcGlobals() - | None -> failwith "unreachable: GetGlobals - are the references to mscorlib.dll and FSharp.Core.dll valid?" - - member private tcImports.SetILGlobals ilg = - CheckDisposed() - ilGlobalsOpt <- Some ilg - - member private tcImports.SetTcGlobals g = - CheckDisposed() - tcGlobals <- Some g - -#if !NO_EXTENSIONTYPING - member private tcImports.InjectProvidedNamespaceOrTypeIntoEntity - (typeProviderEnvironment, - tcConfig: TcConfig, - m, entity: Entity, - injectedNamespace, remainingNamespace, - provider, - st: Tainted option) = - match remainingNamespace with - | next :: rest -> - // Inject the namespace entity - match entity.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind next with - | Some childEntity -> - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, childEntity, next :: injectedNamespace, rest, provider, st) - | None -> - // Build up the artificial namespace if there is not a real one. - let cpath = CompPath(ILScopeRef.Local, injectedNamespace |> List.rev |> List.map (fun n -> (n, ModuleOrNamespaceKind.Namespace)) ) - let mid = ident (next, rangeStartup) - let mty = Construct.NewEmptyModuleOrNamespaceType Namespace - let newNamespace = Construct.NewModuleOrNamespace (Some cpath) taccessPublic mid XmlDoc.Empty [] (MaybeLazy.Strict mty) - entity.ModuleOrNamespaceType.AddModuleOrNamespaceByMutation newNamespace - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, newNamespace, next :: injectedNamespace, rest, provider, st) - | [] -> - match st with - | Some st -> - // Inject the wrapper type into the provider assembly. - // - // Generated types get properly injected into the provided (i.e. generated) assembly CCU in tc.fs - - let importProvidedType t = Import.ImportProvidedType (tcImports.GetImportMap()) m t - let isSuppressRelocate = tcConfig.isInteractive || st.PUntaint((fun st -> st.IsSuppressRelocate), m) - let newEntity = Construct.NewProvidedTycon(typeProviderEnvironment, st, importProvidedType, isSuppressRelocate, m) - entity.ModuleOrNamespaceType.AddProvidedTypeEntity newEntity - | None -> () - - entity.entity_tycon_repr <- - match entity.TypeReprInfo with - // This is the first extension - | TNoRepr -> - TProvidedNamespaceExtensionPoint(typeProviderEnvironment, [provider]) - - // Add to the existing list of extensions - | TProvidedNamespaceExtensionPoint(resolutionFolder, prior) as repr -> - if not(prior |> List.exists(fun r->Tainted.EqTainted r provider)) then - TProvidedNamespaceExtensionPoint(resolutionFolder, provider :: prior) - else - repr - - | _ -> failwith "Unexpected representation in namespace entity referred to by a type provider" - - member tcImportsStrong.ImportTypeProviderExtensions - (ctok, tcConfig: TcConfig, - fileNameOfRuntimeAssembly, - ilScopeRefOfRuntimeAssembly, - runtimeAssemblyAttributes: ILAttribute list, - entityToInjectInto, invalidateCcu: Event<_>, m) = - - let startingErrorCount = CompileThreadStatic.ErrorLogger.ErrorCount - - // Find assembly level TypeProviderAssemblyAttributes. These will point to the assemblies that - // have class which implement ITypeProvider and which have TypeProviderAttribute on them. - let designTimeAssemblyNames = - runtimeAssemblyAttributes - |> List.choose (TryDecodeTypeProviderAssemblyAttr (defaultArg ilGlobalsOpt EcmaMscorlibILGlobals)) - // If no design-time assembly is specified, use the runtime assembly - |> List.map (function null -> fileNameOfRuntimeAssembly | s -> s) - // For each simple name of a design-time assembly, we take the first matching one in the order they are - // specified in the attributes - |> List.distinctBy (fun s -> try Path.GetFileNameWithoutExtension s with _ -> s) - - if not (List.isEmpty designTimeAssemblyNames) then - - // Find the SystemRuntimeAssemblyVersion value to report in the TypeProviderConfig. - let primaryAssemblyVersion = - let primaryAssemblyRef = tcConfig.PrimaryAssemblyDllReference() - let resolution = tcConfig.ResolveLibWithDirectories (CcuLoadFailureAction.RaiseError, primaryAssemblyRef) |> Option.get - // MSDN: this method causes the file to be opened and closed, but the assembly is not added to this domain - let name = System.Reflection.AssemblyName.GetAssemblyName(resolution.resolvedPath) - name.Version - - let typeProviderEnvironment = - { resolutionFolder = tcConfig.implicitIncludeDir - outputFile = tcConfig.outputFile - showResolutionMessages = tcConfig.showExtensionTypeMessages - referencedAssemblies = Array.distinct [| for r in tcImportsStrong.AllAssemblyResolutions() -> r.resolvedPath |] - temporaryFolder = FileSystem.GetTempPathShim() } - - // The type provider should not hold strong references to disposed - // TcImport objects. So the callbacks provided in the type provider config - // dispatch via a thunk which gets set to a non-resource-capturing - // failing function when the object is disposed. - let systemRuntimeContainsType = - // NOTE: do not touch this, edit: but we did, we had no choice - TPs cannot hold a strong reference on TcImports "ever". - let tcImports = tcImportsWeak - let mutable systemRuntimeContainsTypeRef = fun typeName -> tcImports.SystemRuntimeContainsType typeName - tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> systemRuntimeContainsTypeRef <- fun _ -> raise (System.ObjectDisposedException("The type provider has been disposed"))) - fun arg -> systemRuntimeContainsTypeRef arg - - let providers = [ - for designTimeAssemblyName in designTimeAssemblyNames do - yield! ExtensionTyping.GetTypeProvidersOfAssembly(fileNameOfRuntimeAssembly, - ilScopeRefOfRuntimeAssembly, - designTimeAssemblyName, - typeProviderEnvironment, - tcConfig.isInvalidationSupported, - tcConfig.isInteractive, - systemRuntimeContainsType, - primaryAssemblyVersion, - tcConfig.compilerToolPaths, - m) ] - // Note, type providers are disposable objects. The TcImports owns the provider objects - when/if it is disposed, the providers are disposed. - // We ignore all exceptions from provider disposal. - for provider in providers do - tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> - try - provider.PUntaintNoFailure(fun x -> x).Dispose() - with e -> - ()) - - // Add the invalidation signal handlers to each provider - for provider in providers do - provider.PUntaint((fun tp -> - - // Register the type provider invalidation handler. - // - // We are explicit about what the handler closure captures to help reason about the - // lifetime of captured objects, especially in case the type provider instance gets leaked - // or keeps itself alive mistakenly, e.g. via some global state in the type provider instance. - // - // The closure captures - // 1. an Event value, ultimately this is made available in all CCus as ccu.InvalidateEvent - // 2. any handlers registered to ccu.InvalidateEvent - // 3. a message string - // - // Note that the invalidation handler does not explicitly capture the TcImports. - // The only place where handlers are registered is to ccu.InvalidateEvent is in IncrementalBuilder.fs. - - let capturedInvalidateCcu = invalidateCcu - let capturedMessage = "The provider '" + fileNameOfRuntimeAssembly + "' reported a change" - let handler = tp.Invalidate.Subscribe(fun _ -> capturedInvalidateCcu.Trigger (capturedMessage)) - - // When the TcImports is disposed we detach the invalidation callback - tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> try handler.Dispose() with _ -> ())), m) - - match providers with - | [] -> - warning(Error(FSComp.SR.etHostingAssemblyFoundWithoutHosts(fileNameOfRuntimeAssembly, typeof.FullName), m)) - | _ -> - -#if DEBUG - if typeProviderEnvironment.showResolutionMessages then - dprintfn "Found extension type hosting hosting assembly '%s' with the following extensions:" fileNameOfRuntimeAssembly - providers |> List.iter(fun provider ->dprintfn " %s" (ExtensionTyping.DisplayNameOfTypeProvider(provider.TypeProvider, m))) -#endif - - for provider in providers do - try - // Inject an entity for the namespace, or if one already exists, then record this as a provider - // for that namespace. - let rec loop (providedNamespace: Tainted) = - let path = ExtensionTyping.GetProvidedNamespaceAsPath(m, provider, providedNamespace.PUntaint((fun r -> r.NamespaceName), m)) - tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, None) - - // Inject entities for the types returned by provider.GetTypes(). - // - // NOTE: The types provided by GetTypes() are available for name resolution - // when the namespace is "opened". This is part of the specification of the language - // feature. - let tys = providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m) - let ptys = [| for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m) |] - for st in ptys do - tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, Some st) - - for providedNestedNamespace in providedNamespace.PApplyArray((fun provider -> provider.GetNestedNamespaces()), "GetNestedNamespaces", m) do - loop providedNestedNamespace - - RequireCompilationThread ctok // IProvidedType.GetNamespaces is an example of a type provider call - let providedNamespaces = provider.PApplyArray((fun r -> r.GetNamespaces()), "GetNamespaces", m) - - for providedNamespace in providedNamespaces do - loop providedNamespace - with e -> - errorRecovery e m - - if startingErrorCount Option.isSome - - // Add a referenced assembly - // - // Retargetable assembly refs are required for binaries that must run - // against DLLs supported by multiple publishers. For example - // Compact Framework binaries must use this. However it is not - // clear when else it is required, e.g. for Mono. - - member tcImports.PrepareToImportReferencedILAssembly (ctok, m, filename, dllinfo: ImportedBinary) = - CheckDisposed() - let tcConfig = tcConfigP.Get ctok - assert dllinfo.RawMetadata.TryGetILModuleDef().IsSome - let ilModule = dllinfo.RawMetadata.TryGetILModuleDef().Value - let ilScopeRef = dllinfo.ILScopeRef - let aref = - match ilScopeRef with - | ILScopeRef.Assembly aref -> aref - | _ -> error(InternalError("PrepareToImportReferencedILAssembly: cannot reference .NET netmodules directly, reference the containing assembly instead", m)) - - let nm = aref.Name - if verbose then dprintn ("Converting IL assembly to F# data structures "+nm) - let auxModuleLoader = tcImports.MkLoaderForMultiModuleILAssemblies ctok m - let invalidateCcu = new Event<_>() - let ccu = Import.ImportILAssembly(tcImports.GetImportMap, m, auxModuleLoader, ilScopeRef, tcConfig.implicitIncludeDir, Some filename, ilModule, invalidateCcu.Publish) - - let ilg = defaultArg ilGlobalsOpt EcmaMscorlibILGlobals - - let ccuinfo = - { FSharpViewOfMetadata=ccu - ILScopeRef = ilScopeRef - AssemblyAutoOpenAttributes = GetAutoOpenAttributes ilg ilModule - AssemblyInternalsVisibleToAttributes = GetInternalsVisibleToAttributes ilg ilModule -#if !NO_EXTENSIONTYPING - IsProviderGenerated = false - TypeProviders = [] -#endif - FSharpOptimizationData = notlazy None } - tcImports.RegisterCcu ccuinfo - let phase2 () = -#if !NO_EXTENSIONTYPING - ccuinfo.TypeProviders <- tcImports.ImportTypeProviderExtensions (ctok, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m) -#endif - [ResolvedImportedAssembly ccuinfo] - phase2 - - member tcImports.PrepareToImportReferencedFSharpAssembly (ctok, m, filename, dllinfo: ImportedBinary) = - CheckDisposed() -#if !NO_EXTENSIONTYPING - let tcConfig = tcConfigP.Get ctok -#endif - let ilModule = dllinfo.RawMetadata - let ilScopeRef = dllinfo.ILScopeRef - let ilShortAssemName = getNameOfScopeRef ilScopeRef - if verbose then dprintn ("Converting F# assembly to F# data structures "+(getNameOfScopeRef ilScopeRef)) - if verbose then dprintn ("Relinking interface info from F# assembly "+ilShortAssemName) - let optDataReaders = ilModule.GetRawFSharpOptimizationData(m, ilShortAssemName, filename) - - let ccuRawDataAndInfos = - ilModule.GetRawFSharpSignatureData(m, ilShortAssemName, filename) - |> List.map (fun (ccuName, sigDataReader) -> - let data = GetSignatureData (filename, ilScopeRef, ilModule.TryGetILModuleDef(), sigDataReader) - - let optDatas = Map.ofList optDataReaders - - let minfo: PickledCcuInfo = data.RawData - let mspec = minfo.mspec - -#if !NO_EXTENSIONTYPING - let invalidateCcu = new Event<_>() -#endif - - let codeDir = minfo.compileTimeWorkingDir - let ccuData: CcuData = - { ILScopeRef=ilScopeRef - Stamp = newStamp() - FileName = Some filename - QualifiedName= Some(ilScopeRef.QualifiedName) - SourceCodeDirectory = codeDir (* note: in some cases we fix up this information later *) - IsFSharp=true - Contents = mspec -#if !NO_EXTENSIONTYPING - InvalidateEvent=invalidateCcu.Publish - IsProviderGenerated = false - ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) -#endif - TryGetILModuleDef = ilModule.TryGetILModuleDef - UsesFSharp20PlusQuotations = minfo.usesQuotations - MemberSignatureEquality= (fun ty1 ty2 -> typeEquivAux EraseAll (tcImports.GetTcGlobals()) ty1 ty2) - TypeForwarders = ImportILAssemblyTypeForwarders(tcImports.GetImportMap, m, ilModule.GetRawTypeForwarders()) } - - let ccu = CcuThunk.Create(ccuName, ccuData) - - let optdata = - lazy - (match Map.tryFind ccuName optDatas with - | None -> - if verbose then dprintf "*** no optimization data for CCU %s, was DLL compiled with --no-optimization-data??\n" ccuName - None - | Some info -> - let data = GetOptimizationData (filename, ilScopeRef, ilModule.TryGetILModuleDef(), info) - let fixupThunk () = data.OptionalFixup(fun nm -> availableToOptionalCcu(tcImports.FindCcu(ctok, m, nm, lookupOnly=false))) - - // Make a note of all ccuThunks that may still need to be fixed up when other dlls are loaded - for ccuThunk in data.FixupThunks do - if ccuThunk.IsUnresolvedReference then - ccuThunks.TryAdd(ccuThunk, fun () -> fixupThunk () |> ignore) |> ignore - - if verbose then dprintf "found optimization data for CCU %s\n" ccuName - Some (fixupThunk ())) - - let ilg = defaultArg ilGlobalsOpt EcmaMscorlibILGlobals - - let ccuinfo = - { FSharpViewOfMetadata=ccu - AssemblyAutoOpenAttributes = ilModule.GetAutoOpenAttributes ilg - AssemblyInternalsVisibleToAttributes = ilModule.GetInternalsVisibleToAttributes ilg - FSharpOptimizationData=optdata -#if !NO_EXTENSIONTYPING - IsProviderGenerated = false - TypeProviders = [] -#endif - ILScopeRef = ilScopeRef } - - let phase2() = -#if !NO_EXTENSIONTYPING - match ilModule.TryGetILModuleDef() with - | None -> () // no type providers can be used without a real IL Module present - | Some ilModule -> - let tps = tcImports.ImportTypeProviderExtensions (ctok, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m) - ccuinfo.TypeProviders <- tps -#else - () -#endif - data, ccuinfo, phase2) - - // Register all before relinking to cope with mutually-referential ccus - ccuRawDataAndInfos |> List.iter (p23 >> tcImports.RegisterCcu) - let phase2 () = - (* Relink *) - (* dprintf "Phase2: %s\n" filename; REMOVE DIAGNOSTICS *) - ccuRawDataAndInfos - |> List.iter (fun (data, _, _) -> - let fixupThunk () = data.OptionalFixup(fun nm -> availableToOptionalCcu(tcImports.FindCcu(ctok, m, nm, lookupOnly=false))) |> ignore - fixupThunk() - for ccuThunk in data.FixupThunks do - if ccuThunk.IsUnresolvedReference then - ccuThunks.TryAdd(ccuThunk, fixupThunk) |> ignore - ) -#if !NO_EXTENSIONTYPING - ccuRawDataAndInfos |> List.iter (fun (_, _, phase2) -> phase2()) -#endif - ccuRawDataAndInfos |> List.map p23 |> List.map ResolvedImportedAssembly - phase2 - - // NOTE: When used in the Language Service this can cause the transitive checking of projects. Hence it must be cancellable. - member tcImports.RegisterAndPrepareToImportReferencedDll (ctok, r: AssemblyResolution) : Cancellable<_ * (unit -> AvailableImportedAssembly list)> = - cancellable { - CheckDisposed() - let m = r.originalReference.Range - let filename = r.resolvedPath - let! contentsOpt = - cancellable { - match r.ProjectReference with - | Some ilb -> return! ilb.EvaluateRawContents ctok - | None -> return None - } - - let assemblyData = - match contentsOpt with - | Some ilb -> ilb - | None -> - let ilModule, ilAssemblyRefs = tcImports.OpenILBinaryModule(ctok, filename, m) - RawFSharpAssemblyDataBackedByFileOnDisk (ilModule, ilAssemblyRefs) :> IRawFSharpAssemblyData - - let ilShortAssemName = assemblyData.ShortAssemblyName - let ilScopeRef = assemblyData.ILScopeRef - - if tcImports.IsAlreadyRegistered ilShortAssemName then - let dllinfo = tcImports.FindDllInfo(ctok, m, ilShortAssemName) - let phase2() = [tcImports.FindCcuInfo(ctok, m, ilShortAssemName, lookupOnly=true)] - return dllinfo, phase2 - else - let dllinfo = - { RawMetadata=assemblyData - FileName=filename -#if !NO_EXTENSIONTYPING - ProviderGeneratedAssembly=None - IsProviderGenerated=false - ProviderGeneratedStaticLinkMap = None -#endif - ILScopeRef = ilScopeRef - ILAssemblyRefs = assemblyData.ILAssemblyRefs } - tcImports.RegisterDll dllinfo - let ilg = defaultArg ilGlobalsOpt EcmaMscorlibILGlobals - let phase2 = - if assemblyData.HasAnyFSharpSignatureDataAttribute then - if not (assemblyData.HasMatchingFSharpSignatureDataAttribute ilg) then - errorR(Error(FSComp.SR.buildDifferentVersionMustRecompile filename, m)) - tcImports.PrepareToImportReferencedILAssembly (ctok, m, filename, dllinfo) - else - try - tcImports.PrepareToImportReferencedFSharpAssembly (ctok, m, filename, dllinfo) - with e -> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), m)) - else - tcImports.PrepareToImportReferencedILAssembly (ctok, m, filename, dllinfo) - return dllinfo, phase2 - } - - // NOTE: When used in the Language Service this can cause the transitive checking of projects. Hence it must be cancellable. - member tcImports.RegisterAndImportReferencedAssemblies (ctok, nms: AssemblyResolution list) = - cancellable { - CheckDisposed() - let! results = - nms |> Cancellable.each (fun nm -> - cancellable { - try - let! res = tcImports.RegisterAndPrepareToImportReferencedDll (ctok, nm) - return Some res - with e -> - errorR(Error(FSComp.SR.buildProblemReadingAssembly(nm.resolvedPath, e.Message), nm.originalReference.Range)) - return None - }) - - let dllinfos, phase2s = results |> List.choose id |> List.unzip - fixupOrphanCcus() - let ccuinfos = (List.collect (fun phase2 -> phase2()) phase2s) - return dllinfos, ccuinfos - } - - /// Note that implicit loading is not used for compilations from MSBuild, which passes ``--noframework`` - /// Implicit loading is done in non-cancellation mode. Implicit loading is never used in the language service, so - /// no cancellation is needed. - member tcImports.ImplicitLoadIfAllowed (ctok, m, assemblyName, lookupOnly) = - CheckDisposed() - // If the user is asking for the default framework then also try to resolve other implicit assemblies as they are discovered. - // Using this flag to mean 'allow implicit discover of assemblies'. - let tcConfig = tcConfigP.Get ctok - if not lookupOnly && tcConfig.implicitlyResolveAssemblies then - let tryFile speculativeFileName = - let foundFile = tcImports.TryResolveAssemblyReference (ctok, AssemblyReference (m, speculativeFileName, None), ResolveAssemblyReferenceMode.Speculative) - match foundFile with - | OkResult (warns, res) -> - ReportWarnings warns - tcImports.RegisterAndImportReferencedAssemblies(ctok, res) |> Cancellable.runWithoutCancellation |> ignore - true - | ErrorResult (_warns, _err) -> - // Throw away warnings and errors - this is speculative loading - false - - if tryFile (assemblyName + ".dll") then () - else tryFile (assemblyName + ".exe") |> ignore - -#if !NO_EXTENSIONTYPING - member tcImports.TryFindProviderGeneratedAssemblyByName(ctok, assemblyName: string) : System.Reflection.Assembly option = - // The assembly may not be in the resolutions, but may be in the load set including EST injected assemblies - match tcImports.TryFindDllInfo (ctok, range0, assemblyName, lookupOnly=true) with - | Some res -> - // Provider-generated assemblies don't necessarily have an on-disk representation we can load. - res.ProviderGeneratedAssembly - | _ -> None -#endif - - /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcImports.TryFindExistingFullyQualifiedPathBySimpleAssemblyName (ctok, simpleAssemName) : string option = - resolutions.TryFindBySimpleAssemblyName (ctok, simpleAssemName) |> Option.map (fun r -> r.resolvedPath) - - /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef(ctok, assemblyRef: ILAssemblyRef) : string option = - resolutions.TryFindByExactILAssemblyRef (ctok, assemblyRef) |> Option.map (fun r -> r.resolvedPath) - - member tcImports.TryResolveAssemblyReference(ctok, assemblyReference: AssemblyReference, mode: ResolveAssemblyReferenceMode) : OperationResult = - let tcConfig = tcConfigP.Get ctok - // First try to lookup via the original reference text. - match resolutions.TryFindByOriginalReference assemblyReference with - | Some assemblyResolution -> - ResultD [assemblyResolution] - | None -> -#if NO_MSBUILD_REFERENCE_RESOLUTION - try - ResultD [tcConfig.ResolveLibWithDirectories assemblyReference] - with e -> - ErrorD e -#else - // Next try to lookup up by the exact full resolved path. - match resolutions.TryFindByResolvedPath assemblyReference.Text with - | Some assemblyResolution -> - ResultD [assemblyResolution] - | None -> - if tcConfigP.Get(ctok).useSimpleResolution then - let action = - match mode with - | ResolveAssemblyReferenceMode.ReportErrors -> CcuLoadFailureAction.RaiseError - | ResolveAssemblyReferenceMode.Speculative -> CcuLoadFailureAction.ReturnNone - match tcConfig.ResolveLibWithDirectories (action, assemblyReference) with - | Some resolved -> - resolutions <- resolutions.AddResolutionResults [resolved] - ResultD [resolved] - | None -> - ErrorD(AssemblyNotResolved(assemblyReference.Text, assemblyReference.Range)) - else - // This is a previously unencountered assembly. Resolve it and add it to the list. - // But don't cache resolution failures because the assembly may appear on the disk later. - let resolved, unresolved = TcConfig.TryResolveLibsUsingMSBuildRules(tcConfig, [ assemblyReference ], assemblyReference.Range, mode) - match resolved, unresolved with - | (assemblyResolution :: _, _) -> - resolutions <- resolutions.AddResolutionResults resolved - ResultD [assemblyResolution] - | (_, _ :: _) -> - resolutions <- resolutions.AddUnresolvedReferences unresolved - ErrorD(AssemblyNotResolved(assemblyReference.Text, assemblyReference.Range)) - | [], [] -> - // Note, if mode=ResolveAssemblyReferenceMode.Speculative and the resolution failed then TryResolveLibsUsingMSBuildRules returns - // the empty list and we convert the failure into an AssemblyNotResolved here. - ErrorD(AssemblyNotResolved(assemblyReference.Text, assemblyReference.Range)) - -#endif - - - member tcImports.ResolveAssemblyReference(ctok, assemblyReference, mode) : AssemblyResolution list = - CommitOperationResult(tcImports.TryResolveAssemblyReference(ctok, assemblyReference, mode)) - - // Note: This returns a TcImports object. However, framework TcImports are not currently disposed. The only reason - // we dispose TcImports is because we need to dispose type providers, and type providers are never included in the framework DLL set. - // If a framework set ever includes type providers, you will not have to worry about explicitly calling Dispose as the Finalizer will handle it. - static member BuildFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, frameworkDLLs, nonFrameworkDLLs) = - cancellable { - - let tcConfig = tcConfigP.Get ctok - let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, frameworkDLLs, []) - let tcAltResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkDLLs, []) - - let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None, tcConfig.compilationThread) - - // Fetch the primaryAssembly from the referenced assemblies otherwise - let primaryAssemblyReference = - let path = frameworkDLLs |> List.tryFind(fun dll -> String.Compare(Path.GetFileNameWithoutExtension(dll.resolvedPath), tcConfig.primaryAssembly.Name, StringComparison.OrdinalIgnoreCase) = 0) - match path with - | Some p -> AssemblyReference(range0, p.resolvedPath, None) - | None -> tcConfig.PrimaryAssemblyDllReference() - - let primaryAssemblyResolution = frameworkTcImports.ResolveAssemblyReference(ctok, primaryAssemblyReference, ResolveAssemblyReferenceMode.ReportErrors) - let! primaryAssem = frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, primaryAssemblyResolution) - let primaryScopeRef = - match primaryAssem with - | (_, [ResolvedImportedAssembly ccu]) -> ccu.FSharpViewOfMetadata.ILScopeRef - | _ -> failwith "unexpected" - - let primaryAssemblyResolvedPath = - match primaryAssemblyResolution with - | [primaryAssemblyResolution] -> primaryAssemblyResolution.resolvedPath - | _ -> failwith "unexpected" - - let resolvedAssemblies = tcResolutions.GetAssemblyResolutions() - - let readerSettings: ILReaderOptions = - { pdbDirPath=None - reduceMemoryUsage = tcConfig.reduceMemoryUsage - metadataOnly = MetadataOnlyFlag.Yes - tryGetMetadataSnapshot = tcConfig.tryGetMetadataSnapshot } - - let tryFindAssemblyByExportedType manifest (exportedType: ILExportedTypeOrForwarder) = - match exportedType.ScopeRef, primaryScopeRef with - | ILScopeRef.Assembly aref1, ILScopeRef.Assembly aref2 when aref1.EqualsIgnoringVersion aref2 -> - mkRefToILAssembly manifest - |> Some - | _ -> - None - - let tryFindAssemblyThatForwardsToPrimaryAssembly manifest = - manifest.ExportedTypes.TryFindByName "System.Object" - |> Option.bind (tryFindAssemblyByExportedType manifest) - - // Determine what other assemblies could have been the primary assembly - // by checking to see if "System.Object" is an exported type. - let assembliesThatForwardToPrimaryAssembly = - resolvedAssemblies - |> List.choose (fun resolvedAssembly -> - if primaryAssemblyResolvedPath <> resolvedAssembly.resolvedPath then - let reader = OpenILModuleReader resolvedAssembly.resolvedPath readerSettings - reader.ILModuleDef.Manifest - |> Option.bind tryFindAssemblyThatForwardsToPrimaryAssembly - else - None) - - let ilGlobals = mkILGlobals (primaryScopeRef, assembliesThatForwardToPrimaryAssembly) - frameworkTcImports.SetILGlobals ilGlobals - - // Load the rest of the framework DLLs all at once (they may be mutually recursive) - let! _assemblies = frameworkTcImports.RegisterAndImportReferencedAssemblies (ctok, resolvedAssemblies) - - // These are the DLLs we can search for well-known types - let sysCcus = - [| for ccu in frameworkTcImports.GetCcusInDeclOrder() do - //printfn "found sys ccu %s" ccu.AssemblyName - yield ccu |] - - //for ccu in nonFrameworkDLLs do - // printfn "found non-sys ccu %s" ccu.resolvedPath - - let tryFindSysTypeCcu path typeName = - sysCcus |> Array.tryFind (fun ccu -> ccuHasType ccu path typeName) - - let fslibCcu = - if tcConfig.compilingFslib then - // When compiling FSharp.Core.dll, the fslibCcu reference to FSharp.Core.dll is a delayed ccu thunk fixed up during type checking - CcuThunk.CreateDelayed getFSharpCoreLibraryName - else - let fslibCcuInfo = - let coreLibraryReference = tcConfig.CoreLibraryDllReference() - - let resolvedAssemblyRef = - match tcResolutions.TryFindByOriginalReference coreLibraryReference with - | Some resolution -> Some resolution - | _ -> - // Are we using a "non-canonical" FSharp.Core? - match tcAltResolutions.TryFindByOriginalReference coreLibraryReference with - | Some resolution -> Some resolution - | _ -> tcResolutions.TryFindByOriginalReferenceText (getFSharpCoreLibraryName) // was the ".dll" elided? - - match resolvedAssemblyRef with - | Some coreLibraryResolution -> - match frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, [coreLibraryResolution]) |> Cancellable.runWithoutCancellation with - | (_, [ResolvedImportedAssembly fslibCcuInfo ]) -> fslibCcuInfo - | _ -> - error(InternalError("BuildFrameworkTcImports: no successful import of "+coreLibraryResolution.resolvedPath, coreLibraryResolution.originalReference.Range)) - | None -> - error(InternalError(sprintf "BuildFrameworkTcImports: no resolution of '%s'" coreLibraryReference.Text, rangeStartup)) - IlxSettings.ilxFsharpCoreLibAssemRef <- - (let scoref = fslibCcuInfo.ILScopeRef - match scoref with - | ILScopeRef.Assembly aref -> Some aref - | ILScopeRef.Local | ILScopeRef.Module _ | ILScopeRef.PrimaryAssembly -> - error(InternalError("not ILScopeRef.Assembly", rangeStartup))) - fslibCcuInfo.FSharpViewOfMetadata - - // OK, now we have both mscorlib.dll and FSharp.Core.dll we can create TcGlobals - let tcGlobals = TcGlobals(tcConfig.compilingFslib, ilGlobals, fslibCcu, - tcConfig.implicitIncludeDir, tcConfig.mlCompatibility, - tcConfig.isInteractive, tryFindSysTypeCcu, tcConfig.emitDebugInfoInQuotations, - tcConfig.noDebugData, tcConfig.pathMap, tcConfig.langVersion) - -#if DEBUG - // the global_g reference cell is used only for debug printing - global_g <- Some tcGlobals -#endif - frameworkTcImports.SetTcGlobals tcGlobals - return tcGlobals, frameworkTcImports - } - - member tcImports.ReportUnresolvedAssemblyReferences knownUnresolved = - // Report that an assembly was not resolved. - let reportAssemblyNotResolved(file, originalReferences: AssemblyReference list) = - originalReferences |> List.iter(fun originalReference -> errorR(AssemblyNotResolved(file, originalReference.Range))) - knownUnresolved - |> List.map (function UnresolvedAssemblyReference(file, originalReferences) -> file, originalReferences) - |> List.iter reportAssemblyNotResolved - - static member BuildNonFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, tcGlobals: TcGlobals, baseTcImports, nonFrameworkReferences, knownUnresolved) = - cancellable { - let tcConfig = tcConfigP.Get ctok - let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkReferences, knownUnresolved) - let references = tcResolutions.GetAssemblyResolutions() - let tcImports = new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some tcGlobals.ilg, tcConfig.compilationThread) - let! _assemblies = tcImports.RegisterAndImportReferencedAssemblies(ctok, references) - tcImports.ReportUnresolvedAssemblyReferences knownUnresolved - return tcImports - } - - static member BuildTcImports(ctok, tcConfigP: TcConfigProvider) = - cancellable { - let tcConfig = tcConfigP.Get ctok - //let foundationalTcImports, tcGlobals = TcImports.BuildFoundationalTcImports tcConfigP - let frameworkDLLs, nonFrameworkReferences, knownUnresolved = TcAssemblyResolutions.SplitNonFoundationalResolutions(ctok, tcConfig) - let! tcGlobals, frameworkTcImports = TcImports.BuildFrameworkTcImports (ctok, tcConfigP, frameworkDLLs, nonFrameworkReferences) - let! tcImports = TcImports.BuildNonFrameworkTcImports(ctok, tcConfigP, tcGlobals, frameworkTcImports, nonFrameworkReferences, knownUnresolved) - return tcGlobals, tcImports - } - - interface System.IDisposable with - member tcImports.Dispose() = - dispose () - - override tcImports.ToString() = "TcImports(...)" - -/// Process #r in F# Interactive. -/// Adds the reference to the tcImports and add the ccu to the type checking environment. -let RequireDLL (ctok, tcImports: TcImports, tcEnv, thisAssemblyName, m, file) = - let resolutions = CommitOperationResult(tcImports.TryResolveAssemblyReference(ctok, AssemblyReference(m, file, None), ResolveAssemblyReferenceMode.ReportErrors)) - let dllinfos, ccuinfos = tcImports.RegisterAndImportReferencedAssemblies(ctok, resolutions) |> Cancellable.runWithoutCancellation - - let asms = - ccuinfos |> List.map (function - | ResolvedImportedAssembly asm -> asm - | UnresolvedImportedAssembly assemblyName -> error(Error(FSComp.SR.buildCouldNotResolveAssemblyRequiredByFile(assemblyName, file), m))) - - let g = tcImports.GetTcGlobals() - let amap = tcImports.GetImportMap() - let buildTcEnv tcEnv asm = - AddCcuToTcEnv(g, amap, m, tcEnv, thisAssemblyName, asm.FSharpViewOfMetadata, asm.AssemblyAutoOpenAttributes, asm.AssemblyInternalsVisibleToAttributes) - let tcEnv = (tcEnv, asms) ||> List.fold buildTcEnv - tcEnv, (dllinfos, asms) - -let ProcessMetaCommandsFromInput - (nowarnF: 'state -> range * string -> 'state, - dllRequireF: 'state -> range * string -> 'state, - packageRequireF: 'state -> IDependencyManagerProvider * range * string -> 'state, - loadSourceF: 'state -> range * string -> unit) - (tcConfig:TcConfigBuilder, inp, pathOfMetaCommandSource, state0) = - - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - - let canHaveScriptMetaCommands = - match inp with - | ParsedInput.SigFile (_) -> false - | ParsedInput.ImplFile (ParsedImplFileInput (isScript = isScript)) -> isScript - - let ProcessMetaCommand state hash = - let mutable matchedm = range0 - try - match hash with - | ParsedHashDirective("I", args, m) -> - if not canHaveScriptMetaCommands then - errorR(HashIncludeNotAllowedInNonScript m) - match args with - | [path] -> - matchedm <- m - tcConfig.AddIncludePath(m, path, pathOfMetaCommandSource) - state - | _ -> - errorR(Error(FSComp.SR.buildInvalidHashIDirective(), m)) - state - | ParsedHashDirective("nowarn",numbers,m) -> - List.fold (fun state d -> nowarnF state (m,d)) state numbers - - | ParsedHashDirective(("reference" | "r"),args,m) -> - if not canHaveScriptMetaCommands then - errorR(HashReferenceNotAllowedInNonScript m) - - let reportError = - let report errorType err msg = - let error = err, msg - match errorType with - | ErrorReportType.Warning -> warning(Error(error, m)) - | ErrorReportType.Error -> errorR(Error(error, m)) - ResolvingErrorReport (report) - - match args with - | [path] -> - matchedm <- m - let output = tcConfig.outputDir |> Option.defaultValue "" - let dm = tcConfig.dependencyProvider.TryFindDependencyManagerInPath(tcConfig.compilerToolPaths, output , reportError, path) - match dm with - | _, dependencyManager when not(isNull dependencyManager) -> - if tcConfig.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then - packageRequireF state (dependencyManager, m, path) - else - errorR(Error(FSComp.SR.packageManagementRequiresVFive(), m)) - state - - // #r "Assembly" - | path, _ -> - let p = - if String.IsNullOrWhiteSpace(path) then "" - else path - - dllRequireF state (m, p) - - | _ -> - errorR(Error(FSComp.SR.buildInvalidHashrDirective(), m)) - state - - | ParsedHashDirective("load", args, m) -> - if not canHaveScriptMetaCommands then - errorR(HashDirectiveNotAllowedInNonScript m) - match args with - | _ :: _ -> - matchedm<-m - args |> List.iter (fun path -> loadSourceF state (m, path)) - | _ -> - errorR(Error(FSComp.SR.buildInvalidHashloadDirective(), m)) - state - | ParsedHashDirective("time", args, m) -> - if not canHaveScriptMetaCommands then - errorR(HashDirectiveNotAllowedInNonScript m) - match args with - | [] -> - () - | ["on" | "off"] -> - () - | _ -> - errorR(Error(FSComp.SR.buildInvalidHashtimeDirective(), m)) - state - - | _ -> - - (* warning(Error("This meta-command has been ignored", m)) *) - state - with e -> errorRecovery e matchedm; state - - let rec WarnOnIgnoredSpecDecls decls = - decls |> List.iter (fun d -> - match d with - | SynModuleSigDecl.HashDirective (_, m) -> warning(Error(FSComp.SR.buildDirectivesInModulesAreIgnored(), m)) - | SynModuleSigDecl.NestedModule (_, _, subDecls, _) -> WarnOnIgnoredSpecDecls subDecls - | _ -> ()) - - let rec WarnOnIgnoredImplDecls decls = - decls |> List.iter (fun d -> - match d with - | SynModuleDecl.HashDirective (_, m) -> warning(Error(FSComp.SR.buildDirectivesInModulesAreIgnored(), m)) - | SynModuleDecl.NestedModule (_, _, subDecls, _, _) -> WarnOnIgnoredImplDecls subDecls - | _ -> ()) - - let ProcessMetaCommandsFromModuleSpec state (SynModuleOrNamespaceSig(_, _, _, decls, _, _, _, _)) = - List.fold (fun s d -> - match d with - | SynModuleSigDecl.HashDirective (h, _) -> ProcessMetaCommand s h - | SynModuleSigDecl.NestedModule (_, _, subDecls, _) -> WarnOnIgnoredSpecDecls subDecls; s - | _ -> s) - state - decls - - let ProcessMetaCommandsFromModuleImpl state (SynModuleOrNamespace(_, _, _, decls, _, _, _, _)) = - List.fold (fun s d -> - match d with - | SynModuleDecl.HashDirective (h, _) -> ProcessMetaCommand s h - | SynModuleDecl.NestedModule (_, _, subDecls, _, _) -> WarnOnIgnoredImplDecls subDecls; s - | _ -> s) - state - decls - - match inp with - | ParsedInput.SigFile (ParsedSigFileInput (_, _, _, hashDirectives, specs)) -> - let state = List.fold ProcessMetaCommand state0 hashDirectives - let state = List.fold ProcessMetaCommandsFromModuleSpec state specs - state - | ParsedInput.ImplFile (ParsedImplFileInput (_, _, _, _, hashDirectives, impls, _)) -> - let state = List.fold ProcessMetaCommand state0 hashDirectives - let state = List.fold ProcessMetaCommandsFromModuleImpl state impls - state - -let ApplyNoWarnsToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource) = - // Clone - let tcConfigB = tcConfig.CloneOfOriginalBuilder - let addNoWarn = fun () (m,s) -> tcConfigB.TurnWarningOff(m, s) - let addReferencedAssemblyByPath = fun () (_m,_s) -> () - let addDependencyManagerText = fun () (_prefix,_m,_s) -> () - let addLoadedSource = fun () (_m,_s) -> () - ProcessMetaCommandsFromInput (addNoWarn, addReferencedAssemblyByPath, addDependencyManagerText, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) - TcConfig.Create(tcConfigB, validate=false) - -let ApplyMetaCommandsFromInputToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource) = - // Clone - let tcConfigB = tcConfig.CloneOfOriginalBuilder - let getWarningNumber = fun () _ -> () - let addReferencedAssemblyByPath = fun () (m,s) -> tcConfigB.AddReferencedAssemblyByPath(m,s) - let addDependencyManagerText = fun () (packageManager, m,s) -> tcConfigB.AddDependencyManagerText(packageManager,m,s) - let addLoadedSource = fun () (m,s) -> tcConfigB.AddLoadedSource(m,s,pathOfMetaCommandSource) - ProcessMetaCommandsFromInput (getWarningNumber, addReferencedAssemblyByPath, addDependencyManagerText, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) - TcConfig.Create(tcConfigB, validate=false) - -//---------------------------------------------------------------------------- -// Compute the load closure of a set of script files -//-------------------------------------------------------------------------- - -let GetAssemblyResolutionInformation(ctok, tcConfig: TcConfig) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter - let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig - let resolutions = TcAssemblyResolutions.ResolveAssemblyReferences (ctok, tcConfig, assemblyList, []) - resolutions.GetAssemblyResolutions(), resolutions.GetUnresolvedReferences() - -[] -type LoadClosureInput = - { FileName: string - SyntaxTree: ParsedInput option - ParseDiagnostics: (PhasedDiagnostic * bool) list - MetaCommandDiagnostics: (PhasedDiagnostic * bool) list } - -[] -type LoadClosure = - { /// The source files along with the ranges of the #load positions in each file. - SourceFiles: (string * range list) list - /// The resolved references along with the ranges of the #r positions in each file. - References: (string * AssemblyResolution list) list - /// The list of references that were not resolved during load closure. These may still be extension references. - UnresolvedReferences: UnresolvedAssemblyReference list - /// The list of all sources in the closure with inputs when available - Inputs: LoadClosureInput list - /// The #load, including those that didn't resolve - OriginalLoadReferences: (range * string * string) list - /// The #nowarns - NoWarns: (string * range list) list - /// Diagnostics seen while processing resolutions - ResolutionDiagnostics: (PhasedDiagnostic * bool) list - /// Diagnostics seen while parsing root of closure - AllRootFileDiagnostics: (PhasedDiagnostic * bool) list - /// Diagnostics seen while processing the compiler options implied root of closure - LoadClosureRootFileDiagnostics: (PhasedDiagnostic * bool) list } - - -[] -type CodeContext = - | CompilationAndEvaluation // in fsi.exe - | Compilation // in fsc.exe - | Editing // in VS - -module ScriptPreprocessClosure = - open Internal.Utilities.Text.Lexing - - /// Represents an input to the closure finding process - type ClosureSource = ClosureSource of filename: string * referenceRange: range * sourceText: ISourceText * parseRequired: bool - - /// Represents an output of the closure finding process - type ClosureFile = ClosureFile of string * range * ParsedInput option * (PhasedDiagnostic * bool) list * (PhasedDiagnostic * bool) list * (string * range) list // filename, range, errors, warnings, nowarns - - type Observed() = - let seen = System.Collections.Generic.Dictionary<_, bool>() - member ob.SetSeen check = - if not(seen.ContainsKey check) then - seen.Add(check, true) - - member ob.HaveSeen check = - seen.ContainsKey check - - /// Parse a script from source. - let ParseScriptText - (filename: string, sourceText: ISourceText, tcConfig: TcConfig, codeContext, - lexResourceManager: Lexhelp.LexResourceManager, errorLogger: ErrorLogger) = - - // fsc.exe -- COMPILED\!INTERACTIVE - // fsi.exe -- !COMPILED\INTERACTIVE - // Language service - // .fs -- EDITING + COMPILED\!INTERACTIVE - // .fsx -- EDITING + !COMPILED\INTERACTIVE - let defines = - match codeContext with - | CodeContext.CompilationAndEvaluation -> ["INTERACTIVE"] - | CodeContext.Compilation -> ["COMPILED"] - | CodeContext.Editing -> "EDITING" :: (if IsScript filename then ["INTERACTIVE"] else ["COMPILED"]) - - let isFeatureSupported featureId = tcConfig.langVersion.SupportsFeature featureId - let lexbuf = UnicodeLexing.SourceTextAsLexbuf(isFeatureSupported, sourceText) - - let isLastCompiland = (IsScript filename), tcConfig.target.IsExe // The root compiland is last in the list of compilands. - ParseOneInputLexbuf (tcConfig, lexResourceManager, defines, lexbuf, filename, isLastCompiland, errorLogger) - - /// Create a TcConfig for load closure starting from a single .fsx file - let CreateScriptTextTcConfig - (legacyReferenceResolver, defaultFSharpBinariesDir, - filename: string, codeContext, - useSimpleResolution, useFsiAuxLib, - basicReferences, applyCommandLineArgs, - assumeDotNetFramework, useSdkRefs, - tryGetMetadataSnapshot, reduceMemoryUsage) = - - let projectDir = Path.GetDirectoryName filename - let isInteractive = (codeContext = CodeContext.CompilationAndEvaluation) - let isInvalidationSupported = (codeContext = CodeContext.Editing) - - let tcConfigB = - TcConfigBuilder.CreateNew - (legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, projectDir, - isInteractive, isInvalidationSupported, defaultCopyFSharpCore=CopyFSharpCoreFlag.No, - tryGetMetadataSnapshot=tryGetMetadataSnapshot) - - applyCommandLineArgs tcConfigB - - match basicReferences with - | None -> (basicReferencesForScriptLoadClosure useFsiAuxLib useSdkRefs assumeDotNetFramework) |> List.iter(fun f->tcConfigB.AddReferencedAssemblyByPath(range0, f)) // Add script references - | Some rs -> for m, r in rs do tcConfigB.AddReferencedAssemblyByPath(m, r) - - tcConfigB.resolutionEnvironment <- - match codeContext with - | CodeContext.Editing -> ResolutionEnvironment.EditingOrCompilation true - | CodeContext.Compilation -> ResolutionEnvironment.EditingOrCompilation false - | CodeContext.CompilationAndEvaluation -> ResolutionEnvironment.CompilationAndEvaluation - tcConfigB.framework <- false - tcConfigB.useSimpleResolution <- useSimpleResolution - // Indicates that there are some references not in basicReferencesForScriptLoadClosure which should - // be added conditionally once the relevant version of mscorlib.dll has been detected. - tcConfigB.implicitlyResolveAssemblies <- false - tcConfigB.useSdkRefs <- useSdkRefs - - TcConfig.Create(tcConfigB, validate=true) - - let ClosureSourceOfFilename(filename, m, inputCodePage, parseRequired) = - try - let filename = FileSystem.GetFullPathShim filename - use stream = FileSystem.FileStreamReadShim filename - use reader = - match inputCodePage with - | None -> new StreamReader(stream, true) - | Some (n: int) -> new StreamReader(stream, Encoding.GetEncoding n) - let source = reader.ReadToEnd() - [ClosureSource(filename, m, SourceText.ofString source, parseRequired)] - with e -> - errorRecovery e m - [] - - let ApplyMetaCommandsFromInputToTcConfigAndGatherNoWarn - (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource) = - - let tcConfigB = tcConfig.CloneOfOriginalBuilder - let mutable nowarns = [] - let getWarningNumber = fun () (m, s) -> nowarns <- (s, m) :: nowarns - let addReferencedAssemblyByPath = fun () (m, s) -> tcConfigB.AddReferencedAssemblyByPath(m, s) - let addDependencyManagerText = fun () (packageManagerPrefix,m,s) -> tcConfigB.AddDependencyManagerText(packageManagerPrefix,m,s) - let addLoadedSource = fun () (m, s) -> tcConfigB.AddLoadedSource(m, s, pathOfMetaCommandSource) - try - ProcessMetaCommandsFromInput (getWarningNumber, addReferencedAssemblyByPath, addDependencyManagerText, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) - with ReportedError _ -> - // Recover by using whatever did end up in the tcConfig - () - - try - TcConfig.Create(tcConfigB, validate=false), nowarns - with ReportedError _ -> - // Recover by using a default TcConfig. - let tcConfigB = tcConfig.CloneOfOriginalBuilder - TcConfig.Create(tcConfigB, validate=false), nowarns - - let FindClosureFiles(mainFile, _m, closureSources, origTcConfig:TcConfig, codeContext, lexResourceManager: Lexhelp.LexResourceManager) = - let mutable tcConfig = origTcConfig - - let observedSources = Observed() - let loadScripts = HashSet<_>() - - // Resolve the packages - let rec resolveDependencyManagerSources scriptName = - if not (loadScripts.Contains scriptName) then - [ for kv in tcConfig.packageManagerLines do - let packageManagerKey, packageManagerLines = kv.Key, kv.Value - match packageManagerLines with - | [] -> () - | (_, _, m)::_ -> - let reportError = - let report errorType err msg = - let error = err, msg - match errorType with - | ErrorReportType.Warning -> warning(Error(error, m)) - | ErrorReportType.Error -> errorR(Error(error, m)) - ResolvingErrorReport (report) - - match origTcConfig.packageManagerLines |> Map.tryFind packageManagerKey with - | Some oldDependencyManagerLines when oldDependencyManagerLines = packageManagerLines -> () - | _ -> - let outputDir = tcConfig.outputDir |> Option.defaultValue "" - match tcConfig.dependencyProvider.TryFindDependencyManagerByKey(tcConfig.compilerToolPaths, outputDir, reportError, packageManagerKey) with - | null -> - errorR(Error(tcConfig.dependencyProvider.CreatePackageManagerUnknownError(tcConfig.compilerToolPaths, outputDir, packageManagerKey, reportError), m)) - - | dependencyManager -> - let inline snd3 (_, b, _) = b - let packageManagerTextLines = packageManagerLines |> List.map snd3 - let result = tcConfig.dependencyProvider.Resolve(dependencyManager, ".fsx", packageManagerTextLines, reportError, executionTfm, executionRid, tcConfig.implicitIncludeDir, mainFile, scriptName) - match result.Success with - | true -> - // Resolution produced no errors - if not (Seq.isEmpty result.Roots) then - let tcConfigB = tcConfig.CloneOfOriginalBuilder - for folder in result.Roots do - tcConfigB.AddIncludePath(m, folder, "") - tcConfigB.packageManagerLines <- tcConfigB.packageManagerLines |> Map.map(fun _ l -> l |> List.map(fun (_, p, m) -> true, p, m)) - tcConfig <- TcConfig.Create(tcConfigB, validate=false) - for script in result.SourceFiles do - let scriptText = File.ReadAllText script - loadScripts.Add script |> ignore - let iSourceText = SourceText.ofString scriptText - yield! loop (ClosureSource(script, m, iSourceText, true)) - - | false -> - // Resolution produced errors update packagerManagerLines entries to note these failure - // failed resolutions will no longer be considered - let tcConfigB = tcConfig.CloneOfOriginalBuilder - tcConfigB.packageManagerLines <- tcConfigB.packageManagerLines |> Map.map(fun _ l -> l |> List.filter(fun (tried, _, _) -> tried)) - tcConfig <- TcConfig.Create(tcConfigB, validate=false)] - else [] - - and loop (ClosureSource(filename, m, sourceText, parseRequired)) = - [ if not (observedSources.HaveSeen(filename)) then - observedSources.SetSeen(filename) - //printfn "visiting %s" filename - if IsScript filename || parseRequired then - let parseResult, parseDiagnostics = - let errorLogger = CapturingErrorLogger("FindClosureParse") - use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> errorLogger) - let result = ParseScriptText (filename, sourceText, tcConfig, codeContext, lexResourceManager, errorLogger) - result, errorLogger.Diagnostics - - match parseResult with - | Some parsedScriptAst -> - let errorLogger = CapturingErrorLogger("FindClosureMetaCommands") - use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> errorLogger) - let pathOfMetaCommandSource = Path.GetDirectoryName filename - let preSources = tcConfig.GetAvailableLoadedSources() - - let tcConfigResult, noWarns = ApplyMetaCommandsFromInputToTcConfigAndGatherNoWarn (tcConfig, parsedScriptAst, pathOfMetaCommandSource) - tcConfig <- tcConfigResult // We accumulate the tcConfig in order to collect assembly references - - yield! resolveDependencyManagerSources filename - - let postSources = tcConfig.GetAvailableLoadedSources() - let sources = if preSources.Length < postSources.Length then postSources.[preSources.Length..] else [] - - yield! resolveDependencyManagerSources filename - for (m, subFile) in sources do - if IsScript subFile then - for subSource in ClosureSourceOfFilename(subFile, m, tcConfigResult.inputCodePage, false) do - yield! loop subSource - else - yield ClosureFile(subFile, m, None, [], [], []) - - yield ClosureFile(filename, m, Some parsedScriptAst, parseDiagnostics, errorLogger.Diagnostics, noWarns) - - | None -> - yield ClosureFile(filename, m, None, parseDiagnostics, [], []) - else - // Don't traverse into .fs leafs. - yield ClosureFile(filename, m, None, [], [], []) ] - - closureSources |> List.collect loop, tcConfig - - /// Reduce the full directive closure into LoadClosure - let GetLoadClosure(ctok, rootFilename, closureFiles, tcConfig: TcConfig, codeContext) = - - // Mark the last file as isLastCompiland. - let closureFiles = - if isNil closureFiles then - closureFiles - else - match List.frontAndBack closureFiles with - | rest, ClosureFile - (filename, m, - Some(ParsedInput.ImplFile (ParsedImplFileInput (name, isScript, qualNameOfFile, scopedPragmas, hashDirectives, implFileFlags, _))), - parseDiagnostics, metaDiagnostics, nowarns) -> - - let isLastCompiland = (true, tcConfig.target.IsExe) - rest @ [ClosureFile - (filename, m, - Some(ParsedInput.ImplFile (ParsedImplFileInput (name, isScript, qualNameOfFile, scopedPragmas, hashDirectives, implFileFlags, isLastCompiland))), - parseDiagnostics, metaDiagnostics, nowarns)] - - | _ -> closureFiles - - // Get all source files. - let sourceFiles = [ for (ClosureFile(filename, m, _, _, _, _)) in closureFiles -> (filename, m) ] - - let sourceInputs = - [ for (ClosureFile(filename, _, input, parseDiagnostics, metaDiagnostics, _nowarns)) in closureFiles -> - ({ FileName=filename - SyntaxTree=input - ParseDiagnostics=parseDiagnostics - MetaCommandDiagnostics=metaDiagnostics } : LoadClosureInput) ] - - let globalNoWarns = closureFiles |> List.collect (fun (ClosureFile(_, _, _, _, _, noWarns)) -> noWarns) - - // Resolve all references. - let references, unresolvedReferences, resolutionDiagnostics = - let errorLogger = CapturingErrorLogger("GetLoadClosure") - - use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> errorLogger) - let references, unresolvedReferences = GetAssemblyResolutionInformation(ctok, tcConfig) - let references = references |> List.map (fun ar -> ar.resolvedPath, ar) - references, unresolvedReferences, errorLogger.Diagnostics - - // Root errors and warnings - look at the last item in the closureFiles list - let loadClosureRootDiagnostics, allRootDiagnostics = - match List.rev closureFiles with - | ClosureFile(_, _, _, parseDiagnostics, metaDiagnostics, _) :: _ -> - (metaDiagnostics @ resolutionDiagnostics), - (parseDiagnostics @ metaDiagnostics @ resolutionDiagnostics) - | _ -> [], [] // When no file existed. - - let isRootRange exn = - match GetRangeOfDiagnostic exn with - | Some m -> - // Return true if the error was *not* from a #load-ed file. - let isArgParameterWhileNotEditing = (codeContext <> CodeContext.Editing) && (Range.equals m range0 || Range.equals m rangeStartup || Range.equals m rangeCmdArgs) - let isThisFileName = (0 = String.Compare(rootFilename, m.FileName, StringComparison.OrdinalIgnoreCase)) - isArgParameterWhileNotEditing || isThisFileName - | None -> true - - // Filter out non-root errors and warnings - let allRootDiagnostics = allRootDiagnostics |> List.filter (fst >> isRootRange) - - let result: LoadClosure = - { SourceFiles = List.groupBy fst sourceFiles |> List.map (map2Of2 (List.map snd)) - References = List.groupBy fst references |> List.map (map2Of2 (List.map snd)) - UnresolvedReferences = unresolvedReferences - Inputs = sourceInputs - NoWarns = List.groupBy fst globalNoWarns |> List.map (map2Of2 (List.map snd)) - OriginalLoadReferences = tcConfig.loadedSources - ResolutionDiagnostics = resolutionDiagnostics - AllRootFileDiagnostics = allRootDiagnostics - LoadClosureRootFileDiagnostics = loadClosureRootDiagnostics } - - result - - /// Given source text, find the full load closure. Used from service.fs, when editing a script file - let GetFullClosureOfScriptText - (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, - filename, sourceText, codeContext, - useSimpleResolution, useFsiAuxLib, useSdkRefs, - lexResourceManager: Lexhelp.LexResourceManager, - applyCommandLineArgs, assumeDotNetFramework, - tryGetMetadataSnapshot, reduceMemoryUsage) = - - // Resolve the basic references such as FSharp.Core.dll first, before processing any #I directives in the script - // - // This is tries to mimic the action of running the script in F# Interactive - the initial context for scripting is created - // first, then #I and other directives are processed. - let references0 = - let tcConfig = - CreateScriptTextTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, - filename, codeContext, useSimpleResolution, - useFsiAuxLib, None, applyCommandLineArgs, assumeDotNetFramework, - useSdkRefs, tryGetMetadataSnapshot, reduceMemoryUsage) - - let resolutions0, _unresolvedReferences = GetAssemblyResolutionInformation(ctok, tcConfig) - let references0 = resolutions0 |> List.map (fun r->r.originalReference.Range, r.resolvedPath) |> Seq.distinct |> List.ofSeq - references0 - - let tcConfig = - CreateScriptTextTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, filename, - codeContext, useSimpleResolution, useFsiAuxLib, Some references0, - applyCommandLineArgs, assumeDotNetFramework, useSdkRefs, - tryGetMetadataSnapshot, reduceMemoryUsage) - - let closureSources = [ClosureSource(filename, range0, sourceText, true)] - let closureFiles, tcConfig = FindClosureFiles(filename, range0, closureSources, tcConfig, codeContext, lexResourceManager) - GetLoadClosure(ctok, filename, closureFiles, tcConfig, codeContext) - - /// Given source filename, find the full load closure - /// Used from fsi.fs and fsc.fs, for #load and command line - let GetFullClosureOfScriptFiles(ctok, tcConfig:TcConfig, files:(string*range) list,codeContext,lexResourceManager: Lexhelp.LexResourceManager) = - let mainFile, mainFileRange = List.last files - let closureSources = files |> List.collect (fun (filename, m) -> ClosureSourceOfFilename(filename, m,tcConfig.inputCodePage,true)) - let closureFiles,tcConfig = FindClosureFiles(mainFile, mainFileRange, closureSources, tcConfig, codeContext, lexResourceManager) - GetLoadClosure(ctok, mainFile, closureFiles, tcConfig, codeContext) - -type LoadClosure with - /// Analyze a script text and find the closure of its references. - /// Used from FCS, when editing a script file. - // - /// A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the - /// same arguments as the rest of the application. - static member ComputeClosureOfScriptText - (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, - filename: string, sourceText: ISourceText, codeContext, useSimpleResolution: bool, - useFsiAuxLib, useSdkRefs, lexResourceManager: Lexhelp.LexResourceManager, - applyCommandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) = - - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - ScriptPreprocessClosure.GetFullClosureOfScriptText - (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, sourceText, - codeContext, useSimpleResolution, useFsiAuxLib, useSdkRefs, lexResourceManager, - applyCommandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) - - /// Analyze a set of script files and find the closure of their references. - static member ComputeClosureOfScriptFiles - (ctok, tcConfig: TcConfig, files:(string*range) list, codeContext, - lexResourceManager: Lexhelp.LexResourceManager) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - ScriptPreprocessClosure.GetFullClosureOfScriptFiles (ctok, tcConfig, files, codeContext, lexResourceManager) - -//---------------------------------------------------------------------------- -// Initial type checking environment -//-------------------------------------------------------------------------- - -/// Build the initial type checking environment -let GetInitialTcEnv (thisAssemblyName: string, initm: range, tcConfig: TcConfig, tcImports: TcImports, tcGlobals) = - let initm = initm.StartRange - - let ccus = - tcImports.GetImportedAssemblies() - |> List.map (fun asm -> asm.FSharpViewOfMetadata, asm.AssemblyAutoOpenAttributes, asm.AssemblyInternalsVisibleToAttributes) - - let amap = tcImports.GetImportMap() - - let tcEnv = CreateInitialTcEnv(tcGlobals, amap, initm, thisAssemblyName, ccus) - - if tcConfig.checkOverflow then - try TcOpenDecl TcResultsSink.NoSink tcGlobals amap initm initm tcEnv (pathToSynLid initm (splitNamespace FSharpLib.CoreOperatorsCheckedName)) - with e -> errorRecovery e initm; tcEnv - else - tcEnv - -//---------------------------------------------------------------------------- -// Fault injection - -/// Inject faults into checking -let CheckSimulateException(tcConfig: TcConfig) = - match tcConfig.simulateException with - | Some("tc-oom") -> raise(System.OutOfMemoryException()) - | Some("tc-an") -> raise(System.ArgumentNullException("simulated")) - | Some("tc-invop") -> raise(System.InvalidOperationException()) - | Some("tc-av") -> raise(System.AccessViolationException()) - | Some("tc-nfn") -> raise(System.NotFiniteNumberException()) - | Some("tc-aor") -> raise(System.ArgumentOutOfRangeException()) - | Some("tc-dv0") -> raise(System.DivideByZeroException()) - | Some("tc-oe") -> raise(System.OverflowException()) - | Some("tc-atmm") -> raise(System.ArrayTypeMismatchException()) - | Some("tc-bif") -> raise(System.BadImageFormatException()) - | Some("tc-knf") -> raise(System.Collections.Generic.KeyNotFoundException()) - | Some("tc-ior") -> raise(System.IndexOutOfRangeException()) - | Some("tc-ic") -> raise(System.InvalidCastException()) - | Some("tc-ip") -> raise(System.InvalidProgramException()) - | Some("tc-ma") -> raise(System.MemberAccessException()) - | Some("tc-ni") -> raise(System.NotImplementedException()) - | Some("tc-nr") -> raise(System.NullReferenceException()) - | Some("tc-oc") -> raise(System.OperationCanceledException()) - | Some("tc-fail") -> failwith "simulated" - | _ -> () - -//---------------------------------------------------------------------------- -// Type-check sets of files -//-------------------------------------------------------------------------- - -type RootSigs = Zmap -type RootImpls = Zset - -let qnameOrder = Order.orderBy (fun (q: QualifiedNameOfFile) -> q.Text) - -type TcState = - { - tcsCcu: CcuThunk - tcsCcuType: ModuleOrNamespace - tcsNiceNameGen: NiceNameGenerator - tcsTcSigEnv: TcEnv - tcsTcImplEnv: TcEnv - tcsCreatesGeneratedProvidedTypes: bool - tcsRootSigs: RootSigs - tcsRootImpls: RootImpls - tcsCcuSig: ModuleOrNamespaceType - } - - member x.NiceNameGenerator = x.tcsNiceNameGen - - member x.TcEnvFromSignatures = x.tcsTcSigEnv - - member x.TcEnvFromImpls = x.tcsTcImplEnv - - member x.Ccu = x.tcsCcu - - member x.CreatesGeneratedProvidedTypes = x.tcsCreatesGeneratedProvidedTypes - - // Assem(a.fsi + b.fsi + c.fsi) (after checking implementation file ) - member x.CcuType = x.tcsCcuType - - // a.fsi + b.fsi + c.fsi (after checking implementation file for c.fs) - member x.CcuSig = x.tcsCcuSig - - member x.NextStateAfterIncrementalFragment tcEnvAtEndOfLastInput = - { x with tcsTcSigEnv = tcEnvAtEndOfLastInput - tcsTcImplEnv = tcEnvAtEndOfLastInput } - - -/// Create the initial type checking state for compiling an assembly -let GetInitialTcState(m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcImports, niceNameGen, tcEnv0) = - ignore tcImports - - // Create a ccu to hold all the results of compilation - let ccuContents = Construct.NewCcuContents ILScopeRef.Local m ccuName (Construct.NewEmptyModuleOrNamespaceType Namespace) - - let ccuData: CcuData = - { IsFSharp=true - UsesFSharp20PlusQuotations=false -#if !NO_EXTENSIONTYPING - InvalidateEvent=(new Event<_>()).Publish - IsProviderGenerated = false - ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) -#endif - TryGetILModuleDef = (fun () -> None) - FileName=None - Stamp = newStamp() - QualifiedName= None - SourceCodeDirectory = tcConfig.implicitIncludeDir - ILScopeRef=ILScopeRef.Local - Contents=ccuContents - MemberSignatureEquality= typeEquivAux EraseAll tcGlobals - TypeForwarders=Map.empty } - - let ccu = CcuThunk.Create(ccuName, ccuData) - - // OK, is this is the FSharp.Core CCU then fix it up. - if tcConfig.compilingFslib then - tcGlobals.fslibCcu.Fixup ccu - - { tcsCcu= ccu - tcsCcuType=ccuContents - tcsNiceNameGen=niceNameGen - tcsTcSigEnv=tcEnv0 - tcsTcImplEnv=tcEnv0 - tcsCreatesGeneratedProvidedTypes=false - tcsRootSigs = Zmap.empty qnameOrder - tcsRootImpls = Zset.empty qnameOrder - tcsCcuSig = Construct.NewEmptyModuleOrNamespaceType Namespace } - -/// Typecheck a single file (or interactive entry into F# Interactive) -let TypeCheckOneInputEventually (checkForErrors, tcConfig: TcConfig, tcImports: TcImports, tcGlobals, prefixPathOpt, tcSink, tcState: TcState, inp: ParsedInput) = - - eventually { - try - let! ctok = Eventually.token - RequireCompilationThread ctok // Everything here requires the compilation thread since it works on the TAST - - CheckSimulateException tcConfig - - let m = inp.Range - let amap = tcImports.GetImportMap() - match inp with - | ParsedInput.SigFile (ParsedSigFileInput (_, qualNameOfFile, _, _, _) as file) -> - - // Check if we've seen this top module signature before. - if Zmap.mem qualNameOfFile tcState.tcsRootSigs then - errorR(Error(FSComp.SR.buildSignatureAlreadySpecified(qualNameOfFile.Text), m.StartRange)) - - // Check if the implementation came first in compilation order - if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR(Error(FSComp.SR.buildImplementationAlreadyGivenDetail(qualNameOfFile.Text), m)) - - let conditionalDefines = - if tcConfig.noConditionalErasure then None else Some (tcConfig.conditionalCompilationDefines) - - // Typecheck the signature file - let! (tcEnv, sigFileType, createsGeneratedProvidedTypes) = - TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcState.tcsTcSigEnv file - - let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs - - // Add the signature to the signature env (unless it had an explicit signature) - let ccuSigForFile = CombineCcuContentFragments m [sigFileType; tcState.tcsCcuSig] - - // Open the prefixPath for fsi.exe - let tcEnv = - match prefixPathOpt with - | None -> tcEnv - | Some prefixPath -> - let m = qualNameOfFile.Range - TcOpenDecl tcSink tcGlobals amap m m tcEnv prefixPath - - let tcState = - { tcState with - tcsTcSigEnv=tcEnv - tcsTcImplEnv=tcState.tcsTcImplEnv - tcsRootSigs=rootSigs - tcsCreatesGeneratedProvidedTypes=tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes} - - return (tcEnv, EmptyTopAttrs, None, ccuSigForFile), tcState - - | ParsedInput.ImplFile (ParsedImplFileInput (_, _, qualNameOfFile, _, _, _, _) as file) -> - - // Check if we've got an interface for this fragment - let rootSigOpt = tcState.tcsRootSigs.TryFind qualNameOfFile - - // Check if we've already seen an implementation for this fragment - if Zset.contains qualNameOfFile tcState.tcsRootImpls then - errorR(Error(FSComp.SR.buildImplementationAlreadyGiven(qualNameOfFile.Text), m)) - - let tcImplEnv = tcState.tcsTcImplEnv - - let conditionalDefines = - if tcConfig.noConditionalErasure then None else Some (tcConfig.conditionalCompilationDefines) - - // Typecheck the implementation file - let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = - TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file - - let hadSig = rootSigOpt.IsSome - let implFileSigType = SigTypeOfImplFile implFile - - let rootImpls = Zset.add qualNameOfFile tcState.tcsRootImpls - - // Only add it to the environment if it didn't have a signature - let m = qualNameOfFile.Range - - // Add the implementation as to the implementation env - let tcImplEnv = AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcImplEnv implFileSigType - - // Add the implementation as to the signature env (unless it had an explicit signature) - let tcSigEnv = - if hadSig then tcState.tcsTcSigEnv - else AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv implFileSigType - - // Open the prefixPath for fsi.exe (tcImplEnv) - let tcImplEnv = - match prefixPathOpt with - | Some prefixPath -> TcOpenDecl tcSink tcGlobals amap m m tcImplEnv prefixPath - | _ -> tcImplEnv - - // Open the prefixPath for fsi.exe (tcSigEnv) - let tcSigEnv = - match prefixPathOpt with - | Some prefixPath when not hadSig -> TcOpenDecl tcSink tcGlobals amap m m tcSigEnv prefixPath - | _ -> tcSigEnv - - let ccuSig = CombineCcuContentFragments m [implFileSigType; tcState.tcsCcuSig ] - - let ccuSigForFile = CombineCcuContentFragments m [implFileSigType; tcState.tcsCcuSig] - - let tcState = - { tcState with - tcsTcSigEnv=tcSigEnv - tcsTcImplEnv=tcImplEnv - tcsRootImpls=rootImpls - tcsCcuSig=ccuSig - tcsCreatesGeneratedProvidedTypes=tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes } - return (tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile), tcState - - with e -> - errorRecovery e range0 - return (tcState.TcEnvFromSignatures, EmptyTopAttrs, None, tcState.tcsCcuSig), tcState - } - -/// Typecheck a single file (or interactive entry into F# Interactive) -let TypeCheckOneInput (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt) tcState inp = - // 'use' ensures that the warning handler is restored at the end - use unwindEL = PushErrorLoggerPhaseUntilUnwind(fun oldLogger -> GetErrorLoggerFilteringByScopedPragmas(false, GetScopedPragmasForInput inp, oldLogger) ) - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck - TypeCheckOneInputEventually (checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, TcResultsSink.NoSink, tcState, inp) - |> Eventually.force ctok - -/// Finish checking multiple files (or one interactive entry into F# Interactive) -let TypeCheckMultipleInputsFinish(results, tcState: TcState) = - let tcEnvsAtEndFile, topAttrs, implFiles, ccuSigsForFiles = List.unzip4 results - let topAttrs = List.foldBack CombineTopAttrs topAttrs EmptyTopAttrs - let implFiles = List.choose id implFiles - // This is the environment required by fsi.exe when incrementally adding definitions - let tcEnvAtEndOfLastFile = (match tcEnvsAtEndFile with h :: _ -> h | _ -> tcState.TcEnvFromSignatures) - (tcEnvAtEndOfLastFile, topAttrs, implFiles, ccuSigsForFiles), tcState - -let TypeCheckOneInputAndFinishEventually(checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input) = - eventually { - Logger.LogBlockStart LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually - let! results, tcState = TypeCheckOneInputEventually(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input) - let result = TypeCheckMultipleInputsFinish([results], tcState) - Logger.LogBlockStop LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually - return result - } - -let TypeCheckClosedInputSetFinish (declaredImpls: TypedImplFile list, tcState) = - // Publish the latest contents to the CCU - tcState.tcsCcu.Deref.Contents <- Construct.NewCcuContents ILScopeRef.Local range0 tcState.tcsCcu.AssemblyName tcState.tcsCcuSig - - // Check all interfaces have implementations - tcState.tcsRootSigs |> Zmap.iter (fun qualNameOfFile _ -> - if not (Zset.contains qualNameOfFile tcState.tcsRootImpls) then - errorR(Error(FSComp.SR.buildSignatureWithoutImplementation(qualNameOfFile.Text), qualNameOfFile.Range))) - - tcState, declaredImpls - -let TypeCheckClosedInputSet (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs) = - // tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions - let results, tcState = (tcState, inputs) ||> List.mapFold (TypeCheckOneInput (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt)) - let (tcEnvAtEndOfLastFile, topAttrs, implFiles, _), tcState = TypeCheckMultipleInputsFinish(results, tcState) - let tcState, declaredImpls = TypeCheckClosedInputSetFinish (implFiles, tcState) - tcState, topAttrs, declaredImpls, tcEnvAtEndOfLastFile - -// Existing public APIs delegate to newer implementations -let GetFSharpCoreLibraryName () = getFSharpCoreLibraryName -let DefaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework = defaultReferencesForScriptsAndOutOfProjectSources (*useFsiAuxLib*)false assumeDotNetFramework (*useSdkRefs*)false From ca43bfe3242bb126c8aeb149e72593ae0bcab8d4 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 14:22:38 +0000 Subject: [PATCH 57/82] add expression testing for unitized operators --- tests/service/ExprTests.fs | 205 +++++++++++++++++++++++++++++++++++-- 1 file changed, 197 insertions(+), 8 deletions(-) diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 5077986015a..6218b3b8d00 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1042,6 +1042,16 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi |> printDeclarations None |> Seq.toList + printfn " let expectedUnoptimized = [" + for s in resultUnoptimized do + printfn " [], %A" s + printfn " ]" + + printfn " let expectedOptimized = [" + for s in resultOptimized do + printfn " [%s], %A" (if s.Contains("ToStringOperator") then "FC47; FC50" else "") s + printfn " ]" + let mutable countFC45 = 0 let mutable countFC46 = 0 let mutable countFC47 = 0 @@ -1083,14 +1093,6 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi printfn "Optimized FC45 tests: %i, FC46 tests: %i, FC47 tests: %i, FC50 tests: %i" countFC45 countFC46 countFC47 countFC50 printfn "Unfiltered optimized: %i, filtered: %i" (List.length expectedOptimized) (List.length expectedOptFiltered) - printfn " let expectedUnoptimized = [" - for s in resultUnoptFiltered do - printfn " [], %A" s - printfn " ]" - printfn " let expectedOptimized = [" - for s in resultOptFiltered do - printfn " [%s], %A" (if s.Contains("ToStringOperator") then "FC47; FC50" else "") s - printfn " ]" // fail test on first line that fails, show difference in output window resultUnoptFiltered |> shouldPairwiseEqual expectedUnoptFiltered @@ -2403,6 +2405,111 @@ let ``Test Operator Declarations for Single`` () = testOperators "Single" "float32" excludedTests expectedUnoptimized expectedOptimized +[] +let ``Test Operator Declarations for Single with unit of measure`` () = + let excludedTests = [ + "testSingleUnitizedBitwiseAndOperator"; + "testSingleUnitizedBitwiseOrOperator"; + "testSingleUnitizedBitwiseXorOperator"; + "testSingleUnitizedShiftLeftOperator"; + "testSingleUnitizedShiftRightOperator"; + ] + + let expectedUnoptimized = [ + [], "type OperatorTestsSingleUnitized" + [], "let testSingleUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,163--4,172)" + [], "let testSingleUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Inequality> (e1,e2) @ (5,163--5,173)" + [], "let testSingleUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,163--6,172)" + [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,163--7,173)" + [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" + [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,163--9,173)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" + [], "let testSingleUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,98--56,107)" + ] + let expectedOptimized = [ + [], "type OperatorTestsSingleUnitized" + [], "let testSingleUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,163--4,172)" + [], "let testSingleUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality> (e1,e2),False) @ (5,163--5,173)" + [], "let testSingleUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,163--6,172)" + [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan> (e1,e2),False) @ (7,163--7,173)" + [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" + [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan> (e1,e2),False) @ (9,163--9,173)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" + [FC47; FC50], "let testSingleUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.float32 = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,98--56,107)" + ] + + testOperators "SingleUnitized" "float32" excludedTests expectedUnoptimized expectedOptimized + [] let ``Test Operator Declarations for Double`` () = let excludedTests = [ @@ -2512,6 +2619,7 @@ let ``Test Operator Declarations for Double`` () = [] let ``Test Operator Declarations for Decimal`` () = let excludedTests = [ + // None of these are supported for decimals "testDecimalBitwiseAndOperator"; "testDecimalBitwiseOrOperator"; "testDecimalBitwiseXorOperator"; @@ -2607,6 +2715,87 @@ let ``Test Operator Declarations for Decimal`` () = testOperators "Decimal" "decimal" excludedTests expectedUnoptimized expectedOptimized +[] +let ``Test Operator Declarations for Decimal unitized`` () = + let excludedTests = [ + // None of these are supported for unitized decimals + "testDecimalUnitizedBitwiseAndOperator"; + "testDecimalUnitizedBitwiseOrOperator"; + "testDecimalUnitizedBitwiseXorOperator"; + "testDecimalUnitizedShiftLeftOperator"; + "testDecimalUnitizedShiftRightOperator"; + "testDecimalUnitizedToSByte"; + "testDecimalUnitizedToIntPtrChecked"; + "testDecimalUnitizedToUIntPtrChecked"; + "testDecimalUnitizedToIntPtrOperator"; + "testDecimalUnitizedToUIntPtrOperator"; + "testDecimalUnitizedToByteChecked"; + "testDecimalUnitizedToSByteChecked"; + "testDecimalUnitizedToInt16Checked"; + "testDecimalUnitizedToUInt16Checked"; + "testDecimalUnitizedToIntChecked"; + "testDecimalUnitizedToInt32Checked"; + "testDecimalUnitizedToUInt32Checked"; + "testDecimalUnitizedToInt64Checked"; + "testDecimalUnitizedToUInt64Checked"; + "testDecimalUnitizedToByteOperator"; + "testDecimalUnitizedToSByteOperator"; + "testDecimalUnitizedToInt16Operator"; + "testDecimalUnitizedToUInt16Operator"; + "testDecimalUnitizedToIntOperator"; + "testDecimalUnitizedToInt32Operator"; + "testDecimalUnitizedToUInt32Operator"; + "testDecimalUnitizedToInt64Operator"; + "testDecimalUnitizedToUInt64Operator"; + "testDecimalUnitizedToSingleOperator"; + "testDecimalUnitizedToDoubleOperator"; + "testDecimalUnitizedToCharOperator"; + ] + + let expectedUnoptimized = [ + [], "type OperatorTestsDecimalUnitized" + [], "let testDecimalUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,164--4,173)" + [], "let testDecimalUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Inequality> (e1,e2) @ (5,164--5,174)" + [], "let testDecimalUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,164--6,173)" + [], "let testDecimalUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,164--7,174)" + [], "let testDecimalUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,164--8,173)" + [], "let testDecimalUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,164--9,174)" + [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (11,156--11,165)" + [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (12,156--12,165)" + [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (13,156--13,165)" + [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Division (arg0_0,arg1_0),e1,e2) @ (14,156--14,165)" + [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Modulus (arg0_0,arg1_0),e1,e2) @ (15,156--15,165)" + [], "let testDecimalUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,99--22,106)" + [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (24,154--24,171)" + [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (25,154--25,171)" + [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (26,154--26,171)" + [], "let testDecimalUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,99--27,114)" + [], "let testDecimalUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,99--54,109)" + [], "let testDecimalUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,99--56,108)" + ] + let expectedOptimized = [ + [], "type OperatorTestsDecimalUnitized" + [], "let testDecimalUnitizedEqualsOperator(e1) (e2) = Decimal.op_Equality (e1,e2) @ (4,164--4,173)" + [], "let testDecimalUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Equality (Decimal.op_Equality (e1,e2),False) @ (5,164--5,174)" + [], "let testDecimalUnitizedLessThanOperator(e1) (e2) = Decimal.op_LessThan (e1,e2) @ (6,164--6,173)" + [], "let testDecimalUnitizedLessThanOrEqualsOperator(e1) (e2) = Decimal.op_LessThanOrEqual (e1,e2) @ (7,164--7,174)" + [], "let testDecimalUnitizedGreaterThanOperator(e1) (e2) = Decimal.op_GreaterThan (e1,e2) @ (8,164--8,173)" + [], "let testDecimalUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Decimal.op_GreaterThanOrEqual (e1,e2) @ (9,164--9,174)" + [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Decimal.op_Addition (e1,e2) @ (11,156--11,165)" + [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (12,156--12,165)" + [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (13,156--13,165)" + [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Decimal.op_Division (e1,e2) @ (14,156--14,165)" + [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Decimal.op_Modulus (e1,e2) @ (15,156--15,165)" + [], "let testDecimalUnitizedUnaryNegOperator(e1) = Decimal.op_UnaryNegation (e1) @ (22,99--22,106)" + [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Decimal.op_Addition (e1,e2) @ (24,154--24,171)" + [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (25,154--25,171)" + [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (26,154--26,171)" + [], "let testDecimalUnitizedUnaryNegChecked(e1) = Decimal.op_UnaryNegation (e1) @ (27,99--27,114)" + [], "let testDecimalUnitizedToDecimalOperator(e1) = e1 @ (54,99--54,109)" + [FC47; FC50], "let testDecimalUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.decimal = e1 in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,99--56,108)" + ] + testOperators "DecimalUnitized" "decimal" excludedTests expectedUnoptimized expectedOptimized + [] let ``Test Operator Declarations for Char`` () = let excludedTests = [ From b4aa2c03267362c580ccba703b1bb1006cecff33 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 14:22:54 +0000 Subject: [PATCH 58/82] fix witnesses for unitized operators --- src/fsharp/ConstraintSolver.fs | 59 +++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 9d4cc306561..e9a7ac66b8c 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -350,6 +350,14 @@ type PermitWeakResolution = | LegacyYesAtInlineGeneralization -> true | No -> false +// Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> +let GetMeasureOfType g ty = + match ty with + | AppTy g (tcref, [tyarg]) -> + match stripTyEqns g tyarg with + | TType_measure ms when not (measureEquiv g ms Measure.One) -> Some (tcref, ms) + | _ -> None + | _ -> None let rec isNativeIntegerTy g ty = typeEquivAux EraseMeasures g g.nativeint_ty ty || @@ -394,29 +402,40 @@ let isFpTy g ty = let isDecimalTy g ty = typeEquivAux EraseMeasures g g.decimal_ty ty +// int*, int*<_> float*, float<_>*, enums +// +// Addition is supported on these via built-in resolution. Note even on enums, so +// System.DayOfWeek.Monday + System.DayOfWeek.Tuesday +// is allowed let IsNonDecimalNumericOrIntegralEnumType g ty = IsIntegerOrIntegerEnumTy g ty || isFpTy g ty +// int*, int*<_> float*, float<_>*, enums, decimal, decimal<_> +// +// This is used for one side of multiplication supported via built-in resolution let IsNumericOrIntegralEnumType g ty = IsNonDecimalNumericOrIntegralEnumType g ty || isDecimalTy g ty +// decimal<_> but not decimal +let IsUnitizedDecimalType g ty = + Option.isSome (GetMeasureOfType g ty) && isDecimalTy g ty + +// int*, int*<_> float*, float<_>*, enums, decimal<_> but NOT plain decimal +// +// This is used for other side of multiplication supported via built-in resolution + +let IsNonDecimalNumericOrIntegralEnumOrUnitizedDecimalType g ty = + IsNonDecimalNumericOrIntegralEnumType g ty || IsUnitizedDecimalType g ty + let IsNonDecimalNumericType g ty = isIntegerTy g ty || isFpTy g ty let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty -// Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> -let GetMeasureOfType g ty = - match ty with - | AppTy g (tcref, [tyarg]) -> - match stripTyEqns g tyarg with - | TType_measure ms when not (measureEquiv g ms Measure.One) -> Some (tcref, ms) - | _ -> None - | _ -> None - let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty /// Checks the argument type for a built-in solution to an op_Addition, op_Subtraction or op_Modulus constraint. -let IsAddSubModType nm g ty = IsNonDecimalNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) +let IsAddSubModType nm g ty = + IsNonDecimalNumericOrIntegralEnumOrUnitizedDecimalType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) /// Checks the argument type for a built-in solution to a bitwise operator constraint let IsBitwiseOpType g ty = IsIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) @@ -482,14 +501,22 @@ let IsRelationalOpArgTypePair permitWeakResolution minfos g ty1 ty2 = let IsBitwiseOpArgTypePair permitWeakResolution minfos g ty1 ty2 = IsSymmetricBinaryOpArgTypePair (IsBitwiseOpType g) permitWeakResolution minfos g ty1 ty2 +// So +// decimal<_> * decimal<_> +// decimal<_> * decimal +// decimal * decimal<_> +// are supported via built-in resolution, but +// decimal * decimal +// is not since there is an op_Multiply call available for that. +// +// Note +// System.DayOfWeek.Monday * System.DayOfWeek.Tuesday +// is allowed for enums, somewhat weirdly but that's how it is +// let IsMulDivTypeArgPairOneWay permitWeakResolution minfos g ty1 ty2 = IsBinaryOpArgTypePair (IsNumericOrIntegralEnumType g) - // This next condition checks that either - // - Neither type contributes any methods OR - // - We have the special case "decimal<_> * decimal". In this case we have some - // possibly-relevant methods from "decimal" but we ignore them in this case. - (fun ty2 -> IsNumericOrIntegralEnumType g ty2 || (Option.isSome (GetMeasureOfType g ty1) && isDecimalTy g ty2)) + (IsNonDecimalNumericOrIntegralEnumOrUnitizedDecimalType g) permitWeakResolution minfos g @@ -3285,6 +3312,8 @@ let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintIn /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { + // Witnesses ignore units of measure + let tyargs = tyargs |> List.map (stripTyEqnsWrtErasure EraseAll g) let css = CreateCodegenState tcVal g amap let denv = DisplayEnv.Empty g let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv From 448ecf02aea92fd27a2e5fa2314b892508e9b2b8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 14:22:38 +0000 Subject: [PATCH 59/82] add expression testing for unitized operators --- tests/service/ExprTests.fs | 205 +++++++++++++++++++++++++++++++++++-- 1 file changed, 197 insertions(+), 8 deletions(-) diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 5077986015a..6218b3b8d00 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1042,6 +1042,16 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi |> printDeclarations None |> Seq.toList + printfn " let expectedUnoptimized = [" + for s in resultUnoptimized do + printfn " [], %A" s + printfn " ]" + + printfn " let expectedOptimized = [" + for s in resultOptimized do + printfn " [%s], %A" (if s.Contains("ToStringOperator") then "FC47; FC50" else "") s + printfn " ]" + let mutable countFC45 = 0 let mutable countFC46 = 0 let mutable countFC47 = 0 @@ -1083,14 +1093,6 @@ let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimi printfn "Optimized FC45 tests: %i, FC46 tests: %i, FC47 tests: %i, FC50 tests: %i" countFC45 countFC46 countFC47 countFC50 printfn "Unfiltered optimized: %i, filtered: %i" (List.length expectedOptimized) (List.length expectedOptFiltered) - printfn " let expectedUnoptimized = [" - for s in resultUnoptFiltered do - printfn " [], %A" s - printfn " ]" - printfn " let expectedOptimized = [" - for s in resultOptFiltered do - printfn " [%s], %A" (if s.Contains("ToStringOperator") then "FC47; FC50" else "") s - printfn " ]" // fail test on first line that fails, show difference in output window resultUnoptFiltered |> shouldPairwiseEqual expectedUnoptFiltered @@ -2403,6 +2405,111 @@ let ``Test Operator Declarations for Single`` () = testOperators "Single" "float32" excludedTests expectedUnoptimized expectedOptimized +[] +let ``Test Operator Declarations for Single with unit of measure`` () = + let excludedTests = [ + "testSingleUnitizedBitwiseAndOperator"; + "testSingleUnitizedBitwiseOrOperator"; + "testSingleUnitizedBitwiseXorOperator"; + "testSingleUnitizedShiftLeftOperator"; + "testSingleUnitizedShiftRightOperator"; + ] + + let expectedUnoptimized = [ + [], "type OperatorTestsSingleUnitized" + [], "let testSingleUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,163--4,172)" + [], "let testSingleUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Inequality> (e1,e2) @ (5,163--5,173)" + [], "let testSingleUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,163--6,172)" + [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,163--7,173)" + [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" + [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,163--9,173)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" + [], "let testSingleUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,98--56,107)" + ] + let expectedOptimized = [ + [], "type OperatorTestsSingleUnitized" + [], "let testSingleUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,163--4,172)" + [], "let testSingleUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_Equality> (e1,e2),False) @ (5,163--5,173)" + [], "let testSingleUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,163--6,172)" + [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan> (e1,e2),False) @ (7,163--7,173)" + [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" + [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan> (e1,e2),False) @ (9,163--9,173)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" + [FC47; FC50], "let testSingleUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.float32 = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,98--56,107)" + ] + + testOperators "SingleUnitized" "float32" excludedTests expectedUnoptimized expectedOptimized + [] let ``Test Operator Declarations for Double`` () = let excludedTests = [ @@ -2512,6 +2619,7 @@ let ``Test Operator Declarations for Double`` () = [] let ``Test Operator Declarations for Decimal`` () = let excludedTests = [ + // None of these are supported for decimals "testDecimalBitwiseAndOperator"; "testDecimalBitwiseOrOperator"; "testDecimalBitwiseXorOperator"; @@ -2607,6 +2715,87 @@ let ``Test Operator Declarations for Decimal`` () = testOperators "Decimal" "decimal" excludedTests expectedUnoptimized expectedOptimized +[] +let ``Test Operator Declarations for Decimal unitized`` () = + let excludedTests = [ + // None of these are supported for unitized decimals + "testDecimalUnitizedBitwiseAndOperator"; + "testDecimalUnitizedBitwiseOrOperator"; + "testDecimalUnitizedBitwiseXorOperator"; + "testDecimalUnitizedShiftLeftOperator"; + "testDecimalUnitizedShiftRightOperator"; + "testDecimalUnitizedToSByte"; + "testDecimalUnitizedToIntPtrChecked"; + "testDecimalUnitizedToUIntPtrChecked"; + "testDecimalUnitizedToIntPtrOperator"; + "testDecimalUnitizedToUIntPtrOperator"; + "testDecimalUnitizedToByteChecked"; + "testDecimalUnitizedToSByteChecked"; + "testDecimalUnitizedToInt16Checked"; + "testDecimalUnitizedToUInt16Checked"; + "testDecimalUnitizedToIntChecked"; + "testDecimalUnitizedToInt32Checked"; + "testDecimalUnitizedToUInt32Checked"; + "testDecimalUnitizedToInt64Checked"; + "testDecimalUnitizedToUInt64Checked"; + "testDecimalUnitizedToByteOperator"; + "testDecimalUnitizedToSByteOperator"; + "testDecimalUnitizedToInt16Operator"; + "testDecimalUnitizedToUInt16Operator"; + "testDecimalUnitizedToIntOperator"; + "testDecimalUnitizedToInt32Operator"; + "testDecimalUnitizedToUInt32Operator"; + "testDecimalUnitizedToInt64Operator"; + "testDecimalUnitizedToUInt64Operator"; + "testDecimalUnitizedToSingleOperator"; + "testDecimalUnitizedToDoubleOperator"; + "testDecimalUnitizedToCharOperator"; + ] + + let expectedUnoptimized = [ + [], "type OperatorTestsDecimalUnitized" + [], "let testDecimalUnitizedEqualsOperator(e1) (e2) = Operators.op_Equality> (e1,e2) @ (4,164--4,173)" + [], "let testDecimalUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Inequality> (e1,e2) @ (5,164--5,174)" + [], "let testDecimalUnitizedLessThanOperator(e1) (e2) = Operators.op_LessThan> (e1,e2) @ (6,164--6,173)" + [], "let testDecimalUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,164--7,174)" + [], "let testDecimalUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,164--8,173)" + [], "let testDecimalUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,164--9,174)" + [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (11,156--11,165)" + [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (12,156--12,165)" + [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (13,156--13,165)" + [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Division (arg0_0,arg1_0),e1,e2) @ (14,156--14,165)" + [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Modulus (arg0_0,arg1_0),e1,e2) @ (15,156--15,165)" + [], "let testDecimalUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,99--22,106)" + [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (24,154--24,171)" + [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (25,154--25,171)" + [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (26,154--26,171)" + [], "let testDecimalUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,99--27,114)" + [], "let testDecimalUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,99--54,109)" + [], "let testDecimalUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,99--56,108)" + ] + let expectedOptimized = [ + [], "type OperatorTestsDecimalUnitized" + [], "let testDecimalUnitizedEqualsOperator(e1) (e2) = Decimal.op_Equality (e1,e2) @ (4,164--4,173)" + [], "let testDecimalUnitizedNotEqualsOperator(e1) (e2) = Operators.op_Equality (Decimal.op_Equality (e1,e2),False) @ (5,164--5,174)" + [], "let testDecimalUnitizedLessThanOperator(e1) (e2) = Decimal.op_LessThan (e1,e2) @ (6,164--6,173)" + [], "let testDecimalUnitizedLessThanOrEqualsOperator(e1) (e2) = Decimal.op_LessThanOrEqual (e1,e2) @ (7,164--7,174)" + [], "let testDecimalUnitizedGreaterThanOperator(e1) (e2) = Decimal.op_GreaterThan (e1,e2) @ (8,164--8,173)" + [], "let testDecimalUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Decimal.op_GreaterThanOrEqual (e1,e2) @ (9,164--9,174)" + [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Decimal.op_Addition (e1,e2) @ (11,156--11,165)" + [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (12,156--12,165)" + [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (13,156--13,165)" + [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Decimal.op_Division (e1,e2) @ (14,156--14,165)" + [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Decimal.op_Modulus (e1,e2) @ (15,156--15,165)" + [], "let testDecimalUnitizedUnaryNegOperator(e1) = Decimal.op_UnaryNegation (e1) @ (22,99--22,106)" + [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Decimal.op_Addition (e1,e2) @ (24,154--24,171)" + [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Decimal.op_Subtraction (e1,e2) @ (25,154--25,171)" + [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Decimal.op_Multiply (e1,e2) @ (26,154--26,171)" + [], "let testDecimalUnitizedUnaryNegChecked(e1) = Decimal.op_UnaryNegation (e1) @ (27,99--27,114)" + [], "let testDecimalUnitizedToDecimalOperator(e1) = e1 @ (54,99--54,109)" + [FC47; FC50], "let testDecimalUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.decimal = e1 in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,99--56,108)" + ] + testOperators "DecimalUnitized" "decimal" excludedTests expectedUnoptimized expectedOptimized + [] let ``Test Operator Declarations for Char`` () = let excludedTests = [ From 4f8d6146dd149037d7d0b8a38c006081792b2756 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 14:27:52 +0000 Subject: [PATCH 60/82] fix witnesses for primitive operators with units of measure --- src/fsharp/ConstraintSolver.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 982c42e58a1..f915b0b1df8 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3123,6 +3123,8 @@ let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintIn /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { + // Witnesses ignore units of measure + let tyargs = tyargs |> List.map (stripTyEqnsWrtErasure EraseMeasures g) let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let ftps, _renaming, tinst = FreshenTypeInst m typars From f031bf30bdf9efc12266359eb959039bf4a5ca94 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 14:51:35 +0000 Subject: [PATCH 61/82] first check test cases fail for primitive operators with units of measure --- src/fsharp/ConstraintSolver.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index f915b0b1df8..982c42e58a1 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3123,8 +3123,6 @@ let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintIn /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { - // Witnesses ignore units of measure - let tyargs = tyargs |> List.map (stripTyEqnsWrtErasure EraseMeasures g) let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let ftps, _renaming, tinst = FreshenTypeInst m typars From bb67fd6640e20a9fc22e64ea0f811cd2d2192ad8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 15:51:18 +0000 Subject: [PATCH 62/82] fix witnesses for primitive operators with units of measure --- src/fsharp/ConstraintSolver.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 982c42e58a1..f915b0b1df8 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -3123,6 +3123,8 @@ let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintIn /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { + // Witnesses ignore units of measure + let tyargs = tyargs |> List.map (stripTyEqnsWrtErasure EraseMeasures g) let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let ftps, _renaming, tinst = FreshenTypeInst m typars From 51422077560fafb21bbbd477c110bf76c5a2ceeb Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 10 Dec 2020 17:08:50 +0000 Subject: [PATCH 63/82] fix witnesses --- src/fsharp/ConstraintSolver.fs | 30 ++---- src/fsharp/ConstraintSolver.fsi | 4 +- src/fsharp/IlxGen.fs | 4 +- src/fsharp/Optimizer.fs | 2 +- src/fsharp/QuotationTranslator.fs | 2 +- src/fsharp/TypedTreeOps.fs | 15 ++- src/fsharp/TypedTreeOps.fsi | 9 +- src/fsharp/symbols/Exprs.fs | 27 ++++- tests/service/ExprTests.fs | 168 +++++++++++++++--------------- 9 files changed, 139 insertions(+), 122 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index f915b0b1df8..a8f2ff5d9d4 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -379,15 +379,6 @@ let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty -// Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> -let GetMeasureOfType g ty = - match ty with - | AppTy g (tcref, [tyarg]) -> - match stripTyEqns g tyarg with - | TType_measure ms when not (measureEquiv g ms Measure.One) -> Some (tcref, ms) - | _ -> None - | _ -> None - let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty /// Checks the argument type for a built-in solution to an op_Addition, op_Subtraction or op_Modulus constraint. @@ -1204,7 +1195,7 @@ and DepthCheck ndeep m = // If this is a type that's parameterized on a unit-of-measure (expected to be numeric), unify its measure with 1 and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty = - match GetMeasureOfType csenv.g ty with + match getMeasureOfType csenv.g ty with | Some (tcref, _) -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty (mkAppTy tcref [TType_measure Measure.One]) | None -> @@ -1287,12 +1278,12 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // - Neither type contributes any methods OR // - We have the special case "decimal<_> * decimal". In this case we have some // possibly-relevant methods from "decimal" but we ignore them in this case. - (isNil minfos || (Option.isSome (GetMeasureOfType g argty1) && isDecimalTy g argty2)) in + (isNil minfos || (Option.isSome (getMeasureOfType g argty1) && isDecimalTy g argty2)) in checkRuleAppliesInPreferenceToMethods argty1 argty2 || checkRuleAppliesInPreferenceToMethods argty2 argty1) -> - match GetMeasureOfType g argty1 with + match getMeasureOfType g argty1 with | Some (tcref, ms1) -> let ms2 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 (mkAppTy tcref [TType_measure ms2]) @@ -1301,7 +1292,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _ -> - match GetMeasureOfType g argty2 with + match getMeasureOfType g argty2 with | Some (tcref, ms2) -> let ms1 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure ms1]) @@ -1430,7 +1421,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _, _, false, "Sqrt", [argty1] when isFpTy g argty1 -> - match GetMeasureOfType g argty1 with + match getMeasureOfType g argty1 with | Some (tcref, _) -> let ms1 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure (Measure.Prod (ms1, ms1))]) @@ -1479,7 +1470,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _, _, false, "Atan2", [argty1; argty2] when isFpTy g argty1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 - match GetMeasureOfType g argty1 with + match getMeasureOfType g argty1 with | None -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 | Some (tcref, _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure Measure.One]) return TTraitBuiltIn @@ -3113,18 +3104,15 @@ let CreateCodegenState tcVal g amap = InfoReader = new InfoReader(g, amap) } /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code -let CodegenWitnessForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { +let CodegenWitnessExprForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo - let sln = GenWitnessExpr amap g m traitInfo argExprs - return sln + return GenWitnessExpr amap g m traitInfo argExprs } /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { - // Witnesses ignore units of measure - let tyargs = tyargs |> List.map (stripTyEqnsWrtErasure EraseMeasures g) let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let ftps, _renaming, tinst = FreshenTypeInst m typars @@ -3134,7 +3122,7 @@ let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { } /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses -let CodegenWitnessesForTraitWitness tcVal g amap m traitInfo = trackErrors { +let CodegenWitnessArgForTraitConstraint tcVal g amap m traitInfo = trackErrors { let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 78872f1d805..888ac4805c7 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -192,13 +192,13 @@ val SolveTypeAsError: DisplayEnv -> ConstraintSolverState -> range -> TType -> u val ApplyTyparDefaultAtPriority: DisplayEnv -> ConstraintSolverState -> priority: int -> Typar -> unit /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code -val CodegenWitnessForTraitConstraint : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> Expr list -> OperationResult +val CodegenWitnessExprForTraitConstraint : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> Expr list -> OperationResult /// Generate the arguments passed when using a generic construct that accepts traits witnesses val CodegenWitnessesForTyparInst : TcValF -> TcGlobals -> ImportMap -> range -> Typars -> TType list -> OperationResult list> /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses -val CodegenWitnessesForTraitWitness : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> OperationResult> +val CodegenWitnessArgForTraitConstraint : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> OperationResult> /// For some code like "let f() = ([] = [])", a free choice is made for a type parameter /// for an interior type variable. This chooses a solution for a type parameter subject diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 3caec50b3a2..1f541e4bdf5 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -3122,7 +3122,7 @@ and GenWitnessArgFromTraitInfo cenv cgbuf eenv m traitInfo = match storage with | None -> let witnessExpr = - ConstraintSolver.CodegenWitnessesForTraitWitness cenv.tcVal g cenv.amap m traitInfo + ConstraintSolver.CodegenWitnessArgForTraitConstraint cenv.tcVal g cenv.amap m traitInfo |> CommitOperationResult match witnessExpr with | Choice1Of2 _traitInfo -> @@ -4092,7 +4092,7 @@ and GenTraitCall (cenv: cenv) cgbuf eenv (traitInfo: TraitConstraintInfo, argExp // If witnesses are available, we should now always find trait witnesses in scope assert not generateWitnesses - let minfoOpt = CommitOperationResult (ConstraintSolver.CodegenWitnessForTraitConstraint cenv.tcVal g cenv.amap m traitInfo argExprs) + let minfoOpt = CommitOperationResult (ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.tcVal g cenv.amap m traitInfo argExprs) match minfoOpt with | None -> let exnArg = mkString g m (FSComp.SR.ilDynamicInvocationNotSupported(traitInfo.MemberName)) diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index a5f8cb6025d..7d04b23c49b 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -2456,7 +2456,7 @@ and OptimizeWhileLoop cenv env (spWhile, marker, e1, e2, m) = and OptimizeTraitCall cenv env (traitInfo, args, m) = // Resolve the static overloading early (during the compulsory rewrite phase) so we can inline. - match ConstraintSolver.CodegenWitnessForTraitConstraint cenv.TcVal cenv.g cenv.amap m traitInfo args with + match ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.TcVal cenv.g cenv.amap m traitInfo args with | OkResult (_, Some expr) -> OptimizeExpr cenv env expr diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs index 9aa64ae73aa..78dc40e9c11 100644 --- a/src/fsharp/QuotationTranslator.fs +++ b/src/fsharp/QuotationTranslator.fs @@ -737,7 +737,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let minfoOpt = if g.generateWitnesses then - ConstraintSolver.CodegenWitnessForTraitConstraint cenv.tcVal g cenv.amap m traitInfo args |> CommitOperationResult + ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.tcVal g cenv.amap m traitInfo args |> CommitOperationResult else None match minfoOpt with diff --git a/src/fsharp/TypedTreeOps.fs b/src/fsharp/TypedTreeOps.fs index 4508a42500b..bca626f99ca 100644 --- a/src/fsharp/TypedTreeOps.fs +++ b/src/fsharp/TypedTreeOps.fs @@ -1058,6 +1058,15 @@ let returnTypesAEquiv g aenv t1 t2 = returnTypesAEquivAux EraseNone g aenv t1 t2 let measureEquiv g m1 m2 = measureAEquiv g TypeEquivEnv.Empty m1 m2 +// Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> +let getMeasureOfType g ty = + match ty with + | AppTy g (tcref, [tyarg]) -> + match stripTyEqns g tyarg with + | TType_measure ms when not (measureEquiv g ms Measure.One) -> Some (tcref, ms) + | _ -> None + | _ -> None + let isErasedType g ty = match stripTyEqns g ty with #if !NO_EXTENSIONTYPING @@ -6959,9 +6968,9 @@ let mkCallAdditionOperator (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForInt let mkCallSubtractionOperator (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_subtraction_info, [[ty; ty; ty]], [e1;e2], m) -let mkCallMultiplyOperator (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_multiply_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallMultiplyOperator (g: TcGlobals) m ty1 ty2 rty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_multiply_info, [[ty1; ty2; rty]], [e1;e2], m) -let mkCallDivisionOperator (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_division_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallDivisionOperator (g: TcGlobals) m ty1 ty2 rty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_division_info, [[ty1; ty2; rty]], [e1;e2], m) let mkCallModulusOperator (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.unchecked_modulus_info, [[ty; ty; ty]], [e1;e2], m) @@ -6985,7 +6994,7 @@ let mkCallAdditionChecked (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntr let mkCallSubtractionChecked (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_subtraction_info, [[ty; ty; ty]], [e1;e2], m) -let mkCallMultiplyChecked (g: TcGlobals) m ty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_multiply_info, [[ty; ty; ty]], [e1;e2], m) +let mkCallMultiplyChecked (g: TcGlobals) m ty1 ty2 rty e1 e2 = mkApps g (typedExprForIntrinsic g m g.checked_multiply_info, [[ty1; ty2; rty]], [e1;e2], m) let mkCallUnaryNegChecked (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.checked_unary_minus_info, [[ty]], [e1], m) diff --git a/src/fsharp/TypedTreeOps.fsi b/src/fsharp/TypedTreeOps.fsi index 8554c006b76..b4e826452e2 100755 --- a/src/fsharp/TypedTreeOps.fsi +++ b/src/fsharp/TypedTreeOps.fsi @@ -31,6 +31,9 @@ val typeEquiv : TcGlobals -> TType -> TType - /// Check the equivalence of two units-of-measure val measureEquiv : TcGlobals -> Measure -> Measure -> bool +/// Get the unit of measure for an annotated type +val getMeasureOfType: TcGlobals -> TType -> (TyconRef * Measure) option + /// Reduce a type to its more canonical form subject to an erasure flag, inference equations and abbreviations val stripTyEqnsWrtErasure: Erasure -> TcGlobals -> TType -> TType @@ -1895,9 +1898,9 @@ val mkCallAdditionOperator : TcGlobals -> range -> TType -> Ex val mkCallSubtractionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -val mkCallMultiplyOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr +val mkCallMultiplyOperator : TcGlobals -> range -> ty1: TType -> ty2: TType -> rty: TType -> Expr -> Expr -> Expr -val mkCallDivisionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr +val mkCallDivisionOperator : TcGlobals -> range -> ty1: TType -> ty2: TType -> rty: TType -> Expr -> Expr -> Expr val mkCallModulusOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr @@ -1921,7 +1924,7 @@ val mkCallAdditionChecked : TcGlobals -> range -> TType -> Ex val mkCallSubtractionChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -val mkCallMultiplyChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr +val mkCallMultiplyChecked : TcGlobals -> range -> ty1: TType -> ty2: TType -> rty: TType -> Expr -> Expr -> Expr val mkCallUnaryNegChecked : TcGlobals -> range -> TType -> Expr -> Expr diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index 39e59c3cda3..8a44e51d379 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -232,6 +232,15 @@ module FSharpExprConvert = | AI_not -> Some mkCallUnaryNotOperator | _ -> None + let (|ILMulDivOp|_|) e = + match e with + | AI_mul -> Some (mkCallMultiplyOperator, true) + | AI_mul_ovf + | AI_mul_ovf_un -> Some (mkCallMultiplyChecked, true) + | AI_div + | AI_div_un -> Some (mkCallDivisionOperator, false) + | _ -> None + let (|ILBinaryOp|_|) e = match e with | AI_add -> Some mkCallAdditionOperator @@ -240,11 +249,6 @@ module FSharpExprConvert = | AI_sub -> Some mkCallSubtractionOperator | AI_sub_ovf | AI_sub_ovf_un -> Some mkCallSubtractionChecked - | AI_mul -> Some mkCallMultiplyOperator - | AI_mul_ovf - | AI_mul_ovf_un -> Some mkCallMultiplyChecked - | AI_div - | AI_div_un -> Some mkCallDivisionOperator | AI_rem | AI_rem_un -> Some mkCallModulusOperator | AI_ceq -> Some mkCallEqualsOperator @@ -751,6 +755,19 @@ module FSharpExprConvert = let op = binaryOp cenv.g m ty arg1 arg2 ConvExprPrim cenv env op + // For units of measure some binary operators change their return type, e.g. a * b where each is int gives int + | TOp.ILAsm ([ ILMulDivOp (binaryOp, isMul) ], _), _, [arg1;arg2] -> + let argty1 = tyOfExpr cenv.g arg1 + let argty2 = tyOfExpr cenv.g arg2 + let rty = + match getMeasureOfType cenv.g argty1, getMeasureOfType cenv.g argty2 with + | Some (tcref, ms1), Some (_tcref2, ms2) -> mkAppTy tcref [TType_measure (Measure.Prod(ms1, if isMul then ms2 else Measure.Inv ms2))] + | Some _, None -> argty1 + | None, Some _ -> argty2 + | None, None -> argty1 + let op = binaryOp cenv.g m argty1 argty2 rty arg1 arg2 + ConvExprPrim cenv env op + | TOp.ILAsm ([ ILConvertOp convertOp1; ILConvertOp convertOp2 ], _), _, [arg] -> let ty1 = tyOfExpr cenv.g arg let op1 = convertOp1 cenv.g m ty1 arg diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 6218b3b8d00..8ff672213a8 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -2423,42 +2423,42 @@ let ``Test Operator Declarations for Single with unit of measure`` () = [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,163--7,173)" [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,163--9,173)" - [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" - [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" - [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" - [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" - [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" - [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" - [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" - [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" - [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" - [], "let testSingleUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" - [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" - [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" - [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" - [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" - [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" - [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" - [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" - [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" - [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" - [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" - [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" - [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" - [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" - [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" - [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" - [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" - [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" - [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" - [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" - [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" - [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" - [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" - [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" - [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" - [], "let testSingleUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,98--54,108)" - [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.byte> (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.sbyte> (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int16> (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint16> (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int> (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint32> (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int64> (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint64> (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.nativeint> (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.unativeint> (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.byte> (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.sbyte> (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int16> (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint16> (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int> (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint32> (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int64> (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint64> (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.nativeint> (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.unativeint> (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float> (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.decimal> (arg0_0),e1) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.char> (arg0_0),e1) @ (55,98--55,105)" [], "let testSingleUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,98--56,107)" ] let expectedOptimized = [ @@ -2469,43 +2469,43 @@ let ``Test Operator Declarations for Single with unit of measure`` () = [], "let testSingleUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_GreaterThan> (e1,e2),False) @ (7,163--7,173)" [], "let testSingleUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,163--8,172)" [], "let testSingleUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_Equality (Operators.op_LessThan> (e1,e2),False) @ (9,163--9,173)" - [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" - [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" - [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" - [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" - [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" - [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,98--22,105)" - [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" - [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" - [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" - [], "let testSingleUnitizedUnaryNegChecked(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,98--27,113)" - [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,98--29,113)" - [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,98--30,114)" - [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,98--31,114)" - [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,98--32,115)" - [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,98--33,112)" - [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,98--34,114)" - [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,98--35,115)" - [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,98--36,114)" - [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,98--37,115)" - [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,98--38,118)" - [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,98--39,119)" - [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,98--41,105)" - [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,98--42,106)" - [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,98--43,106)" - [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,98--44,107)" - [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,98--45,104)" - [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,98--46,106)" - [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,98--47,107)" - [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,98--48,106)" - [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,98--49,107)" - [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,98--50,110)" - [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,98--51,111)" - [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,98--52,108)" - [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,98--53,106)" - [], "let testSingleUnitizedToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (54,98--54,108)" - [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,98--55,105)" - [FC47; FC50], "let testSingleUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.float32 = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,98--56,107)" + [], "let testSingleUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (11,155--11,164)" + [], "let testSingleUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (12,155--12,164)" + [], "let testSingleUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (13,155--13,164)" + [], "let testSingleUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (14,155--14,164)" + [], "let testSingleUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (15,155--15,164)" + [], "let testSingleUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (22,98--22,105)" + [], "let testSingleUnitizedAdditionChecked(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (24,153--24,170)" + [], "let testSingleUnitizedSubtractionChecked(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (25,153--25,170)" + [], "let testSingleUnitizedMultiplyChecked(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.float32,Microsoft.FSharp.Core.float32> (arg0_0,arg1_0),e1,e2) @ (26,153--26,170)" + [], "let testSingleUnitizedUnaryNegChecked(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (27,98--27,113)" + [], "let testSingleUnitizedToByteChecked(e1) = Checked.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.byte> (arg0_0),e1) @ (29,98--29,113)" + [], "let testSingleUnitizedToSByteChecked(e1) = Checked.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.sbyte> (arg0_0),e1) @ (30,98--30,114)" + [], "let testSingleUnitizedToInt16Checked(e1) = Checked.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int16> (arg0_0),e1) @ (31,98--31,114)" + [], "let testSingleUnitizedToUInt16Checked(e1) = Checked.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint16> (arg0_0),e1) @ (32,98--32,115)" + [], "let testSingleUnitizedToIntChecked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (33,98--33,112)" + [], "let testSingleUnitizedToInt32Checked(e1) = Checked.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (34,98--34,114)" + [], "let testSingleUnitizedToUInt32Checked(e1) = Checked.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint32> (arg0_0),e1) @ (35,98--35,115)" + [], "let testSingleUnitizedToInt64Checked(e1) = Checked.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int64> (arg0_0),e1) @ (36,98--36,114)" + [], "let testSingleUnitizedToUInt64Checked(e1) = Checked.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint64> (arg0_0),e1) @ (37,98--37,115)" + [], "let testSingleUnitizedToIntPtrChecked(e1) = Checked.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.nativeint> (arg0_0),e1) @ (38,98--38,118)" + [], "let testSingleUnitizedToUIntPtrChecked(e1) = Checked.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.unativeint> (arg0_0),e1) @ (39,98--39,119)" + [], "let testSingleUnitizedToByteOperator(e1) = Operators.ToByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.byte> (arg0_0),e1) @ (41,98--41,105)" + [], "let testSingleUnitizedToSByteOperator(e1) = Operators.ToSByte> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.sbyte> (arg0_0),e1) @ (42,98--42,106)" + [], "let testSingleUnitizedToInt16Operator(e1) = Operators.ToInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int16> (arg0_0),e1) @ (43,98--43,106)" + [], "let testSingleUnitizedToUInt16Operator(e1) = Operators.ToUInt16> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint16> (arg0_0),e1) @ (44,98--44,107)" + [], "let testSingleUnitizedToIntOperator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (45,98--45,104)" + [], "let testSingleUnitizedToInt32Operator(e1) = Operators.ToInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int32> (arg0_0),e1) @ (46,98--46,106)" + [], "let testSingleUnitizedToUInt32Operator(e1) = Operators.ToUInt32> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint32> (arg0_0),e1) @ (47,98--47,107)" + [], "let testSingleUnitizedToInt64Operator(e1) = Operators.ToInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.int64> (arg0_0),e1) @ (48,98--48,106)" + [], "let testSingleUnitizedToUInt64Operator(e1) = Operators.ToUInt64> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.uint64> (arg0_0),e1) @ (49,98--49,107)" + [], "let testSingleUnitizedToIntPtrOperator(e1) = Operators.ToIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.nativeint> (arg0_0),e1) @ (50,98--50,110)" + [], "let testSingleUnitizedToUIntPtrOperator(e1) = Operators.ToUIntPtr> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.unativeint> (arg0_0),e1) @ (51,98--51,111)" + [], "let testSingleUnitizedToSingleOperator(e1) = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) @ (52,98--52,108)" + [], "let testSingleUnitizedToDoubleOperator(e1) = Operators.ToDouble> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float> (arg0_0),e1) @ (53,98--53,106)" + [], "let testSingleUnitizedToDecimalOperator(e1) = Convert.ToDecimal (Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1)) @ (54,98--54,108)" + [], "let testSingleUnitizedToCharOperator(e1) = Operators.ToChar> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.char> (arg0_0),e1) @ (55,98--55,105)" + [FC47; FC50], "let testSingleUnitizedToStringOperator(e1) = let x: Microsoft.FSharp.Core.float32 = Operators.ToSingle> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.float32> (arg0_0),e1) in x.ToString(dflt,CultureInfo.get_InvariantCulture () :> System.IFormatProvider) @ (56,98--56,107)" ] testOperators "SingleUnitized" "float32" excludedTests expectedUnoptimized expectedOptimized @@ -2760,17 +2760,17 @@ let ``Test Operator Declarations for Decimal unitized`` () = [], "let testDecimalUnitizedLessThanOrEqualsOperator(e1) (e2) = Operators.op_LessThanOrEqual> (e1,e2) @ (7,164--7,174)" [], "let testDecimalUnitizedGreaterThanOperator(e1) (e2) = Operators.op_GreaterThan> (e1,e2) @ (8,164--8,173)" [], "let testDecimalUnitizedGreaterThanOrEqualsOperator(e1) (e2) = Operators.op_GreaterThanOrEqual> (e1,e2) @ (9,164--9,174)" - [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (11,156--11,165)" - [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (12,156--12,165)" - [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (13,156--13,165)" - [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Division (arg0_0,arg1_0),e1,e2) @ (14,156--14,165)" - [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Modulus (arg0_0,arg1_0),e1,e2) @ (15,156--15,165)" - [], "let testDecimalUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (22,99--22,106)" - [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Addition (arg0_0,arg1_0),e1,e2) @ (24,154--24,171)" - [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Subtraction (arg0_0,arg1_0),e1,e2) @ (25,154--25,171)" - [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> Decimal.op_Multiply (arg0_0,arg1_0),e1,e2) @ (26,154--26,171)" - [], "let testDecimalUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic (arg0_0),e1) @ (27,99--27,114)" - [], "let testDecimalUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (54,99--54,109)" + [], "let testDecimalUnitizedAdditionOperator(e1) (e2) = Operators.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (11,156--11,165)" + [], "let testDecimalUnitizedSubtractionOperator(e1) (e2) = Operators.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (12,156--12,165)" + [], "let testDecimalUnitizedMultiplyOperator(e1) (e2) = Operators.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (13,156--13,165)" + [], "let testDecimalUnitizedDivisionOperator(e1) (e2) = Operators.op_Division,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.DivisionDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (14,156--14,165)" + [], "let testDecimalUnitizedModulusOperator(e1) (e2) = Operators.op_Modulus,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.ModulusDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (15,156--15,165)" + [], "let testDecimalUnitizedUnaryNegOperator(e1) = Operators.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.decimal> (arg0_0),e1) @ (22,99--22,106)" + [], "let testDecimalUnitizedAdditionChecked(e1) (e2) = Checked.op_Addition,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (24,154--24,171)" + [], "let testDecimalUnitizedSubtractionChecked(e1) (e2) = Checked.op_Subtraction,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (25,154--25,171)" + [], "let testDecimalUnitizedMultiplyChecked(e1) (e2) = Checked.op_Multiply,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic,Microsoft.FSharp.Core.decimal,Microsoft.FSharp.Core.decimal> (arg0_0,arg1_0),e1,e2) @ (26,154--26,171)" + [], "let testDecimalUnitizedUnaryNegChecked(e1) = Checked.op_UnaryNegation> (fun arg0_0 -> LanguagePrimitives.UnaryNegationDynamic,Microsoft.FSharp.Core.decimal> (arg0_0),e1) @ (27,99--27,114)" + [], "let testDecimalUnitizedToDecimalOperator(e1) = Operators.ToDecimal> (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic,Microsoft.FSharp.Core.decimal> (arg0_0),e1) @ (54,99--54,109)" [], "let testDecimalUnitizedToStringOperator(e1) = Operators.ToString> (e1) @ (56,99--56,108)" ] let expectedOptimized = [ From f5789065539dfa382ff143e71ce31109872be42c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sun, 13 Dec 2020 19:40:21 +0000 Subject: [PATCH 64/82] fix tests --- tests/fsharp/core/extconstraint/test-compat.output.bsl | 2 +- .../core/extconstraint/test-compat.output.feature-disabled.bsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/core/extconstraint/test-compat.output.bsl b/tests/fsharp/core/extconstraint/test-compat.output.bsl index 9653c054013..0742c139de4 100644 --- a/tests/fsharp/core/extconstraint/test-compat.output.bsl +++ b/tests/fsharp/core/extconstraint/test-compat.output.bsl @@ -33,8 +33,8 @@ module CheckNewOverloadsDoneConfusePreviousCode2 = begin type CheckNominal = class new : unit -> CheckNominal - static member CanResolveOverload : x:System.TimeSpan -> unit static member CanResolveOverload : x:System.Numerics.Complex -> unit + static member CanResolveOverload : x:System.TimeSpan -> unit end val f1 : x:System.Numerics.Complex -> diff --git a/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl b/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl index 161c0f6ad86..2eefa26a8d4 100644 --- a/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl +++ b/tests/fsharp/core/extconstraint/test-compat.output.feature-disabled.bsl @@ -33,8 +33,8 @@ module CheckNewOverloadsDoneConfusePreviousCode2 = begin type CheckNominal = class new : unit -> CheckNominal - static member CanResolveOverload : x:System.TimeSpan -> unit static member CanResolveOverload : x:System.Numerics.Complex -> unit + static member CanResolveOverload : x:System.TimeSpan -> unit end val f1 : x:System.Numerics.Complex -> From 4c85d501f01b096040cab2a6e5d42354b1c51d19 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 24 Jun 2021 22:04:41 +0100 Subject: [PATCH 65/82] fix test --- tests/service/PatternMatchCompilationTests.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/service/PatternMatchCompilationTests.fs b/tests/service/PatternMatchCompilationTests.fs index 30afbefd85d..4ad62e11575 100644 --- a/tests/service/PatternMatchCompilationTests.fs +++ b/tests/service/PatternMatchCompilationTests.fs @@ -408,10 +408,10 @@ match box 1 with dumpErrors checkResults |> shouldEqual [ "(5,34--5,35): The type 'obj' does not support the operator '+'" "(5,32--5,33): The type 'obj' does not support the operator '+'" - "(7,45--7,46): The type 'obj' does not match the type 'uint64'" - "(7,43--7,44): The type 'obj' does not match the type 'uint64'" - "(8,43--8,44): The type 'obj' does not match the type 'int8'" - "(8,41--8,42): The type 'obj' does not match the type 'int8'" + "(7,45--7,46): The types 'uint64, obj' do not support the operator '+'"; + "(7,43--7,44): The types 'uint64, obj' do not support the operator '+'"; + "(8,43--8,44): The types 'int8, obj' do not support the operator '+'"; + "(8,41--8,42): The types 'int8, obj' do not support the operator '+'"; "(3,6--3,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)." ] @@ -1141,7 +1141,7 @@ Some "" |> eq "(19,2--19,4): This expression was expected to have type 'obj' but here has type 'int'" "(21,2--21,7): This expression was expected to have type 'obj' but here has type 'bool'" "(23,2--23,6): This expression was expected to have type 'obj' but here has type 'bool'" - "(28,28--28,29): The type 'obj' does not match the type 'int'" + "(28,28--28,29): The types 'int, obj' do not support the operator '+'" "(41,5--41,6): The value or constructor 'm' is not defined." "(42,5--42,6): The value or constructor 'n' is not defined." "(43,5--43,6): The value or constructor 'o' is not defined." From ebd00d67acca1e5f22f182cd9a77d38ef7fd928b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 14 Sep 2021 15:42:41 +0100 Subject: [PATCH 66/82] fix build --- src/fsharp/CheckExpressions.fs | 16 ++++++++-------- src/fsharp/MethodCalls.fs | 18 +++++++++--------- src/fsharp/NameResolution.fs | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 001337fc6e3..03a85ee2574 100755 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -5622,8 +5622,8 @@ and TcNonPropagatingExprLeafThenConvert cenv (overallTy: OverallTy) (env: TcEnv) and TcAdjustExprForTypeDirectedConversions cenv (overallTy: OverallTy) actualTy (env: TcEnv) (* canAdhoc *) m expr = match overallTy with | MustConvertTo (_, reqdTy) when cenv.g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions -> - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g - AdjustExprForTypeDirectedConversions tcVal cenv.g cenv.amap cenv.infoReader env.AccessRights reqdTy actualTy m expr + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext + AdjustExprForTypeDirectedConversions tcVal cenv.g cenv.amap env.TraitContext cenv.infoReader env.AccessRights reqdTy actualTy m expr | _ -> expr @@ -9276,7 +9276,7 @@ and TcMethodApplication /// STEP 5. Build the argument list. Adjust for optional arguments, byref arguments and coercions. let objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds = - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext AdjustCallerArgs tcVal TcFieldInit env.eCallerMemberName cenv.infoReader ad env.TraitContext finalCalledMeth objArgs lambdaVars mItem mMethExpr // Record the resolution of the named argument for the Language Service @@ -9387,7 +9387,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal | AssignedPropSetter (pinfo, pminfo, pminst) -> MethInfoChecks cenv.g cenv.amap true None [objExpr] ad m pminfo let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] |> fst @@ -9397,7 +9397,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal // Get or set instance IL field ILFieldInstanceChecks cenv.g cenv.amap ad m finfo let calledArgTy = finfo.FieldType (cenv.amap, m) - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildILFieldSet cenv.g m objExpr finfo argExpr argExprPrebinder, action, Item.ILField finfo @@ -9406,7 +9406,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal RecdFieldInstanceChecks cenv.g cenv.amap ad m rfinfo let calledArgTy = rfinfo.FieldType CheckRecdFieldMutation m denv rfinfo - let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g + let tcVal = LightweightTcValForUsingInBuildMethodCall cenv.g env.TraitContext let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExpr tcVal cenv.g cenv.amap env.TraitContext cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildRecdFieldSet cenv.g m objExpr rfinfo argExpr argExprPrebinder, action, Item.RecdField rfinfo @@ -10215,7 +10215,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds let isInline = (checkedBinds |> List.forall (fun tbinfo -> let (CheckedBindingInfo(inl, _, _, _, _, _, _, _, _, _, _, _, _, _)) = tbinfo - (inl = ValInline.PseudoVal))) + (inl = ValInline.Always))) CanonicalizePartialInferenceProblem cenv.css denv synBindsRange (checkedBinds |> List.collect (fun tbinfo -> let (CheckedBindingInfo(_, _, _, _, explicitTyparInfo, _, _, _, tauTy, _, _, _, _, _)) = tbinfo @@ -11154,7 +11154,7 @@ and TcIncrementalLetRecGeneralization cenv scopem let isInline = (newGeneralizableBindings |> List.forall (fun tbinfo -> let (CheckedBindingInfo(inl, _, _, _, _, _, _, _, _, _, _, _, _, _)) = tbinfo.CheckedBinding - (inl = ValInline.PseudoVal))) + (inl = ValInline.Always))) CanonicalizePartialInferenceProblem cenv.css denv scopem supportForBindings isInline diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index edabbe599dc..243efc6e30a 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -1415,7 +1415,7 @@ let MakeNullableExprIfNeeded (infoReader: InfoReader) calledArgTy callerArgTy ca MakeMethInfoCall amap m minfo [] [callerArgExprCoerced] // Adjust all the optional arguments, filling in values for defaults, -let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) ad (assignedArg: AssignedCalledArg<_>) = +let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) traitCtxt ad (assignedArg: AssignedCalledArg<_>) = let g = infoReader.g let amap = infoReader.amap let callerArg = assignedArg.CallerArg @@ -1450,7 +1450,7 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: callerArgExpr else let calledNonOptTy = destNullableTy g calledArgTy - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr + let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap traitCtxt infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr MakeNullableExprIfNeeded infoReader calledArgTy callerArgTy callerArgExpr2 m else failwith "unreachable" // see case above @@ -1481,11 +1481,11 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: else // CSharpMethod(x=b) when 'x' has nullable type and 'b' does not --> CSharpMethod(x=Nullable(b)) let calledNonOptTy = destNullableTy g calledArgTy - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr + let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap traitCtxt infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr MakeNullableExprIfNeeded infoReader calledArgTy callerArgTy callerArgExpr2 m else // CSharpMethod(x=b) --> CSharpMethod(?x=b) - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m callerArgExpr + let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap traitCtxt infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m callerArgExpr callerArgExpr2 | CalleeSide -> @@ -1496,7 +1496,7 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: // FSharpMethod(x=b) when FSharpMethod(A) --> FSharpMethod(?x=Some(b :> A)) if isOptionTy g calledArgTy then let calledNonOptTy = destOptionTy g calledArgTy - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr + let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap traitCtxt infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr mkSome g calledNonOptTy callerArgExpr2 m else assert false @@ -1524,7 +1524,7 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: // - VB also allows you to pass intrinsic values as optional values to parameters // typed as Object. What we do in this case is we box the intrinsic value." // -let AdjustCallerArgsForOptionals tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) ad (calledMeth: CalledMeth<_>) mItem mMethExpr = +let AdjustCallerArgsForOptionals tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) traitCtxt ad (calledMeth: CalledMeth<_>) mItem mMethExpr = let g = infoReader.g let assignedNamedArgs = calledMeth.ArgSets |> List.collect (fun argSet -> argSet.AssignedNamedArgs) @@ -1541,8 +1541,8 @@ let AdjustCallerArgsForOptionals tcVal tcFieldInit eCallerMemberName (infoReader let preBinder2, arg = GetDefaultExpressionForOptionalArg tcFieldInit g calledArg eCallerMemberName mItem mMethExpr arg, (preBinder >> preBinder2)) - let adjustedNormalUnnamedArgs = List.map (AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName infoReader ad) unnamedArgs - let adjustedAssignedNamedArgs = List.map (AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName infoReader ad) assignedNamedArgs + let adjustedNormalUnnamedArgs = List.map (AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName infoReader traitCtxt ad) unnamedArgs + let adjustedAssignedNamedArgs = List.map (AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName infoReader traitCtxt ad) assignedNamedArgs optArgs, optArgPreBinder, adjustedNormalUnnamedArgs, adjustedAssignedNamedArgs @@ -1612,7 +1612,7 @@ let AdjustCallerArgs tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader AdjustParamArrayCallerArgs tcVal g amap traitCtxt infoReader ad calledMeth mMethExpr let optArgs, optArgPreBinder, adjustedNormalUnnamedArgs, adjustedFinalAssignedNamedArgs = - AdjustCallerArgsForOptionals tcVal tcFieldInit eCallerMemberName infoReader ad calledMeth mItem mMethExpr + AdjustCallerArgsForOptionals tcVal tcFieldInit eCallerMemberName infoReader traitCtxt ad calledMeth mItem mMethExpr let outArgs, outArgExprs, outArgTmpBinds = AdjustOutCallerArgs g calledMeth mMethExpr diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index d2280f7bb4e..69544ac4278 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -3551,7 +3551,7 @@ let ResolveFieldPrim sink (ncenv: NameResolver) nenv ad traitCtxt ty (mp, id: Id let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty, tcref)) let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad traitCtxt id2 rest2 typeNameResInfo tn.idRange tcrefs // choose only fields - let tyconSearch = tyconSearch |?> List.choose (function resInfo, Item.RecdField(RecdFieldInfo(_, rfref)), rest -> Some(resInfo, FieldResolution(FreshenRecdFieldRef ncenv m traitCtxt rfref, false), rest) | _ -> None) + let tyconSearch = tyconSearch |?> List.choose (function resInfo, Item.RecdField(RecdFieldInfo(_, rfref)), rest -> Some(resInfo, FieldResolution(FreshenRecdFieldRef ncenv traitCtxt m rfref, false), rest) | _ -> None) tyconSearch | _ -> NoResultsOrUsefulErrors From 5fbc58358460d0f5b9ddb9493b027a2e4608bae8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 14 Sep 2021 15:50:51 +0100 Subject: [PATCH 67/82] fix build --- src/fsharp/IlxGen.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 6c8a9b14bb7..275fce6f7bd 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -26,6 +26,7 @@ open FSharp.Compiler.Infos open FSharp.Compiler.Import open FSharp.Compiler.LowerCallsAndSeqs open FSharp.Compiler.LowerStateMachines +open FSharp.Compiler.NameResolution open FSharp.Compiler.Syntax open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.SyntaxTreeOps @@ -4894,7 +4895,7 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel | [meth] when meth.IsInstance -> meth | _ -> error(InternalError(sprintf "expected method %s not found" imethName, m)) - let slotsig = implementedMeth.GetSlotSig(amap, m) + let slotsig = implementedMeth.GetSlotSig(amap, m, traitCtxtNone) let ilOverridesSpec = GenOverridesSpec cenv eenvinner slotsig m let ilOverrideBy = mkILInstanceMethSpecInTy(ilCloTy, imethName, mdef.ParameterTypes, mdef.Return.Type, []) { Overrides = ilOverridesSpec From fdfa29dea5bf65fa322fff19332dd49a13ceb895 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 15 Sep 2021 13:40:56 +0100 Subject: [PATCH 68/82] trim diff --- src/fsharp/CheckDeclarations.fs | 18 +---- src/fsharp/CheckExpressions.fs | 128 ++++++++++++++++---------------- src/fsharp/ConstraintSolver.fs | 19 ++--- 3 files changed, 72 insertions(+), 93 deletions(-) diff --git a/src/fsharp/CheckDeclarations.fs b/src/fsharp/CheckDeclarations.fs index 62e59cab748..0ac54a29eb7 100644 --- a/src/fsharp/CheckDeclarations.fs +++ b/src/fsharp/CheckDeclarations.fs @@ -5725,19 +5725,7 @@ let ApplyDefaults (cenv: cenv) g denvAtEnd m mexpr extraAttribs = CanonicalizePartialInferenceProblem cenv.css denvAtEnd m unsolved false - // The priority order comes from the order of declaration of the defaults in FSharp.Core. - for priority = 10 downto 0 do - unsolved |> List.iter (fun tp -> - if not tp.IsSolved then - // Apply the first default. If we're defaulting one type variable to another then - // the defaults will be propagated to the new type variable. - ApplyTyparDefaultAtPriority denvAtEnd cenv.css priority tp) - - // OK, now apply defaults for any unsolved TyparStaticReq.HeadType - unsolved |> List.iter (fun tp -> - if not tp.IsSolved then - if (tp.StaticReq <> TyparStaticReq.None) then - ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp) + ApplyDefaultsForUnsolved cenv.css denvAtEnd unsolved with e -> errorRecovery e m let CheckValueRestriction denvAtEnd infoReader rootSigOpt implFileTypePriorToSig m = @@ -5763,9 +5751,7 @@ let CheckValueRestriction denvAtEnd infoReader rootSigOpt implFileTypePriorToSig let SolveInternalUnknowns g (cenv: cenv) denvAtEnd mexpr extraAttribs = let unsolved = FindUnsolved.UnsolvedTyparsOfModuleDef g cenv.amap denvAtEnd (mexpr, extraAttribs) - unsolved |> List.iter (fun tp -> - if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then - ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp) + ChooseSolutionsForUnsolved cenv.css denvAtEnd unsolved let CheckModuleSignature g (cenv: cenv) m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig mexpr = match rootSigOpt with diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 03a85ee2574..8a1a33df4e2 100755 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -1837,18 +1837,18 @@ let MakeAndPublishSimpleValsForMergedScope cenv env m (names: NameMap<_>) = //------------------------------------------------------------------------- // Helpers to freshen existing types and values, i.e. when a reference // to C<_> occurs then generate C for a fresh type inference variable ?ty. -//------------------------------------------------------------------------- - -let FreshenTyconRef traitFreshner m rigid (tcref: TyconRef) declaredTyconTypars = +//------------------------------------------------------------------------- + +let FreshenTyconRef traitFreshner m rigid (tcref: TyconRef) declaredTyconTypars = let tpsorig = declaredTyconTypars let tps = copyTypars tpsorig - if rigid <> TyparRigidity.Rigid then - tps |> List.iter (fun tp -> tp.SetRigidity rigid) - + if rigid <> TyparRigidity.Rigid then + tps |> List.iter (fun tp -> tp.SetRigidity rigid) + let renaming, tinst = FixupNewTypars traitFreshner m [] [] tpsorig tps (TType_app(tcref, List.map mkTyparTy tpsorig), tps, renaming, TType_app(tcref, tinst)) - -let FreshenPossibleForallTy traitFreshner g m rigid ty = + +let FreshenPossibleForallTy traitFreshner g m rigid ty = let tpsorig, tau = tryDestForallTy g ty if isNil tpsorig then [], [], [], tau @@ -2441,10 +2441,10 @@ module BindingNormalization = | SynPat.FromParseError(p, _) -> normPattern p | SynPat.LongIdent (LongIdentWithDots(longId, _), toolId, tyargs, SynArgPats.Pats args, vis, m) -> let typars = match tyargs with None -> inferredTyparDecls | Some typars -> typars - match memberFlagsOpt with - | None -> + match memberFlagsOpt with + | None -> match ResolvePatternLongIdent cenv.tcSink nameResolver AllIdsOK true m ad env.TraitContext env.NameEnv TypeNameResolutionInfo.Default longId with - | Item.NewDef id -> + | Item.NewDef id -> if id.idText = opNameCons then NormalizedBindingPat(pat, rhsExpr, valSynData, typars) else @@ -2584,7 +2584,7 @@ module EventDeclarationNormalization = /// Make a copy of the "this" type for a generic object type, e.g. List<'T> --> List<'?> for a fresh inference variable. /// Also adjust the "this" type to take into account whether the type is a struct. -let FreshenObjectArgType cenv traitFreshner m rigid tcref isExtrinsic declaredTyconTypars = +let FreshenObjectArgType cenv traitFreshner m rigid tcref isExtrinsic declaredTyconTypars = #if EXTENDED_EXTENSION_MEMBERS // indicates if extension members can add additional constraints to type parameters let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy = FreshenTyconRef m (if isExtrinsic then TyparRigidity.Flexible else rigid) tcref declaredTyconTypars #else @@ -2709,7 +2709,7 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op tpsorig, NormalValUse, tinst, tau, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, _, tinst, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty + let tpsorig, _, tinst, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty tpsorig, NormalValUse, tinst, tau, tpenv // If we have got an explicit instantiation then use that @@ -2730,7 +2730,7 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op tpsorig, vrefFlags, tinst, tau2, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, tps, tptys, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty + let tpsorig, tps, tptys, tau = FreshenPossibleForallTy traitFreshner cenv.g m TyparRigidity.Flexible vty //dprintfn "After Freshen: tau = %s" (LayoutRender.showL (typeL tau)) let (tinst: TypeInst), tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) checkInst tinst @@ -2740,7 +2740,7 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op TcValEarlyGeneralizationConsistencyCheck cenv env (v, vrec, tinst, vty, tau, m) //dprintfn "After Unify: tau = %s" (LayoutRender.showL (typeL tau)) - tpsorig, vrefFlags, tptys, tau, tpenv + tpsorig, vrefFlags, tptys, tau, tpenv let exprForVal = Expr.Val (vref, vrefFlags, m) let exprForVal = mkTyAppExpr m (exprForVal, vty) tinst @@ -2760,22 +2760,22 @@ let TcVal traitFreshner checkAttributes cenv env tpenv (vref: ValRef) optInst op /// simplified version of TcVal used in calls to BuildMethodCall (typrelns.fs) /// this function is used on typechecking step for making calls to provided methods and on optimization step (for the same purpose). -let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = - let v = vref.Deref - let vty = vref.Type - // byref-typed values get dereferenced - if isByrefTy g vty then - mkAddrGet m vref, destByrefTy g vty - else - match v.LiteralValue with - | Some c -> - let _, _, _, tau = FreshenPossibleForallTy traitCtxt g m TyparRigidity.Flexible vty +let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = + let v = vref.Deref + let vty = vref.Type + // byref-typed values get dereferenced + if isByrefTy g vty then + mkAddrGet m vref, destByrefTy g vty + else + match v.LiteralValue with + | Some c -> + let _, _, _, tau = FreshenPossibleForallTy traitCtxt g m TyparRigidity.Flexible vty Expr.Const (c, m, tau), tau - | None -> - // Instantiate the value - let tau = - // If we have got an explicit instantiation then use that - let _, tps, tptys, tau = FreshenPossibleForallTy traitCtxtNone g m TyparRigidity.Flexible vty + | None -> + // Instantiate the value + let tau = + // If we have got an explicit instantiation then use that + let _, tps, tptys, tau = FreshenPossibleForallTy traitCtxtNone g m TyparRigidity.Flexible vty if tptys.Length <> vrefTypeInst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tps.Length, vrefTypeInst.Length), m)) instType (mkTyparInst tps vrefTypeInst) tau @@ -2786,7 +2786,6 @@ let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFla /// Mark points where we decide whether an expression will support automatic /// decondensation or not. This is somewhat a relic of a previous implementation of decondensation and could /// be removed - type ApplicableExpr = | ApplicableExpr of // context @@ -2949,9 +2948,9 @@ let BuildPossiblyConditionalMethodCall cenv env isMutable m isProp minfo valUseF let _, retExpt, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (cenv.g, cenv.amap, env.TraitContext, mi, objArgs, isMutable, isProp, valUseFlags, args, m) retExpt, retTy - | _ -> -#endif - let tcVal valref valUse ttypes m = + | _ -> +#endif + let tcVal valref valUse ttypes m = let _, a, _, b, _, _ = TcVal env.TraitContext true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m a, b BuildMethodCall tcVal cenv.g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args @@ -3975,9 +3974,9 @@ let rec TcTyparConstraint ridx cenv newOk checkCxs occ (env: TcEnv) tpenv c = | SynTypeConstraint.WhereTyparSupportsMember(tps, memSpfn, m) -> let traitInfo, tpenv = TcPseudoMemberSpec cenv newOk env tps tpenv memSpfn m - match traitInfo with - | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _, _) when memberFlags.MemberKind = SynMemberKind.Constructor -> - match objtys, argTys with + match traitInfo with + | TTrait(objtys, ".ctor", memberFlags, argTys, returnTy, _, _) when memberFlags.MemberKind = SynMemberKind.Constructor -> + match objtys, argTys with | [ty], [] when typeEquiv cenv.g ty (GetFSharpViewOfReturnType cenv.g returnTy) -> AddCxTypeMustSupportDefaultCtor env.DisplayEnv cenv.css m NoTrace ty tpenv @@ -4029,9 +4028,6 @@ and TcValSpec cenv env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv | Some(MemberOrValContainerInfo(tcref, _, _, _, declaredTyconTypars)) -> let isExtrinsic = (declKind = ExtrinsicExtensionBinding) let _, enclosingDeclaredTypars, _, _, thisTy = FreshenObjectArgType cenv env.TraitContext m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars - // An implemented interface type is in terms of the type's type parameters. - // We need a signature in terms of the values' type parameters. - // let optIntfSlotTy = Option.map (instType renaming) optIntfSlotTy in enclosingDeclaredTypars, Some tcref, Some thisTy, declKind | None -> [], None, thisTyOpt, ModuleOrMemberBinding @@ -4290,7 +4286,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: UnscopedTyparEnv match ltyp with | AppTy g (tcref, tinst) -> let tcref = ResolveTypeLongIdentInTyconRef cenv.tcSink cenv.nameResolver env.eNameResEnv (TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length)) ad env.TraitContext m tcref longId - TcTypeApp cenv newOk checkCxs occ env tpenv m tcref tinst args + TcTypeApp cenv newOk checkCxs occ env tpenv m tcref tinst args | _ -> error(Error(FSComp.SR.tcTypeHasNoNestedTypes(), m)) | SynType.Tuple(isStruct, args, m) -> @@ -4721,7 +4717,7 @@ and TcNestedTypeApplication cenv newOk checkCxs occ env tpenv mWholeTypeApp ty p and TryAdjustHiddenVarNameToCompGenName cenv env (id: Ident) altNameRefCellOpt = match altNameRefCellOpt with - | Some ({contents = SynSimplePatAlternativeIdInfo.Undecided altId } as altNameRefCell) -> + | Some ({contents = SynSimplePatAlternativeIdInfo.Undecided altId } as altNameRefCell) -> match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false id.idRange env.eAccessRights env.TraitContext env.eNameResEnv TypeNameResolutionInfo.Default [id] with | Item.NewDef _ -> None // the name is not in scope as a pattern identifier (e.g. union case), so do not use the alternate ID | _ -> altNameRefCell := SynSimplePatAlternativeIdInfo.Decided altId; Some altId // the name is in scope as a pattern identifier, so use the alternate ID @@ -5050,7 +5046,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let args = getArgPatterns () - // TOTAL/PARTIAL ACTIVE PATTERNS + // TOTAL/PARTIAL ACTIVE PATTERNS let _, vexp, _, _, tinst, _ = TcVal env.TraitContext true cenv env tpenv vref None None m let vexp = MakeApplicableExprWithFlex cenv env vexp let vexpty = vexp.Type @@ -5231,7 +5227,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | Item.Value vref -> match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) - | Some lit -> + | Some lit -> let _, _, _, vexpty, _, _ = TcVal env.TraitContext true cenv env tpenv vref None None lidRange CheckValAccessible lidRange env.AccessRights vref CheckFSharpAttributes cenv.g vref.Attribs lidRange |> CommitOperationResult @@ -7825,9 +7821,9 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = if (match delayed with [DelayedTypeApp _] | [] -> true | _ -> false) then let (TypeNameResolutionInfo(_, staticArgsInfo)) = GetLongIdentTypeNameInfo delayed match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad env.TraitContext longId staticArgsInfo PermitDirectReferenceToGeneratedType.No with - | Result (tinstEnclosing, tcref) when IsEntityAccessible cenv.amap m ad tcref -> - match delayed with - | [DelayedTypeApp (tyargs, _, mExprAndTypeArgs)] -> + | Result (tinstEnclosing, tcref) when IsEntityAccessible cenv.amap m ad tcref -> + match delayed with + | [DelayedTypeApp (tyargs, _, mExprAndTypeArgs)] -> TcTypeApp cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs tcref tinstEnclosing tyargs |> ignore | _ -> () true // resolved to a type name, done with checks @@ -8475,14 +8471,14 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | _ -> let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitContext true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem - + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic otherDelayed - // Value get - | _ -> + // Value get + | _ -> let _, vexp, isSpecial, _, _, tpenv = TcVal env.TraitContext true cenv env tpenv vref None (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed @@ -9073,10 +9069,10 @@ and TcMethodApplication let callerArgs = { Unnamed = unnamedCurriedCallerArgs; Named = namedCurriedCallerArgs } - let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = + let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = let minst = FreshenMethInfo env.TraitContext mItem minfo - let callerTyArgs = - match tyargsOpt with + let callerTyArgs = + match tyargsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) @@ -9180,10 +9176,10 @@ and TcMethodApplication | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) - - // Commit unassociated constraints prior to member overload resolution where there is ambiguity - // about the possible target of the call. - if not uniquelyResolved then + + // Commit unassociated constraints prior to member overload resolution where there is ambiguity + // about the possible target of the call. + if not uniquelyResolved then CanonicalizePartialInferenceProblem cenv.css denv mItem (unnamedCurriedCallerArgs |> List.collectSquared (fun callerArg -> freeInTypeLeftToRight cenv.g false callerArg.CallerArgumentType)) false @@ -9510,8 +9506,8 @@ and TcNewDelegateThen cenv (overallTy: OverallTy) env tpenv mDelTy mExprAndArg d let m = arg.Range let callerArg, (_, tpenv) = TcMethodArg cenv env (Array.empty, tpenv) (Array.empty, CallerArg(fty, m, false, farg)) let expr = BuildNewDelegateExpr (None, cenv.g, cenv.amap, env.TraitContext, delegateTy, invokeMethInfo, delArgTys, callerArg.Expr, fty, m) - PropagateThenTcDelayed cenv overallTy env tpenv m (MakeApplicableExprNoFlex cenv expr) delegateTy atomicFlag delayed - | _ -> + PropagateThenTcDelayed cenv overallTy env tpenv m (MakeApplicableExprNoFlex cenv expr) delegateTy atomicFlag delayed + | _ -> error(Error(FSComp.SR.tcDelegateConstructorMustBePassed(), mExprAndArg)) @@ -10115,10 +10111,10 @@ and TcAttributeEx canFail cenv (env: TcEnv) attrTgt attrEx (synAttr: SynAttribut if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m)) let m = callerArgExpr.Range let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad env.TraitContext id IgnoreOverrides TypeNameResolutionInfo.Default ty - let nm, isProp, argty = - match setterItem with - | Item.Property (_, [pinfo]) -> - if not pinfo.HasSetter then + let nm, isProp, argty = + match setterItem with + | Item.Property (_, [pinfo]) -> + if not pinfo.HasSetter then errorR(Error(FSComp.SR.tcPropertyCannotBeSet0(), m)) id.idText, true, pinfo.GetPropertyType(cenv.amap, m) | Item.ILField finfo -> @@ -10232,7 +10228,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds let enclosingDeclaredTypars = [] let (ExplicitTyparInfo(_, declaredTypars, canInferTypars)) = explicitTyparInfo let allDeclaredTypars = enclosingDeclaredTypars @ declaredTypars - let generalizedTypars, prelimValSchemes2 = + let generalizedTypars, prelimValSchemes2 = let canInferTypars = GeneralizationHelpers.ComputeCanInferExtraGeneralizableTypars (containerInfo.ParentRef, canInferTypars, None) let maxInferredTypars = freeInTypeLeftToRight cenv.g false tauTy @@ -10457,7 +10453,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn | uniqueAbstractMeth :: _ -> let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) - + let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = FreshenAbstractSlot envinner.TraitContext cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth @@ -10515,7 +10511,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) - let _, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = + let _, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = FreshenAbstractSlot envinner.TraitContext cenv.g cenv.amap m synTyparDecls uniqueAbstractMeth if not (isNil typarsFromAbsSlot) then diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index e90ecc591d8..77e0f44b98f 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -1675,15 +1675,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload minfos // curried members may not be used to satisfy constraints |> List.choose (fun minfo -> - if minfo.IsCurried then - None - else - let callerArgs = - { Unnamed = [ (argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr))) ] - Named = [ [ ] ] } - let minst = FreshenMethInfo traitCtxt m minfo - let callerObjTys = if memFlags.IsInstance then [ List.head traitObjAndArgTys ] else [] - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo traitCtxt, m, traitAD, minfo, minst, minst, None, callerObjTys, callerArgs, false, false, None))) + if minfo.IsCurried then None else + let callerArgs = + { Unnamed = [ (argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr))) ] + Named = [ [ ] ] } + let minst = FreshenMethInfo traitCtxt m minfo + let callerObjTys = if memFlags.IsInstance then [ List.head traitObjAndArgTys ] else [] + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo traitCtxt, m, traitAD, minfo, minst, minst, None, callerObjTys, callerArgs, false, false, None))) let methOverloadResult, errors = trace.CollectThenUndoOrCommit @@ -1829,7 +1827,6 @@ and GetRelevantExtensionMethodsForTrait m (infoReader: InfoReader) (traitInfo: T /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argtys, rty, soln, traitCtxt) as traitInfo) : MethInfo list = - //let traitAD = traitCtxt.AccessRights :?> AccessorDomain let results = if permitWeakResolution.PerformWeakOverloadResolution csenv.g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then @@ -3478,7 +3475,7 @@ let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { let ftps, _renaming, tinst = FreshenTypeInst traitCtxtNone m typars let traitInfos = GetTraitConstraintInfosOfTypars g ftps do! SolveTyparsEqualTypes csenv 0 m NoTrace tinst tyargs - let witnessArgs = MethodCalls.GenWitnessArgs amap g m traitInfos + let witnessArgs = GenWitnessArgs amap g m traitInfos for witnessArg in witnessArgs do match witnessArg with | Choice1Of2 _traitInfo -> () From c830f4e2f851be08507f9cb1fc85b370e46f39bd Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 12:02:35 +0100 Subject: [PATCH 69/82] merge part of main --- src/fsharp/ConstraintSolver.fsi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 13fceb22e92..5605170ec35 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -49,7 +49,7 @@ val FreshenMethInfo : ITraitContext option -> range -> MethInfo -> TType list /// Information about the context of a type equation, for better error reporting [] ->>>>>>> 06d9821e5561dd9125fafa4a77b0a4a922da29c6 +type ContextInfo = /// No context was given. | NoContext @@ -314,13 +314,9 @@ val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> /// for any unsolved free inference type variables. val ApplyDefaultsForUnsolved: ConstraintSolverState -> DisplayEnv -> Typar list -> unit -<<<<<<< HEAD /// Choose solutions for any remaining unsolved free inference type variables. val ChooseSolutionsForUnsolved: ConstraintSolverState -> DisplayEnv -> Typar list -> unit val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> ITraitContext option -> MethInfo -> TType -> bool val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit -======= -val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit ->>>>>>> f5e74287fdf2813acdf54316da97475bbb140df0 From 321f3b4243a2feca9363b03e37533c3df20c750c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 13:23:15 +0100 Subject: [PATCH 70/82] fix merge --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index f709206ac2c..503159c5c65 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -422,6 +422,7 @@ Logic\ConstraintSolver.fsi + Checking\ConstraintSolver.fsi @@ -436,6 +437,7 @@ Logic\QuotationTranslator.fsi + Checking\FindUnsolved.fsi From 7d6944f7e142fc9aa9654fdf701ad56a674fc0b5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 13:26:17 +0100 Subject: [PATCH 71/82] fix merge --- src/Compiler/FSharp.Compiler.Service.fsproj | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 503159c5c65..d1053b27733 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -414,14 +414,11 @@ Checking\PatternMatchCompilation.fs - - Logic\FindUnsolved.fsi - - - Logic\FindUnsolved.fs + + Checking\FindUnsolved.fsi - - Logic\ConstraintSolver.fsi + + Checking\FindUnsolved.fs Checking\ConstraintSolver.fsi @@ -438,12 +435,6 @@ Logic\QuotationTranslator.fsi - - Checking\FindUnsolved.fsi - - - Checking\FindUnsolved.fs - Checking\QuotationTranslator.fsi From 6e0521beeb6fea2cb16c0bfaf2af7ff1308a6c6e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 13:29:22 +0100 Subject: [PATCH 72/82] fix merge --- src/Compiler/FSharp.Compiler.Service.fsproj | 264 -------------------- 1 file changed, 264 deletions(-) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index d1053b27733..5ee3256d378 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -273,270 +273,6 @@ SyntaxTree\FsLexOutput\lex.fs - - SyntaxTree\LexFilter.fsi - - - SyntaxTree\LexFilter.fs - - - TypedTree\tainted.fsi - - - TypedTree\tainted.fs - - - TypedTree\TypeProviders.fsi - - - TypedTree\TypeProviders.fs - - - TypedTree\QuotationPickler.fsi - - - TypedTree\QuotationPickler.fs - - - TypedTree\CompilerGlobalState.fsi - - - TypedTree\CompilerGlobalState.fs - - - TypedTree\TypedTree.fsi - - - TypedTree\TypedTree.fs - - - TypedTree\TypedTreeBasics.fsi - - - TypedTree\TypedTreeBasics.fs - - - TypedTree\TcGlobals.fs - - - TypedTree\TypedTreeOps.fsi - - - TypedTree\TypedTreeOps.fs - - - TypedTree\TypedTreePickle.fsi - - - TypedTree\TypedTreePickle.fs - - - Checking\import.fsi - - - Checking\import.fs - - - Checking\TypeHierarchy.fsi - - - Checking\TypeHierarchy.fs - - - Checking\infos.fsi - - - Checking\infos.fs - - - Checking\AccessibilityLogic.fsi - - - Checking\AccessibilityLogic.fs - - - Checking\AttributeChecking.fsi - - - Checking\AttributeChecking.fs - - - Checking\TypeRelations.fsi - - - Checking\TypeRelations.fs - - - Checking\InfoReader.fsi - - - Checking\InfoReader.fs - - - Checking\NicePrint.fsi - - - Checking\NicePrint.fs - - - Checking\AugmentWithHashCompare.fsi - - - Checking\AugmentWithHashCompare.fs - - - Checking\NameResolution.fsi - - - Checking\NameResolution.fs - - - Checking\SignatureConformance.fsi - - - Checking\SignatureConformance.fs - - - Checking\MethodOverrides.fsi - - - Checking\MethodOverrides.fs - - - Checking\MethodCalls.fsi - - - Checking\MethodCalls.fs - - - Checking\PatternMatchCompilation.fsi - - - Checking\PatternMatchCompilation.fs - - - Checking\FindUnsolved.fsi - - - Checking\FindUnsolved.fs - - - Checking\ConstraintSolver.fsi - - - Checking\ConstraintSolver.fs - - - Checking\CheckFormatStrings.fsi - - - Checking\CheckFormatStrings.fs - - - Logic\QuotationTranslator.fsi - - - Checking\QuotationTranslator.fsi - - - Checking\QuotationTranslator.fs - - - Checking\PostInferenceChecks.fsi - - - Checking\PostInferenceChecks.fs - - - Checking\CheckExpressions.fsi - - - Checking\CheckExpressions.fs - - - Checking\CheckComputationExpressions.fsi - - - Checking\CheckComputationExpressions.fs - - - Checking\CheckDeclarations.fsi - - - Checking\CheckDeclarations.fs - - - Optimize\Optimizer.fsi - - - Optimize\Optimizer.fs - - - Optimize\DetupleArgs.fsi - - - Optimize\DetupleArgs.fs - - - Optimize\InnerLambdasToTopLevelFuncs.fsi - - - Optimize\InnerLambdasToTopLevelFuncs.fs - - - Optimize\LowerCalls.fsi - - - Optimize\LowerCalls.fs - - - Optimize\LowerSequences.fsi - - - Optimize\LowerSequences.fs - - - Optimize\LowerComputedCollections.fsi - - - Optimize\LowerComputedCollections.fs - - - Optimize\LowerStateMachines.fsi - - - Optimize\LowerStateMachines.fs - - - Optimize\LowerLocalMutables.fsi - - - Optimize\LowerLocalMutables.fs - - - CodeGen\EraseClosures.fsi - - - CodeGen\EraseClosures.fs - - - CodeGen\EraseUnions.fsi - - - CodeGen\EraseUnions.fs - - - CodeGen\IlxGen.fsi - - - CodeGen\IlxGen.fs - - - Driver\FxResolver.fsi - - - Driver\FxResolver.fs - From bf4b44ab2ae9f2cb01f920c7ee5fb2c4e7bfb63a Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 13:58:44 +0100 Subject: [PATCH 73/82] fix build --- src/Compiler/Checking/CheckDeclarations.fs | 4 +-- src/Compiler/Checking/CheckExpressions.fs | 10 +++--- src/Compiler/Checking/ConstraintSolver.fs | 26 ++++++++------ src/Compiler/Checking/FindUnsolved.fs | 11 +++--- src/Compiler/Checking/MethodCalls.fs | 2 +- src/Compiler/Checking/NameResolution.fsi | 2 +- src/Compiler/FSharp.Compiler.Service.fsproj | 4 +-- src/Compiler/TypedTree/TypedTree.fs | 12 ++++--- src/Compiler/TypedTree/TypedTree.fsi | 38 +++++++++++++++++---- src/Compiler/TypedTree/TypedTreeOps.fs | 21 ++++-------- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 -- 11 files changed, 76 insertions(+), 57 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 79fabf0b3e2..c886e80ca2c 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -5149,7 +5149,7 @@ let CheckOneImplFile let infoReader = InfoReader(g, amap) cancellable { - let envinner, mtypeAcc = MakeInitialEnv env + let envinner, moduleTyAcc = MakeInitialEnv env let tcVal = LightweightTcValForUsingInBuildMethodCall g envinner.TraitContext @@ -5162,8 +5162,6 @@ let CheckOneImplFile tcArrayOrListSequenceExpression=TcArrayOrListComputedExpression, tcComputationExpression=TcComputationExpression) - let envinner, moduleTyAcc = MakeInitialEnv env - let defs = [ for x in implFileFrags -> SynModuleDecl.NamespaceFragment x ] let! moduleContents, topAttrs, envAtEnd = TcModuleOrNamespaceElements cenv ParentNone qualNameOfFile.Range envinner PreXmlDoc.Empty None openDecls0 defs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index e8316783bcb..32fbe902923 100755 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -3006,7 +3006,7 @@ let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFla // Instantiate the value let tau = // If we have got an explicit instantiation then use that - let _, tps, tpTys, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let _, tps, tpTys, tau = FreshenPossibleForallTy traitCtxt g m TyparRigidity.Flexible vTy if tpTys.Length <> vrefTypeInst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tps.Length, vrefTypeInst.Length), m)) @@ -3187,7 +3187,7 @@ let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo // and uses TcVal to do this. However we don't want to check attributes again for provided references to values, // so we pass 'false' for 'checkAttributes'. let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext - let _, retExpr, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (g, cenv.amap, mi, objArgs, isMutable, isProp, valUseFlags, args, m) + let _, retExpr, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (g, cenv.amap, env.TraitContext, mi, objArgs, isMutable, isProp, valUseFlags, args, m) retExpr, retTy | _ -> @@ -5582,7 +5582,7 @@ and TcAdjustExprForTypeDirectedConversions cenv (overallTy: OverallTy) actualTy match overallTy with | MustConvertTo (_, reqdTy) when g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions -> let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext - AdjustExprForTypeDirectedConversions tcVal g cenv.amap cenv.infoReader env.AccessRights reqdTy actualTy m expr + AdjustExprForTypeDirectedConversions tcVal g cenv.amap env.TraitContext cenv.infoReader env.AccessRights reqdTy actualTy m expr | _ -> expr @@ -6816,7 +6816,7 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implTy: TType) virtNameAndArit | [ (_, absSlot) ] -> let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot g env.TraitContext cenv.amap mBinding synTyparDecls absSlot + FreshenAbstractSlot env.TraitContext g cenv.amap mBinding synTyparDecls absSlot // Work out the required type of the member let bindingTy = mkFunTy cenv.g implTy (mkMethodTy cenv.g argTysFromAbsSlot retTyFromAbsSlot) @@ -8492,7 +8492,7 @@ and TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed = let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) let typeNameResInfo = GetLongIdentTypeNameInfo otherDelayed - let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true + let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.TraitContext env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: _delayed' -> diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 98dd8fa5109..f09fa559547 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -135,7 +135,7 @@ let FreshenTypars traitCtxt m tpsorig = let _, _, tpTys = FreshenTypeInst traitCtxt m tpsorig tpTys -let FreshenMethInfo m (minfo: MethInfo) = +let FreshenMethInfo traitCtxt m (minfo: MethInfo) = let _, _, tpTys = FreshMethInst traitCtxt m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tpTys @@ -1494,7 +1494,14 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// /// 2. Some additional solutions are forced prior to generalization (permitWeakResolution= Yes or YesDuringCodeGen). See above and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace traitInfo : OperationResult = trackErrors { - let (TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln, traitCtxt))) = traitInfo + let (TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln, traitCtxt)) = traitInfo + + // Work out the relevant accessibility domain for the trait + let traitAD = + match traitCtxt with + | None -> AccessorDomain.AccessibleFromEverywhere + | Some c -> (c.AccessRights :?> AccessorDomain) + // Do not re-solve if already solved if sln.Value.IsSome then return true else let g = csenv.g @@ -1509,7 +1516,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let tys = ListSet.setify (typeAEquiv g aenv) tys // Rebuild the trait info after removing duplicates - let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln, traitCtxt)) + let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln, traitCtxt) let retTy = GetFSharpViewOfReturnType g retTy // Assert the object type if the constraint is for an instance member @@ -1562,7 +1569,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, false, ("op_LessThan" | "op_LessThanOrEqual" | "op_GreaterThan" | "op_GreaterThanOrEqual" | "op_Equality" | "op_Inequality" ), [argTy1;argTy2] - when IsRelationalOpArgTypePair permitWeakResolution minfos g argty1 argty2 -> + when IsRelationalOpArgTypePair permitWeakResolution minfos g argTy1 argTy2 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy g.bool_ty @@ -1623,8 +1630,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argTy1;argTy2] - when IsBitwiseOpType g argTy1 && IsBinaryOpOtherArgType g permitWeakResolution argTy2 - || IsBitwiseOpType g argTy2 && IsBinaryOpOtherArgType g permitWeakResolution argTy1 -> + when IsBitwiseOpArgTypePair permitWeakResolution minfos g argTy1 argTy1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy argTy1 @@ -1720,7 +1726,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, false, "Atan2", [argTy1; argTy2] - when isFpTy g argty1 -> + when isFpTy g argTy1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 match getMeasureOfType g argTy1 with @@ -2918,7 +2924,7 @@ and ReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMet and AssumeMethodSolvesTrait (csenv: ConstraintSolverEnv) (cx: TraitConstraintInfo option) m trace (calledMeth: CalledMeth<_>) = match cx with | Some traitInfo when traitInfo.Solution.IsNone -> - let traitSln = MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs + let traitSln = MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs #if TRAIT_CONSTRAINT_CORRECTIONS if csenv.g.langVersion.SupportsFeature LanguageFeature.TraitConstraintCorrections then TransactMemberConstraintSolution traitInfo trace traitSln @@ -3654,11 +3660,11 @@ let ApplyDefaultsAfterWitnessGeneration (g: TcGlobals) amap css denv sln = if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then sln |> Option.iter (fun slnExpr -> // Apply all defaults - let unsolved = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr + let unsolved = FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr ApplyDefaultsForUnsolved css denv unsolved // Search again and choose solutions - let unsolved2 = FSharp.Compiler.FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr + let unsolved2 = FindUnsolved.UnsolvedTyparsOfExpr g amap denv slnExpr ChooseSolutionsForUnsolved css denv unsolved2) /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index 9ddbca61fc9..eeb51c375b9 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -292,11 +292,12 @@ let UnsolvedTyparsOfModuleDef g amap denv mdef extraAttribs = let UnsolvedTyparsOfExpr g amap denv expr = let cenv = - { g =g - amap=amap - denv=denv - unsolved = [] } - accExpr cenv Nix expr + { g =g + amap=amap + denv=denv + unsolved = [] + stackGuard = StackGuard(FindUnsolvedStackGuardDepth) } + accExpr cenv NoEnv expr List.rev cenv.unsolved diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 8fe49518354..37585876e45 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -994,7 +994,7 @@ let BuildFSharpMethodApp g m (vref: ValRef) vExpr vexprty (args: Exprs) = retTy /// Build a call to an F# method. -let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags declaringTypeInst minst args = +let BuildFSharpMethodCall g m (vref: ValRef) valUseFlags declaringTypeInst minst args = let vExpr = Expr.Val (vref, valUseFlags, m) let vExprTy = vref.Type let tpsorig, tau = vref.GeneralizedType diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index ae6a7480a54..6b61a7ca865 100644 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -783,7 +783,7 @@ val FakeInstantiationGenerator: (range -> Typars -> ITraitContext option -> Type val TryToResolveLongIdentAsType: NameResolver -> NameResolutionEnv -> range -> string list -> TType option /// Resolve a (possibly incomplete) long identifier to a loist of possible class or record fields -val internal ResolvePartialLongIdentToClassOrRecdFields : NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> Item list +val ResolvePartialLongIdentToClassOrRecdFields: NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> bool -> Item list /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions. val ResolvePartialLongIdent: diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 5ee3256d378..483886240d7 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -320,12 +320,12 @@ + + - - diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index bcb898b1b27..33de132d209 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2339,7 +2339,9 @@ type TyparConstraint = override x.ToString() = sprintf "%+A" x -/// Only satisfied by elsewhere. Not stored in TastPickle. +/// Represents the ability to solve traits via extension methods in a particular scope. +/// +/// Only satisfied by types defined elsewhere (e.g. NameResolutionEnv), and not stored in TypedTreePickle. type ITraitContext = /// Used to select the extension methods in the context relevant to solving the constraint /// given the current support types @@ -2378,7 +2380,7 @@ type TraitConstraintInfo = /// /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of supportTys: TTypes * memberName: string * memFlags: SynMemberFlags * argTys: TTypes * returnTy: TType option * traitSln: TraitConstraintSln option ref * traitContext: ITraitContext option + | TTrait of supportTys: TTypes * memberName: string * memFlags: SynMemberFlags * argTys: TTypes * returnTy: TType option * solution: TraitConstraintSln option ref * traitContext: ITraitContext option /// Get the support types that can help provide members to solve the constraint member x.SupportTypes = (let (TTrait(tys,_,_,_,_,_,_)) = x in tys) @@ -2419,9 +2421,9 @@ type TraitConstraintSln = /// FSMethSln(ty, vref, minst) /// /// Indicates a trait is solved by an F# method. - /// ty -- the apparent type and its instantiation - /// vref -- the method that solves the trait constraint - /// minst -- the generic method instantiation + /// apparentType -- the apparent type and its instantiation + /// valRef -- the method that solves the trait constraint + /// methodInst -- the generic method instantiation /// isExt -- is this a use of an extension method | FSMethSln of apparentType: TType * valRef: ValRef * methodInst: TypeInst * isExt: bool diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 57037ba27d8..f95cc271bb6 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1641,6 +1641,22 @@ type TraitWitnessInfo = /// Get the return type recorded in the member constraint. member ReturnType: TType option +/// Represents the ability to solve traits via extension methods in a particular scope. +/// +/// Only satisfied by types defined elsewhere (e.g. NameResolutionEnv), and not stored in TypedTreePickle. +type ITraitContext = + /// Used to select the extension methods in the context relevant to solving the constraint + /// given the current support types + abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> ITraitExtensionMember list + + /// Gives the access rights (e.g. InternalsVisibleTo, Protected) at the point the trait is being solved + abstract AccessRights: ITraitAccessorDomain + +/// Only satisfied by elsewhere. Not stored in TastPickle. +type ITraitExtensionMember = interface end + +type ITraitAccessorDomain = interface end + /// The specification of a member constraint that must be solved [] type TraitConstraintInfo = @@ -1648,15 +1664,19 @@ type TraitConstraintInfo = /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. | TTrait of - tys: TTypes * + supportTys: TTypes * memberName: string * - _memFlags: Syntax.SynMemberFlags * + memFlags: SynMemberFlags * argTys: TTypes * returnTy: TType option * - solution: TraitConstraintSln option ref + solution: TraitConstraintSln option ref * + traitContext: ITraitContext option override ToString: unit -> string + /// Get the support types that can help provide members to solve the constraint + member SupportTypes: TTypes + /// Get the argument types recorded in the member constraint. This includes the object instance type for /// instance members. member ArgumentTypes: TTypes @@ -1676,6 +1696,9 @@ type TraitConstraintInfo = /// Get or set the solution of the member constraint during inference member Solution: TraitConstraintSln option with get, set + /// Get the context used to help determine possible extension member solutions + member TraitContext: ITraitContext option + /// Get the key associated with the member constraint. member TraitKey: TraitWitnessInfo @@ -1686,10 +1709,11 @@ type TraitConstraintSln = /// FSMethSln(ty, vref, minst) /// /// Indicates a trait is solved by an F# method. - /// ty -- the type type its instantiation - /// vref -- the method that solves the trait constraint - /// minst -- the generic method instantiation - | FSMethSln of ty: TType * vref: ValRef * minst: TypeInst + /// apparentType -- the apparent type and its instantiation + /// valRef -- the method that solves the trait constraint + /// methodInst -- the generic method instantiation + /// isExt -- is this a use of an extension method + | FSMethSln of apparentType: TType * valRef: ValRef * methodInst: TypeInst * isExt: bool /// FSRecdFieldSln(tinst, rfref, isSetProp) /// diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index a4e0d214015..4ed34654aff 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -65,14 +65,6 @@ type TyparMap<'T> = [] type TyconRefMap<'T>(imap: StampMap<'T>) = -<<<<<<< HEAD - member m.Item with get (v: TyconRef) = imap[v.Stamp] - member m.TryFind (v: TyconRef) = imap.TryFind v.Stamp - member m.ContainsKey (v: TyconRef) = imap.ContainsKey v.Stamp - member m.Add (v: TyconRef) x = TyconRefMap (imap.Add (v.Stamp, x)) - member m.Remove (v: TyconRef) = TyconRefMap (imap.Remove v.Stamp) - member m.IsEmpty = imap.IsEmpty -======= member _.Item with get (tcref: TyconRef) = imap[tcref.Stamp] member _.TryFind (tcref: TyconRef) = imap.TryFind tcref.Stamp member _.ContainsKey (tcref: TyconRef) = imap.ContainsKey tcref.Stamp @@ -80,7 +72,6 @@ type TyconRefMap<'T>(imap: StampMap<'T>) = member _.Remove (tcref: TyconRef) = TyconRefMap (imap.Remove tcref.Stamp) member _.IsEmpty = imap.IsEmpty ->>>>>>> 0c1eba0671d0edb86e97618e0a7678a7550befe4 static member Empty: TyconRefMap<'T> = TyconRefMap Map.empty static member OfList vs = (vs, TyconRefMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) @@ -290,7 +281,7 @@ and remapTraitWitnessInfo tyenv (TraitWitnessInfo(tys, nm, flags, argTys, retTy) let rtyR = Option.map (remapTypeAux tyenv) retTy TraitWitnessInfo(tysR, nm, flags, argTysR, rtyR) -and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell, , traitCtxt)) = +and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell, traitCtxt)) = let slnCell = match slnCell.Value with | None -> None @@ -301,7 +292,7 @@ and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell, , trait | ILMethSln(ty, extOpt, ilMethRef, minst) -> ILMethSln(remapTypeAux tyenv ty, extOpt, ilMethRef, remapTypesAux tyenv minst) | FSMethSln(ty, vref, minst, isExt) -> - FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, isExt) + FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, isExt) | FSRecdFieldSln(tinst, rfref, isSet) -> FSRecdFieldSln(remapTypesAux tyenv tinst, remapRecdFieldRef tyenv.tyconRefRemap rfref, isSet) | FSAnonRecdFieldSln(anonInfo, tinst, n) -> @@ -314,7 +305,7 @@ and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell, , trait let traitCtxtNew = if tyenv.traitCtxtsMap.ContainsKey nm then - Some tyenv.traitCtxtsMap.[nm] + Some tyenv.traitCtxtsMap[nm] else traitCtxt @@ -2512,10 +2503,10 @@ and accTraitCtxtsInType acc ty = match ty with | TType_tuple (_, tys) | TType_anon (_, tys) - | TType_app (_, tys) + | TType_app (_, tys, _) | TType_ucase (_, tys) -> accTraitCtxtsInTypes acc tys - | TType_fun (d, r) -> accTraitCtxtsInType (accTraitCtxtsInType acc d) r - | TType_var r -> accTraitCtxtsTyparRef acc r + | TType_fun (d, r, _) -> accTraitCtxtsInType (accTraitCtxtsInType acc d) r + | TType_var (r, _) -> accTraitCtxtsTyparRef acc r | TType_forall (_tps, r) -> accTraitCtxtsInType acc r | TType_measure unt -> List.foldBack (fun (tp, _) acc -> accTraitCtxtsTyparRef acc tp) (ListMeasureVarOccsWithNonZeroExponents unt) acc diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index bca7bb21124..21fb94fb17f 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1424,9 +1424,6 @@ module DebugPrint = /// A global flag indicating whether debug output should include type information val mutable layoutTypes: bool - /// A global flag indicating whether debug output should include stamps - val layoutStamps : bool ref - /// Convert a type to a string for debugging purposes val showType: TType -> string From 134aac474862d144beec6778648948620d659ce2 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 14:02:19 +0100 Subject: [PATCH 74/82] fromat source --- src/Compiler/Checking/CheckExpressions.fsi | 10 ++++++++-- src/Compiler/Checking/ConstraintSolver.fsi | 10 ++++++++-- src/Compiler/Checking/NameResolution.fsi | 20 +++++++++++++------- src/Compiler/Checking/TypeHierarchy.fsi | 7 ++++++- src/Compiler/CodeGen/IlxGen.fs | 9 +++++---- src/Compiler/Driver/fsc.fs | 8 +++++++- src/Compiler/TypedTree/TypedTree.fsi | 12 ++++++++---- src/Compiler/TypedTree/TypedTreeOps.fsi | 22 ++++++++++++---------- 8 files changed, 67 insertions(+), 31 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 497f41f4a81..baf377794e1 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -113,7 +113,7 @@ type TcEnv = member NameEnv: NameResolutionEnv member AccessRights: AccessorDomain - member TraitContext : ITraitContext option + member TraitContext: ITraitContext option interface ITraitContext @@ -215,7 +215,13 @@ exception InvalidInternalsVisibleToAssemblyName of badName: string * fileName: s val TcFieldInit: range -> ILFieldInit -> Const val LightweightTcValForUsingInBuildMethodCall: - g: TcGlobals -> traitCtxt: ITraitContext option -> vref: ValRef -> vrefFlags: ValUseFlag -> vrefTypeInst: TTypes -> m: range -> Expr * TType + g: TcGlobals -> + traitCtxt: ITraitContext option -> + vref: ValRef -> + vrefFlags: ValUseFlag -> + vrefTypeInst: TTypes -> + m: range -> + Expr * TType //------------------------------------------------------------------------- // The rest are all helpers needed for declaration checking (CheckDeclarations.fs) diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index 4702149cab6..b7270c33c32 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -42,7 +42,13 @@ val NewInferenceTypes: TcGlobals -> 'T list -> TType list /// 2. the instantiation mapping old type parameters to inference variables /// 3. the inference type variables as a list of types. val FreshenAndFixupTypars: - ITraitContext option -> m: range -> rigid: TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInstantiation * TType list + ITraitContext option -> + m: range -> + rigid: TyparRigidity -> + Typars -> + TType list -> + Typars -> + Typars * TyparInstantiation * TType list /// Given a set of type parameters, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted. @@ -338,4 +344,4 @@ val ChooseSolutionsForUnsolved: ConstraintSolverState -> DisplayEnv -> Typar lis val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> ITraitContext option -> MethInfo -> TType -> bool -val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit +val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> bool -> unit diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 6b61a7ca865..ee075ec5a4f 100644 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -18,7 +18,10 @@ open FSharp.Compiler.TcGlobals type NameResolver = new: - g: TcGlobals * amap: ImportMap * infoReader: InfoReader * instantiationGenerator: (range -> Typars -> ITraitContext option -> TypeInst) -> + g: TcGlobals * + amap: ImportMap * + infoReader: InfoReader * + instantiationGenerator: (range -> Typars -> ITraitContext option -> TypeInst) -> NameResolver member InfoReader: InfoReader @@ -164,15 +167,15 @@ type ExtensionMember = | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority /// The logical name, e.g. for constraint solving - member LogicalName : string + member LogicalName: string /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced /// later through 'open' get priority in overload resolution. member Priority: ExtensionMethodPriority /// Freshen a trait for use at a particular location - /// The environment of information used to resolve names + [] type NameResolutionEnv = { @@ -221,7 +224,7 @@ type NameResolutionEnv = /// Extension members by type and name eIndexedExtensionMembers: TyconRefMultiMap - /// Extension members by name + /// Extension members by name eExtensionMembersByName: NameMultiMap /// Other extension members unindexed by type @@ -588,7 +591,8 @@ val internal AllMethInfosOfTypeInScope: TType -> MethInfo list -val internal SelectExtensionMethInfosForTrait: traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> MethInfo list +val internal SelectExtensionMethInfosForTrait: + traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> MethInfo list /// Used to report an error condition where name resolution failed due to an indeterminate type exception internal IndeterminateType of range @@ -783,7 +787,8 @@ val FakeInstantiationGenerator: (range -> Typars -> ITraitContext option -> Type val TryToResolveLongIdentAsType: NameResolver -> NameResolutionEnv -> range -> string list -> TType option /// Resolve a (possibly incomplete) long identifier to a loist of possible class or record fields -val ResolvePartialLongIdentToClassOrRecdFields: NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> bool -> Item list +val ResolvePartialLongIdentToClassOrRecdFields: + NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> bool -> Item list /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions. val ResolvePartialLongIdent: @@ -822,4 +827,5 @@ val TrySelectExtensionMethInfoOfILExtMem: val traitCtxtNone: ITraitContext option -val ExtensionMethInfosOfTypeInScope: ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> range -> TType -> MethInfo list +val ExtensionMethInfosOfTypeInScope: + ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> range -> TType -> MethInfo list diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index d6fd15b3231..7b11b4e704f 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -161,7 +161,12 @@ val ImportReturnTypeFromMetadata: /// /// Note: this now looks identical to constraint instantiation. -val CopyTyparConstraints: traitCtxt: ITraitContext option -> m: range -> tprefInst: TyparInstantiation -> tporig: Typar -> TyparConstraint list +val CopyTyparConstraints: + traitCtxt: ITraitContext option -> + m: range -> + tprefInst: TyparInstantiation -> + tporig: Typar -> + TyparConstraint list /// The constraints for each typar copied from another typar can only be fixed up once /// we have generated all the new constraints, e.g. f List, B :> List> ... diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 6487a37da7b..2c29ec0be9b 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -539,7 +539,7 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty member _.WithoutTemplateReplacement() = TypeReprEnv(reprs, count, None) /// Lookup a type parameter - member _.LookupTyparRepr (tp: Typar, m: range) = + member _.LookupTyparRepr(tp: Typar, m: range) = try reprs[tp.Stamp] with :? KeyNotFoundException -> @@ -711,8 +711,7 @@ and GenTypeAux cenv m (tyenv: TypeReprEnv) voidOK ptrsOK ty = else EraseClosures.mkILTyFuncTy cenv.ilxPubCloEnv - | TType_var (tp, _) -> - mkILTyvarTy (tyenv.LookupTyparRepr(tp, m)) + | TType_var (tp, _) -> mkILTyvarTy (tyenv.LookupTyparRepr(tp, m)) | TType_measure _ -> g.ilg.typ_Int32 @@ -6552,7 +6551,9 @@ and GenGenericParams cenv eenv tps = tps |> DropErasedTypars |> List.map (GenGenericParam cenv eenv) and GenGenericArgs m (tyenv: TypeReprEnv) tps = - tps |> DropErasedTypars |> List.map (fun c -> mkILTyvarTy (tyenv.LookupTyparRepr(c, m))) + tps + |> DropErasedTypars + |> List.map (fun c -> mkILTyvarTy (tyenv.LookupTyparRepr(c, m))) /// Generate a local type function contract class and implementation and GenClosureAsLocalTypeFunction cenv (cgbuf: CodeGenBuffer) eenv thisVars expr m = diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 8d441c8ec7b..441a27ca564 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -1141,7 +1141,13 @@ let main4 // Create the Abstract IL generator let ilxGenerator = - CreateIlxAssemblyGenerator(tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), generatedCcu) + CreateIlxAssemblyGenerator( + tcConfig, + tcImports, + tcGlobals, + (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), + generatedCcu + ) let codegenBackend = (if Option.isSome dynamicAssemblyCreator then diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index f95cc271bb6..4b61ee4b5d0 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1644,7 +1644,7 @@ type TraitWitnessInfo = /// Represents the ability to solve traits via extension methods in a particular scope. /// /// Only satisfied by types defined elsewhere (e.g. NameResolutionEnv), and not stored in TypedTreePickle. -type ITraitContext = +type ITraitContext = /// Used to select the extension methods in the context relevant to solving the constraint /// given the current support types abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> ITraitExtensionMember list @@ -1653,9 +1653,13 @@ type ITraitContext = abstract AccessRights: ITraitAccessorDomain /// Only satisfied by elsewhere. Not stored in TastPickle. -type ITraitExtensionMember = interface end +type ITraitExtensionMember = + interface + end -type ITraitAccessorDomain = interface end +type ITraitAccessorDomain = + interface + end /// The specification of a member constraint that must be solved [] @@ -1711,7 +1715,7 @@ type TraitConstraintSln = /// Indicates a trait is solved by an F# method. /// apparentType -- the apparent type and its instantiation /// valRef -- the method that solves the trait constraint - /// methodInst -- the generic method instantiation + /// methodInst -- the generic method instantiation /// isExt -- is this a use of an extension method | FSMethSln of apparentType: TType * valRef: ValRef * methodInst: TypeInst * isExt: bool diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 21fb94fb17f..6752b5eb18a 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -550,19 +550,21 @@ type ValRemap = ValMap /// Represents a combination of substitutions/instantiations where things replace other things during remapping [] type Remap = - { tpinst : TyparInstantiation + { + tpinst: TyparInstantiation - /// Values to remap - valRemap: ValRemap + /// Values to remap + valRemap: ValRemap - /// TyconRefs to remap - tyconRefRemap : TyconRefRemap + /// TyconRefs to remap + tyconRefRemap: TyconRefRemap - /// Remove existing trait solutions? - removeTraitSolutions: bool + /// Remove existing trait solutions? + removeTraitSolutions: bool - /// A map indicating how to fill in trait contexts for traits as we copy an expression. Indexed by the member name of the trait - traitCtxtsMap: Map } + /// A map indicating how to fill in trait contexts for traits as we copy an expression. Indexed by the member name of the trait + traitCtxtsMap: Map + } static member Empty: Remap @@ -1594,7 +1596,7 @@ type TypeDefMetadata = val metadataOfTycon: Tycon -> TypeDefMetadata #if EXTENSIONTYPING -val extensionInfoOfTy : TcGlobals -> TType -> TyconRepresentation +val extensionInfoOfTy: TcGlobals -> TType -> TyconRepresentation #endif /// Extract metadata from a type From 6710063aa9e6af5401f883492bde54ec7119bb94 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 14:21:08 +0100 Subject: [PATCH 75/82] reduce diff --- src/Compiler/Checking/ConstraintSolver.fs | 3 --- src/Compiler/Checking/PostInferenceChecks.fs | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index f09fa559547..c35bc5d3c8b 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -2999,7 +2999,6 @@ and ResolveOverloading candidates |> FilterEachThenUndo (fun newTrace calledMeth -> let csenv = { csenv with IsSpeculativeForMethodOverloading = true } let cxsln = AssumeMethodSolvesTrait csenv cx m (WithTrace newTrace) calledMeth - //let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) CanMemberSigsMatchUpToCheck csenv permitOptArgs @@ -3043,7 +3042,6 @@ and ResolveOverloading match CollectThenUndo (fun newTrace -> let csenv = { csenv with IsSpeculativeForMethodOverloading = true } let cxsln = AssumeMethodSolvesTrait csenv cx m (WithTrace newTrace) calledMeth - //let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) CanMemberSigsMatchUpToCheck csenv permitOptArgs @@ -3083,7 +3081,6 @@ and ResolveOverloading trackErrors { do! errors let cxsln = AssumeMethodSolvesTrait csenv cx m trace calledMeth - //let cxsln = cx |> Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m traitInfo.TraitContext calledMeth.Method calledMeth.CalledTyArgs)) match calledMethTrace with | NoTrace -> let! _usesTDC = diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index b814e7c9646..4ad5131c4d7 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2290,7 +2290,8 @@ let CheckEntityDefn cenv env (tycon: Entity) = let methodUniquenessIncludesReturnType (minfo: MethInfo) = minfo.LogicalName = "op_Explicit" || minfo.LogicalName = "op_Implicit" || - (AttributeChecking.MethInfoHasAttribute g m g.attrib_AllowOverloadByReturnTypeAttribute minfo) + (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions && + AttributeChecking.MethInfoHasAttribute g m g.attrib_AllowOverloadByReturnTypeAttribute minfo) let MethInfosEquivWrtUniqueness eraseFlag m minfo minfo2 = if methodUniquenessIncludesReturnType minfo then From 84a811585f70e62124a954744d3aeab151309c6f Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 16:48:53 +0100 Subject: [PATCH 76/82] update tests --- .gitignore | 3 +- src/Compiler/Checking/ConstraintSolver.fs | 58 +-- tests/fsharp/tests.fs | 50 +-- .../fsharp/typecheck/sigs/neg120.preview.bsl | 10 +- .../fsharp/typecheck/sigs/neg123.preview.bsl | 10 +- .../fsharp/typecheck/sigs/neg124.preview.bsl | 16 +- .../fsharp/typecheck/sigs/neg125.preview.bsl | 338 +++++++++--------- tests/fsharp/typecheck/sigs/neg126.fs | 4 +- .../fsharp/typecheck/sigs/neg127.preview.bsl | 338 +++++++++--------- tests/fsharp/typecheck/sigs/neg128.fs | 2 +- .../sigs/{neg129.4.7.bsl => neg129.6.0.bsl} | 0 tests/fsharp/typecheck/sigs/neg131.bsl | 258 +------------ tests/fsharp/typecheck/sigs/neg131.fs | 219 +----------- tests/fsharp/typecheck/sigs/neg132.bsl | 2 +- tests/fsharp/typecheck/sigs/neg132.fs | 34 +- .../fsharp/typecheck/sigs/neg132.preview.bsl | 6 + tests/fsharp/typecheck/sigs/neg140.bsl | 256 +++++++++++++ tests/fsharp/typecheck/sigs/neg140.fs | 214 +++++++++++ tests/fsharp/typecheck/sigs/neg141.bsl | 6 + tests/fsharp/typecheck/sigs/neg141.fs | 27 ++ tests/fsharp/typecheck/sigs/neg142.fs | 47 +++ ...{neg133.preview.bsl => neg142.preview.bsl} | 2 +- 22 files changed, 997 insertions(+), 903 deletions(-) rename tests/fsharp/typecheck/sigs/{neg129.4.7.bsl => neg129.6.0.bsl} (100%) create mode 100644 tests/fsharp/typecheck/sigs/neg132.preview.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg140.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg140.fs create mode 100644 tests/fsharp/typecheck/sigs/neg141.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg141.fs create mode 100644 tests/fsharp/typecheck/sigs/neg142.fs rename tests/fsharp/typecheck/sigs/{neg133.preview.bsl => neg142.preview.bsl} (81%) diff --git a/.gitignore b/.gitignore index 7bb9a91aed9..083ac72915f 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,8 @@ project.lock.json Backup/ tests/fsharp/core/array/dont.run.peverify tests/fsharp/core/innerpoly/dont.run.peverify -tests/fsharp/typecheck/sigs/neg94-pre.dll +tests/fsharp/typecheck/sigs/*.dll +tests/fsharp/typecheck/sigs/*.exe times /tests/fsharpqa/testenv/bin/System.ValueTuple.dll source_link.json diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index c35bc5d3c8b..20fbd88f6d6 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -381,32 +381,32 @@ let rec occursCheck g un ty = type PermitWeakResolution = /// Represents the point where we are generalizing inline code - | LegacyYesAtInlineGeneralization + | YesAtInlineGeneralization /// Represents points where we are choosing a default solution to trait constraints | YesAtChooseSolution /// Represents invocations of the constraint solver during codegen or inlining to determine witnesses - | LegacyYesAtCodeGen + | YesAtCodeGen /// No weak resolution allowed | No /// Determine if the weak resolution flag means we perform overload resolution /// based on weak information. - member x.PerformWeakOverloadResolution (g: TcGlobals) = + member x.Permit (g: TcGlobals) = if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then match x with | YesAtChooseSolution -> true - | LegacyYesAtCodeGen - | LegacyYesAtInlineGeneralization + | YesAtCodeGen + | YesAtInlineGeneralization | No -> false else //legacy match x with | YesAtChooseSolution - | LegacyYesAtCodeGen - | LegacyYesAtInlineGeneralization -> true + | YesAtCodeGen + | YesAtInlineGeneralization -> true | No -> false // Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> @@ -523,9 +523,9 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = // erasing units) typeEquivAux EraseMeasures g ty1 ty2 - // During regular canonicalization (weak resolution) we don't do any check on the other type at all - we + // During regular canonicalization we don't do any check on the other type at all - we // ignore the possibility that method overloads may resolve the constraint - | PermitWeakResolution.LegacyYesAtInlineGeneralization + | PermitWeakResolution.YesAtInlineGeneralization | PermitWeakResolution.YesAtChooseSolution -> // weak resolution lets the other type be a variable type isTyparTy g ty2 || @@ -535,7 +535,7 @@ let IsBinaryOpArgTypePair p1 p2 permitWeakResolution minfos g ty1 ty2 = typeEquivAux EraseMeasures g ty1 ty2 // During codegen we only apply a builtin resolution if both the types are correct - | PermitWeakResolution.LegacyYesAtCodeGen -> + | PermitWeakResolution.YesAtCodeGen -> p2 ty2 && // All built-in rules only apply in cases where left and right operator types are equal (after // erasing units) @@ -1862,7 +1862,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // If there's nothing left to learn then raise the errors. // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability // reasons we use the more restrictive isNil frees. - if (permitWeakResolution.PerformWeakOverloadResolution g && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + if (permitWeakResolution.Permit g && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors else do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees @@ -1870,7 +1870,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload match errors with | ErrorResult (_, UnresolvedOverloading _) when - not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) && + //not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) && not ignoreUnresolvedOverload && csenv.ErrorOnFailedMemberConstraintResolution && (not (nm = "op_Explicit" || nm = "op_Implicit")) -> @@ -1958,17 +1958,20 @@ and TransactMemberConstraintSolution traitInfo (trace: OptionalTrace) sln = trace.Exec (fun () -> traitInfo.Solution <- Some sln) (fun () -> traitInfo.Solution <- prev) and GetRelevantExtensionMethodsForTrait m (infoReader: InfoReader) (traitInfo: TraitConstraintInfo) = - match traitInfo.TraitContext with - | None -> [] - | Some traitCtxt -> - [ for extMethInfo in traitCtxt.SelectExtensionMethods(traitInfo, m, infoReader=infoReader) do - yield (extMethInfo :?> MethInfo) ] + [ + match traitInfo.TraitContext with + | None -> () + | Some traitCtxt -> + for extMethInfo in traitCtxt.SelectExtensionMethods(traitInfo, m, infoReader=infoReader) do + (extMethInfo :?> MethInfo) + ] /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argTys, retTy, soln, traitCtxt) as traitInfo): MethInfo list = + let g = csenv.g let results = - if permitWeakResolution.PerformWeakOverloadResolution csenv.g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then + if permitWeakResolution.Permit g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m let minfos = match memFlags.MemberKind with @@ -1983,14 +1986,14 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio // Get the extension method that may be relevant to solving the constraint as MethInfo objects. // Extension members are not used when canonicalizing prior to generalization (permitWeakResolution=true) - let extMInfos = + let extMethInfos = if MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then GetRelevantExtensionMethodsForTrait csenv.m csenv.InfoReader traitInfo else [] - let extMInfos = extMInfos |> ListSet.setify MethInfo.MethInfosUseIdenticalDefinitions + let extMethInfos = extMethInfos |> ListSet.setify MethInfo.MethInfosUseIdenticalDefinitions - let minfos = minfos @ extMInfos + let minfos = minfos @ extMethInfos /// Check that the available members aren't hiding a member from the parent (depth 1 only) let relevantMinfos = minfos |> List.filter(fun minfo -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) @@ -2065,8 +2068,9 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep (pe let csenv = { csenv with m = m2 } SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) -and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps isInline = - let permitWeakResolution = (if isInline then PermitWeakResolution.LegacyYesAtInlineGeneralization else PermitWeakResolution.YesAtChooseSolution) +and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps (isInline: bool) = + ignore isInline + let permitWeakResolution = (if isInline then PermitWeakResolution.YesAtInlineGeneralization else PermitWeakResolution.YesAtChooseSolution) SolveRelevantMemberConstraints csenv ndeep permitWeakResolution trace tps and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) traitInfo support (frees: Typar list) = @@ -3632,11 +3636,11 @@ let ApplyDefaultsForUnsolved css denv (unsolved: Typar list) = // The priority order comes from the order of declaration of the defaults in FSharp.Core. for priority = 10 downto 0 do - unsolved |> List.iter (fun tp -> + for tp in unsolved do if not tp.IsSolved then // Apply the first default. If we're defaulting one type variable to another then // the defaults will be propagated to the new type variable. - ApplyTyparDefaultAtPriority denv css priority tp) + ApplyTyparDefaultAtPriority denv css priority tp // OK, now apply defaults for any unsolved HeadTypeStaticReq for tp in unsolved do @@ -3669,7 +3673,7 @@ let CodegenWitnessExprForTraitConstraint tcVal g amap m (traitInfo:TraitConstrai let css = CreateCodegenState tcVal g amap let denv = DisplayEnv.Empty g let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.YesAtCodeGen 0 m NoTrace traitInfo let sln = GenWitnessExpr amap g m traitInfo argExprs ApplyDefaultsAfterWitnessGeneration g amap css denv sln return sln @@ -3700,7 +3704,7 @@ let CodegenWitnessArgForTraitConstraint tcVal g amap m traitInfo = trackErrors { let css = CreateCodegenState tcVal g amap let denv = DisplayEnv.Empty g let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.LegacyYesAtCodeGen 0 m NoTrace traitInfo + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.YesAtCodeGen 0 m NoTrace traitInfo let witnessLambda = MethodCalls.GenWitnessExprLambda amap g m traitInfo match witnessLambda with | Choice1Of2 _traitInfo -> () diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index a167fdd3569..2998680ed6a 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3328,7 +3328,7 @@ module TypecheckTests = singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg126" [] - let ``type check neg126 preview`` () = + let ``type check neg126 preview positive`` () = let cfg = testConfig "typecheck/sigs" fsc cfg "%s --target:library -o:neg126-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg126.fs"] peverify cfg "neg126-preview.dll" @@ -3351,18 +3351,18 @@ module TypecheckTests = singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg128" [] - let ``type check neg128 preview`` () = + let ``type check neg128 preview positive`` () = let cfg = testConfig "typecheck/sigs" fsc cfg "%s --target:library -o:neg128-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg128.fs"] peverify cfg "neg128-preview.dll" // The code in this test starts to compile once FS-1043 is enabled. [] - let ``type check neg129 4_7`` () = - singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg129" + let ``type check neg129 6_0`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg129" [] - let ``type check neg129 preview`` () = + let ``type check neg129 preview positive`` () = let cfg = testConfig "typecheck/sigs" fsc cfg "%s --target:library -o:neg129-preview.dll --langversion:preview --warnaserror" cfg.fsc_flags ["neg129.fs"] peverify cfg "neg129-preview.dll" @@ -3370,26 +3370,35 @@ module TypecheckTests = [] let ``type check neg130`` () = singleNegTest (testConfig "typecheck/sigs") "neg130" + [] + let ``type check neg131`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg131" + + [] + let ``type check neg132`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "5.0" "neg132" + + [] + let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" + [] - let ``type check neg131b 4_7`` () = - singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg131b" + let ``type check neg140 4_7`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "4.7" "neg140" [] - let ``type check neg131b preview`` () = - singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg131b" + let ``type check neg140 preview`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg140" [] // This code must pass compilation with /langversion:4.7 on because RFC FS-1043 is not supported - let ``type check neg132b 4_7`` () = + let ``type check neg141 4_7`` () = let cfg = testConfig "typecheck/sigs" - fsc cfg "%s -o:neg132b-4.7.exe --langversion:4.7 --warnaserror" cfg.fsc_flags ["neg132b.fs"] - peverify cfg "neg132b-4.7.exe" - exec cfg ("." ++ "neg132b-4.7.exe") "" + fsc cfg "%s -o:neg141-4.7.exe --langversion:4.7 --warnaserror" cfg.fsc_flags ["neg141.fs"] + peverify cfg "neg141-4.7.exe" + exec cfg ("." ++ "neg141-4.7.exe") "" [] // This code must not pass compilation with /langversion:preview on because RFC FS-1043 is supported - let ``type check neg132b preview`` () = - singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg132b" + let ``type check neg141 preview`` () = + singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg141" // The code in the neg133 test does not compile (in any language version). // However it raises an internal error without RFC-1043 and so we don't @@ -3399,16 +3408,7 @@ module TypecheckTests = //let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" [] - let ``type check neg133 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg133" - - [] - let ``type check neg131`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg131" - - [] - let ``type check neg132`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "5.0" "neg132" - - [] - let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" + let ``type check neg142 preview`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "preview" "neg142" [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg120.preview.bsl b/tests/fsharp/typecheck/sigs/neg120.preview.bsl index 315d92239b0..e0b1aebc7b2 100644 --- a/tests/fsharp/typecheck/sigs/neg120.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.preview.bsl @@ -6,8 +6,8 @@ Known return type: obj Known type parameters: < Id , (int -> obj) > Available overloads: - - static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match - - static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match - - static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints + - static member Bind.(>>=) : source: 'T option * f: ('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.(>>=) : source: Async<'T> * f: ('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match + - static member Bind.(>>=) : source: Id<'T> * f: ('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.(>>=) : source: Lazy<'T> * f: ('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.(>>=) : source: Task<'T> * f: ('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg123.preview.bsl b/tests/fsharp/typecheck/sigs/neg123.preview.bsl index 440a1f74fa0..a944f087500 100644 --- a/tests/fsharp/typecheck/sigs/neg123.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg123.preview.bsl @@ -1,10 +1,2 @@ -neg123.fs(19,49,19,51): typecheck error FS0001: No overloads match for method 'pass'. - -Known type parameter: < (unit -> unit) > - -Available overloads: - - static member Switcher.pass : (int -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match - - static member Switcher.pass : (string -> ^r) -> unit when (Switcher or ^r) : (static member pass : ^r -> unit) // Argument at index 1 doesn't match - - static member Switcher.pass : int -> unit // Argument at index 1 doesn't match - - static member Switcher.pass : unit -> unit // Argument at index 1 doesn't match +neg123.fs(19,18,19,27): typecheck error FS0003: This value is not a function and cannot be applied. diff --git a/tests/fsharp/typecheck/sigs/neg124.preview.bsl b/tests/fsharp/typecheck/sigs/neg124.preview.bsl index 356440c6eff..5b13ecc8bd6 100644 --- a/tests/fsharp/typecheck/sigs/neg124.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg124.preview.bsl @@ -6,11 +6,11 @@ Known return type: uint8 Known type parameter: < obj > Available overloads: - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32 // Argument 'x' doesn't match - - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64 // Argument 'x' doesn't match Consider adding further type constraints + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: byte -> byte // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: int16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: int32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: int64 -> uint64 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: sbyte -> uint8 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: uint16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: uint32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness: x: uint64 -> uint64 // Argument 'x' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg125.preview.bsl b/tests/fsharp/typecheck/sigs/neg125.preview.bsl index 5c26683981b..17a6052b4e5 100644 --- a/tests/fsharp/typecheck/sigs/neg125.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg125.preview.bsl @@ -6,19 +6,19 @@ Known return type: int32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -27,19 +27,19 @@ Known return type: int64 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -48,19 +48,19 @@ Known return type: bigint Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -69,19 +69,19 @@ Known return type: float Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -90,19 +90,19 @@ Known return type: sbyte Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -111,19 +111,19 @@ Known return type: int16 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -132,19 +132,19 @@ Known return type: byte Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -153,19 +153,19 @@ Known return type: uint16 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -174,19 +174,19 @@ Known return type: uint32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -195,19 +195,19 @@ Known return type: uint64 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -216,19 +216,19 @@ Known return type: float32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -237,19 +237,19 @@ Known return type: decimal Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -258,16 +258,16 @@ Known return type: Complex Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg126.fs b/tests/fsharp/typecheck/sigs/neg126.fs index 232a35bb9c1..a5c0ed20238 100644 --- a/tests/fsharp/typecheck/sigs/neg126.fs +++ b/tests/fsharp/typecheck/sigs/neg126.fs @@ -17,8 +17,8 @@ module Neg126 // // That is, the code is not generic at all, because the F# compiler thinks that it commit to the one and only witness. // -// This test exists to pin down that we get a warning produced saying ^a has been instantiated to "sbyte" - +// For pre-FS0143 this test exists to pin down that we get a warning produced saying ^a has been instantiated to "sbyte" +// For post-FS0143 this test exists to check that the code now compiles module Negative_SelectOverloadedWitnessBasedOnInputTypeOneWitness = type witnesses = static member inline foo_witness (x : sbyte) : byte = byte x diff --git a/tests/fsharp/typecheck/sigs/neg127.preview.bsl b/tests/fsharp/typecheck/sigs/neg127.preview.bsl index 39c91a61d5b..76b3c8e353f 100644 --- a/tests/fsharp/typecheck/sigs/neg127.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg127.preview.bsl @@ -6,19 +6,19 @@ Known return type: int32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -27,19 +27,19 @@ Known return type: int64 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -48,19 +48,19 @@ Known return type: bigint Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -69,19 +69,19 @@ Known return type: float Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -90,19 +90,19 @@ Known return type: sbyte Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -111,19 +111,19 @@ Known return type: int16 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -132,19 +132,19 @@ Known return type: byte Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -153,19 +153,19 @@ Known return type: uint16 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -174,19 +174,19 @@ Known return type: uint32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -195,19 +195,19 @@ Known return type: uint64 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -216,19 +216,19 @@ Known return type: float32 Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -237,19 +237,19 @@ Known return type: decimal Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. @@ -258,16 +258,16 @@ Known return type: Complex Known type parameter: < BigInteger > Candidates: - - static member witnesses.convert_witness : x:bigint -> Complex - - static member witnesses.convert_witness : x:bigint -> bigint - - static member witnesses.convert_witness : x:bigint -> byte - - static member witnesses.convert_witness : x:bigint -> decimal - - static member witnesses.convert_witness : x:bigint -> float - - static member witnesses.convert_witness : x:bigint -> float32 - - static member witnesses.convert_witness : x:bigint -> int - - static member witnesses.convert_witness : x:bigint -> int16 - - static member witnesses.convert_witness : x:bigint -> int64 - - static member witnesses.convert_witness : x:bigint -> sbyte - - static member witnesses.convert_witness : x:bigint -> uint16 - - static member witnesses.convert_witness : x:bigint -> uint32 - - static member witnesses.convert_witness : x:bigint -> uint64 + - static member witnesses.convert_witness: x: bigint -> Complex + - static member witnesses.convert_witness: x: bigint -> bigint + - static member witnesses.convert_witness: x: bigint -> byte + - static member witnesses.convert_witness: x: bigint -> decimal + - static member witnesses.convert_witness: x: bigint -> float + - static member witnesses.convert_witness: x: bigint -> float32 + - static member witnesses.convert_witness: x: bigint -> int + - static member witnesses.convert_witness: x: bigint -> int16 + - static member witnesses.convert_witness: x: bigint -> int64 + - static member witnesses.convert_witness: x: bigint -> sbyte + - static member witnesses.convert_witness: x: bigint -> uint16 + - static member witnesses.convert_witness: x: bigint -> uint32 + - static member witnesses.convert_witness: x: bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg128.fs b/tests/fsharp/typecheck/sigs/neg128.fs index b936ee254b6..ecc625dd56b 100644 --- a/tests/fsharp/typecheck/sigs/neg128.fs +++ b/tests/fsharp/typecheck/sigs/neg128.fs @@ -32,5 +32,5 @@ module Negative_SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentGe let v1 : int32 = convert 777I let v2 : int64 = convert 777I - // This gives an error, because solving kicks in once all selector types are known + // Pre-FS1043 this gives an error, because solving kicks in once all selector types are known. Post-FS1043 it should compile let inline inst (num: bigint) : 'output = convert num diff --git a/tests/fsharp/typecheck/sigs/neg129.4.7.bsl b/tests/fsharp/typecheck/sigs/neg129.6.0.bsl similarity index 100% rename from tests/fsharp/typecheck/sigs/neg129.4.7.bsl rename to tests/fsharp/typecheck/sigs/neg129.6.0.bsl diff --git a/tests/fsharp/typecheck/sigs/neg131.bsl b/tests/fsharp/typecheck/sigs/neg131.bsl index afea02dfd55..7015901cf41 100644 --- a/tests/fsharp/typecheck/sigs/neg131.bsl +++ b/tests/fsharp/typecheck/sigs/neg131.bsl @@ -1,256 +1,8 @@ -neg131.fs(143,23,143,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' +neg131.fs(15,9,15,55): typecheck error FS0041: A unique overload for method 'SomeMethod' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg131.fs(143,27,143,29): typecheck error FS0039: The value or constructor 'P1' is not defined. +Known types of arguments: 'a * ('b -> int) -neg131.fs(144,22,144,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(144,25,144,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(145,22,145,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(145,25,145,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(146,22,146,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(146,25,146,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(147,22,147,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(147,25,147,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(148,22,148,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(148,25,148,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(149,22,149,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(149,25,149,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(150,22,150,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(150,25,150,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(151,22,151,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(151,25,151,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(152,22,152,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(152,25,152,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(153,22,153,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(153,25,153,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(154,22,154,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(154,25,154,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(155,22,155,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(155,25,155,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(156,22,156,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(156,25,156,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(157,22,157,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(157,25,157,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(158,22,158,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(158,25,158,27): typecheck error FS0039: The value or constructor 'P1' is not defined. - -neg131.fs(160,22,160,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(160,25,160,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(161,22,161,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(161,25,161,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(162,22,162,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(162,25,162,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(163,22,163,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(163,25,163,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(164,22,164,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(164,25,164,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(165,22,165,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(165,25,165,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(166,22,166,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(166,25,166,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(167,22,167,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(167,25,167,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(168,22,168,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(168,25,168,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(169,22,169,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(169,25,169,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(170,22,170,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(170,25,170,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(171,22,171,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(171,25,171,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(172,22,172,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(172,25,172,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(173,22,173,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(173,25,173,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(174,22,174,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(174,25,174,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(175,22,175,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(175,25,175,27): typecheck error FS0039: The value or constructor 'P2' is not defined. - -neg131.fs(177,22,177,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(177,25,177,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(178,22,178,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(178,25,178,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(179,22,179,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(179,25,179,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(180,22,180,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(180,25,180,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(181,22,181,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(181,25,181,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(182,22,182,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(182,25,182,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(183,22,183,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(183,25,183,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(184,22,184,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(184,25,184,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(185,22,185,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(185,25,185,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(186,22,186,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(186,25,186,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(187,22,187,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(187,25,187,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(188,22,188,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(188,25,188,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(189,22,189,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(189,25,189,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(190,22,190,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(190,25,190,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(191,22,191,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(191,25,191,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(192,22,192,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(192,25,192,27): typecheck error FS0039: The value or constructor 'P3' is not defined. - -neg131.fs(194,22,194,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(194,25,194,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(195,22,195,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(195,25,195,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(196,22,196,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(196,25,196,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(197,22,197,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(197,25,197,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(198,22,198,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(198,25,198,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(199,22,199,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(199,25,199,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(200,22,200,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(200,25,200,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(201,22,201,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(201,25,201,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(202,22,202,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(202,25,202,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(203,22,203,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(203,25,203,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(204,22,204,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(204,25,204,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(205,22,205,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(205,25,205,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(206,22,206,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(206,25,206,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(207,22,207,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(207,25,207,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(208,22,208,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(208,25,208,27): typecheck error FS0039: The value or constructor 'P4' is not defined. - -neg131.fs(209,22,209,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' - -neg131.fs(209,25,209,27): typecheck error FS0039: The value or constructor 'P4' is not defined. +Candidates: + - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: ( ^T -> int) -> int when ^T: (member get_Length: ^T -> int) + - static member OverloadsWithSrtp.SomeMethod: x: 'T list * f: ('T list -> int) -> int diff --git a/tests/fsharp/typecheck/sigs/neg131.fs b/tests/fsharp/typecheck/sigs/neg131.fs index 9366d707a91..e1db0ef2f82 100644 --- a/tests/fsharp/typecheck/sigs/neg131.fs +++ b/tests/fsharp/typecheck/sigs/neg131.fs @@ -1,214 +1,15 @@ module Neg131 -module SmartHashUtils = - let ByteToUInt (array:byte[]) offset length endian = +open System +open FSharp.Core.CompilerServices +module TestOverloadsWithSrtpThatDontResolve1 = - let temp:uint32[] = Array.create (length / 4) (uint32 0) - let ff = uint32 0xff + type OverloadsWithSrtp() = + [] + static member inline SomeMethod< ^T when ^T : (member Length: int) > (x: ^T, f: ^T -> int) = 1 + static member SomeMethod(x: 'T list, f: 'T list -> int) = 2 - match endian with - | 0 -> - let funn i n = - (uint32 array.[offset + i*4] &&& ff) ||| - ((uint32 array.[offset + i*4+1] &&& ff) <<< 8) ||| - ((uint32 array.[offset + i*4+2] &&& ff) <<< 16) ||| - ((uint32 array.[offset + i*4+3] &&& ff) <<< 24) - Array.mapi funn temp - | _ -> - let funn i n = - ((uint32 array.[offset + i*4] &&& ff) <<< 24) ||| - ((uint32 array.[offset + i*4+1] &&& ff) <<< 16) ||| - ((uint32 array.[offset + i*4+2] &&& ff) <<< 8) ||| - (uint32 array.[offset + i*4+3] &&& ff) - Array.mapi funn temp + // 'x' doesn't contain any type information so the overload doesn't resolve. - - let UIntToByte (array:uint32[]) offset length endian = - let temp:byte[] = Array.create (length * 4) (byte 0) - - match endian with - | 0 -> - let funn i n = byte (array.[offset + i/4] >>> (i%4 * 8)) - Array.mapi funn temp - | _ -> - let funn i n = byte (array.[offset + i/4] >>> ((3 - i%4) * 8)) - Array.mapi funn temp - - - let ULongToByte (array:uint64[]) offset length endian = - let temp:byte[] = Array.create (length * 8) (byte 0) - - match endian with - | 0 -> - let funn i n = byte (array.[offset + i/8] >>> (i%8 * 8)) - Array.mapi funn temp - | _ -> - let funn i n = byte (array.[offset + i/8] >>> ((7 - i%8) * 8)) - Array.mapi funn temp - - - let LS (x:uint32) n = uint32 ((x <<< n) ||| (x >>> (32 - n))) - let RS (x:uint32) n = uint32 ((x >>> n) ||| (x <<< (32 - n))) - -module SmartHashBlock = - open System.Security.Cryptography - - [] - type BlockHashAlgorithm() = - inherit HashAlgorithm() - ///The size in bytes of an individual block. - let mutable blockSize = 1 - ///The length of bytes, that have been processed. - ///This number includes the number of bytes currently waiting in the buffer. - let mutable count:uint64 = uint64 0 - ///Buffer for storing leftover bytes that are waiting to be processed. - let mutable buffer = Array.zeroCreate blockSize - ///The number of bytes currently in the Buffer waiting to be processed. - let mutable bufferCount = 0 - - member b.BlockSize with get() = blockSize and set(v) = blockSize <- v - member b.BufferCount with get() = bufferCount and set(v) = bufferCount <- v - member b.Count with get() = count and set(v) = count <- v - - default x.Initialize() = - count <- uint64 0 - bufferCount <- 0 - buffer <- Array.zeroCreate blockSize - - default x.HashCore(array, ibStart, cbSize) = - //let engineUpdate input offset' length' = - let mutable offset = ibStart - let mutable length = cbSize - count <- count + (uint64 length) - - if ((bufferCount > 0) && ((bufferCount + length) >= blockSize)) then - let off = blockSize - bufferCount - Array.blit array offset buffer bufferCount off - offset <- offset + off - length <- length - off - bufferCount <- 0 - x.BlockTransform (buffer, 0) - - let numBlocks = length / blockSize - for i in 0..(numBlocks-1) do - x.BlockTransform (array, (offset + i * blockSize)) - - let bytesLeft = length % blockSize - - if (bytesLeft <> 0) then - Array.blit array (offset + (length - bytesLeft)) buffer bufferCount bytesLeft - bufferCount <- bufferCount + bytesLeft - - abstract BlockTransform: (byte[] * int) -> unit - - member x.CreatePadding(minSize, append) = - let mutable paddingSize = x.BlockSize - ((int x.Count) % x.BlockSize) - - if (paddingSize < minSize) then paddingSize <- paddingSize + x.BlockSize - - let Padding = Array.create paddingSize (byte 0) - Padding.[0] <- append - Padding - -module SmartHashMD5 = - open SmartHashUtils - open SmartHashBlock - - - type MD5() as this = - inherit BlockHashAlgorithm() - ///The size in bytes of an individual block. - let mutable state:int32[] = null - - do this.BlockSize <- 64 - do this.HashSizeValue <- 128 - do state <- Array.zeroCreate 4 - do this.Initialize() - - override x.Initialize() = - base.Initialize() - state.[0] <- 0x67452301 - state.[1] <- 0xEFCDAB89 - state.[2] <- 0x98BADCFE - state.[3] <- 0x10325476 - - member x.BlockTransform(data, iOffset) = - let mutable A = state.[0] - let mutable B = state.[3] - let mutable C = state.[2] - let mutable D = state.[1] - - let X = ByteToUInt data iOffset 64 0 - - A <- D + LS (P1 D C B + A + X.[0] + uint32 0xD76AA478) 7 - B <- A + LS(P1 A D C + B + X.[1] + uint32 0xE8C7B756) 12 - C <- B + LS(P1 B A D + C + X.[2] + uint32 0x242070DB) 17 - D <- C + LS(P1 C B A + D + X.[3] + uint32 0xC1BDCEEE) 22 - A <- D + LS(P1 D C B + A + X.[4] + uint32 0xF57C0FAF) 7 - B <- A + LS(P1 A D C + B + X.[5] + uint32 0x4787C62A) 12 - C <- B + LS(P1 B A D + C + X.[6] + uint32 0xA8304613) 17 - D <- C + LS(P1 C B A + D + X.[7] + uint32 0xFD469501) 22 - A <- D + LS(P1 D C B + A + X.[8] + uint32 0x698098D8) 7 - B <- A + LS(P1 A D C + B + X.[9] + uint32 0x8B44F7AF) 12 - C <- B + LS(P1 B A D + C + X.[10] + uint32 0xFFFF5BB1) 17 - D <- C + LS(P1 C B A + D + X.[11] + uint32 0x895CD7BE) 22 - A <- D + LS(P1 D C B + A + X.[12] + uint32 0x6B901122) 7 - B <- A + LS(P1 A D C + B + X.[13] + uint32 0xFD987193) 12 - C <- B + LS(P1 B A D + C + X.[14] + uint32 0xA679438E) 17 - D <- C + LS(P1 C B A + D + X.[15] + uint32 0x49B40821) 22 - - A <- D + LS(P2 D C B + A + X.[1] + uint32 0xF61E2562) 5 - B <- A + LS(P2 A D C + B + X.[6] + uint32 0xC040B340) 9 - C <- B + LS(P2 B A D + C + X.[11] + uint32 0x265E5A51) 14 - D <- C + LS(P2 C B A + D + X.[0] + uint32 0xE9B6C7AA) 20 - A <- D + LS(P2 D C B + A + X.[5] + uint32 0xD62F105D) 5 - B <- A + LS(P2 A D C + B + X.[10] + uint32 0x02441453) 9 - C <- B + LS(P2 B A D + C + X.[15] + uint32 0xD8A1E681) 14 - D <- C + LS(P2 C B A + D + X.[4] + uint32 0xE7D3FBC8) 20 - A <- D + LS(P2 D C B + A + X.[9] + uint32 0x21E1CDE6) 5 - B <- A + LS(P2 A D C + B + X.[14] + uint32 0xC33707D6) 9 - C <- B + LS(P2 B A D + C + X.[3] + uint32 0xF4D50D87) 14 - D <- C + LS(P2 C B A + D + X.[8] + uint32 0x455A14ED) 20 - A <- D + LS(P2 D C B + A + X.[13] + uint32 0xA9E3E905) 5 - B <- A + LS(P2 A D C + B + X.[2] + uint32 0xFCEFA3F8) 9 - C <- B + LS(P2 B A D + C + X.[7] + uint32 0x676F02D9) 14 - D <- C + LS(P2 C B A + D + X.[12] + uint32 0x8D2A4C8A) 20 - - A <- D + LS(P3 D C B + A + X.[5] + uint32 0xFFFA3942) 4 - B <- A + LS(P3 A D C + B + X.[8] + uint32 0x8771F681) 11 - C <- B + LS(P3 B A D + C + X.[11] + uint32 0x6D9D6122) 16 - D <- C + LS(P3 C B A + D + X.[14] + uint32 0xFDE5380C) 23 - A <- D + LS(P3 D C B + A + X.[1] + uint32 0xA4BEEA44) 4 - B <- A + LS(P3 A D C + B + X.[4] + uint32 0x4BDECFA9) 11 - C <- B + LS(P3 B A D + C + X.[7] + uint32 0xF6BB4B60) 16 - D <- C + LS(P3 C B A + D + X.[10] + uint32 0xBEBFBC70) 23 - A <- D + LS(P3 D C B + A + X.[13] + uint32 0x289B7EC6) 4 - B <- A + LS(P3 A D C + B + X.[0] + uint32 0xEAA127FA) 11 - C <- B + LS(P3 B A D + C + X.[3] + uint32 0xD4EF3085) 16 - D <- C + LS(P3 C B A + D + X.[6] + uint32 0x04881D05) 23 - A <- D + LS(P3 D C B + A + X.[9] + uint32 0xD9D4D039) 4 - B <- A + LS(P3 A D C + B + X.[12] + uint32 0xE6DB99E5) 11 - C <- B + LS(P3 B A D + C + X.[15] + uint32 0x1FA27CF8) 16 - D <- C + LS(P3 C B A + D + X.[2] + uint32 0xC4AC5665) 23 - - A <- D + LS(P4 D C B + A + X.[0] + uint32 0xF4292244) 6 - B <- A + LS(P4 A D C + B + X.[7] + uint32 0x432AFF97) 10 - C <- B + LS(P4 B A D + C + X.[14] + uint32 0xAB9423A7) 15 - D <- C + LS(P4 C B A + D + X.[5] + uint32 0xFC93A039) 21 - A <- D + LS(P4 D C B + A + X.[12] + uint32 0x655B59C3) 6 - B <- A + LS(P4 A D C + B + X.[3] + uint32 0x8F0CCC92) 10 - C <- B + LS(P4 B A D + C + X.[10] + uint32 0xFFEFF47D) 15 - D <- C + LS(P4 C B A + D + X.[1] + uint32 0x85845DD1) 21 - A <- D + LS(P4 D C B + A + X.[8] + uint32 0x6FA87E4F) 6 - B <- A + LS(P4 A D C + B + X.[15] + uint32 0xFE2CE6E0) 10 - C <- B + LS(P4 B A D + C + X.[6] + uint32 0xA3014314) 15 - D <- C + LS(P4 C B A + D + X.[13] + uint32 0x4E0811A1) 21 - A <- D + LS(P4 D C B + A + X.[4] + uint32 0xF7537E82) 6 - B <- A + LS(P4 A D C + B + X.[11] + uint32 0xBD3AF235) 10 - C <- B + LS(P4 B A D + C + X.[2] + uint32 0x2AD7D2BB) 15 - D <- C + LS(P4 C B A + D + X.[9] + uint32 0xEB86D391) 21 - - state.[0] <- state.[0] + A - state.[3] <- state.[3] + B - state.[2] <- state.[2] + C - state.[1] <- state.[1] + D + let inline f x = + OverloadsWithSrtp.SomeMethod (x, (fun a -> 1)) diff --git a/tests/fsharp/typecheck/sigs/neg132.bsl b/tests/fsharp/typecheck/sigs/neg132.bsl index ed2b768854a..a8af8c90b45 100644 --- a/tests/fsharp/typecheck/sigs/neg132.bsl +++ b/tests/fsharp/typecheck/sigs/neg132.bsl @@ -7,4 +7,4 @@ Known types of arguments: 'a * ('b -> int) Candidates: - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: ( ^T -> int) -> int when ^T: (member get_Length: ^T -> int) - - static member OverloadsWithSrtp.SomeMethod: x: 'T list * f: ('T list -> int) -> int + - static member OverloadsWithSrtp.SomeMethod: x: 'T list * f: ('T list -> int) -> int \ No newline at end of file diff --git a/tests/fsharp/typecheck/sigs/neg132.fs b/tests/fsharp/typecheck/sigs/neg132.fs index 719b4d02a41..393130266f5 100644 --- a/tests/fsharp/typecheck/sigs/neg132.fs +++ b/tests/fsharp/typecheck/sigs/neg132.fs @@ -1,27 +1,15 @@ +module Neg132 -module Neg132 +open System +open FSharp.Core.CompilerServices +module TestOverloadsWithSrtpThatDontResolve1 = -// This code starts failing to compile once RFC-1043 is enabled -// -// This is because the constraint relies on return types in the set of support types. -// -// This leaves unexpected ambiguity in common code especially when the shape of internal collections is potentially -// ambiguous internally in function implementations. -// -// Prior to RFC-1043 this ambiguity was resolved by applying weak resolution eagerly. + type OverloadsWithSrtp() = + [] + static member inline SomeMethod< ^T when ^T : (member Length: int) > (x: ^T, f: ^T -> int) = 1 + static member SomeMethod(x: 'T list, f: 'T list -> int) = 2 -// See https://github.com/fsharp/fslang-design/issues/435#issuecomment-584192749 -let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = - ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + // this will give a "requires version 6.0 or greater" error -// A simulated collection with a'Map' witness -type Coll<'T>(x: 'T) = - member _.X = x - static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>(mapping source.X) - -// What's the return collection type of the inner `InvokeMap` call? We only know once we apply weak resolution. -let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = - InvokeMap ((+) v) (InvokeMap ((+) v) x) - -let v1 = AddTwice (Coll(3)) 2 -let v2 = AddTwice (Coll(3uy)) 2uy + let inline f x = + OverloadsWithSrtp.SomeMethod (x, (fun a -> 1)) diff --git a/tests/fsharp/typecheck/sigs/neg132.preview.bsl b/tests/fsharp/typecheck/sigs/neg132.preview.bsl new file mode 100644 index 00000000000..6a87ecd0eef --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg132.preview.bsl @@ -0,0 +1,6 @@ + +neg132.fs(24,24,24,33): typecheck error FS0043: Type constraint mismatch. The type + ''d -> 'e' +is not compatible with type + ''a -> 'f' + diff --git a/tests/fsharp/typecheck/sigs/neg140.bsl b/tests/fsharp/typecheck/sigs/neg140.bsl new file mode 100644 index 00000000000..a148a4ec77b --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg140.bsl @@ -0,0 +1,256 @@ + +neg140.fs(143,23,143,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(143,27,143,29): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(144,22,144,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(144,25,144,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(145,22,145,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(145,25,145,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(146,22,146,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(146,25,146,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(147,22,147,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(147,25,147,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(148,22,148,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(148,25,148,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(149,22,149,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(149,25,149,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(150,22,150,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(150,25,150,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(151,22,151,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(151,25,151,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(152,22,152,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(152,25,152,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(153,22,153,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(153,25,153,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(154,22,154,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(154,25,154,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(155,22,155,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(155,25,155,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(156,22,156,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(156,25,156,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(157,22,157,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(157,25,157,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(158,22,158,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(158,25,158,27): typecheck error FS0039: The value or constructor 'P1' is not defined. + +neg140.fs(160,22,160,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(160,25,160,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(161,22,161,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(161,25,161,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(162,22,162,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(162,25,162,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(163,22,163,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(163,25,163,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(164,22,164,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(164,25,164,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(165,22,165,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(165,25,165,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(166,22,166,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(166,25,166,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(167,22,167,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(167,25,167,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(168,22,168,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(168,25,168,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(169,22,169,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(169,25,169,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(170,22,170,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(170,25,170,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(171,22,171,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(171,25,171,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(172,22,172,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(172,25,172,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(173,22,173,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(173,25,173,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(174,22,174,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(174,25,174,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(175,22,175,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(175,25,175,27): typecheck error FS0039: The value or constructor 'P2' is not defined. + +neg140.fs(177,22,177,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(177,25,177,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(178,22,178,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(178,25,178,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(179,22,179,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(179,25,179,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(180,22,180,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(180,25,180,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(181,22,181,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(181,25,181,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(182,22,182,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(182,25,182,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(183,22,183,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(183,25,183,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(184,22,184,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(184,25,184,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(185,22,185,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(185,25,185,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(186,22,186,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(186,25,186,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(187,22,187,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(187,25,187,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(188,22,188,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(188,25,188,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(189,22,189,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(189,25,189,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(190,22,190,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(190,25,190,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(191,22,191,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(191,25,191,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(192,22,192,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(192,25,192,27): typecheck error FS0039: The value or constructor 'P3' is not defined. + +neg140.fs(194,22,194,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(194,25,194,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(195,22,195,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(195,25,195,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(196,22,196,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(196,25,196,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(197,22,197,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(197,25,197,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(198,22,198,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(198,25,198,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(199,22,199,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(199,25,199,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(200,22,200,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(200,25,200,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(201,22,201,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(201,25,201,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(202,22,202,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(202,25,202,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(203,22,203,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(203,25,203,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(204,22,204,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(204,25,204,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(205,22,205,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(205,25,205,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(206,22,206,68): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(206,25,206,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(207,22,207,70): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(207,25,207,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(208,22,208,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(208,25,208,27): typecheck error FS0039: The value or constructor 'P4' is not defined. + +neg140.fs(209,22,209,69): typecheck error FS0001: The types 'int32, uint32' do not support the operator '+' + +neg140.fs(209,25,209,27): typecheck error FS0039: The value or constructor 'P4' is not defined. diff --git a/tests/fsharp/typecheck/sigs/neg140.fs b/tests/fsharp/typecheck/sigs/neg140.fs new file mode 100644 index 00000000000..5a5894ea72e --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg140.fs @@ -0,0 +1,214 @@ +module Neg140 + +module SmartHashUtils = + let ByteToUInt (array:byte[]) offset length endian = + + let temp:uint32[] = Array.create (length / 4) (uint32 0) + let ff = uint32 0xff + + match endian with + | 0 -> + let funn i n = + (uint32 array.[offset + i*4] &&& ff) ||| + ((uint32 array.[offset + i*4+1] &&& ff) <<< 8) ||| + ((uint32 array.[offset + i*4+2] &&& ff) <<< 16) ||| + ((uint32 array.[offset + i*4+3] &&& ff) <<< 24) + Array.mapi funn temp + | _ -> + let funn i n = + ((uint32 array.[offset + i*4] &&& ff) <<< 24) ||| + ((uint32 array.[offset + i*4+1] &&& ff) <<< 16) ||| + ((uint32 array.[offset + i*4+2] &&& ff) <<< 8) ||| + (uint32 array.[offset + i*4+3] &&& ff) + Array.mapi funn temp + + + let UIntToByte (array:uint32[]) offset length endian = + let temp:byte[] = Array.create (length * 4) (byte 0) + + match endian with + | 0 -> + let funn i n = byte (array.[offset + i/4] >>> (i%4 * 8)) + Array.mapi funn temp + | _ -> + let funn i n = byte (array.[offset + i/4] >>> ((3 - i%4) * 8)) + Array.mapi funn temp + + + let ULongToByte (array:uint64[]) offset length endian = + let temp:byte[] = Array.create (length * 8) (byte 0) + + match endian with + | 0 -> + let funn i n = byte (array.[offset + i/8] >>> (i%8 * 8)) + Array.mapi funn temp + | _ -> + let funn i n = byte (array.[offset + i/8] >>> ((7 - i%8) * 8)) + Array.mapi funn temp + + + let LS (x:uint32) n = uint32 ((x <<< n) ||| (x >>> (32 - n))) + let RS (x:uint32) n = uint32 ((x >>> n) ||| (x <<< (32 - n))) + +module SmartHashBlock = + open System.Security.Cryptography + + [] + type BlockHashAlgorithm() = + inherit HashAlgorithm() + ///The size in bytes of an individual block. + let mutable blockSize = 1 + ///The length of bytes, that have been processed. + ///This number includes the number of bytes currently waiting in the buffer. + let mutable count:uint64 = uint64 0 + ///Buffer for storing leftover bytes that are waiting to be processed. + let mutable buffer = Array.zeroCreate blockSize + ///The number of bytes currently in the Buffer waiting to be processed. + let mutable bufferCount = 0 + + member b.BlockSize with get() = blockSize and set(v) = blockSize <- v + member b.BufferCount with get() = bufferCount and set(v) = bufferCount <- v + member b.Count with get() = count and set(v) = count <- v + + default x.Initialize() = + count <- uint64 0 + bufferCount <- 0 + buffer <- Array.zeroCreate blockSize + + default x.HashCore(array, ibStart, cbSize) = + //let engineUpdate input offset' length' = + let mutable offset = ibStart + let mutable length = cbSize + count <- count + (uint64 length) + + if ((bufferCount > 0) && ((bufferCount + length) >= blockSize)) then + let off = blockSize - bufferCount + Array.blit array offset buffer bufferCount off + offset <- offset + off + length <- length - off + bufferCount <- 0 + x.BlockTransform (buffer, 0) + + let numBlocks = length / blockSize + for i in 0..(numBlocks-1) do + x.BlockTransform (array, (offset + i * blockSize)) + + let bytesLeft = length % blockSize + + if (bytesLeft <> 0) then + Array.blit array (offset + (length - bytesLeft)) buffer bufferCount bytesLeft + bufferCount <- bufferCount + bytesLeft + + abstract BlockTransform: (byte[] * int) -> unit + + member x.CreatePadding(minSize, append) = + let mutable paddingSize = x.BlockSize - ((int x.Count) % x.BlockSize) + + if (paddingSize < minSize) then paddingSize <- paddingSize + x.BlockSize + + let Padding = Array.create paddingSize (byte 0) + Padding.[0] <- append + Padding + +module SmartHashMD5 = + open SmartHashUtils + open SmartHashBlock + + + type MD5() as this = + inherit BlockHashAlgorithm() + ///The size in bytes of an individual block. + let mutable state:int32[] = null + + do this.BlockSize <- 64 + do this.HashSizeValue <- 128 + do state <- Array.zeroCreate 4 + do this.Initialize() + + override x.Initialize() = + base.Initialize() + state.[0] <- 0x67452301 + state.[1] <- 0xEFCDAB89 + state.[2] <- 0x98BADCFE + state.[3] <- 0x10325476 + + member x.BlockTransform(data, iOffset) = + let mutable A = state.[0] + let mutable B = state.[3] + let mutable C = state.[2] + let mutable D = state.[1] + + let X = ByteToUInt data iOffset 64 0 + + A <- D + LS (P1 D C B + A + X.[0] + uint32 0xD76AA478) 7 + B <- A + LS(P1 A D C + B + X.[1] + uint32 0xE8C7B756) 12 + C <- B + LS(P1 B A D + C + X.[2] + uint32 0x242070DB) 17 + D <- C + LS(P1 C B A + D + X.[3] + uint32 0xC1BDCEEE) 22 + A <- D + LS(P1 D C B + A + X.[4] + uint32 0xF57C0FAF) 7 + B <- A + LS(P1 A D C + B + X.[5] + uint32 0x4787C62A) 12 + C <- B + LS(P1 B A D + C + X.[6] + uint32 0xA8304613) 17 + D <- C + LS(P1 C B A + D + X.[7] + uint32 0xFD469501) 22 + A <- D + LS(P1 D C B + A + X.[8] + uint32 0x698098D8) 7 + B <- A + LS(P1 A D C + B + X.[9] + uint32 0x8B44F7AF) 12 + C <- B + LS(P1 B A D + C + X.[10] + uint32 0xFFFF5BB1) 17 + D <- C + LS(P1 C B A + D + X.[11] + uint32 0x895CD7BE) 22 + A <- D + LS(P1 D C B + A + X.[12] + uint32 0x6B901122) 7 + B <- A + LS(P1 A D C + B + X.[13] + uint32 0xFD987193) 12 + C <- B + LS(P1 B A D + C + X.[14] + uint32 0xA679438E) 17 + D <- C + LS(P1 C B A + D + X.[15] + uint32 0x49B40821) 22 + + A <- D + LS(P2 D C B + A + X.[1] + uint32 0xF61E2562) 5 + B <- A + LS(P2 A D C + B + X.[6] + uint32 0xC040B340) 9 + C <- B + LS(P2 B A D + C + X.[11] + uint32 0x265E5A51) 14 + D <- C + LS(P2 C B A + D + X.[0] + uint32 0xE9B6C7AA) 20 + A <- D + LS(P2 D C B + A + X.[5] + uint32 0xD62F105D) 5 + B <- A + LS(P2 A D C + B + X.[10] + uint32 0x02441453) 9 + C <- B + LS(P2 B A D + C + X.[15] + uint32 0xD8A1E681) 14 + D <- C + LS(P2 C B A + D + X.[4] + uint32 0xE7D3FBC8) 20 + A <- D + LS(P2 D C B + A + X.[9] + uint32 0x21E1CDE6) 5 + B <- A + LS(P2 A D C + B + X.[14] + uint32 0xC33707D6) 9 + C <- B + LS(P2 B A D + C + X.[3] + uint32 0xF4D50D87) 14 + D <- C + LS(P2 C B A + D + X.[8] + uint32 0x455A14ED) 20 + A <- D + LS(P2 D C B + A + X.[13] + uint32 0xA9E3E905) 5 + B <- A + LS(P2 A D C + B + X.[2] + uint32 0xFCEFA3F8) 9 + C <- B + LS(P2 B A D + C + X.[7] + uint32 0x676F02D9) 14 + D <- C + LS(P2 C B A + D + X.[12] + uint32 0x8D2A4C8A) 20 + + A <- D + LS(P3 D C B + A + X.[5] + uint32 0xFFFA3942) 4 + B <- A + LS(P3 A D C + B + X.[8] + uint32 0x8771F681) 11 + C <- B + LS(P3 B A D + C + X.[11] + uint32 0x6D9D6122) 16 + D <- C + LS(P3 C B A + D + X.[14] + uint32 0xFDE5380C) 23 + A <- D + LS(P3 D C B + A + X.[1] + uint32 0xA4BEEA44) 4 + B <- A + LS(P3 A D C + B + X.[4] + uint32 0x4BDECFA9) 11 + C <- B + LS(P3 B A D + C + X.[7] + uint32 0xF6BB4B60) 16 + D <- C + LS(P3 C B A + D + X.[10] + uint32 0xBEBFBC70) 23 + A <- D + LS(P3 D C B + A + X.[13] + uint32 0x289B7EC6) 4 + B <- A + LS(P3 A D C + B + X.[0] + uint32 0xEAA127FA) 11 + C <- B + LS(P3 B A D + C + X.[3] + uint32 0xD4EF3085) 16 + D <- C + LS(P3 C B A + D + X.[6] + uint32 0x04881D05) 23 + A <- D + LS(P3 D C B + A + X.[9] + uint32 0xD9D4D039) 4 + B <- A + LS(P3 A D C + B + X.[12] + uint32 0xE6DB99E5) 11 + C <- B + LS(P3 B A D + C + X.[15] + uint32 0x1FA27CF8) 16 + D <- C + LS(P3 C B A + D + X.[2] + uint32 0xC4AC5665) 23 + + A <- D + LS(P4 D C B + A + X.[0] + uint32 0xF4292244) 6 + B <- A + LS(P4 A D C + B + X.[7] + uint32 0x432AFF97) 10 + C <- B + LS(P4 B A D + C + X.[14] + uint32 0xAB9423A7) 15 + D <- C + LS(P4 C B A + D + X.[5] + uint32 0xFC93A039) 21 + A <- D + LS(P4 D C B + A + X.[12] + uint32 0x655B59C3) 6 + B <- A + LS(P4 A D C + B + X.[3] + uint32 0x8F0CCC92) 10 + C <- B + LS(P4 B A D + C + X.[10] + uint32 0xFFEFF47D) 15 + D <- C + LS(P4 C B A + D + X.[1] + uint32 0x85845DD1) 21 + A <- D + LS(P4 D C B + A + X.[8] + uint32 0x6FA87E4F) 6 + B <- A + LS(P4 A D C + B + X.[15] + uint32 0xFE2CE6E0) 10 + C <- B + LS(P4 B A D + C + X.[6] + uint32 0xA3014314) 15 + D <- C + LS(P4 C B A + D + X.[13] + uint32 0x4E0811A1) 21 + A <- D + LS(P4 D C B + A + X.[4] + uint32 0xF7537E82) 6 + B <- A + LS(P4 A D C + B + X.[11] + uint32 0xBD3AF235) 10 + C <- B + LS(P4 B A D + C + X.[2] + uint32 0x2AD7D2BB) 15 + D <- C + LS(P4 C B A + D + X.[9] + uint32 0xEB86D391) 21 + + state.[0] <- state.[0] + A + state.[3] <- state.[3] + B + state.[2] <- state.[2] + C + state.[1] <- state.[1] + D diff --git a/tests/fsharp/typecheck/sigs/neg141.bsl b/tests/fsharp/typecheck/sigs/neg141.bsl new file mode 100644 index 00000000000..582828cd78f --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg141.bsl @@ -0,0 +1,6 @@ + +neg141.fs(24,24,24,33): typecheck error FS0043: Type constraint mismatch. The type + ''d -> 'e' +is not compatible with type + ''a -> 'f' + diff --git a/tests/fsharp/typecheck/sigs/neg141.fs b/tests/fsharp/typecheck/sigs/neg141.fs new file mode 100644 index 00000000000..31975e04fa2 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg141.fs @@ -0,0 +1,27 @@ + +module Neg141 + +// This code starts failing to compile once RFC-1043 is enabled +// +// This is because the constraint relies on return types in the set of support types. +// +// This leaves unexpected ambiguity in common code especially when the shape of internal collections is potentially +// ambiguous internally in function implementations. +// +// Prior to RFC-1043 this ambiguity was resolved by applying weak resolution eagerly. + +// See https://github.com/fsharp/fslang-design/issues/435#issuecomment-584192749 +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + +// A simulated collection with a'Map' witness +type Coll<'T>(x: 'T) = + member _.X = x + static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>(mapping source.X) + +// What's the return collection type of the inner `InvokeMap` call? We only know once we apply weak resolution. +let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + InvokeMap ((+) v) (InvokeMap ((+) v) x) + +let v1 = AddTwice (Coll(3)) 2 +let v2 = AddTwice (Coll(3uy)) 2uy diff --git a/tests/fsharp/typecheck/sigs/neg142.fs b/tests/fsharp/typecheck/sigs/neg142.fs new file mode 100644 index 00000000000..610d7706cb8 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg142.fs @@ -0,0 +1,47 @@ +module Neg133 + +// This code should fail to compile regardless RFC-1043 + +let inline CallReturn< ^M, ^R, 'T when (^M or ^R) : (static member Return : unit -> ('T -> ^R))> () = + ((^M or ^R) : (static member Return : unit -> ('T -> ^R)) ()) + +let inline CallApply< ^M, ^I1, ^I2, ^R when (^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R)> (input1: ^I1, input2: ^I2) = + ((^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R) input1, input2) + +let inline CallMap< ^M, ^F, ^I, ^R when (^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R)> (mapping: ^F, source: ^I) : ^R = + ((^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R) mapping, source) + +let inline CallSequence< ^M, ^I, ^R when (^M or ^I) : (static member Sequence : ^I -> ^R)> (b: ^I) : ^R = + ((^M or ^I) : (static member Sequence : ^I -> ^R) b) + +type Return = class end + +type Apply = class end + +type Map = class end + +type Sequence = class end + +let inline InvokeReturn (x: 'T) : ^R = + CallReturn< Return , ^R , 'T> () x + +let inline InvokeApply (f: ^I1) (x: ^I2) : ^R = + CallApply(f, x) + +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + CallMap (mapping, source) + +type Sequence with + static member inline Sequence (t: list>) : ^R = + List.foldBack (fun (x: 't option) (ys: ^R) -> InvokeApply (InvokeMap (fun x y -> x :: y) x) ys) t (InvokeReturn []) + +type Map with + static member Map (f: 'T->'U, x: option<_>) = Option.map f x + +type Apply with + static member Apply (f: option<_>, x: option<'T>) : option<'U> = failwith "" + +type Return with + static member Return () = fun x -> Some x : option<'a> +let res18() = + CallSequence [Some 3; Some 2; Some 1] diff --git a/tests/fsharp/typecheck/sigs/neg133.preview.bsl b/tests/fsharp/typecheck/sigs/neg142.preview.bsl similarity index 81% rename from tests/fsharp/typecheck/sigs/neg133.preview.bsl rename to tests/fsharp/typecheck/sigs/neg142.preview.bsl index 45f7ffaad98..653b9b8e88d 100644 --- a/tests/fsharp/typecheck/sigs/neg133.preview.bsl +++ b/tests/fsharp/typecheck/sigs/neg142.preview.bsl @@ -1,5 +1,5 @@ -neg133.fs(47,5,47,58): optimize error FS0071: Type constraint mismatch when applying the default type 'Microsoft.FSharp.Core.obj' for a type inference variable. Type constraint mismatch. The type +neg142.fs(47,5,47,58): optimize error FS0071: Type constraint mismatch when applying the default type 'Microsoft.FSharp.Core.obj' for a type inference variable. Type constraint mismatch. The type 'Microsoft.FSharp.Core.obj' is not compatible with type ''a Microsoft.FSharp.Core.option' From a84c6a4ce1b10388e7c7383a7b427e085aee11a7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 22:41:46 +0100 Subject: [PATCH 77/82] fix tests --- .../Expressions/BindingExpressions/BindingExpressions.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs index 89b2383dd86..5be6236d1cd 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/BindingExpressions/BindingExpressions.fs @@ -105,8 +105,8 @@ module BindingExpressions = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 1, Line 12, Col 13, Line 12, Col 14, "The type 'int' does not match the type 'unit'") - (Error 1, Line 12, Col 18, Line 12, Col 24, "Type mismatch. Expecting a\n ''a -> 'b' \nbut given a\n ''a -> unit' \nThe type 'int' does not match the type 'unit'") + (Error 1, Line 12, Col 13, Line 12, Col 14, "The types 'unit, int' do not support the operator '+'") + (Error 1, Line 12, Col 18, Line 12, Col 24, "The types 'unit, int' do not support the operator '+'") (Warning 20, Line 13, Col 5, Line 13, Col 10, "The result of this expression has type 'bool' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.") ] @@ -118,8 +118,8 @@ module BindingExpressions = |> compile |> shouldFail |> withDiagnostics [ - (Error 1, Line 10, Col 9, Line 10, Col 10, "The type 'int' does not match the type 'unit'") - (Error 1, Line 10, Col 14, Line 10, Col 20, "Type mismatch. Expecting a\n ''a -> 'b' \nbut given a\n ''a -> unit' \nThe type 'int' does not match the type 'unit'") + (Error 1, Line 10, Col 9, Line 10, Col 10, "The types 'unit, int' do not support the operator '+'") + (Error 1, Line 10, Col 14, Line 10, Col 20, "The types 'unit, int' do not support the operator '+'") ] // SOURCE=MutableLocals01.fs SCFLAGS="--warnon:3180 --optimize+ --test:ErrorRanges" From 8b93a2449430d2402809047d32b23f06312bb7b5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 22:45:01 +0100 Subject: [PATCH 78/82] fix tests --- .../Type-relatedExpressions/E_RigidTypeAnnotation02.fsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx index 994da64066f..050c4070cc6 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02.fsx @@ -15,12 +15,11 @@ let f3 x = (x : float32) + 1M let f4 x = (x : decimal) + "" exit 1 -s + //The types 'string, int' do not support the operator //The types 'string, int' do not support the operator //The types 'string, byte' do not support the operator //The types 'string, byte' do not support the operator -//This expression was expected to have type. 'float' .but here has type. 'int' //The types 'float, int' do not support the operator //The types 'float, int' do not support the operator //The types 'float32, decimal' do not support the operator From cd87f56037434e9ce1c3345dbfa374e997c46375 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 22:45:21 +0100 Subject: [PATCH 79/82] fix tests --- .../Type-relatedExpressions/E_RigidTypeAnnotation02_5_0.fsx | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02_5_0.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02_5_0.fsx index ad279dbc4de..f211712534b 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02_5_0.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation02_5_0.fsx @@ -20,7 +20,6 @@ exit 1 //The type 'int' does not match the type 'string' //The type 'byte' does not match the type 'string' //The type 'byte' does not match the type 'string' -//This expression was expected to have type. 'float' .but here has type. 'int' //The type 'int' does not match the type 'float' //The type 'int' does not match the type 'float' //The type 'decimal' does not match the type 'float32' From c44e06a2bae9bef7454a2619a0d96c286bcadeca Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 26 Oct 2022 12:30:55 +0100 Subject: [PATCH 80/82] merge main --- src/Compiler/Checking/NicePrint.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index f64609f79ac..6230f997c93 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -815,7 +815,7 @@ module PrintTypes = match argTys with | [] -> retTyL | _ -> curriedLayoutsL "->" [argTysL] retTyL - (tysL |> addColonL) --- bracketL (stat ++ (nameL |> addColonL) --- sigL) + (supportTysL |> addColonL) --- bracketL (stat ++ (nameL |> addColonL) --- sigL) /// Layout a unit of measure expression and layoutMeasure denv unt = From b1774ba1e3eb3f75fb3bb3ca812130b342ec45b7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 26 Oct 2022 13:47:02 +0100 Subject: [PATCH 81/82] merge main --- src/Compiler/TypedTree/TypedTree.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 44c7c6dfff1..c25ea2c3f35 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2434,7 +2434,7 @@ type TraitConstraintInfo = /// Get or set the solution of the member constraint during inference member x.Solution - with get() = (let (TTrait(_, _, _, _, _, sln, _,)) = x in sln.Value) + with get() = (let (TTrait(_, _, _, _, _, sln, _)) = x in sln.Value) and set v = (let (TTrait(_, _, _, _, _, sln, _)) = x in sln.Value <- v) /// Get the context used to help determine possible extension member solutions From 96be154b4d89980a6524fb8db00da999dc4003e4 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 26 Oct 2022 14:22:30 +0100 Subject: [PATCH 82/82] merge main --- src/Compiler/Checking/CheckBasics.fs | 4 +-- src/Compiler/Checking/CheckExpressions.fs | 20 +++++++------- src/Compiler/Checking/CheckFormatStrings.fs | 2 +- src/Compiler/Checking/ConstraintSolver.fs | 27 ++++++++++--------- src/Compiler/Checking/ConstraintSolver.fsi | 2 +- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/MethodCalls.fs | 2 +- src/Compiler/Checking/NameResolution.fs | 11 ++++---- src/Compiler/Checking/NameResolution.fsi | 4 +-- src/Compiler/Checking/NicePrint.fs | 2 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/Service/FSharpCheckerResults.fs | 2 +- .../Service/ServiceDeclarationLists.fs | 2 +- src/Compiler/Symbols/SymbolHelpers.fs | 6 ++--- src/Compiler/Symbols/Symbols.fs | 2 +- src/Compiler/TypedTree/TypedTree.fs | 8 +++--- src/Compiler/TypedTree/TypedTree.fsi | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 11 ++++---- 18 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index d4d13ab4c7c..9f1e85aa73f 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -257,7 +257,7 @@ type TcEnv = member tenv.SelectExtensionMethods(traitInfo, m, infoReader) = let infoReader = unbox(infoReader) SelectExtensionMethInfosForTrait(traitInfo, m, tenv.eNameResEnv, infoReader) - |> List.map (fun minfo -> minfo :> ITraitExtensionMember) + |> List.map (fun (supportTy, minfo) -> supportTy, (minfo :> ITraitExtensionMember)) member tenv.AccessRights = (tenv.eAccessRights :> ITraitAccessorDomain) @@ -349,7 +349,7 @@ type TcFileState = let niceNameGen = NiceNameGenerator() let infoReader = InfoReader(g, amap) - let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig + let instantiationGenerator m tpsorig traitCtxt = FreshenTypars g traitCtxt m tpsorig let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) { g = g amap = amap diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index ce87928a449..f2366749bd7 100755 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -1741,7 +1741,7 @@ let FreshenPossibleForallTy traitFreshner g m rigid ty = origTypars, tps, tinst, instType renaming tau let FreshenTyconRef2 traitFreshner (g: TcGlobals) m (tcref: TyconRef) = - let tps, renaming, tinst = FreshenTypeInst traitFreshner m (tcref.Typars m) + let tps, renaming, tinst = FreshenTypeInst g traitFreshner m (tcref.Typars m) tps, renaming, tinst, TType_app (tcref, tinst, g.knownWithoutNull) /// Given a abstract method, which may be a generic method, freshen the type in preparation @@ -3163,7 +3163,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result getEnumeratorMethInfo -> - let getEnumeratorMethInst = FreshenMethInfo env.TraitContext m getEnumeratorMethInfo + let getEnumeratorMethInst = FreshenMethInfo g env.TraitContext m getEnumeratorMethInfo let getEnumeratorRetTy = getEnumeratorMethInfo.GetFSharpReturnType(cenv.amap, m, getEnumeratorMethInst) if hasArgs getEnumeratorMethInfo getEnumeratorMethInst then err true tyToSearchForGetEnumeratorAndItem else @@ -3171,7 +3171,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result moveNextMethInfo -> - let moveNextMethInst = FreshenMethInfo env.TraitContext m moveNextMethInfo + let moveNextMethInst = FreshenMethInfo g env.TraitContext m moveNextMethInfo let moveNextRetTy = moveNextMethInfo.GetFSharpReturnType(cenv.amap, m, moveNextMethInst) if not (typeEquiv g g.bool_ty moveNextRetTy) then err false getEnumeratorRetTy else if hasArgs moveNextMethInfo moveNextMethInst then err false getEnumeratorRetTy else @@ -3180,7 +3180,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result getCurrentMethInfo -> - let getCurrentMethInst = FreshenMethInfo env.TraitContext m getCurrentMethInfo + let getCurrentMethInst = FreshenMethInfo g env.TraitContext m getCurrentMethInfo if hasArgs getCurrentMethInfo getCurrentMethInst then err false getEnumeratorRetTy else let enumElemTy = getCurrentMethInfo.GetFSharpReturnType(cenv.amap, m, getCurrentMethInst) @@ -3965,7 +3965,7 @@ let rec TcTyparConstraint ridx (cenv: cenv) newOk checkConstraints occ (env: TcE let tps = List.map (destTyparTy g) tinst //, _, tinst, _ = FreshenTyconRef2 g m tcref let tprefInst, _tptys = mkTyparToTyparRenaming tpsorig tps //let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (tp.Constraints @ CopyTyparConstraints m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (tp.Constraints @ CopyTyparConstraints env.TraitContext m tprefInst tporig)) | CheckCxs -> () | AppTy g (_tcref, selfTy :: _rest) when isTyparTy g selfTy && isInterfaceTy g tyR -> AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace tyR selfTy @@ -6185,7 +6185,7 @@ and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = let mExprAndLongId = unionRanges synTypar.Range ident.idRange let ty = mkTyparTy tp let lookupKind = LookupKind.Expr LookupIsInstance.Ambivalent - let item, _rest = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv lookupKind ident.idRange ad ident IgnoreOverrides TypeNameResolutionInfo.Default ty + let item, _rest = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv lookupKind ident.idRange ad env.TraitContext ident IgnoreOverrides TypeNameResolutionInfo.Default ty let delayed3 = match rest with | [] -> delayed2 @@ -9406,12 +9406,12 @@ and TcMethodApplication_UniqueOverloadInference let callerArgs = { Unnamed = unnamedCurriedCallerArgs; Named = namedCurriedCallerArgs } let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = - let minst = FreshenMethInfo env.TraitContext mItem minfo + let minst = FreshenMethInfo g env.TraitContext mItem minfo let callerTyArgs = match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo g env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt) let preArgumentTypeCheckingCalledMethGroup = [ for minfo, pinfoOpt in candidateMethsAndProps do @@ -9623,7 +9623,7 @@ and TcMethodApplication match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt)) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo g env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt)) // Commit unassociated constraints prior to member overload resolution where there is ambiguity // about the possible target of the call. @@ -11157,7 +11157,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl CheckForNonAbstractInterface declKind tcref memberFlags id.idRange let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, _ = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, _ = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index e9b95da9c43..6e7919b9ed1 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -17,7 +17,7 @@ open FSharp.Compiler.TcGlobals type FormatItem = Simple of TType | FuncAndVal let copyAndFixupFormatTypar g m tp = - let _,_,tinst = FreshenAndFixupTypars g traitCtxtNone g m TyparRigidity.Flexible [] [] [tp] + let _,_,tinst = FreshenAndFixupTypars g traitCtxtNone m TyparRigidity.Flexible [] [] [tp] List.head tinst let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 448b0e484df..5b1fe635312 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -1955,7 +1955,7 @@ and AddUnsolvedMemberConstraint csenv ndeep m2 trace permitWeakResolution ignore // If there's nothing left to learn then raise the errors. // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability // reasons we use the more restrictive isNil frees. - if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + if (permitWeakResolution.Permit(g) && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then do! errors // Otherwise re-record the trait waiting for canonicalization else @@ -2011,8 +2011,8 @@ and MemberConstraintSolutionOfMethInfo css m traitCtxt minfo minst staticTyOpt = let iltref = ilMeth.ILExtensionMethodDeclaringTyconRef |> Option.map (fun tcref -> tcref.CompiledRepresentationForNamedType) ILMethSln(ilMeth.ApparentEnclosingType, iltref, mref, minst, staticTyOpt) - | FSMeth(_, ty, vref, _) -> - FSMethSln(ty, vref, minst, extInfo.IsSome, staticTyOpt) + | FSMeth(_, ty, vref, extInfo) -> + FSMethSln(ty, vref, minst, staticTyOpt, extInfo.IsSome) | MethInfo.DefaultStructCtor _ -> error(InternalError("the default struct constructor was the unexpected solution to a trait constraint", m)) @@ -2053,14 +2053,15 @@ and GetRelevantExtensionMethodsForTrait m (infoReader: InfoReader) (traitInfo: T match traitInfo.TraitContext with | None -> () | Some traitCtxt -> - for extMethInfo in traitCtxt.SelectExtensionMethods(traitInfo, m, infoReader=infoReader) do - (extMethInfo :?> MethInfo) + for (supportTy, extMethInfo) in traitCtxt.SelectExtensionMethods(traitInfo, m, infoReader=infoReader) do + supportTy, (extMethInfo :?> MethInfo) ] /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm traitInfo : (TType * MethInfo) list = - let (TTrait(_, _, memFlags, _, _, _, traitCtxt)) = traitInfo + let g = csenv.g + let (TTrait(_, _, memFlags, _, _, _, _)) = traitInfo let results = if permitWeakResolution.Permit g || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m @@ -2080,7 +2081,7 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio // Merge the sets so we don't get the same minfo from each side // We merge based on whether minfos use identical metadata or not. - let minfos = ListSet.setify (fun (_,minfo1) (_, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) minfos + let minfos = minfos |> ListSet.setify (fun (_,minfo1) (_, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) // Get the extension method that may be relevant to solving the constraint as MethInfo objects. // Extension members are not used when canonicalizing prior to generalization (permitWeakResolution=true) @@ -2089,7 +2090,7 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio GetRelevantExtensionMethodsForTrait csenv.m csenv.InfoReader traitInfo else [] - let extMethInfos = extMethInfos |> ListSet.setify MethInfo.MethInfosUseIdenticalDefinitions + let extMethInfos = extMethInfos |> ListSet.setify (fun (_,minfo1) (_, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) let minfos = minfos @ extMethInfos @@ -2249,8 +2250,8 @@ and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr and TraitsAreRelated (csenv: ConstraintSolverEnv) retry traitInfo1 traitInfo2 = let g = csenv.g - let (TTrait(tys1, nm1, memFlags1, argTys1, _, _)) = traitInfo1 - let (TTrait(tys2, nm2, memFlags2, argTys2, _, _)) = traitInfo2 + let (TTrait(tys1, nm1, memFlags1, argTys1, _, _, _)) = traitInfo1 + let (TTrait(tys2, nm2, memFlags2, argTys2, _, _, _)) = traitInfo2 memFlags1.IsInstance = memFlags2.IsInstance && nm1 = nm2 && // Multiple op_Explicit and op_Implicit constraints can exist for the same type variable. @@ -3876,7 +3877,7 @@ let ApplyDefaultsAfterWitnessGeneration (g: TcGlobals) amap css denv sln = let CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs tcVal g amap m (traitInfo:TraitConstraintInfo) = trackErrors { let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.YesAtCodeGen 0 m NoTrace traitInfo let res = match traitInfo.Solution with | None @@ -3904,7 +3905,7 @@ let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { // This is invoked every time codegen or quotation calls a witness-accepting // method. TBH the witnesses need to be generated during type checking and passed all the way down, // or at least be left in the tree as WitnessArg nodes. - let ftps, _renaming, tinst = FreshenTypeInst traitCtxtNone m typars + let ftps, _renaming, tinst = FreshenTypeInst g traitCtxtNone m typars let traitInfos = GetTraitConstraintInfosOfTypars g ftps do! SolveTyparsEqualTypes csenv 0 m NoTrace tinst tyargs let witnessArgs = GenWitnessArgs amap g m traitInfos @@ -3944,7 +3945,7 @@ let IsApplicableMethApprox g amap m traitCtxt (minfo: MethInfo) availObjTy = PostInferenceChecksPreDefaults = ResizeArray() PostInferenceChecksFinal = ResizeArray() } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let minst = FreshenMethInfo traitCtxt m minfo + let minst = FreshenMethInfo g traitCtxt m minfo match minfo.GetObjArgTypes(amap, m, minst) with | [reqdObjTy] -> let reqdObjTy = if isByrefTy g reqdObjTy then destByrefTy g reqdObjTy else reqdObjTy // This is to support byref extension methods. diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index 55a69d2c7da..33a49d5e418 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -70,7 +70,7 @@ val FreshenTypars: g: TcGlobals -> ITraitContext option -> range -> Typars -> TT /// its generic parameters, and ensure that the constraints the new type variables are adjusted. /// /// Returns the inference type variables as a list of types. -val FreshenMethInfo: ITraitContext option -> range -> MethInfo -> TType list +val FreshenMethInfo: g: TcGlobals -> ITraitContext option -> range -> MethInfo -> TType list /// Information about the context of a type equation, for better error reporting [] diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index e71ef359b1b..a2bb22c6b3f 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -296,7 +296,7 @@ let UnsolvedTyparsOfExpr g amap denv expr = amap=amap denv=denv unsolved = [] - stackGuard = StackGuard(FindUnsolvedStackGuardDepth) } + stackGuard = StackGuard(FindUnsolvedStackGuardDepth, "UnsolvedTyparsOfExpr") } accExpr cenv NoEnv expr List.rev cenv.unsolved diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 7a43e438f51..67816b12443 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -1324,7 +1324,7 @@ let rec AdjustExprForTypeDirectedConversions tcVal (g: TcGlobals) amap traitCtxt isNullableTy g reqdTy && not (isNullableTy g actualTy) then let underlyingTy = destNullableTy g reqdTy - let adjustedExpr = AdjustExprForTypeDirectedConversions tcVal g amap infoReader ad underlyingTy actualTy m expr + let adjustedExpr = AdjustExprForTypeDirectedConversions tcVal g amap traitCtxt infoReader ad underlyingTy actualTy m expr let adjustedActualTy = tyOfExpr g adjustedExpr let minfo = GetIntrinsicConstructorInfosOfType infoReader m reqdTy |> List.head diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 9f03c73cc02..87756c81272 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -740,11 +740,12 @@ let AllMethInfosOfTypeInScope collectionSettings infoReader nenv optFilter ad fi let SelectExtensionMethInfosForTrait(traitInfo: TraitConstraintInfo, m, nenv: NameResolutionEnv, infoReader: InfoReader) = let g = infoReader.g if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then - [ for traitSupportTy in traitInfo.SupportTypes do - if not (isTyparTy g traitSupportTy) then - let extMethInfos = ExtensionMethInfosOfTypeInScope ResultCollectionSettings.AllResults infoReader nenv (Some traitInfo.MemberName) m traitSupportTy + [ for suportTy in traitInfo.SupportTypes do + if not (isTyparTy g suportTy) then + let isInstanceFilter = (if traitInfo.MemberFlags.IsInstance then LookupIsInstance.Yes else LookupIsInstance.No) + let extMethInfos = ExtensionMethInfosOfTypeInScope ResultCollectionSettings.AllResults infoReader nenv (Some traitInfo.MemberLogicalName) isInstanceFilter m suportTy for extMethInfo in extMethInfos do - yield extMethInfo ] + yield (suportTy, extMethInfo) ] else [] //------------------------------------------------------------------------- @@ -3746,7 +3747,7 @@ let NeedsWorkAfterResolution namedItem = | Item.MethodGroup(_, minfos, _) | Item.CtorGroup(_, minfos) -> minfos.Length > 1 || minfos |> List.exists (fun minfo -> not (isNil minfo.FormalMethodInst)) | Item.Property(_, pinfos) -> pinfos.Length > 1 - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(valRef=vref)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> not (List.isEmpty vref.Typars) | Item.CustomOperation (_, _, Some minfo) -> not (isNil minfo.FormalMethodInst) | Item.ActivePatternCase apref -> not (List.isEmpty apref.ActivePatternVal.Typars) diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 4e47d05dd57..51482526a20 100755 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -663,7 +663,7 @@ val internal AllMethInfosOfTypeInScope: MethInfo list val internal SelectExtensionMethInfosForTrait: - traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> MethInfo list + traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> (TType * MethInfo) list /// Used to report an error condition where name resolution failed due to an indeterminate type exception internal IndeterminateType of range @@ -858,4 +858,4 @@ val TrySelectExtensionMethInfoOfILExtMem: val traitCtxtNone: ITraitContext option val ExtensionMethInfosOfTypeInScope: - ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> range -> TType -> MethInfo list + ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> isInstanceFilter: LookupIsInstance -> range -> TType -> MethInfo list diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 282d73affb2..ecbe8e55124 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -825,7 +825,7 @@ module PrintTypes = let tysL = match tys with | [ty] -> layoutTypeWithInfo denv env ty - | _ -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) supportTys) + | _ -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) tys) let retTyL = layoutReturnType denv env retTy let sigL = diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 1fceed567e8..fcd9564e7d2 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -648,7 +648,7 @@ let CheckTypeAux permitByRefLike (cenv: cenv) env m ty onInnerByrefError = let visitTraitSolution info = match info with - | FSMethSln(_, vref, _, _) -> + | FSMethSln(valRef=vref) -> //printfn "considering %s..." vref.DisplayName if valRefInThisAssembly cenv.g.compilingFSharpCore vref && not (cenv.boundVals.ContainsKey(vref.Stamp)) then //printfn "recording %s..." vref.DisplayName diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 0274bfaacab..abfc209fda3 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -477,7 +477,7 @@ type internal TypeCheckInfo // Exact resolution via 'T.$ | CNR (Item.TypeVar (_, tp), _, denv, nenv, ad, m) :: _, Some _ -> let targets = - ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m) + ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m traitCtxtNone) let items = ResolveCompletionsInType ncenv nenv targets m ad true (mkTyparTy tp) let items = List.map ItemWithNoInst items diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 06cf656b078..ed890b58789 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -153,7 +153,7 @@ module DeclarationListHelpers = let denv = SimplerDisplayEnv denv let xml = GetXmlCommentForItem infoReader m item.Item match item.Item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(valRef=vref)) }) -> // operator with solution FormatItemDescriptionToToolTipElement displayFullName infoReader ad m denv { item with Item = Item.Value vref } diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index a3232c3db39..babc0a96562 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -111,7 +111,7 @@ module internal SymbolHelpers = | Item.SetterArg (_, item) -> rangeOfItem g preferFlag item | Item.ArgName (_, _, _, m) -> Some m | Item.CustomOperation (_, _, implOpt) -> implOpt |> Option.bind (rangeOfMethInfo g preferFlag) - | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(vref=vref))}) -> Some vref.Range + | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(valRef=vref))}) -> Some vref.Range | Item.ImplicitOp _ -> None | Item.UnqualifiedType tcrefs -> tcrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) | Item.DelegateCtor ty @@ -566,7 +566,7 @@ module internal SymbolHelpers = let rec FullNameOfItem g item = let denv = DisplayEnv.Empty g match item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(valRef=vref)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> fullDisplayTextOfValRef vref | Item.UnionCase (ucinfo, _) -> fullDisplayTextOfUnionCaseRef ucinfo.UnionCaseRef | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.DisplayNameByIdx idx @@ -612,7 +612,7 @@ module internal SymbolHelpers = match item with | Item.ImplicitOp(_, sln) -> match sln.Value with - | Some(TraitConstraintSln.FSMethSln(vref=vref)) -> + | Some(TraitConstraintSln.FSMethSln(valRef=vref)) -> GetXmlCommentForItem infoReader m (Item.Value vref) | Some (TraitConstraintSln.ILMethSln _) | Some (TraitConstraintSln.FSRecdFieldSln _) diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 2e327d17056..64c5331f185 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -326,7 +326,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C | Item.ArgName(id, ty, argOwner, m) -> FSharpParameter(cenv, id, ty, argOwner, m) :> _ - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(valRef=vref)) }) -> FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _ // TODO: the following don't currently return any interesting subtype diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index c25ea2c3f35..61e1fb6e4f9 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2376,7 +2376,7 @@ type TyparConstraint = type ITraitContext = /// Used to select the extension methods in the context relevant to solving the constraint /// given the current support types - abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> ITraitExtensionMember list + abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> (TType * ITraitExtensionMember) list /// Gives the access rights (e.g. InternalsVisibleTo, Protected) at the point the trait is being solved abstract AccessRights: ITraitAccessorDomain @@ -2411,7 +2411,7 @@ type TraitConstraintInfo = /// /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of tys: TTypes * memberName: string * memberFlags: SynMemberFlags * objAndArgTys: TTypes * returnTyOpt: TType option * solution: TraitConstraintSln option ref * traitContext: ITraitContext option + | TTrait of supportTys: TTypes * memberName: string * memberFlags: SynMemberFlags * objAndArgTys: TTypes * returnTyOpt: TType option * solution: TraitConstraintSln option ref * traitContext: ITraitContext option /// Get the types that may provide solutions for the traits member x.SupportTypes = (let (TTrait(tys, _, _, _, _, _, _)) = x in tys) @@ -2423,14 +2423,14 @@ type TraitConstraintInfo = member x.MemberLogicalName = (let (TTrait(_, nm, _, _, _, _, _)) = x in nm) /// Get the member flags associated with the member constraint. - member x.MemberFlags = (let (TTrait(_, _, flags, _, _, _, _, _)) = x in flags) + member x.MemberFlags = (let (TTrait(_, _, flags, _, _, _, _)) = x in flags) member x.CompiledObjectAndArgumentTypes = (let (TTrait(_, _, _, objAndArgTys, _, _, _)) = x in objAndArgTys) member x.WithMemberKind(kind) = (let (TTrait(a, b, c, d, e, f, g)) = x in TTrait(a, b, { c with MemberKind=kind }, d, e, f, g)) /// Get the optional return type recorded in the member constraint. - member x.CompiledReturnType = (let (TTrait(_, _, _, _, retTy, _)) = x in retTy) + member x.CompiledReturnType = (let (TTrait(_, _, _, _, retTy, _, _)) = x in retTy) /// Get or set the solution of the member constraint during inference member x.Solution diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 784f56a653f..5903b3245d6 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1655,7 +1655,7 @@ type TraitWitnessInfo = type ITraitContext = /// Used to select the extension methods in the context relevant to solving the constraint /// given the current support types - abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> ITraitExtensionMember list + abstract SelectExtensionMethods: TraitConstraintInfo * range * infoReader: obj -> (TType * ITraitExtensionMember) list /// Gives the access rights (e.g. InternalsVisibleTo, Protected) at the point the trait is being solved abstract AccessRights: ITraitAccessorDomain diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 65634f6650b..0bcd81a53a8 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -290,8 +290,8 @@ and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell, traitCt match sln with | ILMethSln(ty, extOpt, ilMethRef, minst, staticTyOpt) -> ILMethSln(remapTypeAux tyenv ty, extOpt, ilMethRef, remapTypesAux tyenv minst, Option.map (remapTypeAux tyenv) staticTyOpt) - | FSMethSln(ty, vref, minst, isExt, staticTyOpt) -> - FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, isExt, Option.map (remapTypeAux tyenv) staticTyOpt) + | FSMethSln(ty, vref, minst, staticTyOpt, isExt) -> + FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, Option.map (remapTypeAux tyenv) staticTyOpt, isExt) | FSRecdFieldSln(tinst, rfref, isSet) -> FSRecdFieldSln(remapTypesAux tyenv tinst, remapRecdFieldRef tyenv.tyconRefRemap rfref, isSet) | FSAnonRecdFieldSln(anonInfo, tinst, n) -> @@ -2668,7 +2668,7 @@ type TraitConstraintInfo with /// Get the key associated with the member constraint. member traitInfo.GetWitnessInfo() = - let (TTrait(tys, nm, memFlags, objAndArgTys, rty, _)) = traitInfo + let (TTrait(tys, nm, memFlags, objAndArgTys, rty, _, _)) = traitInfo TraitWitnessInfo(tys, nm, memFlags, objAndArgTys, rty) /// Get information about the trait constraints for a set of typars. @@ -6346,8 +6346,9 @@ let copyImplFile g compgen e = let instExpr g tpinst e = let traitCtxtsMap = traitCtxtsInTypes (List.map snd tpinst) - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth"); traitCtxtsMap = traitCtxtsMap } - remapExprImpl ctxt CloneAll (mkInstRemap tpinst) e + let ctxt : RemapContext = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } + let remap = { mkInstRemap tpinst with traitCtxtsMap = traitCtxtsMap } + remapExprImpl ctxt CloneAll remap e //-------------------------------------------------------------------------- // Replace Marks - adjust debugging marks when a lambda gets