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 e1316708559..b9f05ee2ea1 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1681,7 +1681,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 a372de41e11..d4adb23767c 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,29 +93,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 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 FreshMethInst m fctps tinst tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible fctps tinst tpsorig +let FreshenTypeInst traitFreshner m tpsorig = FreshenAndFixupTypars traitFreshner m TyparRigidity.Flexible [] [] 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 @@ -204,7 +208,7 @@ type ConstraintSolverEnv = MatchingOnly: bool m: range EquivEnv: TypeEquivEnv - DisplayEnv: DisplayEnv + DisplayEnv : DisplayEnv } member csenv.InfoReader = csenv.SolverState.InfoReader member csenv.g = csenv.SolverState.g @@ -1028,7 +1032,8 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// 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 { +and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload 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 @@ -1041,27 +1046,29 @@ 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 @@ -1097,7 +1104,7 @@ 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 || IsNumericOrIntegralEnumType g argty2 || (Option.isSome (GetMeasureOfType g argty1) && isDecimalTy g argty2)) checkRuleAppliesInPreferenceToMethods argty1 argty2 || checkRuleAppliesInPreferenceToMethods argty2 argty1) -> @@ -1120,7 +1127,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn - | _, _, false, ("op_Addition" | "op_Subtraction" | "op_Modulus"), [argty1;argty2] + | _, 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)) @@ -1129,7 +1136,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload 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] + | _, 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))) @@ -1140,32 +1147,32 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // 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)) @@ -1175,7 +1182,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)) @@ -1186,7 +1193,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys return TTraitBuiltIn - | [], _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argty1;argty2] + | _, 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)) -> @@ -1195,7 +1202,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 return TTraitBuiltIn - | [], _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] + | _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] when isIntegerOrIntegerEnumTy g argty1 -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty @@ -1203,38 +1210,38 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload 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, _) -> @@ -1246,14 +1253,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 @@ -1266,7 +1274,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 @@ -1274,16 +1282,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 @@ -1302,11 +1311,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) @@ -1368,12 +1377,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 -> @@ -1468,6 +1478,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 @@ -1498,9 +1509,19 @@ 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 nm (TTrait(tys, _, memFlags, argtys, rty, soln, extSlns, ad) as traitInfo) : MethInfo list = let results = if permitWeakResolution || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m @@ -1515,6 +1536,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 @@ -1524,19 +1556,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 @@ -1545,7 +1578,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 = @@ -1573,7 +1606,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 (trace:OptionalTrace) tp = let cxst = csenv.SolverState.ExtraCxs let tpn = tp.Stamp let cxs = cxst.FindAll tpn @@ -1590,7 +1629,7 @@ and SolveRelevantMemberConstraintsForTypar (csenv: ConstraintSolverEnv) ndeep pe and CanonicalizeRelevantMemberConstraints (csenv: ConstraintSolverEnv) ndeep trace tps = SolveRelevantMemberConstraints csenv ndeep true 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 @@ -1605,7 +1644,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) ) @@ -1632,8 +1671,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. @@ -2766,26 +2805,40 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo: Tra 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! @@ -2800,6 +2853,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 @@ -2807,6 +2861,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 @@ -2892,7 +2947,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 4626c736bdb..d6d879964bf 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,47 +35,70 @@ 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. -| NoContext -/// The type equation comes from an IF expression. -| IfExpression of range -/// The type equation comes from an omitted else branch. -| OmittedElseBranch of range -/// The type equation comes from a type check of the result of an else branch. -| ElseBranchResult of range -/// The type equation comes from the verification of record fields. -| RecordFields -/// The type equation comes from the verification of a tuple in record fields. -| TupleInRecordFields -/// The type equation comes from a list or array constructor -| CollectionElement of bool * range -/// The type equation comes from a return in a computation expression. -| ReturnInComputationExpression -/// The type equation comes from a yield in a computation expression. -| YieldInComputationExpression -/// The type equation comes from a runtime type test. -| RuntimeTypeTest of bool -/// The type equation comes from an downcast where a upcast could be used. -| DowncastUsedInsteadOfUpcast of bool -/// The type equation comes from a return type of a pattern match clause (not the first clause). -| FollowingPatternMatchClause of range -/// The type equation comes from a pattern match guard. -| PatternMatchGuard of range -/// The type equation comes from a sequence expression. -| SequenceExpression of TType + + /// No context was given. + | NoContext + + /// The type equation comes from an IF expression. + | IfExpression of range + + /// The type equation comes from an omitted else branch. + | OmittedElseBranch of range + + /// The type equation comes from a type check of the result of an else branch. + | ElseBranchResult of range + + /// The type equation comes from the verification of record fields. + | RecordFields + + /// The type equation comes from the verification of a tuple in record fields. + | TupleInRecordFields + + /// The type equation comes from a list or array constructor + | CollectionElement of bool * range + + /// The type equation comes from a return in a computation expression. + | ReturnInComputationExpression + + /// The type equation comes from a yield in a computation expression. + | YieldInComputationExpression + + /// The type equation comes from a runtime type test. + | RuntimeTypeTest of bool + + /// The type equation comes from an downcast where a upcast could be used. + | DowncastUsedInsteadOfUpcast of bool + + /// The type equation comes from a return type of a pattern match clause (not the first clause). + | FollowingPatternMatchClause of range + + /// The type equation comes from a pattern match guard. + | PatternMatchGuard of range + + /// The type equation comes from a sequence expression. + | SequenceExpression of TType exception ConstraintSolverTupleDiffLengths of DisplayEnv * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of ContextInfo * DisplayEnv * TType * TType * range * range @@ -115,7 +139,10 @@ type OptionalTrace = val SimplifyMeasuresInTypeScheme : TcGlobals -> bool -> Typars -> TType -> TyparConstraint list -> Typars val SolveTyparEqualsType : ConstraintSolverEnv -> int -> range -> OptionalTrace -> TType -> TType -> OperationResult val SolveTypeEqualsTypeKeepAbbrevs : ConstraintSolverEnv -> int -> range -> OptionalTrace -> TType -> TType -> OperationResult + +/// Canonicalize constraints prior to generalization val CanonicalizeRelevantMemberConstraints : ConstraintSolverEnv -> int -> OptionalTrace -> Typars -> OperationResult + val ResolveOverloading : ConstraintSolverEnv -> OptionalTrace -> string -> ndeep: int -> TraitConstraintInfo option -> int * int -> AccessorDomain -> CalledMeth list -> bool -> TType option -> CalledMeth option * OperationResult val UnifyUniqueOverloading : ConstraintSolverEnv -> int * int -> string -> AccessorDomain -> CalledMeth list -> TType -> OperationResult val EliminateConstraintsForGeneralizedTypars : ConstraintSolverEnv -> OptionalTrace -> Typars -> unit @@ -144,4 +171,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 63324554f1c..53f289a6de7 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1075,7 +1075,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 ac64aa6c1df..01faf7ef9be 100644 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -133,7 +133,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/InfoReader.fs b/src/fsharp/InfoReader.fs index 8176e4119a1..767f4a0bc71 100644 --- a/src/fsharp/InfoReader.fs +++ b/src/fsharp/InfoReader.fs @@ -20,7 +20,7 @@ open FSharp.Compiler.Tastops open FSharp.Compiler.TcGlobals /// Use the given function to select some of the member values from the members of an F# type -let private SelectImmediateMemberVals g optFilter f (tcref: TyconRef) = +let SelectImmediateMemberVals g optFilter f (tcref: TyconRef) = let chooser (vref: ValRef) = match vref.MemberInfo with // The 'when' condition is a workaround for the fact that values providing diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 2f8fd8bbbc3..d4c4c63264c 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -491,6 +491,9 @@ type CalledMeth<'T> member x.TotalNumAssignedNamedArgs = x.ArgSets |> List.sumBy (fun x -> x.NumAssignedNamedArgs) + override x.ToString() = "call to " + minfo.ToString() + + let NamesOfCalledArgs (calledArgs: CalledArg list) = calledArgs |> List.choose (fun x -> x.NameOpt) @@ -676,12 +679,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 @@ -691,15 +694,20 @@ let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = /// calls to the type-directed solutions to member constraints. let MakeMethInfoCall amap m minfo minst args = let valUseFlags = NormalValUse // correct unless if we allow wild trait constraints like "T has a ctor and can be used as a parent class" + match minfo with - | ILMeth(g, ilminfo, _) -> + + | ILMeth(g,ilminfo,_) -> let direct = not minfo.IsVirtual 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 - | DefaultStructCtor(_, ty) -> - mkDefault (m, ty) + + | FSMeth(g, _, vref, _) -> + BuildFSharpMethodCall g m vref valUseFlags minfo.DeclaringTypeInst minst args |> fst + + | DefaultStructCtor(_,ty) -> + mkDefault (m,ty) + #if !NO_EXTENSIONTYPING | ProvidedMeth(amap, mi, _, m) -> let isProp = false // not necessarily correct, but this is only used post-creflect where this flag is irrelevant diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 8a9b46298d4..cbb0e1e6073 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -282,6 +282,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 @@ -302,12 +304,17 @@ type ExtensionMember = /// 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 x.Priority = - match x with + member x.Priority = + match x with | 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' @@ -366,6 +373,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 @@ -388,6 +398,7 @@ type NameResolutionEnv = eFullyQualifiedTyconsByAccessNames = LayeredMultiMap.Empty eFullyQualifiedTyconsByDemangledNameAndArity = LayeredMap.Empty eIndexedExtensionMembers = TyconRefMultiMap<_>.Empty + eExtensionMembersByName = NameMultiMap<_>.Empty eUnindexedExtensionMembers = [] eTypars = Map.empty } @@ -525,6 +536,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 entrypoint is used to add some extra items to the environment for Visual Studio, e.g. static members let AddFakeNamedValRefToNameEnv nm nenv vref = @@ -555,6 +577,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. @@ -567,6 +590,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 } @@ -637,12 +661,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 ilStyleExtensionMeths = GetCSharpStyleIndexedExtensionMembersForTyconRef amap m tcref - ((nenv.eIndexedExtensionMembers, nenv.eUnindexedExtensionMembers), ilStyleExtensionMeths) ||> List.fold (fun (tab1, tab2) extMemInfo -> - match extMemInfo with - | Choice1Of2 (tcref, extMemInfo) -> tab1.Add (tcref, extMemInfo), tab2 - | Choice2Of2 extMemInfo -> tab1, extMemInfo :: tab2) + let eIndexedExtensionMembers, eExtensionMembersByName, eUnindexedExtensionMembers = + let ilStyleExtensionMeths = GetCSharpStyleIndexedExtensionMembersForTyconRef amap m tcref + ((nenv.eIndexedExtensionMembers, nenv.eExtensionMembersByName, nenv.eUnindexedExtensionMembers),ilStyleExtensionMeths) ||> List.fold (fun (tab1,tab2,tab3) extMemInfo -> + match extMemInfo with + | 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 = @@ -694,7 +718,8 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g: TcGlobals) eFieldLabels = eFieldLabels eUnqualifiedItems = eUnqualifiedItems ePatItems = ePatItems - eIndexedExtensionMembers = eIndexedExtensionMembers + eIndexedExtensionMembers = eIndexedExtensionMembers + eExtensionMembersByName = eExtensionMembersByName eUnindexedExtensionMembers = eUnindexedExtensionMembers } /// Add a set of type definitions to the name resolution environment @@ -2005,6 +2030,21 @@ let IntrinsicMethInfosOfType (infoReader:InfoReader) optFilter ad allowMultiIntf let minfos = minfos |> ExcludeHiddenOfMethInfos g amap m minfos +let TrySelectExtensionMethInfoOfILExtMem m amap apparentTy (actualParent, minfo, pri) = + match minfo with + | ILMeth(_,ilminfo,_) -> + MethInfo.CreateILExtensionMeth (amap, m, apparentTy, actualParent, Some pri, ilminfo.RawMetadata) |> Some + // F#-defined IL-style extension methods are not seen as extension methods in F# code + | FSMeth(g,_,vref,_) -> + FSMeth(g, apparentTy, vref, Some pri) |> Some +#if !NO_EXTENSIONTYPING + // // Provided extension methods are not yet supported + | ProvidedMeth(amap,providedMeth,_,m) -> + ProvidedMeth(amap, providedMeth, Some pri,m) |> Some +#endif + | DefaultStructCtor _ -> + None + /// Select from a list of extension methods let SelectMethInfosFromExtMembers (infoReader: InfoReader) optFilter apparentTy m extMemInfos = let g = infoReader.g @@ -2022,20 +2062,9 @@ let SelectMethInfosFromExtMembers (infoReader: InfoReader) optFilter apparentTy | Some m -> yield m | _ -> () | ILExtMem (actualParent, minfo, pri) when (match optFilter with None -> true | Some nm -> nm = minfo.LogicalName) -> - // Make a reference to the type containing the extension members - match minfo with - | ILMeth(_, ilminfo, _) -> - yield (MethInfo.CreateILExtensionMeth (infoReader.amap, m, apparentTy, actualParent, Some pri, ilminfo.RawMetadata)) - // F#-defined IL-style extension methods are not seen as extension methods in F# code - | FSMeth(g, _, vref, _) -> - yield (FSMeth(g, apparentTy, vref, Some pri)) -#if !NO_EXTENSIONTYPING - // // Provided extension methods are not yet supported - | ProvidedMeth(amap, providedMeth, _, m) -> - yield (ProvidedMeth(amap, providedMeth, Some pri, m)) -#endif - | DefaultStructCtor _ -> - () + match TrySelectExtensionMethInfoOfILExtMem m infoReader.amap apparentTy (actualParent, minfo, pri) with + | Some minfo -> yield minfo + | None -> () | _ -> () ] diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 8ec9caedc76..188e2ef2a4a 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -140,25 +140,86 @@ val ItemWithNoInst : Item -> ItemWithInst type FieldResolution = FieldResolution of RecdFieldRef * bool /// Information about an extension member held in the name resolution environment -[] -type ExtensionMember +type ExtensionMember = + /// F#-style Extrinsic extension member, defined in F# code + | FSExtMem of ValRef * ExtensionMethodPriority + + /// ILExtMem(declaringTyconRef, ilMetadata, pri) + /// + /// 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 /// The environment of information used to resolve names [] type NameResolutionEnv = - {eDisplayEnv: DisplayEnv - eUnqualifiedItems: LayeredMap - ePatItems: NameMap - eModulesAndNamespaces: NameMultiMap - eFullyQualifiedModulesAndNamespaces: NameMultiMap - eFieldLabels: NameMultiMap - eTyconsByAccessNames: LayeredMultiMap - eFullyQualifiedTyconsByAccessNames: LayeredMultiMap - eTyconsByDemangledNameAndArity: LayeredMap - eFullyQualifiedTyconsByDemangledNameAndArity: LayeredMap - eIndexedExtensionMembers: TyconRefMultiMap - eUnindexedExtensionMembers: ExtensionMember list - eTypars: NameMap } + { /// Display environment information for output + eDisplayEnv: DisplayEnv + + /// Values and Data Tags available by unqualified name + eUnqualifiedItems: LayeredMap + + /// Data Tags and Active Pattern Tags available by unqualified name + ePatItems: NameMap + + /// 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. + + + /// REVIEW (old comment) + /// "The boolean flag is means the namespace or module entry shouldn't 'really' be in the + /// map, and if it is ever used to resolve a name then we give a warning. + /// This is used to give warnings on unqualified namespace accesses, e.g. + /// open System + /// open Collections <--- give a warning + /// let v = new Collections.Generic.List() <--- give a warning" + + eModulesAndNamespaces: NameMultiMap + + /// Fully qualified modules and namespaces. 'open' does not change this. + eFullyQualifiedModulesAndNamespaces: NameMultiMap + + /// RecdField labels in scope. RecdField labels are those where type are inferred + /// by label rather than by known type annotation. + /// Bools indicate if from a record, where no warning is given on indeterminate lookup + eFieldLabels: NameMultiMap + + /// Tycons indexed by the various names that may be used to access them, e.g. + /// "List" --> multiple TyconRef's for the various tycons accessible by this name. + /// "List`1" --> TyconRef + eTyconsByAccessNames: LayeredMultiMap + + eFullyQualifiedTyconsByAccessNames: LayeredMultiMap + + /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) + eTyconsByDemangledNameAndArity: LayeredMap + + /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) + eFullyQualifiedTyconsByDemangledNameAndArity: LayeredMap + + /// Extension members by type and name + eIndexedExtensionMembers: TyconRefMultiMap + + /// Extension members by name + eExtensionMembersByName: NameMultiMap + + /// Other extension members unindexed by type + eUnindexedExtensionMembers: ExtensionMember list + + /// Typars (always available by unqualified names). Further typars can be + /// in the tpenv, a structure folded through each top-level definition. + eTypars: NameMap + + } static member Empty : g:TcGlobals -> NameResolutionEnv member DisplayEnv : DisplayEnv member FindUnqualifiedItem : string -> Item @@ -541,3 +602,5 @@ val ResolveCompletionsInType : NameResolver -> NameResolutionEnv -> Resolv val GetVisibleNamespacesAndModulesAtPoint : NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> ModuleOrNamespaceRef list 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 diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index ab45f12c137..addddfb3d89 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -787,11 +787,11 @@ module private PrintTypes = let cxs = cxs |> ListSet.setify (fun (_, cx1) (_, cx2) -> - match cx1, cx2 with + match cx1,cx2 with | TyparConstraint.MayResolveMember(traitInfo1, _), TyparConstraint.MayResolveMember(traitInfo2, _) -> traitsAEquiv denv.g TypeEquivEnv.Empty traitInfo1 traitInfo2 | _ -> false) - + let cxsL = List.collect (layoutConstraintWithInfo denv env) cxs match cxsL with | [] -> emptyL @@ -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/Optimizer.fs b/src/fsharp/Optimizer.fs index 1d5abb724e2..20ccb0821a2 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -1067,6 +1067,11 @@ let AbstractLazyModulInfoByHiding isAssemblyBoundary mhi = Zset.exists hiddenUnionCase fvs.FreeUnionCases ) -> UnknownValue + // TODO: consider what happens when the expression refers to extSlns that have become hidden + // At the moment it feels like this may lead to remap failures, where the optimization information + // for a module contains dangling references to extSlns that are no longer needed (because they have been solved). + // However, we don't save extSlns into actual pickled optimization information, so maybe this is not a problem. + // Check for escape in constant | ConstValue(_, ty) when (let ftyvs = freeInType CollectAll ty @@ -3406,7 +3411,7 @@ let OptimizeImplFile (settings, ccu, tcGlobals, tcVal, importMap, optEnv, isIncr optimizing=true localInternalVals=Dictionary(10000) emitTailcalls=emitTailcalls - casApplied=new Dictionary() } + casApplied=new Dictionary() } let (optEnvNew, _, _, _ as results) = OptimizeImplFileInternal cenv optEnv isIncrementalFragment hidden mimpls let optimizeDuringCodeGen expr = OptimizeExpr cenv optEnvNew expr |> fst results, optimizeDuringCodeGen diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 521d623a4e9..abb45cc2575 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -301,7 +301,7 @@ let rec CheckTypeDeep (cenv: cenv) ((visitTy, visitTyconRefOpt, visitAppTyOpt, v | TType_var tp when tp.Solution.IsSome -> tp.Constraints |> List.iter (fun cx -> match cx with - | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln)), _) -> + | TyparConstraint.MayResolveMember((TTrait(_, _, _, _, _, soln, _, _)), _) -> match visitTraitSolutionOpt, !soln with | Some visitTraitSolution, Some sln -> visitTraitSolution sln | _ -> () @@ -370,7 +370,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 172131d91a2..a5423bdec56 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -61,7 +61,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) @@ -94,15 +94,25 @@ let emptyTyparInst = ([]: TyparInst) [] 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 } let emptyRemap = { tpinst = emptyTyparInst tyconRefRemap = emptyTyconRefRemap valRemap = ValMap.Empty - removeTraitSolutions = false } + removeTraitSolutions = false + extSlnsMap = Map.empty } type Remap with static member Empty = emptyRemap @@ -237,25 +247,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 @@ -276,7 +286,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. @@ -284,7 +301,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 @@ -377,12 +394,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 @@ -898,7 +917,9 @@ type TypeEquivEnv with static member FromEquivTypars tps1 tps2 = TypeEquivEnv.Empty.BindEquivTypars tps1 tps2 -let rec traitsAEquivAux erasureFlag g aenv (TTrait(tys1, nm, mf1, argtys, rty, _)) (TTrait(tys2, nm2, mf2, argtys2, rty2, _)) = +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 mf1 = mf2 && nm = nm2 && ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 && @@ -918,7 +939,7 @@ and typarConstraintsAEquivAux erasureFlag g aenv tpc1 tpc2 = TyparConstraint.CoercesTo(fcty, _) -> typeAEquivAux erasureFlag g aenv acty fcty - | TyparConstraint.MayResolveMember(trait1, _), + | TyparConstraint.MayResolveMember(trait1, _), TyparConstraint.MayResolveMember(trait2, _) -> traitsAEquivAux erasureFlag g aenv trait1 trait2 @@ -1419,6 +1440,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)) @@ -2031,7 +2053,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 @@ -2151,10 +2173,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) = @@ -2213,6 +2236,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 //-------------------------------------------------------------------------- @@ -2485,8 +2554,6 @@ module PrettyTypes = computeKeep keep (tp :: change) rest let keep, change = computeKeep [] [] ftps - // change |> List.iter (fun tp -> dprintf "change typar: %s %s %d\n" tp.Name (tp.DisplayName) (stamp_of_typar tp)) - // keep |> List.iter (fun tp -> dprintf "keep typar: %s %s %d\n" tp.Name (tp.DisplayName) (stamp_of_typar tp)) let alreadyInUse = keep |> List.map (fun x -> x.Name) let names = PrettyTyparNames (fun x -> List.memq x change) alreadyInUse ftps @@ -2500,8 +2567,7 @@ module PrettyTypes = let tauThings = mapTys getTauStayTau things let prettyThings = mapTys (instType renaming) tauThings - // niceTypars |> List.iter (fun tp -> dprintf "nice typar: %d\n" (stamp_of_typar tp)); * - let tpconstraints = niceTypars |> List.collect (fun tpnice -> List.map (fun tpc -> tpnice, tpc) tpnice.Constraints) + let tpconstraints = niceTypars |> List.collect (fun tpnice -> List.map (fun tpc -> tpnice, tpc) tpnice.Constraints) prettyThings, tpconstraints @@ -3335,7 +3401,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 -> @@ -3915,7 +3981,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 @@ -3993,7 +4060,6 @@ let accValRemap g aenv (msigty: ModuleOrNamespaceType) (implVal: Val) (mrpi, mhi let vref = mkLocalValRef implVal match sigValOpt with | None -> - if verbose then dprintf "accValRemap, hide = %s#%d\n" implVal.LogicalName implVal.Stamp let mhi = { mhi with HiddenVals = Zset.add implVal mhi.HiddenVals } (mrpi, mhi) | Some (sigVal: Val) -> @@ -4017,7 +4083,6 @@ let rec accValRemapFromModuleOrNamespaceType g aenv (mty: ModuleOrNamespaceType) acc let ComputeRemappingFromInferredSignatureToExplicitSignature g mty msigty = - // dprintf "ComputeRemappingFromInferredSignatureToExplicitSignature, \nmty = %s\nmmsigty=%s\n" (showL(entityTypeL mty)) (showL(entityTypeL msigty)) let ((mrpi, _) as entityRemap) = accEntityRemapFromModuleOrNamespaceType mty msigty (SignatureRepackageInfo.Empty, SignatureHidingInfo.Empty) let aenv = mrpi.ImplToSigMapping let valAndEntityRemap = accValRemapFromModuleOrNamespaceType g aenv mty msigty entityRemap @@ -4078,7 +4143,6 @@ and accValRemapFromModuleOrNamespaceBind g aenv msigty x acc = and accValRemapFromModuleOrNamespaceDefs g aenv msigty mdefs acc = List.foldBack (accValRemapFromModuleOrNamespace g aenv msigty) mdefs acc let ComputeRemappingFromImplementationToSignature g mdef msigty = - //if verbose then dprintf "ComputeRemappingFromImplementationToSignature, \nmdefs = %s\nmsigty=%s\n" (showL(DebugPrint.mdefL mdef)) (showL(DebugPrint.entityTypeL msigty)) let ((mrpi, _) as entityRemap) = accEntityRemapFromModuleOrNamespace msigty mdef (SignatureRepackageInfo.Empty, SignatureHidingInfo.Empty) let aenv = mrpi.ImplToSigMapping @@ -4134,16 +4198,14 @@ let rec accModuleOrNamespaceHidingInfoAtAssemblyBoundary mty acc = acc let ComputeHidingInfoAtAssemblyBoundary mty acc = -// dprintf "ComputeRemappingFromInferredSignatureToExplicitSignature, \nmty = %s\nmmsigty=%s\n" (showL(entityTypeL mty)) (showL(entityTypeL msigty)) accModuleOrNamespaceHidingInfoAtAssemblyBoundary mty acc //-------------------------------------------------------------------------- // Compute instances of the above for mexpr -> mty //-------------------------------------------------------------------------- -let IsHidden setF accessF remapF debugF = +let IsHidden setF accessF remapF = let rec check mrmi x = - if verbose then dprintf "IsHidden %s ??\n" (showL (debugF x)) // Internal/private? not (canAccessFromEverywhere (accessF x)) || (match mrmi with @@ -4154,14 +4216,15 @@ let IsHidden setF accessF remapF debugF = // Recurse... check rest (remapF rpi x)) fun mrmi x -> - let res = check mrmi x - if verbose then dprintf "IsHidden, #mrmi = %d, %s = %b\n" mrmi.Length (showL (debugF x)) res - res + 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) DebugPrint.tyconL mrmi x -let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x -let IsHiddenVal mrmi x = IsHidden (fun mhi -> mhi.HiddenVals) (fun v -> v.Accessibility) (fun rpi x -> (remapValRef rpi (mkLocalValRef x)).Deref) DebugPrint.valL mrmi x -let IsHiddenRecdField mrmi x = IsHidden (fun mhi -> mhi.HiddenRecdFields) (fun rfref -> rfref.RecdField.Accessibility) (fun rpi x -> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL 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 + +let IsHiddenVal mrmi x = IsHidden (fun mhi -> mhi.HiddenVals) (fun v -> v.Accessibility) (fun rpi x -> (remapValRef rpi (mkLocalValRef x)).Deref) mrmi x + +let IsHiddenRecdField mrmi x = IsHidden (fun mhi -> mhi.HiddenRecdFields) (fun rfref -> rfref.RecdField.Accessibility) (fun rpi x -> remapRecdFieldRef rpi.tyconRefRemap x) mrmi x //-------------------------------------------------------------------------- // Generic operations on module types @@ -4545,7 +4608,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 @@ -5411,7 +5474,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 @@ -5626,7 +5692,7 @@ let rec tyOfExpr g e = | TOp.LValueOp (LByrefGet, v) -> destByrefTy g v.Type | TOp.LValueOp (LAddrOf readonly, v) -> mkByrefTyWithFlag g readonly v.Type | TOp.RefAddrGet readonly -> (match tinst with [ty] -> mkByrefTyWithFlag g readonly ty | _ -> failwith "bad TOp.RefAddrGet node") - | TOp.TraitCall (TTrait(_, _, _, _, ty, _)) -> GetFSharpViewOfReturnType g ty + | TOp.TraitCall traitInfo -> GetFSharpViewOfReturnType g traitInfo.ReturnType | TOp.Reraise -> (match tinst with [rtn_ty] -> rtn_ty | _ -> failwith "bad TOp.Reraise node") | TOp.Goto _ | TOp.Label _ | TOp.Return -> //assert false @@ -7641,7 +7707,6 @@ let typarEnc _g (gtpsType, gtpsMethod) typar = "``0" let rec typeEnc g (gtpsType, gtpsMethod) ty = - if verbose then dprintf "--> typeEnc" let stripped = stripTyEqnsAndMeasureEqns g ty match stripped with | TType_forall _ -> diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 6098625122f..89445dd56e4 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -469,6 +469,8 @@ type TyconRefMap<'T> = /// Determine if the map is empty member IsEmpty : bool + member Contents : StampMap<'T> + /// The empty map static member Empty : TyconRefMap<'T> @@ -485,6 +487,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> @@ -526,9 +530,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 @@ -549,6 +562,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 @@ -1442,6 +1456,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 6bb5dacaccd..833348db756 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1485,7 +1485,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 = @@ -1517,10 +1518,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 old mode 100755 new mode 100644 index 0fc972b8cee..58b3a8bfeed --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -218,11 +218,13 @@ 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 let computeAccessRights eAccessPath eInternalsVisibleCompPaths eFamilyType = - AccessibleFrom (eAccessPath :: eInternalsVisibleCompPaths, eFamilyType) // env.eAccessRights + AccessibleFrom (eAccessPath :: eInternalsVisibleCompPaths, eFamilyType) // env.AccessRights let emptyTcEnv g = let cpath = compPathInternal // allow internal access initially @@ -308,6 +310,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 @@ -367,7 +371,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 and namespaces implied by an `open` declaration @@ -430,7 +434,7 @@ let AddModuleAbbreviationAndReport tcSink scopem id modrefs env = CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) let item = Item.ModuleOrNamespaces modrefs - CallNameResolutionSink tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) env /// Add a "module X = ..." definition to the TcEnv @@ -443,7 +447,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 @@ -513,7 +517,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 @@ -536,8 +540,8 @@ type cenv = override __.ToString() = "cenv(...)" -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) @@ -557,7 +561,7 @@ let MakeInnerEnvWithAcc env nm mtypeAcc modKind = eCompPath = cpath eAccessPath = cpath eAccessRights = computeAccessRights cpath env.eInternalsVisibleCompPaths env.eFamilyType // update this computed field - eNameResEnv = { env.eNameResEnv with eDisplayEnv = env.DisplayEnv.AddOpenPath (pathOfLid path) } + eNameResEnv = { env.NameEnv with eDisplayEnv = env.DisplayEnv.AddOpenPath (pathOfLid path) } eModuleOrNamespaceTypeAccumulator = mtypeAcc } /// Make an environment suitable for a module or namespace, creating a new accumulator. @@ -858,7 +862,7 @@ module AttributeTargets = let ForNewConstructors tcSink (env: TcEnv) mObjTy methodName meths = let origItem = Item.CtorGroup(methodName, meths) - let callSink (item, minst) = CallNameResolutionSink tcSink (mObjTy, env.NameEnv, item, origItem, minst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + let callSink (item, minst) = CallNameResolutionSink tcSink (mObjTy, env.NameEnv, item, origItem, minst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) let sendToSink minst refinedMeths = callSink (Item.CtorGroup(methodName, refinedMeths), minst) match meths with | [] -> @@ -1061,9 +1065,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 = @@ -1296,7 +1297,7 @@ let PublishModuleDefn cenv env mspec = if intoFslibCcu then mty else mty.AddEntity mspec) let item = Item.ModuleOrNamespaces([mkLocalModRef mspec]) - CallNameResolutionSink cenv.tcSink (mspec.Range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (mspec.Range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.AccessRights) let PublishTypeDefn cenv env tycon = UpdateAccModuleOrNamespaceType cenv env (fun _ mty -> @@ -1526,7 +1527,7 @@ let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, vscheme, baseOrThisInfo = ValBaseOrThisInfo.MemberThisVal && vspec.LogicalName = "__" -> false | _ -> true - match cenv.tcSink.CurrentSink with + match cenv.tcSink.CurrentSink with | Some _ when not vspec.IsCompilerGenerated && shouldNotifySink vspec -> let nenv = AddFakeNamedValRefToNameEnv vspec.DisplayName env.NameEnv (mkLocalValRef vspec) CallEnvSink cenv.tcSink (vspec.Range, nenv, env.eAccessRights) @@ -1904,33 +1905,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 infoOfTyconRef 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 @@ -1952,7 +1953,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) @@ -2004,7 +2005,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 @@ -2111,24 +2112,24 @@ module GeneralizationHelpers = let ComputeUnabstractableTycons env = - let acc_in_free_item acc (item: UngeneralizableItem) = + let accInFreeItem acc (item: UngeneralizableItem) = let ftycs = if item.WillNeverHaveFreeTypars then item.CachedFreeLocalTycons else let ftyvs = item.GetFreeTyvars() ftyvs.FreeTycons if ftycs.IsEmpty then acc else unionFreeTycons ftycs acc - List.fold acc_in_free_item emptyFreeTycons env.eUngeneralizableItems + List.fold accInFreeItem emptyFreeTycons env.eUngeneralizableItems let ComputeUnabstractableTraitSolutions env = - let acc_in_free_item acc (item: UngeneralizableItem) = + let accInFreeItem acc (item: UngeneralizableItem) = let ftycs = if item.WillNeverHaveFreeTypars then item.CachedFreeTraitSolutions else let ftyvs = item.GetFreeTyvars() ftyvs.FreeTraitSolutions if ftycs.IsEmpty then acc else unionFreeLocals ftycs acc - List.fold acc_in_free_item emptyFreeLocals env.eUngeneralizableItems + List.fold accInFreeItem emptyFreeLocals env.eUngeneralizableItems let rec IsGeneralizableValue g t = match t with @@ -2283,17 +2284,17 @@ module GeneralizationHelpers = (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult - let ComputeAndGeneralizeGenericTypars (cenv, - denv: DisplayEnv, - m, - freeInEnv: FreeTypars, - canInferTypars, - genConstrainedTyparFlag, - inlineFlag, - exprOpt, - allDeclaredTypars: Typars, - maxInferredTypars: Typars, - tauTy, + let ComputeAndGeneralizeGenericTypars (cenv, + denv: DisplayEnv, + m, + freeInEnv: FreeTypars, + canInferTypars, + genConstrainedTyparFlag, + inlineFlag, + exprOpt, + allDeclaredTypars: Typars, + maxInferredTypars: Typars, + tauTy, resultFirst) = let allDeclaredTypars = NormalizeDeclaredTyparsForEquiRecursiveInference cenv.g allDeclaredTypars @@ -2526,7 +2527,7 @@ module BindingNormalization = | _ -> MakeNormalizedInstanceMemberBinding cenv thisId memberId toolId vis m typars args rhsExpr valSynData let private NormalizeBindingPattern cenv nameResolver isObjExprBinding (env: TcEnv) valSynData pat rhsExpr = - let ad = env.eAccessRights + let ad = env.AccessRights let (SynValData(memberFlagsOpt, _, _)) = valSynData let rec normPattern pat = // One major problem with versions of F# prior to 1.9.x was that data constructors easily 'pollute' the namespace @@ -2537,7 +2538,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.eNameResEnv TypeNameResolutionInfo.Default longId with + match ResolvePatternLongIdent cenv.tcSink nameResolver AllIdsOK true m ad env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> if id.idText = opNameCons then NormalizedBindingPat(pat, rhsExpr, valSynData, typars) @@ -2669,11 +2670,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 = @@ -2740,10 +2741,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 @@ -2764,7 +2765,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 -> @@ -2794,8 +2795,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) -> @@ -2815,7 +2816,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 @@ -2825,7 +2826,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 @@ -2854,13 +2855,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 @@ -3037,7 +3038,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 @@ -3252,7 +3253,7 @@ let CompilePatternForMatchClauses cenv env mExpr matchm warnOnUnused actionOnFai // localAlloc is relevant if the enumerator is a mutable struct and indicates // if the enumerator can be allocated as a mutable local variable let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr = - let ad = env.eAccessRights + let ad = env.AccessRights let err k ty = let txt = NicePrint.minimalStringOfType env.DisplayEnv ty @@ -3275,7 +3276,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 @@ -3283,7 +3284,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 @@ -3292,7 +3293,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) @@ -4316,7 +4317,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 @@ -4350,10 +4351,14 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv memSpfn m = let logicalCompiledName = ComputeLogicalName id memberFlags let item = Item.ArgName (id, memberConstraintTy, None) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + 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), tpenv | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) + | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) @@ -4366,7 +4371,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 @@ -4511,9 +4516,9 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a | Some TyparKind.Type, TyparKind.Measure -> error (Error(FSComp.SR.tcExpectedTypeParameter(), id.idRange)); res, tpenv | _, _ -> let item = Item.TypeVar(id.idText, res) - 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) // 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 @@ -4525,7 +4530,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a if newOk = NoNewTypars then let predictTypeParameters() = let predictions1 = - env.eNameResEnv.eTypars + env.NameEnv.eTypars |> Seq.map (fun p -> "'" + p.Key) let predictions2 = @@ -4545,7 +4550,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a // The kind defaults to Type let tp' = NewTypar ((match optKind with None -> TyparKind.Type | Some kind -> kind), TyparRigidity.WarnIfNotRigid, tp, false, TyparDynamicReq.Yes, [], false, false) 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', AddUnscopedTypar key tp' tpenv and TcTypar cenv env newOk tpenv tp = @@ -4564,7 +4569,7 @@ and TcTyparDecl cenv env (TyparDecl(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 @@ -4585,7 +4590,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.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) + let tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver occ OpenQualified env.NameEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match optKind, tcref.TypeOrMeasureKind with | Some TyparKind.Type, TyparKind.Measure -> error(Error(FSComp.SR.tcExpectedTypeNotUnitOfMeasure(), m)) @@ -4817,7 +4822,7 @@ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (v: SynType) idOpt co match idOpt with | Some id -> let item = Item.ArgName (id, ttype, Some container) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) | _ -> () match v with @@ -4997,7 +5002,7 @@ and TcProvidedTypeApp cenv env tpenv tcref args m = /// the prefix of type arguments. and TcTypeApp cenv newOk checkCxs occ env tpenv m tcref pathTypeArgs (synArgTys: SynType list) = let g = cenv.g - CheckTyconAccessible cenv.amap m env.eAccessRights tcref |> ignore + CheckTyconAccessible cenv.amap m env.AccessRights tcref |> ignore CheckEntityAttributes g tcref m |> CommitOperationResult #if !NO_EXTENSIONTYPING @@ -5006,7 +5011,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, _ = infoOfTyconRef 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. @@ -5187,7 +5192,7 @@ and TcPatBindingName cenv env id ty isMemberThis vis1 topValData (inlineFlag, de // For non-left-most paths, we register the name resolutions here if not isLeftMost && not vspec.IsCompilerGenerated && not (vspec.LogicalName.StartsWithOrdinal("_")) then let item = Item.Value(mkLocalValRef vspec) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.AccessRights) PBind(vspec, typeScheme)), names, takenNames @@ -5212,7 +5217,7 @@ and TcPatAndRecover warnOnUpper cenv (env: TcEnv) topValInfo vFlags (tpenv, name /// the second-phase function in terms of a List.map from names to actual /// value specifications. and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty pat = - let ad = env.eAccessRights + let ad = env.AccessRights match pat with | SynPat.Const (c, m) -> match c with @@ -5291,7 +5296,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.eNameResEnv TypeNameResolutionInfo.Default longId with + match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver warnOnUpperForId false m ad env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> match args with | SynConstructorArgs.Pats [] @@ -5301,7 +5306,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 @@ -5362,7 +5367,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let activePatIdentity = if isNil activePatArgsAsSynExprs then Some (vref, tinst) else None (fun values -> // Report information about the 'active recognizer' occurrence to IDE - CallNameResolutionSink cenv.tcSink (rangeOfLid longId, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Pattern, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (rangeOfLid longId, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Pattern, env.DisplayEnv, env.AccessRights) TPat_query((activePatExpr, activePatResTys, activePatIdentity, idx, apinfo), arg' values, m)), (tpenv, names, takenNames) @@ -5429,12 +5434,12 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let args', acc = TcPatterns warnOnUpper cenv env vFlags (tpenv, names, takenNames) argTys args (fun values -> // Report information about the case occurrence to IDE - CallNameResolutionSink cenv.tcSink (rangeOfLid longId, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Pattern, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (rangeOfLid longId, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Pattern, env.DisplayEnv, env.AccessRights) mkf m (List.map (fun f -> f values) args')), acc | Item.ILField finfo -> // LITERAL .NET FIELDS - CheckILFieldInfoAccessible cenv.g cenv.amap m env.eAccessRights finfo + CheckILFieldInfoAccessible cenv.g cenv.amap m env.AccessRights finfo if not finfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(finfo.FieldName), m)) CheckILFieldAttributes cenv.g finfo m match finfo.LiteralValue with @@ -5449,7 +5454,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | Item.RecdField rfinfo -> // LITERAL F# FIELDS - CheckRecdFieldInfoAccessible cenv.amap m env.eAccessRights rfinfo + CheckRecdFieldInfoAccessible cenv.amap m env.AccessRights rfinfo if not rfinfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.Name), m)) CheckRecdFieldInfoAttributes cenv.g rfinfo m |> CommitOperationResult match rfinfo.LiteralValue with @@ -5467,8 +5472,8 @@ 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 - CheckValAccessible m env.eAccessRights vref + 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() UnifyTypes cenv env m ty vexpty @@ -5500,7 +5505,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 = infoOfTyconRef 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) @@ -5524,6 +5529,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | SynPat.InstanceMember (_, _, _, _, m) -> errorR(Error(FSComp.SR.tcIllegalPattern(), pat.Range)) (fun _ -> TPat_wild m), (tpenv, names, takenNames) + | SynPat.FromParseError (pat, _) -> suppressErrorReporting (fun () -> TcPatAndRecover warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) (NewErrorType()) pat) @@ -5737,7 +5743,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = | SynExpr.Paren (expr2, _, _, mWholeExprIncludingParentheses) -> // We invoke CallExprHasTypeSink for every construct which is atomic in the syntax, i.e. where a '.' immediately following the // construct is a dot-lookup for the result of the construct. - CallExprHasTypeSink cenv.tcSink (mWholeExprIncludingParentheses, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (mWholeExprIncludingParentheses, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) let env = ShrinkContext env mWholeExprIncludingParentheses expr2.Range TcExpr cenv overallTy env tpenv expr2 @@ -5745,7 +5751,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = | SynExpr.TypeApp _ | SynExpr.Ident _ | SynExpr.LongIdent _ | SynExpr.App _ | SynExpr.DotGet _ -> error(Error(FSComp.SR.tcExprUndelayed(), synExpr.Range)) | SynExpr.Const (SynConst.String (s, m), _) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) TcConstStringExpr cenv overallTy env m tpenv s | SynExpr.Const (synConst, m) -> @@ -5865,7 +5871,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = TcAnonRecdExpr cenv overallTy env tpenv (isStruct, optOrigExpr, unsortedArgs, mWholeExpr) | SynExpr.ArrayOrList (isArray, args, m) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) let argty = NewInferenceType () UnifyTypes cenv env m overallTy (if isArray then mkArrayType cenv.g argty else Tastops.mkListTy cenv.g argty) @@ -5893,11 +5899,11 @@ 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) -> - CallExprHasTypeSink cenv.tcSink (mWholeExpr, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (mWholeExpr, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr) | SynExpr.While (spWhile, synGuardExpr, synBodyExpr, m) -> @@ -5915,7 +5921,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = // notify name resolution sink about loop variable let item = Item.Value(mkLocalValRef idv) - CallNameResolutionSink cenv.tcSink (idv.Range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (idv.Range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.AccessRights) let bodyExpr, tpenv = TcStmt cenv envinner tpenv body mkFastForLoop cenv.g (spBind, m, idv, startExpr, dir, finishExpr, bodyExpr), tpenv @@ -5941,7 +5947,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = TcComputationOrSequenceExpression cenv env overallTy m None tpenv comp | SynExpr.ArrayOrListOfSeqExpr (isArray, comp, m) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) match comp with | SynExpr.CompExpr (_, _, (SimpleSemicolonSequence true elems as body), _) -> @@ -6105,11 +6111,12 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = | SynExpr.TraitCall (tps, memSpfn, arg, m) -> let synTypes = tps |> List.map (fun tp -> SynType.Var(tp, m)) - let (TTrait(_, logicalCompiledName, _, argTys, returnTy, _) as traitInfo), tpenv = TcPseudoMemberSpec cenv NewTyparsOK env synTypes tpenv memSpfn m - if BakedInTraitConstraintNames.Contains logicalCompiledName then - warning(BakedInMemberConstraintName(logicalCompiledName, m)) + let traitInfo, tpenv = TcPseudoMemberSpec cenv NewTyparsOK env synTypes tpenv memSpfn m + if BakedInTraitConstraintNames.Contains traitInfo.MemberName then + warning(BakedInMemberConstraintName(traitInfo.MemberName, m)) - let returnTy = GetFSharpViewOfReturnType cenv.g returnTy + let argTys = traitInfo.ArgumentTypes + let returnTy = GetFSharpViewOfReturnType cenv.g traitInfo.ReturnType let args, namedCallerArgs = GetMethodArgs arg if not (isNil namedCallerArgs) then errorR(Error(FSComp.SR.tcNamedArgumentsCannotBeUsedInMemberTraits(), m)) // Subsumption at trait calls if arguments have nominal type prior to unification of any arguments or return type @@ -6156,7 +6163,7 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = mkAsmExpr (Array.toList s, tyargs', args', rtys', m), tpenv | SynExpr.Quote (oper, raw, ast, isFromQueryExpression, m) -> - CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.AccessRights) TcQuotationExpr cenv overallTy env tpenv (oper, raw, ast, isFromQueryExpression, m) | SynExpr.YieldOrReturn ((isTrueYield, _), _, m) @@ -6206,7 +6213,7 @@ and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = // .NET metadata. This means we manually typecheck 'e1' and look to see if it has a nominal type. We then // do the right thing in each case. and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArgs delayed = - let ad = env.eAccessRights + let ad = env.AccessRights let e1', e1ty, tpenv = TcExprOfUnknownType cenv env tpenv e1 // Find the first type in the effective hierarchy that either has a DefaultMember attribute OR @@ -6321,7 +6328,7 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg /// For 'inherit Type(args)', mWholeExprOrObjTy is the whole expression /// For an implicit inherit from System.Object or a default constructor, mWholeExprOrObjTy is the type name of the type being defined and TcNewExpr cenv env tpenv objTy mObjTyOpt superInit arg mWholeExprOrObjTy = - let ad = env.eAccessRights + let ad = env.AccessRights // Handle the case 'new 'a()' if (isTyparTy cenv.g objTy) then if superInit then error(Error(FSComp.SR.tcCannotInheritFromVariableType(), mWholeExprOrObjTy)) @@ -6340,7 +6347,7 @@ and TcNewExpr cenv env tpenv objTy mObjTyOpt superInit arg mWholeExprOrObjTy = /// Check an 'inheritedTys declaration in an implicit or explicit class and TcCtorCall isNaked cenv env tpenv overallTy objTy mObjTyOpt item superInit args mWholeCall delayed afterTcOverloadResolutionOpt = - let ad = env.eAccessRights + let ad = env.AccessRights let isSuperInit = (if superInit then CtorValUsedAsSuperInit else NormalValUse) let mItem = match mObjTyOpt with Some m -> m | None -> mWholeCall @@ -6369,7 +6376,7 @@ and TcCtorCall isNaked cenv env tpenv overallTy objTy mObjTyOpt item superInit a | Item.DelegateCtor ty, [arg] -> // Re-record the name resolution since we now know it's a constructor call match mObjTyOpt with - | Some mObjTy -> CallNameResolutionSink cenv.tcSink (mObjTy, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + | Some mObjTy -> CallNameResolutionSink cenv.tcSink (mObjTy, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) | None -> () TcNewDelegateThen cenv objTy env tpenv mItem mWholeCall ty arg ExprAtomicFlag.NonAtomic delayed @@ -6447,7 +6454,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 @@ -6545,8 +6552,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) @@ -6711,7 +6717,7 @@ and TcObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, // Object expression members can access protected members of the implemented type let env = EnterFamilyRegion tcref env - let ad = env.eAccessRights + let ad = env.AccessRights if // record construction ? isRecordTy || @@ -6753,7 +6759,7 @@ and TcObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, | Item.CtorGroup(methodName, minfos), Some (arg, baseIdOpt) -> let meths = minfos |> List.map (fun minfo -> minfo, None) let afterResolution = ForNewConstructors cenv.tcSink env synObjTy.Range methodName minfos - let ad = env.eAccessRights + let ad = env.AccessRights let expr, tpenv = TcMethodApplicationThen cenv env objTy None tpenv None [] mWholeExpr mObjTy methodName ad PossiblyMutates false meths afterResolution CtorValUsedAsSuperInit [arg] ExprAtomicFlag.Atomic [] // The 'base' value is always bound @@ -6959,7 +6965,7 @@ and TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr | [] -> [] | _ -> let tcref, _, fldsList = BuildFieldMap cenv env hasOrigExpr overallTy flds mWholeExpr - let _, _, _, gtyp = infoOfTyconRef mWholeExpr tcref + let _, _, _, gtyp = FreshenTyconRef2 env.TraitFreshner mWholeExpr tcref UnifyTypes cenv env mWholeExpr overallTy gtyp [ for n, v in fldsList do @@ -7255,7 +7261,7 @@ and IgnoreAttribute _ = None and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv comp = //dprintfn "TcComputationOrSequenceExpression, comp = \n%A\n-------------------\n" comp - let ad = env.eAccessRights + let ad = env.AccessRights let mkSynDelay2 (e: SynExpr) = mkSynDelay (e.Range.MakeSynthetic()) e @@ -7478,7 +7484,7 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv match e with | SynExpr.App (_, _, SynExpr.App (_, _, e1, SingleIdent opName, _), e2, _) when opName.idText = customOperationJoinConditionWord nm -> let item = Item.CustomOperation (opName.idText, (fun () -> None), None) - CallNameResolutionSink cenv.tcSink (opName.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (opName.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.AccessRights) Some (e1, e2) | _ -> None @@ -8692,9 +8698,9 @@ 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, _ = infoOfTyconRef mItem ucref.TyconRef - let ucinfo = UnionCaseInfo(tinst, ucref) + 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)) | _ -> ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy item @@ -8948,6 +8954,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del | Item.FakeInterfaceCtor _ -> error(Error(FSComp.SR.tcInvalidUseOfInterfaceType(), mItem)) + | Item.ImplicitOp(id, sln) -> let isPrefix = PrettyNaming.IsPrefixOperator id.idText @@ -8974,7 +8981,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) @@ -9086,10 +9095,10 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Mutable value set: 'v <- e' | DelayedSet(e2, mStmt) :: otherDelayed -> if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mStmt)) - UnifyTypes cenv env mStmt overallTy g.unit_ty - vref.Deref.SetHasBeenReferenced() - CheckValAccessible mItem env.eAccessRights vref - CheckValAttributes g vref mItem |> CommitOperationResult + UnifyTypes cenv env mStmt overallTy cenv.g.unit_ty + vref.Deref.SetHasBeenReferenced() + CheckValAccessible mItem env.AccessRights vref + CheckValAttributes cenv.g vref mItem |> CommitOperationResult let vty = vref.Type let vty2 = if isByrefTy g vty then @@ -9117,7 +9126,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 @@ -9125,7 +9134,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 @@ -9282,7 +9291,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela if isTyparTy cenv.g objExprTy then GeneralizationHelpers.CanonicalizePartialInferenceProblem (cenv, env.DisplayEnv, mExprAndLongId) (freeInTypeLeftToRight cenv.g false objExprTy) - let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.eNameResEnv objExprTy longId findFlag false + let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId findFlag false let mExprAndItem = unionRanges mObjExpr mItem let delayed = delayRest rest mExprAndItem delayed @@ -9718,12 +9727,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 @@ -9732,7 +9741,7 @@ and TcMethodApplication if meth.UsesParamArrayConversion then yield makeOneCalledMeth (minfo, pinfoOpt, false) ] - let uniquelyResolved = + let uniquelyResolved = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext cenv.css mMethExpr denv UnifyUniqueOverloading csenv callerArgCounts methodName ad preArgumentTypeCheckingCalledMethGroup returnTy @@ -9823,7 +9832,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 @@ -10734,7 +10743,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt apinfo.ActiveTagsWithRanges |> List.iteri (fun i (_tag, tagRange) -> let item = Item.ActivePatternResult(apinfo, cenv.g.unit_ty, i, tagRange) - CallNameResolutionSink cenv.tcSink (tagRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights)) + CallNameResolutionSink cenv.tcSink (tagRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.AccessRights)) { envinner with eNameResEnv = AddActivePatternResultTagsToNameEnv apinfo envinner.eNameResEnv ty m } | None -> @@ -11274,7 +11283,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) @@ -11331,7 +11340,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)) @@ -11408,7 +11417,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 @@ -11478,7 +11487,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 @@ -11642,7 +11651,6 @@ and AnalyzeAndMakeAndPublishRecursiveValue overridesOK isGeneratedEventVal cenv let item = Item.Value (mkLocalValRef vspec) CallNameResolutionSink cenv.tcSink (tid.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.RelatedText, env.DisplayEnv, env.eAccessRights) | _ -> () - let mangledId = ident(vspec.LogicalName, vspec.Range) // Reconstitute the binding with the unique name @@ -11964,7 +11972,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 @@ -12206,7 +12214,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) @@ -13427,7 +13435,7 @@ module MutRecBindingChecking = AddLocalTyconRefs true g cenv.amap tcref.Range [tcref] initalEnvForTycon // 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 @@ -14157,7 +14165,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/TypeRelations.fs b/src/fsharp/TypeRelations.fs index 2169bf295cb..e15acac2b77 100755 --- a/src/fsharp/TypeRelations.fs +++ b/src/fsharp/TypeRelations.fs @@ -137,7 +137,7 @@ let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) = match tpc with | TyparConstraint.CoercesTo(x, m) -> join m x, m - | TyparConstraint.MayResolveMember(TTrait(_, _, _, _, _, _), m) -> + | TyparConstraint.MayResolveMember(_traitInfo, m) -> maxSoFar, m | TyparConstraint.SimpleChoice(_, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInPrintf(), m)) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 568773a361c..779dd69cc2f 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -1978,7 +1978,7 @@ let main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, use unwindParsePhase = PushThreadBuildPhaseUntilUnwind (BuildPhase.TypeCheck) let tcEnv0 = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) - let tcState,topAttrs,typedAssembly,_tcEnvAtEnd = + let tcState, topAttrs, typedAssembly, _tcEnvAtEnd = TypeCheck(ctok, tcConfig, tcImports, tcGlobals, errorLogger, assemblyName, NiceNameGenerator(), tcEnv0, inputs,exiter) let generatedCcu = tcState.Ccu @@ -2024,7 +2024,7 @@ let main2a(Args (ctok, tcConfig, tcImports, frameworkTcImports: TcImports, tcGlo use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Optimize let optEnv0 = GetInitialOptimizationEnv (tcImports, tcGlobals) - + let importMap = tcImports.GetImportMap() let metadataVersion = match tcConfig.metadataVersion with diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index dd6f8b0e3f3..5c1b280bf01 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 @@ -863,9 +881,7 @@ type ILMethInfo = // MethInfo -#if DEBUG [] -#endif /// Describes an F# use of a method [] type MethInfo = @@ -948,7 +964,6 @@ type MethInfo = /// over extension members. member x.ExtensionMemberPriority = defaultArg x.ExtensionMemberPriorityOption System.UInt64.MaxValue -#if DEBUG /// Get the method name in DebuggerDisplayForm member x.DebuggerDisplayName = match x with @@ -958,7 +973,6 @@ type MethInfo = | ProvidedMeth(_, mi, _, m) -> "ProvidedMeth: " + mi.PUntaint((fun mi -> mi.Name), m) #endif | DefaultStructCtor _ -> ".ctor" -#endif /// Get the method name in LogicalName form, i.e. the name as it would be stored in .NET metadata member x.LogicalName = @@ -1504,10 +1518,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)) @@ -2221,6 +2235,8 @@ type PropInfo = | ProvidedProp(_, pi, _) -> ProvidedPropertyInfo.TaintedGetHashCode pi #endif + override x.ToString() = "property " + x.PropertyName + //------------------------------------------------------------------------- // ILEventInfo @@ -2468,6 +2484,7 @@ type EventInfo = #if !NO_EXTENSIONTYPING | ProvidedEvent (_, ei, _) -> ProvidedEventInfo.TaintedGetHashCode ei #endif + override x.ToString() = "event " + x.EventName //------------------------------------------------------------------------- // Helpers associated with getting and comparing method signatures diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index e09e1d4df30..2959d81e9a4 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, _colution)), _, _ -> + | 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 50368c3ca2f..f197c8ed90f 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1211,7 +1211,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 @@ -1269,7 +1270,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 33fffda0a26..7d9bb6986e1 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2321,6 +2321,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 = @@ -2334,7 +2342,7 @@ and | SupportsNull of range /// Indicates a constraint that a type has a member with the given signature - | MayResolveMember of TraitConstraintInfo * range + | MayResolveMember of TraitConstraintInfo * range /// Indicates a constraint that a type is a non-Nullable value type /// These are part of .NET's model of generic constraints, and in order to @@ -2376,22 +2384,34 @@ and [] TraitConstraintInfo = - /// TTrait(tys, nm, memFlags, argtys, rty, colution) + /// 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) /// 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() @@ -4847,7 +4867,7 @@ and | Label of ILCodeLabel /// Pseudo method calls. This is used for overloaded operations like op_Addition. - | TraitCall of TraitConstraintInfo + | TraitCall of TraitConstraintInfo /// Operation nodes representing C-style operations on byrefs and mutable vals (l-values) | LValueOp of LValueOperation * ValRef diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index faca9cae453..aed60b4455d 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -5237,11 +5237,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 8bb6848ede1..d34553fbd81 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -5237,11 +5237,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.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf new file mode 100644 index 00000000000..841ba6e1e5a --- /dev/null +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -0,0 +1,7132 @@ + + + + + + The namespace '{0}' is not defined. + The namespace '{0}' is not defined. + + + + The namespace or module '{0}' is not defined. + The namespace or module '{0}' is not defined. + + + + The field, constructor or member '{0}' is not defined. + The field, constructor or member '{0}' is not defined. + + + + The value, constructor, namespace or type '{0}' is not defined. + The value, constructor, namespace or type '{0}' is not defined. + + + + The value or constructor '{0}' is not defined. + The value or constructor '{0}' is not defined. + + + + The value, namespace, type or module '{0}' is not defined. + The value, namespace, type or module '{0}' is not defined. + + + + The constructor, module or namespace '{0}' is not defined. + The constructor, module or namespace '{0}' is not defined. + + + + The type '{0}' is not defined. + The type '{0}' is not defined. + + + + The type '{0}' is not defined in '{1}'. + The type '{0}' is not defined in '{1}'. + + + + The record label or namespace '{0}' is not defined. + The record label or namespace '{0}' is not defined. + + + + The record label '{0}' is not defined. + The record label '{0}' is not defined. + + + + Maybe you want one of the following: + Maybe you want one of the following: + + + + The type parameter {0} is not defined. + The type parameter {0} is not defined. + + + + The pattern discriminator '{0}' is not defined. + The pattern discriminator '{0}' is not defined. + + + + Replace with '{0}' + Replace with '{0}' + + + + Add . for indexer access. + Add . for indexer access. + + + + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + + + + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + + + + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + + + + The 'if' expression needs to have type '{0}' to satisfy context type requirements. It currently has type '{1}'. + The 'if' expression needs to have type '{0}' to satisfy context type requirements. It currently has type '{1}'. + + + + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{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}'. + 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}'. + + + + A pattern match guard must be of type 'bool', but this 'when' expression is of type '{0}'. + A pattern match guard must be of type 'bool', but this 'when' expression is of type '{0}'. + + + + A ';' is used to separate field values in records. Consider replacing ',' with ';'. + A ';' is used to separate field values in records. Consider replacing ',' with ';'. + + + + The '!' operator is used to dereference a ref cell. Consider using 'not expr' here. + The '!' operator is used to dereference a ref cell. Consider using 'not expr' here. + + + + The non-generic type '{0}' does not expect any type arguments, but here is given {1} type argument(s) + The non-generic type '{0}' does not expect any type arguments, but here is given {1} type argument(s) + + + + Consider using 'return!' instead of 'return'. + Consider using 'return!' instead of 'return'. + + + + Consider using 'yield!' instead of 'yield'. + Consider using 'yield!' instead of 'yield'. + + + + \nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface. + \nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface. + + + + Invalid warning number '{0}' + Invalid warning number '{0}' + + + + Invalid version string '{0}' + Invalid version string '{0}' + + + + Invalid version file '{0}' + Invalid version file '{0}' + + + + Microsoft (R) F# Compiler version {0} + Microsoft (R) F# Compiler version {0} + + + + F# Compiler for F# {0} + F# Compiler for F# {0} + + + + Problem with filename '{0}': {1} + Problem with filename '{0}': {1} + + + + No inputs specified + No inputs specified + + + + The '--pdb' option requires the '--debug' option to be used + The '--pdb' option requires the '--debug' option to be used + + + + The search directory '{0}' is invalid + The search directory '{0}' is invalid + + + + The search directory '{0}' could not be found + The search directory '{0}' could not be found + + + + '{0}' is not a valid filename + '{0}' is not a valid filename + + + + '{0}' is not a valid assembly name + '{0}' is not a valid assembly name + + + + Unrecognized privacy setting '{0}' for managed resource, valid options are 'public' and 'private' + Unrecognized privacy setting '{0}' for managed resource, valid options are 'public' and 'private' + + + + Multiple references to '{0}.dll' are not permitted + Multiple references to '{0}.dll' are not permitted + + + + Unable to read assembly '{0}' + Unable to read assembly '{0}' + + + + Assembly resolution failure at or near this location + Assembly resolution failure at or near this location + + + + The declarations in this file will be placed in an implicit module '{0}' based on the file name '{1}'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. + The declarations in this file will be placed in an implicit module '{0}' based on the file name '{1}'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. + + + + Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. + Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. + + + + Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error. + Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error. + + + + This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. + This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. + + + + Option requires parameter: {0} + Option requires parameter: {0} + + + + Source file '{0}' could not be found + Source file '{0}' could not be found + + + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. + + + + Could not resolve assembly '{0}' + Could not resolve assembly '{0}' + + + + Could not resolve assembly '{0}' required by '{1}' + Could not resolve assembly '{0}' required by '{1}' + + + + Error opening binary file '{0}': {1} + Error opening binary file '{0}': {1} + + + + The F#-compiled DLL '{0}' needs to be recompiled to be used with this version of F# + The F#-compiled DLL '{0}' needs to be recompiled to be used with this version of F# + + + + Invalid directive. Expected '#I \"<path>\"'. + Invalid directive. Expected '#I \"<path>\"'. + + + + Invalid directive. Expected '#r \"<file-or-assembly>\"'. + Invalid directive. Expected '#r \"<file-or-assembly>\"'. + + + + Invalid directive. Expected '#load \"<file>\" ... \"<file>\"'. + Invalid directive. Expected '#load \"<file>\" ... \"<file>\"'. + + + + Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. + Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. + + + + Directives inside modules are ignored + Directives inside modules are ignored + + + + A signature for the file or module '{0}' has already been specified + A signature for the file or module '{0}' has already been specified + + + + An implementation of file or module '{0}' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. + An implementation of file or module '{0}' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. + + + + An implementation of the file or module '{0}' has already been given + An implementation of the file or module '{0}' has already been given + + + + The signature file '{0}' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. + The signature file '{0}' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. + + + + '{0}' is not a valid integer argument + '{0}' is not a valid integer argument + + + + '{0}' is not a valid floating point argument + '{0}' is not a valid floating point argument + + + + Unrecognized option: '{0}' + Unrecognized option: '{0}' + + + + Invalid module or namespace name + Invalid module or namespace name + + + + Error reading/writing metadata for the F# compiled DLL '{0}'. Was the DLL compiled with an earlier version of the F# compiler? (error: '{1}'). + Error reading/writing metadata for the F# compiled DLL '{0}'. Was the DLL compiled with an earlier version of the F# compiler? (error: '{1}'). + + + + The type/module '{0}' is not a concrete module or type + The type/module '{0}' is not a concrete module or type + + + + The type '{0}' has an inline assembly code representation + The type '{0}' has an inline assembly code representation + + + + A namespace and a module named '{0}' both occur in two parts of this assembly + A namespace and a module named '{0}' both occur in two parts of this assembly + + + + Two modules named '{0}' occur in two parts of this assembly + Two modules named '{0}' occur in two parts of this assembly + + + + Two type definitions named '{0}' occur in namespace '{1}' in two parts of this assembly + Two type definitions named '{0}' occur in namespace '{1}' in two parts of this assembly + + + + A module and a type definition named '{0}' occur in namespace '{1}' in two parts of this assembly + A module and a type definition named '{0}' occur in namespace '{1}' in two parts of this assembly + + + + Invalid member signature encountered because of an earlier error + Invalid member signature encountered because of an earlier error + + + + This value does not have a valid property setter type + This value does not have a valid property setter type + + + + Invalid form for a property getter. At least one '()' argument is required when using the explicit syntax. + Invalid form for a property getter. At least one '()' argument is required when using the explicit syntax. + + + + Invalid form for a property setter. At least one argument is required. + Invalid form for a property setter. At least one argument is required. + + + + Unexpected use of a byref-typed variable + Unexpected use of a byref-typed variable + + + + Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. + Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. + + + + The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed + The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed + + + + Recursively defined values cannot appear directly as part of the construction of a tuple value within a recursive binding + Recursively defined values cannot appear directly as part of the construction of a tuple value within a recursive binding + + + + Recursive values cannot appear directly as a construction of the type '{0}' within a recursive binding. This feature has been removed from the F# language. Consider using a record instead. + Recursive values cannot appear directly as a construction of the type '{0}' within a recursive binding. This feature has been removed from the F# language. Consider using a record instead. + + + + Recursive values cannot be directly assigned to the non-mutable field '{0}' of the type '{1}' within a recursive binding. Consider using a mutable field instead. + Recursive values cannot be directly assigned to the non-mutable field '{0}' of the type '{1}' within a recursive binding. Consider using a mutable field instead. + + + + Unexpected decode of AutoOpenAttribute + Unexpected decode of AutoOpenAttribute + + + + Unexpected decode of InternalsVisibleToAttribute + Unexpected decode of InternalsVisibleToAttribute + + + + Unexpected decode of InterfaceDataVersionAttribute + Unexpected decode of InterfaceDataVersionAttribute + + + + Active patterns cannot return more than 7 possibilities + Active patterns cannot return more than 7 possibilities + + + + This is not a valid constant expression or custom attribute value + This is not a valid constant expression or custom attribute value + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe mutability attributes differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe mutability attributes differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe names differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe names differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled names differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled names differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe display names differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe display names differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe accessibility specified in the signature is more than that specified in the implementation + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe accessibility specified in the signature is more than that specified in the implementation + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe inline flags differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe inline flags differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe literal constant values and/or attributes differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe literal constant values and/or attributes differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is a type function and the other is not. The signature requires explicit type parameters if they are present in the implementation. + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is a type function and the other is not. The signature requires explicit type parameters if they are present in the implementation. + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe respective type parameter counts differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe respective type parameter counts differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe types differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe types differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is an extension member and the other is not + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is an extension member and the other is not + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nAn arity was not inferred for this value + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nAn arity was not inferred for this value + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe number of generic parameters in the signature and implementation differ (the signature declares {3} but the implementation declares {4} + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe number of generic parameters in the signature and implementation differ (the signature declares {3} but the implementation declares {4} + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe generic parameters in the signature and implementation have different kinds. Perhaps there is a missing [<Measure>] attribute. + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe generic parameters in the signature and implementation have different kinds. Perhaps there is a missing [<Measure>] attribute. + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe arities in the signature and implementation differ. The signature specifies that '{3}' is function definition or lambda expression accepting at least {4} argument(s), but the implementation is a computed function value. To declare that a computed function value is a permitted implementation simply parenthesize its type in the signature, e.g.\n\tval {5}: int -> (int -> int)\ninstead of\n\tval {6}: int -> int -> int. + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe arities in the signature and implementation differ. The signature specifies that '{3}' is function definition or lambda expression accepting at least {4} argument(s), but the implementation is a computed function value. To declare that a computed function value is a permitted implementation simply parenthesize its type in the signature, e.g.\n\tval {5}: int -> (int -> int)\ninstead of\n\tval {6}: int -> int -> int. + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe CLI member names differ + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe CLI member names differ + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is static and the other isn't + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is static and the other isn't + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is virtual and the other isn't + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is virtual and the other isn't + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is abstract and the other isn't + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is abstract and the other isn't + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is final and the other isn't + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is final and the other isn't + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is marked as an override and the other isn't + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is marked as an override and the other isn't + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is a constructor/property and the other is not + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is a constructor/property and the other is not + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member + + + + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member + Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member + + + + The {0} definitions in the signature and implementation are not compatible because the names differ. The type is called '{1}' in the signature file but '{2}' in implementation. + The {0} definitions in the signature and implementation are not compatible because the names differ. The type is called '{1}' in the signature file but '{2}' in implementation. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the respective type parameter counts differ + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the respective type parameter counts differ + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature requires that the type supports the interface {2} but the interface has not been implemented + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature requires that the type supports the interface {2} but the interface has not been implemented + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [<Sealed>] attribute to the signature. + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [<Sealed>] attribute to the signature. + + + + 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. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [<AbstractClass>] attribute to the signature. + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [<AbstractClass>] attribute to the signature. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [<AbstractClass>] attribute to the implementation. + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [<AbstractClass>] attribute to the implementation. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the types have different base types + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the types have different base types + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the number of {2}s differ + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the number of {2}s differ + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature defines the {2} '{3}' but the implementation does not (or does, but not in the same order) + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature defines the {2} '{3}' but the implementation does not (or does, but not in the same order) + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation defines the {2} '{3}' but the signature does not (or does, but not in the same order) + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation defines the {2} '{3}' but the signature does not (or does, but not in the same order) + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature + The {0} definitions for type '{1}' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because a type representation is being hidden by a signature + The {0} definitions for type '{1}' in the signature and implementation are not compatible because a type representation is being hidden by a signature + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the types are of different kinds + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the types are of different kinds + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the IL representations differ + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the IL representations differ + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the representations differ + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the representations differ + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field {2} was present in the implementation but not in the signature + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field {2} was present in the implementation but not in the signature + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field {2} was required by the signature but was not specified by the implementation + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field {2} was required by the signature but was not specified by the implementation + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field '{2}' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the field '{2}' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abstract member '{2}' was required by the signature but was not specified by the implementation + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abstract member '{2}' was required by the signature but was not specified by the implementation + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abstract member '{2}' was present in the implementation but not in the signature + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abstract member '{2}' was present in the implementation but not in the signature + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature declares a {2} while the implementation declares a {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature declares a {2} while the implementation declares a {3} + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the abbreviations differ: {2} versus {3} + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. + The {0} definitions for type '{1}' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. + + + + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not + The {0} definitions for type '{1}' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not + + + + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe names differ + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe names differ + + + + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe respective number of data fields differ + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe respective number of data fields differ + + + + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe types of the fields differ + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nThe types of the fields differ + + + + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nthe accessibility specified in the signature is more than that specified in the implementation + The module contains the constructor\n {0} \nbut its signature specifies\n {1} \nthe accessibility specified in the signature is more than that specified in the implementation + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe names differ + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe names differ + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nthe accessibility specified in the signature is more than that specified in the implementation + The module contains the field\n {0} \nbut its signature specifies\n {1} \nthe accessibility specified in the signature is more than that specified in the implementation + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'static' modifiers differ + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'static' modifiers differ + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'mutable' modifiers differ + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'mutable' modifiers differ + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'literal' modifiers differ + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'literal' modifiers differ + + + + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe types differ + The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe types differ + + + + The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '{0}' and '{1}'. Consider using type annotations to resolve the ambiguity + The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '{0}' and '{1}'. Consider using type annotations to resolve the ambiguity + + + + Could not resolve the ambiguity inherent in the use of a 'printf'-style format string + Could not resolve the ambiguity inherent in the use of a 'printf'-style format string + + + + Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position + Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position + + + + Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position + Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position + + + + Invalid value + Invalid value + + + + The signature and implementation are not compatible because the respective type parameter counts differ + The signature and implementation are not compatible because the respective type parameter counts differ + + + + The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation + The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation + + + + The signature and implementation are not compatible because the declaration of the type parameter '{0}' requires a constraint of the form {1} + The signature and implementation are not compatible because the declaration of the type parameter '{0}' requires a constraint of the form {1} + + + + The signature and implementation are not compatible because the type parameter '{0}' has a constraint of the form {1} but the implementation does not. Either remove this constraint from the signature or add it to the implementation. + The signature and implementation are not compatible because the type parameter '{0}' has a constraint of the form {1} but the implementation does not. Either remove this constraint from the signature or add it to the implementation. + + + + The type '{0}' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' + The type '{0}' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' + + + + The type '{0}' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly + The type '{0}' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly + + + + The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type + The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type + + + + The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' + The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' + + + + The struct, record or union type '{0}' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' + The struct, record or union type '{0}' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' + + + + The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1} + The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1} + + + + The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1} + The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1} + + + + The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + + + + The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + + + + The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + + + + The exception definitions are not compatible because the field '{0}' was required by the signature but was not specified by the implementation. The module contains the exception definition\n {1} \nbut its signature specifies\n\t{2}. + The exception definitions are not compatible because the field '{0}' was required by the signature but was not specified by the implementation. The module contains the exception definition\n {1} \nbut its signature specifies\n\t{2}. + + + + The exception definitions are not compatible because the field '{0}' was present in the implementation but not in the signature. The module contains the exception definition\n {1} \nbut its signature specifies\n\t{2}. + The exception definitions are not compatible because the field '{0}' was present in the implementation but not in the signature. The module contains the exception definition\n {1} \nbut its signature specifies\n\t{2}. + + + + The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n {0} \nbut its signature specifies\n\t{1}. + + + + The namespace or module attributes differ between signature and implementation + The namespace or module attributes differ between signature and implementation + + + + This method is over-constrained in its type parameters + This method is over-constrained in its type parameters + + + + No implementations of '{0}' had the correct number of arguments and type parameters. The required signature is '{1}'. + No implementations of '{0}' had the correct number of arguments and type parameters. The required signature is '{1}'. + + + + The override for '{0}' was ambiguous + The override for '{0}' was ambiguous + + + + More than one override implements '{0}' + More than one override implements '{0}' + + + + The method '{0}' is sealed and cannot be overridden + The method '{0}' is sealed and cannot be overridden + + + + The override '{0}' implements more than one abstract slot, e.g. '{1}' and '{2}' + The override '{0}' implements more than one abstract slot, e.g. '{1}' and '{2}' + + + + Duplicate or redundant interface + Duplicate or redundant interface + + + + The interface '{0}' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. + The interface '{0}' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. + + + + A named argument has been assigned more than one value + A named argument has been assigned more than one value + + + + No implementation was given for '{0}' + No implementation was given for '{0}' + + + + No implementation was given for '{0}'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + No implementation was given for '{0}'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + + + + The member '{0}' does not have the correct number of arguments. The required signature is '{1}'. + The member '{0}' does not have the correct number of arguments. The required signature is '{1}'. + + + + The member '{0}' does not have the correct number of method type parameters. The required signature is '{1}'. + The member '{0}' does not have the correct number of method type parameters. The required signature is '{1}'. + + + + The member '{0}' does not have the correct kinds of generic parameters. The required signature is '{1}'. + The member '{0}' does not have the correct kinds of generic parameters. The required signature is '{1}'. + + + + The member '{0}' cannot be used to implement '{1}'. The required signature is '{2}'. + The member '{0}' cannot be used to implement '{1}'. The required signature is '{2}'. + + + + Error while parsing embedded IL + Error while parsing embedded IL + + + + Error while parsing embedded IL type + Error while parsing embedded IL type + + + + This indexer notation has been removed from the F# language + This indexer notation has been removed from the F# language + + + + Invalid expression on left of assignment + Invalid expression on left of assignment + + + + The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. + The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. + + + + This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' + This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' + + + + The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute + The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute + + + + The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute + The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute + + + + The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes + The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes + + + + A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes + A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes + + + + Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes + Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes + + + + A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' + A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' + + + + A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' + A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' + + + + A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' + A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' + + + + A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes + A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes + + + + A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes + A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes + + + + The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes + The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes + + + + Positional specifiers are not permitted in format strings + Positional specifiers are not permitted in format strings + + + + Missing format specifier + Missing format specifier + + + + '{0}' flag set twice + '{0}' flag set twice + + + + Prefix flag (' ' or '+') set twice + Prefix flag (' ' or '+') set twice + + + + The # formatting modifier is invalid in F# + The # formatting modifier is invalid in F# + + + + Bad precision in format specifier + Bad precision in format specifier + + + + Bad width in format specifier + Bad width in format specifier + + + + '{0}' format does not support '0' flag + '{0}' format does not support '0' flag + + + + Precision missing after the '.' + Precision missing after the '.' + + + + '{0}' format does not support precision + '{0}' format does not support precision + + + + Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + + + + The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + + + + The 'h' or 'H' in this format specifier is unnecessary. You can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + The 'h' or 'H' in this format specifier is unnecessary. You can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. + + + + '{0}' does not support prefix '{1}' flag + '{0}' does not support prefix '{1}' flag + + + + Bad format specifier: '{0}' + Bad format specifier: '{0}' + + + + System.Environment.Exit did not exit + System.Environment.Exit did not exit + + + + The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined + The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined + + + + A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. + A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. + + + + The byref-typed variable '{0}' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + The byref-typed variable '{0}' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + + + + The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. + The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. + + + + The variable '{0}' is used in an invalid way + The variable '{0}' is used in an invalid way + + + + The type '{0}' is less accessible than the value, member or type '{1}' it is used in. + The type '{0}' is less accessible than the value, member or type '{1}' it is used in. + + + + 'System.Void' can only be used as 'typeof<System.Void>' in F# + 'System.Void' can only be used as 'typeof<System.Void>' in F# + + + + A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + + + + Calls to 'reraise' may only occur directly in a handler of a try-with + Calls to 'reraise' may only occur directly in a handler of a try-with + + + + Expression-splicing operators may only be used within quotations + Expression-splicing operators may only be used within quotations + + + + First-class uses of the expression-splicing operator are not permitted + First-class uses of the expression-splicing operator are not permitted + + + + First-class uses of the address-of operators are not permitted + First-class uses of the address-of operators are not permitted + + + + First-class uses of the 'reraise' function is not permitted + First-class uses of the 'reraise' function is not permitted + + + + The byref typed value '{0}' cannot be used at this point + The byref typed value '{0}' cannot be used at this point + + + + 'base' values may only be used to make direct calls to the base implementations of overridden members + 'base' values may only be used to make direct calls to the base implementations of overridden members + + + + Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. + Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. + + + + The address of the variable '{0}' cannot be used at this point + The address of the variable '{0}' cannot be used at this point + + + + The address of the static field '{0}' cannot be used at this point + The address of the static field '{0}' cannot be used at this point + + + + The address of the field '{0}' cannot be used at this point + The address of the field '{0}' cannot be used at this point + + + + The address of an array element cannot be used at this point + The address of an array element cannot be used at this point + + + + The type of a first-class function cannot contain byrefs + The type of a first-class function cannot contain byrefs + + + + A method return type would contain byrefs which is not permitted + A method return type would contain byrefs which is not permitted + + + + Invalid custom attribute value (not a constant or literal) + Invalid custom attribute value (not a constant or literal) + + + + The attribute type '{0}' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. + The attribute type '{0}' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. + + + + The member '{0}' is used in an invalid way. A use of '{1}' has been inferred prior to its definition at or near '{2}'. This is an invalid forward reference. + The member '{0}' is used in an invalid way. A use of '{1}' has been inferred prior to its definition at or near '{2}'. This is an invalid forward reference. + + + + A byref typed value would be stored here. Top-level let-bound byref values are not permitted. + A byref typed value would be stored here. Top-level let-bound byref values are not permitted. + + + + [<ReflectedDefinition>] terms cannot contain uses of the prefix splice operator '%' + [<ReflectedDefinition>] terms cannot contain uses of the prefix splice operator '%' + + + + A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. + A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. + + + + compiled form of the union case + compiled form of the union case + + + + default augmentation of the union case + default augmentation of the union case + + + + The property '{0}' has the same name as a method in type '{1}'. + The property '{0}' has the same name as a method in type '{1}'. + + + + The property '{0}' of type '{1}' has a getter and a setter that do not match. If one is abstract then the other must be as well. + The property '{0}' of type '{1}' has a getter and a setter that do not match. If one is abstract then the other must be as well. + + + + The property '{0}' has the same name as another property in type '{1}', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. + The property '{0}' has the same name as another property in type '{1}', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. + + + + A type would store a byref typed value. This is not permitted by Common IL. + A type would store a byref typed value. This is not permitted by Common IL. + + + + Duplicate method. The method '{0}' has the same name and signature as another method in type '{1}'. + Duplicate method. The method '{0}' has the same name and signature as another method in type '{1}'. + + + + Duplicate method. The method '{0}' has the same name and signature as another method in type '{1}' once tuples, functions, units of measure and/or provided types are erased. + Duplicate method. The method '{0}' has the same name and signature as another method in type '{1}' once tuples, functions, units of measure and/or provided types are erased. + + + + The method '{0}' has curried arguments but has the same name as another method in type '{1}'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. + The method '{0}' has curried arguments but has the same name as another method in type '{1}'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. + + + + Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments + Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments + + + + Duplicate property. The property '{0}' has the same name and signature as another property in type '{1}'. + Duplicate property. The property '{0}' has the same name and signature as another property in type '{1}'. + + + + Duplicate property. The property '{0}' has the same name and signature as another property in type '{1}' once tuples, functions, units of measure and/or provided types are erased. + Duplicate property. The property '{0}' has the same name and signature as another property in type '{1}' once tuples, functions, units of measure and/or provided types are erased. + + + + Duplicate method. The abstract method '{0}' has the same name and signature as an abstract method in an inherited type. + Duplicate method. The abstract method '{0}' has the same name and signature as an abstract method in an inherited type. + + + + Duplicate method. The abstract method '{0}' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. + Duplicate method. The abstract method '{0}' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. + + + + This type implements the same interface at different generic instantiations '{0}' and '{1}'. This is not permitted in this version of F#. + This type implements the same interface at different generic instantiations '{0}' and '{1}'. This is not permitted in this version of F#. + + + + The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check + The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check + + + + The type abbreviation contains byrefs. This is not permitted by F#. + The type abbreviation contains byrefs. This is not permitted by F#. + + + + The variable '{0}' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. + The variable '{0}' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. + + + + Quotations cannot contain uses of generic expressions + Quotations cannot contain uses of generic expressions + + + + Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. + Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. + + + + Quotations cannot contain object expressions + Quotations cannot contain object expressions + + + + Quotations cannot contain expressions that take the address of a field + Quotations cannot contain expressions that take the address of a field + + + + Quotations cannot contain expressions that fetch static fields + Quotations cannot contain expressions that fetch static fields + + + + Quotations cannot contain inline assembly code or pattern matching on arrays + Quotations cannot contain inline assembly code or pattern matching on arrays + + + + Quotations cannot contain descending for loops + Quotations cannot contain descending for loops + + + + Quotations cannot contain expressions that fetch union case indexes + Quotations cannot contain expressions that fetch union case indexes + + + + Quotations cannot contain expressions that set union case fields + Quotations cannot contain expressions that set union case fields + + + + Quotations cannot contain expressions that set fields in exception values + Quotations cannot contain expressions that set fields in exception values + + + + Quotations cannot contain expressions that require byref pointers + Quotations cannot contain expressions that require byref pointers + + + + Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call + Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call + + + + Quotations cannot contain this kind of constant + Quotations cannot contain this kind of constant + + + + Quotations cannot contain this kind of pattern match + Quotations cannot contain this kind of pattern match + + + + Quotations cannot contain array pattern matching + Quotations cannot contain array pattern matching + + + + Quotations cannot contain this kind of type + Quotations cannot contain this kind of type + + + + The declared type parameter '{0}' cannot be used here since the type parameter cannot be resolved at compile time + The declared type parameter '{0}' cannot be used here since the type parameter cannot be resolved at compile time + + + + This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'. + This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'. + + + + Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. + Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. + + + + Expected arguments to an instance member + Expected arguments to an instance member + + + + This indexer expects {0} arguments but is here given {1} + This indexer expects {0} arguments but is here given {1} + + + + Expecting a type supporting the operator '{0}' but given a function type. You may be missing an argument to a function. + Expecting a type supporting the operator '{0}' but given a function type. You may be missing an argument to a function. + + + + Expecting a type supporting the operator '{0}' but given a tuple type + Expecting a type supporting the operator '{0}' but given a tuple type + + + + None of the types '{0}' support the operator '{1}' + None of the types '{0}' support the operator '{1}' + + + + The type '{0}' does not support the operator '{1}' + The type '{0}' does not support the operator '{1}' + + + + None of the types '{0}' support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + None of the types '{0}' support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + + + + The type '{0}' does not support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + The type '{0}' does not support the operator '{1}'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + + + + The type '{0}' does not support a conversion to the type '{1}' + The type '{0}' does not support a conversion to the type '{1}' + + + + The type '{0}' has a method '{1}' (full name '{2}'), but the method is static + The type '{0}' has a method '{1}' (full name '{2}'), but the method is static + + + + The type '{0}' has a method '{1}' (full name '{2}'), but the method is not static + The type '{0}' has a method '{1}' (full name '{2}'), but the method is not static + + + + The constraints 'struct' and 'not struct' are inconsistent + The constraints 'struct' and 'not struct' are inconsistent + + + + The type '{0}' does not have 'null' as a proper value + The type '{0}' does not have 'null' as a proper value + + + + The type '{0}' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. + The type '{0}' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. + + + + The type '{0}' does not support the 'comparison' constraint because it has the 'NoComparison' attribute + The type '{0}' does not support the 'comparison' constraint because it has the 'NoComparison' attribute + + + + The type '{0}' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface + The type '{0}' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface + + + + 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 + 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 + + + + The type '{0}' does not support the 'equality' constraint because it has the 'NoEquality' attribute + The type '{0}' does not support the 'equality' constraint because it has the 'NoEquality' attribute + + + + The type '{0}' does not support the 'equality' constraint because it is a function type + The type '{0}' does not support the 'equality' constraint because it is a function type + + + + The type '{0}' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality + The type '{0}' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality + + + + The type '{0}' is not a CLI enum type + The type '{0}' is not a CLI enum type + + + + The type '{0}' has a non-standard delegate type + The type '{0}' has a non-standard delegate type + + + + The type '{0}' is not a CLI delegate type + The type '{0}' is not a CLI delegate type + + + + This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. + This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. + + + + A generic construct requires that the type '{0}' is a CLI or F# struct type + A generic construct requires that the type '{0}' is a CLI or F# struct type + + + + A generic construct requires that the type '{0}' is an unmanaged type + A generic construct requires that the type '{0}' is an unmanaged type + + + + The type '{0}' is not compatible with any of the types {1}, arising from the use of a printf-style format string + The type '{0}' is not compatible with any of the types {1}, arising from the use of a printf-style format string + + + + A generic construct requires that the type '{0}' have reference semantics, but it does not, i.e. it is a struct + A generic construct requires that the type '{0}' have reference semantics, but it does not, i.e. it is a struct + + + + A generic construct requires that the type '{0}' be non-abstract + A generic construct requires that the type '{0}' be non-abstract + + + + A generic construct requires that the type '{0}' have a public default constructor + A generic construct requires that the type '{0}' have a public default constructor + + + + Type instantiation length mismatch + Type instantiation length mismatch + + + + Optional arguments not permitted here + Optional arguments not permitted here + + + + {0} is not a static member + {0} is not a static member + + + + {0} is not an instance member + {0} is not an instance member + + + + Argument length mismatch + Argument length mismatch + + + + The argument types don't match + The argument types don't match + + + + This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument + This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument + + + + The member or object constructor '{0}' is not {1} + The member or object constructor '{0}' is not {1} + + + + The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. + + + + {0} is not a static method + {0} is not a static method + + + + {0} is not an instance method + {0} is not an instance method + + + + The member or object constructor '{0}' has no argument or settable return property '{1}'. {2}. + The member or object constructor '{0}' has no argument or settable return property '{1}'. {2}. + + + + The object constructor '{0}' has no argument or settable return property '{1}'. {2}. + The object constructor '{0}' has no argument or settable return property '{1}'. {2}. + + + + The required signature is {0} + The required signature is {0} + + + + The member or object constructor '{0}' requires {1} argument(s). The required signature is '{2}'. + The member or object constructor '{0}' requires {1} argument(s). The required signature is '{2}'. + + + + The member or object constructor '{0}' requires {1} additional argument(s). The required signature is '{2}'. + The member or object constructor '{0}' requires {1} additional argument(s). The required signature is '{2}'. + + + + The member or object constructor '{0}' requires {1} argument(s). The required signature is '{2}'. Some names for missing arguments are {3}. + The member or object constructor '{0}' requires {1} argument(s). The required signature is '{2}'. Some names for missing arguments are {3}. + + + + The member or object constructor '{0}' requires {1} additional argument(s). The required signature is '{2}'. Some names for missing arguments are {3}. + The member or object constructor '{0}' requires {1} additional argument(s). The required signature is '{2}'. Some names for missing arguments are {3}. + + + + The member or object constructor '{0}' requires {1} argument(s) but is here given {2} unnamed and {3} named argument(s). The required signature is '{4}'. + The member or object constructor '{0}' requires {1} argument(s) but is here given {2} unnamed and {3} named argument(s). The required signature is '{4}'. + + + + The member or object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. + The member or object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. + + + + The object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. + The object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. + + + + The object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). + The object constructor '{0}' takes {1} argument(s) but is here given {2}. The required signature is '{3}'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). + + + + The member or object constructor '{0}' takes {1} type argument(s) but is here given {2}. The required signature is '{3}'. + The member or object constructor '{0}' takes {1} type argument(s) but is here given {2}. The required signature is '{3}'. + + + + A member or object constructor '{0}' taking {1} arguments is not accessible from this code location. All accessible versions of method '{2}' take {3} arguments. + A member or object constructor '{0}' taking {1} arguments is not accessible from this code location. All accessible versions of method '{2}' take {3} arguments. + + + + Incorrect generic instantiation. No {0} member named '{1}' takes {2} generic arguments. + Incorrect generic instantiation. No {0} member named '{1}' takes {2} generic arguments. + + + + The member or object constructor '{0}' does not take {1} argument(s). An overload was found taking {2} arguments. + The member or object constructor '{0}' does not take {1} argument(s). An overload was found taking {2} arguments. + + + + No {0} member or object constructor named '{1}' takes {2} arguments + No {0} member or object constructor named '{1}' takes {2} arguments + + + + No {0} member or object constructor named '{1}' takes {2} arguments. Note the call to this member also provides {3} named arguments. + No {0} member or object constructor named '{1}' takes {2} arguments. Note the call to this member also provides {3} named arguments. + + + + No {0} member or object constructor named '{1}' takes {2} arguments. The named argument '{3}' doesn't correspond to any argument or settable return property for any overload. + No {0} member or object constructor named '{1}' takes {2} arguments. The named argument '{3}' doesn't correspond to any argument or settable return property for any overload. + + + + Method or object constructor '{0}' not found + Method or object constructor '{0}' not found + + + + No overloads match for method '{0}'. + No overloads match for method '{0}'. + + + + A unique overload for method '{0}' could not be determined based on type information prior to this program point. A type annotation may be needed. + A unique overload for method '{0}' could not be determined based on type information prior to this program point. A type annotation may be needed. + + + + Candidates: {0} + Candidates: {0} + + + + The available overloads are shown below. + The available overloads are shown below. + + + + Accessibility modifiers are not permitted on 'do' bindings, but '{0}' was given. + Accessibility modifiers are not permitted on 'do' bindings, but '{0}' was given. + + + + End of file in #if section begun at or after here + End of file in #if section begun at or after here + + + + End of file in string begun at or before here + End of file in string begun at or before here + + + + End of file in verbatim string begun at or before here + End of file in verbatim string begun at or before here + + + + End of file in comment begun at or before here + End of file in comment begun at or before here + + + + End of file in string embedded in comment begun at or before here + End of file in string embedded in comment begun at or before here + + + + End of file in verbatim string embedded in comment begun at or before here + End of file in verbatim string embedded in comment begun at or before here + + + + End of file in IF-OCAML section begun at or before here + End of file in IF-OCAML section begun at or before here + + + + End of file in directive begun at or before here + End of file in directive begun at or before here + + + + No #endif found for #if or #else + No #endif found for #if or #else + + + + Attributes have been ignored in this construct + Attributes have been ignored in this construct + + + + 'use' bindings are not permitted in primary constructors + 'use' bindings are not permitted in primary constructors + + + + 'use' bindings are not permitted in modules and are treated as 'let' bindings + 'use' bindings are not permitted in modules and are treated as 'let' bindings + + + + An integer for loop must use a simple identifier + An integer for loop must use a simple identifier + + + + At most one 'with' augmentation is permitted + At most one 'with' augmentation is permitted + + + + A semicolon is not expected at this point + A semicolon is not expected at this point + + + + Unexpected end of input + Unexpected end of input + + + + Accessibility modifiers are not permitted here, but '{0}' was given. + Accessibility modifiers are not permitted here, but '{0}' was given. + + + + Only '#' compiler directives may occur prior to the first 'namespace' declaration + Only '#' compiler directives may occur prior to the first 'namespace' declaration + + + + Accessibility modifiers should come immediately prior to the identifier naming a construct + Accessibility modifiers should come immediately prior to the identifier naming a construct + + + + Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' + Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' + + + + A module abbreviation must be a simple name, not a path + A module abbreviation must be a simple name, not a path + + + + Ignoring attributes on module abbreviation + Ignoring attributes on module abbreviation + + + + The '{0}' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. + The '{0}' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. + + + + The '{0}' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. + The '{0}' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. + + + + Unclosed block + Unclosed block + + + + Unmatched 'begin' or 'struct' + Unmatched 'begin' or 'struct' + + + + A module name must be a simple name, not a path + A module name must be a simple name, not a path + + + + Unexpected empty type moduleDefn list + Unexpected empty type moduleDefn list + + + + Attributes should be placed before 'val' + Attributes should be placed before 'val' + + + + Attributes are not permitted on interface implementations + Attributes are not permitted on interface implementations + + + + Syntax error + Syntax error + + + + Augmentations are not permitted on delegate type moduleDefns + Augmentations are not permitted on delegate type moduleDefns + + + + Unmatched 'class', 'interface' or 'struct' + Unmatched 'class', 'interface' or 'struct' + + + + A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. + A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. + + + + Unmatched 'with' or badly formatted 'with' block + Unmatched 'with' or badly formatted 'with' block + + + + 'get', 'set' or 'get,set' required + 'get', 'set' or 'get,set' required + + + + Only class types may take value arguments + Only class types may take value arguments + + + + Unmatched 'begin' + Unmatched 'begin' + + + + Invalid declaration syntax + Invalid declaration syntax + + + + 'get' and/or 'set' required + 'get' and/or 'set' required + + + + Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' + Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' + + + + A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' + A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' + + + + Multiple accessibilities given for property getter or setter + Multiple accessibilities given for property getter or setter + + + + Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' + Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' + + + + Interfaces always have the same visibility as the enclosing type + Interfaces always have the same visibility as the enclosing type + + + + Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. + Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. + + + + Attributes are not permitted on 'inherit' declarations + Attributes are not permitted on 'inherit' declarations + + + + Accessibility modifiers are not permitted on an 'inherits' declaration + Accessibility modifiers are not permitted on an 'inherits' declaration + + + + 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. + 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. + + + + Attributes are not allowed here + Attributes are not allowed here + + + + Accessibility modifiers are not permitted in this position for type abbreviations + Accessibility modifiers are not permitted in this position for type abbreviations + + + + Accessibility modifiers are not permitted in this position for enum types + Accessibility modifiers are not permitted in this position for enum types + + + + All enum fields must be given values + All enum fields must be given values + + + + Accessibility modifiers are not permitted on inline assembly code types + Accessibility modifiers are not permitted on inline assembly code types + + + + Unexpected identifier: '{0}' + Unexpected identifier: '{0}' + + + + Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. + Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. + + + + Accessibility modifiers are not permitted on enumeration fields + Accessibility modifiers are not permitted on enumeration fields + + + + Consider using a separate record type instead + Consider using a separate record type instead + + + + Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. + Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. + + + + The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings + The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings + + + + Unmatched '(' + Unmatched '(' + + + + Successive patterns should be separated by spaces or tupled + Successive patterns should be separated by spaces or tupled + + + + No matching 'in' found for this 'let' + No matching 'in' found for this 'let' + + + + Error in the return expression for this 'let'. Possible incorrect indentation. + Error in the return expression for this 'let'. Possible incorrect indentation. + + + + The block following this '{0}' is unfinished. Every code block is an expression and must have a result. '{1}' cannot be the final code element in a block. Consider giving this block an explicit result. + The block following this '{0}' is unfinished. Every code block is an expression and must have a result. '{1}' cannot be the final code element in a block. Consider giving this block an explicit result. + + + + Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + Incomplete conditional. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + + + + 'assert' may not be used as a first class value. Use 'assert <expr>' instead. + 'assert' may not be used as a first class value. Use 'assert <expr>' instead. + + + + Identifier expected + Identifier expected + + + + 'in' or '=' expected + 'in' or '=' expected + + + + The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. + The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. + + + + Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized + Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized + + + + Unmatched '[' + Unmatched '[' + + + + Missing qualification after '.' + Missing qualification after '.' + + + + In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array + In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array + + + + Mismatched quotation, beginning with '{0}' + Mismatched quotation, beginning with '{0}' + + + + Unmatched '{0}' + Unmatched '{0}' + + + + Unmatched '[|' + Unmatched '[|' + + + + Unmatched '{{' + Unmatched '{{' + + + + Field bindings must have the form 'id = expr;' + Field bindings must have the form 'id = expr;' + + + + This member is not permitted in an object implementation + This member is not permitted in an object implementation + + + + Missing function body + Missing function body + + + + Syntax error in labelled type argument + Syntax error in labelled type argument + + + + Unexpected infix operator in type expression + Unexpected infix operator in type expression + + + + The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident<typ,...,typ>' instead + The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident<typ,...,typ>' instead + + + + Invalid literal in type + Invalid literal in type + + + + Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. + Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. + + + + Unexpected integer literal in unit-of-measure expression + Unexpected integer literal in unit-of-measure expression + + + + Syntax error: unexpected type parameter specification + Syntax error: unexpected type parameter specification + + + + Mismatched quotation operator name, beginning with '{0}' + Mismatched quotation operator name, beginning with '{0}' + + + + Active pattern case identifiers must begin with an uppercase letter + Active pattern case identifiers must begin with an uppercase letter + + + + The '|' character is not permitted in active pattern case identifiers + The '|' character is not permitted in active pattern case identifiers + + + + Denominator must not be 0 in unit-of-measure exponent + Denominator must not be 0 in unit-of-measure exponent + + + + No '=' symbol should follow a 'namespace' declaration + No '=' symbol should follow a 'namespace' declaration + + + + The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' + The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' + + + + The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' + The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' + + + + A static field was used where an instance field is expected + A static field was used where an instance field is expected + + + + Method '{0}' is not accessible from this code location + Method '{0}' is not accessible from this code location + + + + Implicit product of measures following / + Implicit product of measures following / + + + + Unexpected SynMeasure.Anon + Unexpected SynMeasure.Anon + + + + Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. + Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. + + + + In sequence expressions, results are generated using 'yield' + In sequence expressions, results are generated using 'yield' + + + + Unexpected big rational constant + Unexpected big rational constant + + + + Units-of-measure supported only on float, float32, decimal and signed integer types + Units-of-measure supported only on float, float32, decimal and signed integer types + + + + Unexpected Const_uint16array + Unexpected Const_uint16array + + + + Unexpected Const_bytearray + Unexpected Const_bytearray + + + + A parameter with attributes must also be given a name, e.g. '[<Attribute>] Name : Type' + A parameter with attributes must also be given a name, e.g. '[<Attribute>] Name : Type' + + + + Return values cannot have names + Return values cannot have names + + + + MemberKind.PropertyGetSet only expected in parse trees + MemberKind.PropertyGetSet only expected in parse trees + + + + Namespaces cannot contain values. Consider using a module to hold your value declarations. + Namespaces cannot contain values. Consider using a module to hold your value declarations. + + + + Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. + Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. + + + + Multiple visibility attributes have been specified for this identifier + Multiple visibility attributes have been specified for this identifier + + + + Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. + Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. + + + + The name '({0})' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '{1}' instead. + The name '({0})' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '{1}' instead. + + + + The name '({0})' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '{1}' instead. + The name '({0})' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '{1}' instead. + + + + The name '({0})' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '{1}' instead. + The name '({0})' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '{1}' instead. + + + + The name '({0})' should not be used as a member name because it is given a standard definition in the F# library over fixed types + The name '({0})' should not be used as a member name because it is given a standard definition in the F# library over fixed types + + + + The '{0}' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. + The '{0}' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. + + + + The '{0}' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. + The '{0}' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. + + + + The '{0}' operator should not normally be redefined. Consider using a different operator name + The '{0}' operator should not normally be redefined. Consider using a different operator name + + + + The '{0}' operator cannot be redefined. Consider using a different operator name + The '{0}' operator cannot be redefined. Consider using a different operator name + + + + Expected module or namespace parent {0} + Expected module or namespace parent {0} + + + + The struct, record or union type '{0}' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. + The struct, record or union type '{0}' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. + + + + The struct, record or union type '{0}' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. + The struct, record or union type '{0}' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. + + + + The struct, record or union type '{0}' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. + The struct, record or union type '{0}' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. + + + + This record contains fields from inconsistent types + This record contains fields from inconsistent types + + + + DLLImport stubs cannot be inlined + DLLImport stubs cannot be inlined + + + + Structs may only bind a 'this' parameter at member declarations + Structs may only bind a 'this' parameter at member declarations + + + + Unexpected expression at recursive inference point + Unexpected expression at recursive inference point + + + + This code is less generic than required by its annotations because the explicit type variable '{0}' could not be generalized. It was constrained to be '{1}'. + This code is less generic than required by its annotations because the explicit type variable '{0}' could not be generalized. It was constrained to be '{1}'. + + + + One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types + One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types + + + + A generic type parameter has been used in a way that constrains it to always be '{0}' + A generic type parameter has been used in a way that constrains it to always be '{0}' + + + + This type parameter has been used in a way that constrains it to always be '{0}' + This type parameter has been used in a way that constrains it to always be '{0}' + + + + The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). + The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). + + + + Explicit type parameters may only be used on module or member bindings + Explicit type parameters may only be used on module or member bindings + + + + You must explicitly declare either all or no type parameters when overriding a generic abstract method + You must explicitly declare either all or no type parameters when overriding a generic abstract method + + + + The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type + The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type + + + + The field '{0}' appears twice in this record expression or pattern + The field '{0}' appears twice in this record expression or pattern + + + + Unknown union case + Unknown union case + + + + This code is not sufficiently generic. The type variable {0} could not be generalized because it would escape its scope. + This code is not sufficiently generic. The type variable {0} could not be generalized because it would escape its scope. + + + + A property cannot have explicit type parameters. Consider using a method instead. + A property cannot have explicit type parameters. Consider using a method instead. + + + + A constructor cannot have explicit type parameters. Consider using a static construction method instead. + A constructor cannot have explicit type parameters. Consider using a static construction method instead. + + + + This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. + This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. + + + + Unexpected source-level property specification in syntax tree + Unexpected source-level property specification in syntax tree + + + + A static initializer requires an argument + A static initializer requires an argument + + + + An object constructor requires an argument + An object constructor requires an argument + + + + This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. + This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. + + + + An explicit static initializer should use the syntax 'static new(args) = expr' + An explicit static initializer should use the syntax 'static new(args) = expr' + + + + An explicit object constructor should use the syntax 'new(args) = expr' + An explicit object constructor should use the syntax 'new(args) = expr' + + + + Unexpected source-level property specification + Unexpected source-level property specification + + + + This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. + This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. + + + + Invalid declaration + Invalid declaration + + + + Attributes are not allowed within patterns + Attributes are not allowed within patterns + + + + The generic function '{0}' must be given explicit type argument(s) + The generic function '{0}' must be given explicit type argument(s) + + + + The method or function '{0}' should not be given explicit type argument(s) because it does not declare its type parameters explicitly + The method or function '{0}' should not be given explicit type argument(s) because it does not declare its type parameters explicitly + + + + This value, type or method expects {0} type parameter(s) but was given {1} + This value, type or method expects {0} type parameter(s) but was given {1} + + + + The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization + The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization + + + + Couldn't find Dispose on IDisposable, or it was overloaded + Couldn't find Dispose on IDisposable, or it was overloaded + + + + This value is not a literal and cannot be used in a pattern + This value is not a literal and cannot be used in a pattern + + + + This field is readonly + This field is readonly + + + + Named arguments must appear after all other arguments + Named arguments must appear after all other arguments + + + + This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking {0} arguments. + This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking {0} arguments. + + + + The type '{0}' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method + The type '{0}' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method + + + + This recursive binding uses an invalid mixture of recursive forms + This recursive binding uses an invalid mixture of recursive forms + + + + This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. + This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. + + + + Invalid constraint + Invalid constraint + + + + Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution + Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution + + + + An 'enum' constraint must be of the form 'enum<type>' + An 'enum' constraint must be of the form 'enum<type>' + + + + 'new' constraints must take one argument of type 'unit' and return the constructed type + 'new' constraints must take one argument of type 'unit' and return the constructed type + + + + This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. + This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. + + + + Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [<Measure>] attribute. + Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [<Measure>] attribute. + + + + Expected type parameter, not unit-of-measure parameter + Expected type parameter, not unit-of-measure parameter + + + + Expected type, not unit-of-measure + Expected type, not unit-of-measure + + + + Expected unit-of-measure, not type + Expected unit-of-measure, not type + + + + Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. + Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. + + + + Unit-of-measure cannot be used in type constructor application + Unit-of-measure cannot be used in type constructor application + + + + This control construct may only be used if the computation expression builder defines a '{0}' method + This control construct may only be used if the computation expression builder defines a '{0}' method + + + + This type has no nested types + This type has no nested types + + + + Unexpected {0} in type expression + Unexpected {0} in type expression + + + + Type parameter cannot be used as type constructor + Type parameter cannot be used as type constructor + + + + Illegal syntax in type expression + Illegal syntax in type expression + + + + Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression + Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression + + + + Anonymous type variables are not permitted in this declaration + Anonymous type variables are not permitted in this declaration + + + + Unexpected / in type + Unexpected / in type + + + + Unexpected type arguments + Unexpected type arguments + + + + Optional arguments are only permitted on type members + Optional arguments are only permitted on type members + + + + Name '{0}' not bound in pattern context + Name '{0}' not bound in pattern context + + + + Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when <variable> = <constant>' at the end of the match clause. + Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when <variable> = <constant>' at the end of the match clause. + + + + Type arguments cannot be specified here + Type arguments cannot be specified here + + + + Only active patterns returning exactly one result may accept arguments + Only active patterns returning exactly one result may accept arguments + + + + Invalid argument to parameterized pattern label + Invalid argument to parameterized pattern label + + + + Internal error. Invalid index into active pattern array + Internal error. Invalid index into active pattern array + + + + This union case does not take arguments + This union case does not take arguments + + + + This union case takes one argument + This union case takes one argument + + + + This union case expects {0} arguments in tupled form + This union case expects {0} arguments in tupled form + + + + Field '{0}' is not static + Field '{0}' is not static + + + + This field is not a literal and cannot be used in a pattern + This field is not a literal and cannot be used in a pattern + + + + This is not a variable, constant, active recognizer or literal + This is not a variable, constant, active recognizer or literal + + + + This is not a valid pattern + This is not a valid pattern + + + + Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. + Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. + + + + Illegal pattern + Illegal pattern + + + + Syntax error - unexpected '?' symbol + Syntax error - unexpected '?' symbol + + + + Expected {0} expressions, got {1} + Expected {0} expressions, got {1} + + + + TcExprUndelayed: delayed + TcExprUndelayed: delayed + + + + This expression form may only be used in sequence and computation expressions + This expression form may only be used in sequence and computation expressions + + + + Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. + Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. + + + + Invalid object, sequence or record expression + Invalid object, sequence or record expression + + + + Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' + Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' + + + + This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression + This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression + + + + Unable to parse format string '{0}' + Unable to parse format string '{0}' + + + + This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. + This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. + + + + The expression form 'expr then expr' may only be used as part of an explicit object constructor + The expression form 'expr then expr' may only be used as part of an explicit object constructor + + + + Named arguments cannot be given to member trait calls + Named arguments cannot be given to member trait calls + + + + This is not a valid name for an enumeration case + This is not a valid name for an enumeration case + + + + This field is not mutable + This field is not mutable + + + + This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq {{ ... }}', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements + This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq {{ ... }}', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements + + + + This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. + This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. + + + + This construct may only be used within sequence or computation expressions + This construct may only be used within sequence or computation expressions + + + + This construct may only be used within computation expressions + This construct may only be used within computation expressions + + + + Invalid indexer expression + Invalid indexer expression + + + + The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints + The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints + + + + Cannot inherit from a variable type + Cannot inherit from a variable type + + + + Calls to object constructors on type parameters cannot be given arguments + Calls to object constructors on type parameters cannot be given arguments + + + + The 'CompiledName' attribute cannot be used with this language element + The 'CompiledName' attribute cannot be used with this language element + + + + '{0}' may only be used with named types + '{0}' may only be used with named types + + + + 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. + 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. + + + + 'new' cannot be used on interface types. Consider using an object expression '{{ new ... with ... }}' instead. + 'new' cannot be used on interface types. Consider using an object expression '{{ new ... with ... }}' instead. + + + + Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{{ new ... with ... }}' instead. + Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{{ new ... with ... }}' instead. + + + + It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value + It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value + + + + '{0}' may only be used to construct object types + '{0}' may only be used to construct object types + + + + Constructors for the type '{0}' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. + Constructors for the type '{0}' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. + + + + The field '{0}' has been given a value, but is not present in the type '{1}' + The field '{0}' has been given a value, but is not present in the type '{1}' + + + + No assignment given for field '{0}' of type '{1}' + No assignment given for field '{0}' of type '{1}' + + + + Extraneous fields have been given values + Extraneous fields have been given values + + + + Only overrides of abstract and virtual members may be specified in object expressions + Only overrides of abstract and virtual members may be specified in object expressions + + + + The member '{0}' does not correspond to any abstract or virtual method available to override or implement. + The member '{0}' does not correspond to any abstract or virtual method available to override or implement. + + + + The type {0} contains the member '{1}' but it is not a virtual or abstract method that is available to override or implement. + The type {0} contains the member '{1}' but it is not a virtual or abstract method that is available to override or implement. + + + + The member '{0}' does not accept the correct number of arguments. {1} argument(s) are expected, but {2} were given. The required signature is '{3}'.{4} + The member '{0}' does not accept the correct number of arguments. {1} argument(s) are expected, but {2} were given. The required signature is '{3}'.{4} + + + + The member '{0}' does not accept the correct number of arguments. One overload accepts {1} arguments, but {2} were given. The required signature is '{3}'.{4} + The member '{0}' does not accept the correct number of arguments. One overload accepts {1} arguments, but {2} were given. The required signature is '{3}'.{4} + + + + A simple method name is required here + A simple method name is required here + + + + The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class + The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class + + + + 'new' must be used with a named type + 'new' must be used with a named type + + + + Cannot create an extension of a sealed type + Cannot create an extension of a sealed type + + + + No arguments may be given when constructing a record value + No arguments may be given when constructing a record value + + + + Interface implementations cannot be given on construction expressions + Interface implementations cannot be given on construction expressions + + + + Object construction expressions may only be used to implement constructors in class types + Object construction expressions may only be used to implement constructors in class types + + + + Only simple bindings of the form 'id = expr' can be used in construction expressions + Only simple bindings of the form 'id = expr' can be used in construction expressions + + + + Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field + Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field + + + + Expected an interface type + Expected an interface type + + + + Constructor expressions for interfaces do not take arguments + Constructor expressions for interfaces do not take arguments + + + + This object constructor requires arguments + This object constructor requires arguments + + + + 'new' may only be used with object constructors + 'new' may only be used with object constructors + + + + At least one override did not correctly implement its corresponding abstract member + At least one override did not correctly implement its corresponding abstract member + + + + This numeric literal requires that a module '{0}' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope + This numeric literal requires that a module '{0}' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope + + + + Invalid record construction + Invalid record construction + + + + The expression form {{ expr with ... }} may only be used with record types. To build object types use {{ new Type(...) with ... }} + The expression form {{ expr with ... }} may only be used with record types. To build object types use {{ new Type(...) with ... }} + + + + The inherited type is not an object model type + The inherited type is not an object model type + + + + Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors + Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors + + + + '{{ }}' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. + '{{ }}' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. + + + + This type is not a record type. Values of class and struct types must be created using calls to object constructors. + This type is not a record type. Values of class and struct types must be created using calls to object constructors. + + + + This type is not a record type + This type is not a record type + + + + This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder {{ ... }}'. + This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder {{ ... }}'. + + + + This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {{... }}'. + This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {{... }}'. + + + + 'do!' cannot be used within sequence expressions + 'do!' cannot be used within sequence expressions + + + + The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. + The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. + + + + 'try'/'with' cannot be used within sequence expressions + 'try'/'with' cannot be used within sequence expressions + + + + In sequence expressions, multiple results are generated using 'yield!' + In sequence expressions, multiple results are generated using 'yield!' + + + + Invalid assignment + Invalid assignment + + + + Invalid use of a type name + Invalid use of a type name + + + + This type has no accessible object constructors + This type has no accessible object constructors + + + + Invalid use of an interface type + Invalid use of an interface type + + + + Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. + Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. + + + + Property '{0}' is not static + Property '{0}' is not static + + + + Property '{0}' is not readable + Property '{0}' is not readable + + + + This lookup cannot be used here + This lookup cannot be used here + + + + Property '{0}' is static + Property '{0}' is static + + + + Property '{0}' cannot be set + Property '{0}' cannot be set + + + + Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. + Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. + + + + The syntax 'expr.id' may only be used with record labels, properties and fields + The syntax 'expr.id' may only be used with record labels, properties and fields + + + + Event '{0}' is static + Event '{0}' is static + + + + Event '{0}' is not static + Event '{0}' is not static + + + + The named argument '{0}' did not match any argument or mutable property + The named argument '{0}' did not match any argument or mutable property + + + + One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. + One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. + + + + The unnamed arguments do not form a prefix of the arguments of the method called + The unnamed arguments do not form a prefix of the arguments of the method called + + + + Static optimization conditionals are only for use within the F# library + Static optimization conditionals are only for use within the F# library + + + + The corresponding formal argument is not optional + The corresponding formal argument is not optional + + + + Invalid optional assignment to a property or field + Invalid optional assignment to a property or field + + + + A delegate constructor must be passed a single function value + A delegate constructor must be passed a single function value + + + + A binding cannot be marked both 'use' and 'rec' + A binding cannot be marked both 'use' and 'rec' + + + + The 'VolatileField' attribute may only be used on 'let' bindings in classes + The 'VolatileField' attribute may only be used on 'let' bindings in classes + + + + Attributes are not permitted on 'let' bindings in expressions + Attributes are not permitted on 'let' bindings in expressions + + + + The 'DefaultValue' attribute may only be used on 'val' declarations + The 'DefaultValue' attribute may only be used on 'val' declarations + + + + The 'ConditionalAttribute' attribute may only be used on members + The 'ConditionalAttribute' attribute may only be used on members + + + + This is not a valid name for an active pattern + This is not a valid name for an active pattern + + + + The 'EntryPointAttribute' attribute may only be used on function definitions in modules + The 'EntryPointAttribute' attribute may only be used on function definitions in modules + + + + Mutable values cannot be marked 'inline' + Mutable values cannot be marked 'inline' + + + + Mutable values cannot have generic parameters + Mutable values cannot have generic parameters + + + + Mutable function values should be written 'let mutable f = (fun args -> ...)' + Mutable function values should be written 'let mutable f = (fun args -> ...)' + + + + Only functions may be marked 'inline' + Only functions may be marked 'inline' + + + + A literal value cannot be given the [<ThreadStatic>] or [<ContextStatic>] attributes + A literal value cannot be given the [<ThreadStatic>] or [<ContextStatic>] attributes + + + + A literal value cannot be marked 'mutable' + A literal value cannot be marked 'mutable' + + + + A literal value cannot be marked 'inline' + A literal value cannot be marked 'inline' + + + + Literal values cannot have generic parameters + Literal values cannot have generic parameters + + + + This is not a valid constant expression + This is not a valid constant expression + + + + This type is not accessible from this code location + This type is not accessible from this code location + + + + Unexpected condition in imported assembly: failed to decode AttributeUsage attribute + Unexpected condition in imported assembly: failed to decode AttributeUsage attribute + + + + Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. + Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. + + + + This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. + This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. + + + + This attribute is not valid for use on this language element + This attribute is not valid for use on this language element + + + + Optional arguments cannot be used in custom attributes + Optional arguments cannot be used in custom attributes + + + + This property cannot be set + This property cannot be set + + + + This property or field was not found on this custom attribute type + This property or field was not found on this custom attribute type + + + + A custom attribute must be a reference type + A custom attribute must be a reference type + + + + The number of args for a custom attribute does not match the expected number of args for the attribute constructor + The number of args for a custom attribute does not match the expected number of args for the attribute constructor + + + + A custom attribute must invoke an object constructor + A custom attribute must invoke an object constructor + + + + Attribute expressions must be calls to object constructors + Attribute expressions must be calls to object constructors + + + + This attribute cannot be used in this version of F# + This attribute cannot be used in this version of F# + + + + Invalid inline specification + Invalid inline specification + + + + 'use' bindings must be of the form 'use <var> = <expr>' + 'use' bindings must be of the form 'use <var> = <expr>' + + + + Abstract members are not permitted in an augmentation - they must be defined as part of the type itself + Abstract members are not permitted in an augmentation - they must be defined as part of the type itself + + + + Method overrides and interface implementations are not permitted here + Method overrides and interface implementations are not permitted here + + + + No abstract or interface member was found that corresponds to this override + No abstract or interface member was found that corresponds to this override + + + + This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:{0} + This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:{0} + + + + This method already has a default implementation + This method already has a default implementation + + + + The method implemented by this default is ambiguous + The method implemented by this default is ambiguous + + + + No abstract property was found that corresponds to this override + No abstract property was found that corresponds to this override + + + + This property overrides or implements an abstract property but the abstract property doesn't have a corresponding {0} + This property overrides or implements an abstract property but the abstract property doesn't have a corresponding {0} + + + + Invalid signature for set member + Invalid signature for set member + + + + This new member hides the abstract member '{0}'. Rename the member or use 'override' instead. + This new member hides the abstract member '{0}'. Rename the member or use 'override' instead. + + + + This new member hides the abstract member '{0}' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. + This new member hides the abstract member '{0}' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. + + + + Interfaces cannot contain definitions of static initializers + Interfaces cannot contain definitions of static initializers + + + + Interfaces cannot contain definitions of object constructors + Interfaces cannot contain definitions of object constructors + + + + Interfaces cannot contain definitions of member overrides + Interfaces cannot contain definitions of member overrides + + + + Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. + Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. + + + + Constructors cannot be specified in exception augmentations + Constructors cannot be specified in exception augmentations + + + + Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. + Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. + + + + Constructors cannot be defined for this type + Constructors cannot be defined for this type + + + + Recursive bindings that include member specifications can only occur as a direct augmentation of a type + Recursive bindings that include member specifications can only occur as a direct augmentation of a type + + + + Only simple variable patterns can be bound in 'let rec' constructs + Only simple variable patterns can be bound in 'let rec' constructs + + + + Only record fields and simple, non-recursive 'let' bindings may be marked mutable + Only record fields and simple, non-recursive 'let' bindings may be marked mutable + + + + This member is not sufficiently generic + This member is not sufficiently generic + + + + A declaration may only be the [<Literal>] attribute if a constant value is also given, e.g. 'val x : int = 1' + A declaration may only be the [<Literal>] attribute if a constant value is also given, e.g. 'val x : int = 1' + + + + A declaration may only be given a value in a signature if the declaration has the [<Literal>] attribute + A declaration may only be given a value in a signature if the declaration has the [<Literal>] attribute + + + + Thread-static and context-static variables must be static and given the [<DefaultValue>] attribute to indicate that the value is initialized to the default value on each new thread + Thread-static and context-static variables must be static and given the [<DefaultValue>] attribute to indicate that the value is initialized to the default value on each new thread + + + + Volatile fields must be marked 'mutable' and cannot be thread-static + Volatile fields must be marked 'mutable' and cannot be thread-static + + + + Uninitialized 'val' fields must be mutable and marked with the '[<DefaultValue>]' attribute. Consider using a 'let' binding instead of a 'val' field. + Uninitialized 'val' fields must be mutable and marked with the '[<DefaultValue>]' attribute. Consider using a 'let' binding instead of a 'val' field. + + + + Static 'val' fields in types must be mutable, private and marked with the '[<DefaultValue>]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. + Static 'val' fields in types must be mutable, private and marked with the '[<DefaultValue>]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. + + + + This field requires a name + This field requires a name + + + + Invalid namespace, module, type or union case name + Invalid namespace, module, type or union case name + + + + Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' + Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' + + + + Return types of union cases must be identical to the type being defined, up to abbreviations + Return types of union cases must be identical to the type being defined, up to abbreviations + + + + This is not a valid value for an enumeration literal + This is not a valid value for an enumeration literal + + + + The type '{0}' is not an interface type + The type '{0}' is not an interface type + + + + Duplicate specification of an interface + Duplicate specification of an interface + + + + A field/val declaration is not permitted here + A field/val declaration is not permitted here + + + + A inheritance declaration is not permitted here + A inheritance declaration is not permitted here + + + + This declaration opens the module '{0}', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. + This declaration opens the module '{0}', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. + + + + This declaration opens the namespace or module '{0}' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. + This declaration opens the namespace or module '{0}' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. + + + + Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. + Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. + + + + Type abbreviations cannot have members + Type abbreviations cannot have members + + + + As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. + As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. + + + + Enumerations cannot have members + Enumerations cannot have members + + + + Measure declarations may have only static members + Measure declarations may have only static members + + + + Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings + Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings + + + + Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. + Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. + + + + Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. + Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. + + + + Measure declarations may have only static members: constructors are not available + Measure declarations may have only static members: constructors are not available + + + + A member and a local class binding both have the name '{0}' + A member and a local class binding both have the name '{0}' + + + + Type abbreviations cannot have interface declarations + Type abbreviations cannot have interface declarations + + + + Enumerations cannot have interface declarations + Enumerations cannot have interface declarations + + + + This type is not an interface type + This type is not an interface type + + + + All implemented interfaces should be declared on the initial declaration of the type + All implemented interfaces should be declared on the initial declaration of the type + + + + A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type + A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type + + + + This member is not permitted in an interface implementation + This member is not permitted in an interface implementation + + + + This declaration element is not permitted in an augmentation + This declaration element is not permitted in an augmentation + + + + Types cannot contain nested type definitions + Types cannot contain nested type definitions + + + + type, exception or module + type, exception or module + + + + type or module + type or module + + + + The struct, record or union type '{0}' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. + The struct, record or union type '{0}' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. + + + + The struct, record or union type '{0}' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. + The struct, record or union type '{0}' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. + + + + Explicit type specifications cannot be used for exception constructors + Explicit type specifications cannot be used for exception constructors + + + + Exception abbreviations should not have argument lists + Exception abbreviations should not have argument lists + + + + Abbreviations for Common IL exceptions cannot take arguments + Abbreviations for Common IL exceptions cannot take arguments + + + + Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception + Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception + + + + Abbreviations for Common IL exception types must have a matching object constructor + Abbreviations for Common IL exception types must have a matching object constructor + + + + Not an exception + Not an exception + + + + Invalid module name + Invalid module name + + + + Invalid type extension + Invalid type extension + + + + The attributes of this type specify multiple kinds for the type + The attributes of this type specify multiple kinds for the type + + + + The kind of the type specified by its attributes does not match the kind implied by its definition + The kind of the type specified by its attributes does not match the kind implied by its definition + + + + Measure definitions cannot have type parameters + Measure definitions cannot have type parameters + + + + This type requires a definition + This type requires a definition + + + + This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. + This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. + + + + Structs, interfaces, enums and delegates cannot inherit from other types + Structs, interfaces, enums and delegates cannot inherit from other types + + + + Types cannot inherit from multiple concrete types + Types cannot inherit from multiple concrete types + + + + Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute + Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute + + + + Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal + Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal + + + + Generic types cannot be given the 'StructLayout' attribute + Generic types cannot be given the 'StructLayout' attribute + + + + Only structs and classes without primary constructors may be given the 'StructLayout' attribute + Only structs and classes without primary constructors may be given the 'StructLayout' attribute + + + + The representation of this type is hidden by the signature. It must be given an attribute such as [<Sealed>], [<Class>] or [<Interface>] to indicate the characteristics of the type. + The representation of this type is hidden by the signature. It must be given an attribute such as [<Sealed>], [<Class>] or [<Interface>] to indicate the characteristics of the type. + + + + Only classes may be given the 'AbstractClass' attribute + Only classes may be given the 'AbstractClass' attribute + + + + Only types representing units-of-measure may be given the 'Measure' attribute + Only types representing units-of-measure may be given the 'Measure' attribute + + + + Accessibility modifiers are not permitted on overrides or interface implementations + Accessibility modifiers are not permitted on overrides or interface implementations + + + + Discriminated union types are always sealed + Discriminated union types are always sealed + + + + Record types are always sealed + Record types are always sealed + + + + Assembly code types are always sealed + Assembly code types are always sealed + + + + Struct types are always sealed + Struct types are always sealed + + + + Delegate types are always sealed + Delegate types are always sealed + + + + Enum types are always sealed + Enum types are always sealed + + + + Interface types and delegate types cannot contain fields + Interface types and delegate types cannot contain fields + + + + Abbreviated types cannot be given the 'Sealed' attribute + Abbreviated types cannot be given the 'Sealed' attribute + + + + Cannot inherit a sealed type + Cannot inherit a sealed type + + + + Cannot inherit from interface type. Use interface ... with instead. + Cannot inherit from interface type. Use interface ... with instead. + + + + Struct types cannot contain abstract members + Struct types cannot contain abstract members + + + + Interface types cannot be sealed + Interface types cannot be sealed + + + + Delegate specifications must be of the form 'typ -> typ' + Delegate specifications must be of the form 'typ -> typ' + + + + Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. + Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. + + + + Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char + Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char + + + + This type definition involves an immediate cyclic reference through an abbreviation + This type definition involves an immediate cyclic reference through an abbreviation + + + + This type definition involves an immediate cyclic reference through a struct field or inheritance relation + This type definition involves an immediate cyclic reference through a struct field or inheritance relation + + + + The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[<Sealed>] attribute to the type definition in the signature + The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[<Sealed>] attribute to the type definition in the signature + + + + Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. + Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. + + + + One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '{0}' + One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '{0}' + + + + Type definitions may only have one 'inherit' specification and it must be the first declaration + Type definitions may only have one 'inherit' specification and it must be the first declaration + + + + 'let' and 'do' bindings must come before member and interface definitions in type definitions + 'let' and 'do' bindings must come before member and interface definitions in type definitions + + + + This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. + This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. + + + + This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + + + + This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + + + + Type abbreviations cannot have augmentations + Type abbreviations cannot have augmentations + + + + The path '{0}' is a namespace. A module abbreviation may not abbreviate a namespace. + The path '{0}' is a namespace. A module abbreviation may not abbreviate a namespace. + + + + The type '{0}' is used in an invalid way. A value prior to '{1}' has an inferred type involving '{2}', which is an invalid forward reference. + The type '{0}' is used in an invalid way. A value prior to '{1}' has an inferred type involving '{2}', which is an invalid forward reference. + + + + The member '{0}' is used in an invalid way. A use of '{1}' has been inferred prior to the definition of '{2}', which is an invalid forward reference. + The member '{0}' is used in an invalid way. A use of '{1}' has been inferred prior to the definition of '{2}', which is an invalid forward reference. + + + + The attribute 'AutoOpen(\"{0}\")' in the assembly '{1}' did not refer to a valid module or namespace in that assembly and has been ignored + The attribute 'AutoOpen(\"{0}\")' in the assembly '{1}' did not refer to a valid module or namespace in that assembly and has been ignored + + + + Undefined value '{0}' + Undefined value '{0}' + + + + Label {0} not found + Label {0} not found + + + + Incorrect number of type arguments to local call + Incorrect number of type arguments to local call + + + + Dynamic invocation of {0} is not supported + Dynamic invocation of {0} is not supported + + + + Taking the address of a literal field is invalid + Taking the address of a literal field is invalid + + + + This operation involves taking the address of a value '{0}' represented using a local variable or other special representation. This is invalid. + This operation involves taking the address of a value '{0}' represented using a local variable or other special representation. This is invalid. + + + + Custom marshallers cannot be specified in F# code. Consider using a C# helper function. + Custom marshallers cannot be specified in F# code. Consider using a C# helper function. + + + + The MarshalAs attribute could not be decoded + The MarshalAs attribute could not be decoded + + + + The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. + The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. + + + + The DllImport attribute could not be decoded + The DllImport attribute could not be decoded + + + + Literal fields cannot be set + Literal fields cannot be set + + + + GenSetStorage: {0} was represented as a static method but was not an appropriate lambda expression + GenSetStorage: {0} was represented as a static method but was not an appropriate lambda expression + + + + Mutable variables cannot escape their method + Mutable variables cannot escape their method + + + + Compiler error: unexpected unrealized value + Compiler error: unexpected unrealized value + + + + Main module of program is empty: nothing will happen when it is run + Main module of program is empty: nothing will happen when it is run + + + + This type cannot be used for a literal field + This type cannot be used for a literal field + + + + Unexpected GetSet annotation on a property + Unexpected GetSet annotation on a property + + + + The FieldOffset attribute could not be decoded + The FieldOffset attribute could not be decoded + + + + The StructLayout attribute could not be decoded + The StructLayout attribute could not be decoded + + + + The DefaultAugmentation attribute could not be decoded + The DefaultAugmentation attribute could not be decoded + + + + Reflected definitions cannot contain uses of the prefix splice operator '%' + Reflected definitions cannot contain uses of the prefix splice operator '%' + + + + Problem with codepage '{0}': {1} + Problem with codepage '{0}': {1} + + + + Copyright (c) Microsoft Corporation. All Rights Reserved. + Copyright (c) Microsoft Corporation. All Rights Reserved. + + + + Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt + Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt + + + + Name of the output file (Short form: -o) + Name of the output file (Short form: -o) + + + + Build a console executable + Build a console executable + + + + Build a Windows executable + Build a Windows executable + + + + Build a library (Short form: -a) + Build a library (Short form: -a) + + + + Build a module that can be added to another assembly + Build a module that can be added to another assembly + + + + Delay-sign the assembly using only the public portion of the strong name key + Delay-sign the assembly using only the public portion of the strong name key + + + + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed + + + + Write the xmldoc of the assembly to the given file + Write the xmldoc of the assembly to the given file + + + + Specify a strong name key file + Specify a strong name key file + + + + Specify a strong name key container + Specify a strong name key container + + + + Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. + Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. + + + + Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. + Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. + + + + Don't add a resource to the generated assembly containing F#-specific metadata + Don't add a resource to the generated assembly containing F#-specific metadata + + + + Print the inferred interface of the assembly to a file + Print the inferred interface of the assembly to a file + + + + Reference an assembly (Short form: -r) + Reference an assembly (Short form: -r) + + + + Specify a Win32 resource file (.res) + Specify a Win32 resource file (.res) + + + + Specify a Win32 manifest file + Specify a Win32 manifest file + + + + Do not include the default Win32 manifest + Do not include the default Win32 manifest + + + + Embed all source files in the portable PDB file + Embed all source files in the portable PDB file + + + + Embed specific source files in the portable PDB file + Embed specific source files in the portable PDB file + + + + Source link information file to embed in the portable PDB file + Source link information file to embed in the portable PDB file + + + + --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) + --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) + + + + --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) + --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) + + + + Source file is too large to embed in a portable PDB + Source file is too large to embed in a portable PDB + + + + Embed the specified managed resource + Embed the specified managed resource + + + + Link the specified resource to this assembly where the resinfo format is <file>[,<string name>[,public|private]] + Link the specified resource to this assembly where the resinfo format is <file>[,<string name>[,public|private]] + + + + Emit debug information (Short form: -g) + Emit debug information (Short form: -g) + + + + Specify debugging type: full, portable, embedded, pdbonly. ('{0}' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). + Specify debugging type: full, portable, embedded, pdbonly. ('{0}' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). + + + + Enable optimizations (Short form: -O) + Enable optimizations (Short form: -O) + + + + Enable or disable tailcalls + Enable or disable tailcalls + + + + Produce a deterministic assembly (including module version GUID and timestamp) + Produce a deterministic assembly (including module version GUID and timestamp) + + + + Enable or disable cross-module optimizations + Enable or disable cross-module optimizations + + + + Report all warnings as errors + Report all warnings as errors + + + + Report specific warnings as errors + Report specific warnings as errors + + + + Set a warning level (0-5) + Set a warning level (0-5) + + + + Disable specific warning messages + Disable specific warning messages + + + + Enable specific warnings that may be off by default + Enable specific warnings that may be off by default + + + + Generate overflow checks + Generate overflow checks + + + + Define conditional compilation symbols (Short form: -d) + Define conditional compilation symbols (Short form: -d) + + + + Ignore ML compatibility warnings + Ignore ML compatibility warnings + + + + + Display this usage message (Short form: -?) + Display this usage message (Short form: -?) + + + + Read response file for more options + Read response file for more options + + + + Specify the codepage used to read source files + Specify the codepage used to read source files + + + + Output messages in UTF-8 encoding + Output messages in UTF-8 encoding + + + + Output messages with fully qualified paths + Output messages with fully qualified paths + + + + Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) + Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) + + + + Base address for the library to be built + Base address for the library to be built + + + + Do not reference the default CLI assemblies by default + Do not reference the default CLI assemblies by default + + + + Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated + Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated + + + + Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. + Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. + + + + Use a resident background compilation service to improve compiler startup times. + Use a resident background compilation service to improve compiler startup times. + + + + Name the output debug file + Name the output debug file + + + + Resolve assembly references using directory-based rules rather than MSBuild resolution + Resolve assembly references using directory-based rules rather than MSBuild resolution + + + + Unrecognized target '{0}', expected 'exe', 'winexe', 'library' or 'module' + Unrecognized target '{0}', expected 'exe', 'winexe', 'library' or 'module' + + + + Unrecognized debug type '{0}', expected 'pdbonly' or 'full' + Unrecognized debug type '{0}', expected 'pdbonly' or 'full' + + + + Invalid warning level '{0}' + Invalid warning level '{0}' + + + + Short form of '{0}' + Short form of '{0}' + + + + The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. + The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. + + + + Use to override where the compiler looks for mscorlib.dll and framework components + Use to override where the compiler looks for mscorlib.dll and framework components + + + + - OUTPUT FILES - + - OUTPUT FILES - + + + + - INPUT FILES - + - INPUT FILES - + + + + - RESOURCES - + - RESOURCES - + + + + - CODE GENERATION - + - CODE GENERATION - + + + + - ADVANCED - + - ADVANCED - + + + + - MISCELLANEOUS - + - MISCELLANEOUS - + + + + - LANGUAGE - + - LANGUAGE - + + + + - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - + + + + Unknown --test argument: '{0}' + Unknown --test argument: '{0}' + + + + Unrecognized platform '{0}', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' + Unrecognized platform '{0}', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' + + + + The command-line option '{0}' is for test purposes only + The command-line option '{0}' is for test purposes only + + + + The command-line option '{0}' has been deprecated + The command-line option '{0}' has been deprecated + + + + The command-line option '{0}' has been deprecated. Use '{1}' instead. + The command-line option '{0}' has been deprecated. Use '{1}' instead. + + + + The command-line option '{0}' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. + The command-line option '{0}' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. + + + + Output warning and error messages in color + Output warning and error messages in color + + + + Enable high-entropy ASLR + Enable high-entropy ASLR + + + + Specify subsystem version of this assembly + Specify subsystem version of this assembly + + + + Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib + Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib + + + + Emit debug information in quotations + Emit debug information in quotations + + + + Specify the preferred output language culture name (e.g. es-ES, ja-JP) + Specify the preferred output language culture name (e.g. es-ES, ja-JP) + + + + Don't copy FSharp.Core.dll along the produced binaries + Don't copy FSharp.Core.dll along the produced binaries + + + + Invalid version '{0}' for '--subsystemversion'. The version must be 4.00 or greater. + Invalid version '{0}' for '--subsystemversion'. The version must be 4.00 or greater. + + + + Invalid value '{0}' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. + Invalid value '{0}' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. + + + + Full name + Full name + + + + and {0} other overloads + and {0} other overloads + + + + union case + union case + + + + active pattern result + active pattern result + + + + active recognizer + active recognizer + + + + field + field + + + + event + event + + + + property + property + + + + extension + extension + + + + custom operation + custom operation + + + + argument + argument + + + + patvar + patvar + + + + namespace + namespace + + + + module + module + + + + namespace/module + namespace/module + + + + from {0} + from {0} + + + + also from {0} + also from {0} + + + + generated property + generated property + + + + generated type + generated type + + + + Found by AssemblyFolders registry key + Found by AssemblyFolders registry key + + + + Found by AssemblyFoldersEx registry key + Found by AssemblyFoldersEx registry key + + + + .NET Framework + .NET Framework + + + + Global Assembly Cache + Global Assembly Cache + + + + Recursive class hierarchy in type '{0}' + Recursive class hierarchy in type '{0}' + + + + Invalid recursive reference to an abstract slot + Invalid recursive reference to an abstract slot + + + + The event '{0}' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit {1} and {2} methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. + The event '{0}' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit {1} and {2} methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. + + + + The type '{0}' is not accessible from this code location + The type '{0}' is not accessible from this code location + + + + The union cases or fields of the type '{0}' are not accessible from this code location + The union cases or fields of the type '{0}' are not accessible from this code location + + + + The value '{0}' is not accessible from this code location + The value '{0}' is not accessible from this code location + + + + The union case '{0}' is not accessible from this code location + The union case '{0}' is not accessible from this code location + + + + The record, struct or class field '{0}' is not accessible from this code location + The record, struct or class field '{0}' is not accessible from this code location + + + + The struct or class field '{0}' is not accessible from this code location + The struct or class field '{0}' is not accessible from this code location + + + + This construct is experimental + This construct is experimental + + + + No Invoke methods found for delegate type + No Invoke methods found for delegate type + + + + More than one Invoke method found for delegate type + More than one Invoke method found for delegate type + + + + Delegates are not allowed to have curried signatures + Delegates are not allowed to have curried signatures + + + + Unexpected Expr.TyChoose + Unexpected Expr.TyChoose + + + + Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. + Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. + + + + Identifiers containing '@' are reserved for use in F# code generation + Identifiers containing '@' are reserved for use in F# code generation + + + + The identifier '{0}' is reserved for future use by F# + The identifier '{0}' is reserved for future use by F# + + + + Missing variable '{0}' + Missing variable '{0}' + + + + Partial active patterns may only generate one result + Partial active patterns may only generate one result + + + + The type '{0}' is required here and is unavailable. You must add a reference to assembly '{1}'. + The type '{0}' is required here and is unavailable. You must add a reference to assembly '{1}'. + + + + A reference to the type '{0}' in assembly '{1}' was found, but the type could not be found in that assembly + A reference to the type '{0}' in assembly '{1}' was found, but the type could not be found in that assembly + + + + Internal error or badly formed metadata: not enough type parameters were in scope while importing + Internal error or badly formed metadata: not enough type parameters were in scope while importing + + + + A reference to the DLL {0} is required by assembly {1}. The imported type {2} is located in the first assembly and could not be resolved. + A reference to the DLL {0} is required by assembly {1}. The imported type {2} is located in the first assembly and could not be resolved. + + + + An imported assembly uses the type '{0}' but that type is not public + An imported assembly uses the type '{0}' but that type is not public + + + + The value '{0}' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible + The value '{0}' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible + + + + The value '{0}' was marked inline but was not bound in the optimization environment + The value '{0}' was marked inline but was not bound in the optimization environment + + + + Local value {0} not found during optimization + Local value {0} not found during optimization + + + + A value marked as 'inline' has an unexpected value + A value marked as 'inline' has an unexpected value + + + + A value marked as 'inline' could not be inlined + A value marked as 'inline' could not be inlined + + + + Failed to inline the value '{0}' marked 'inline', perhaps because a recursive value was marked 'inline' + Failed to inline the value '{0}' marked 'inline', perhaps because a recursive value was marked 'inline' + + + + Recursive ValValue {0} + Recursive ValValue {0} + + + + The indentation of this 'in' token is incorrect with respect to the corresponding 'let' + The indentation of this 'in' token is incorrect with respect to the corresponding 'let' + + + + Possible incorrect indentation: this token is offside of context started at position {0}. Try indenting this token further or using standard formatting conventions. + Possible incorrect indentation: this token is offside of context started at position {0}. Try indenting this token further or using standard formatting conventions. + + + + The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. + The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. + + + + Invalid module/expression/type + Invalid module/expression/type + + + + Multiple types exist called '{0}', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '{1}'. + Multiple types exist called '{0}', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '{1}'. + + + + The instantiation of the generic type '{0}' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '{1}'. + The instantiation of the generic type '{0}' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '{1}'. + + + + 'global' may only be used as the first name in a qualified path + 'global' may only be used as the first name in a qualified path + + + + This is not a constructor or literal, or a constructor is being used incorrectly + This is not a constructor or literal, or a constructor is being used incorrectly + + + + Unexpected empty long identifier + Unexpected empty long identifier + + + + The record type '{0}' does not contain a label '{1}'. + The record type '{0}' does not contain a label '{1}'. + + + + Invalid field label + Invalid field label + + + + Invalid expression '{0}' + Invalid expression '{0}' + + + + No constructors are available for the type '{0}' + No constructors are available for the type '{0}' + + + + The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using. + The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using. + + + + The record type for the record field '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('{1}') in the name you are using. + The record type for the record field '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('{1}') in the name you are using. + + + + Unexpected error creating debug information file '{0}' + Unexpected error creating debug information file '{0}' + + + + This number is outside the allowable range for this integer type + This number is outside the allowable range for this integer type + + + + '{0}' is not permitted as a character in operator names and is reserved for future use + '{0}' is not permitted as a character in operator names and is reserved for future use + + + + Unexpected character '{0}' + Unexpected character '{0}' + + + + This byte array literal contains characters that do not encode as a single byte + This byte array literal contains characters that do not encode as a single byte + + + + Identifiers followed by '{0}' are reserved for future use + Identifiers followed by '{0}' are reserved for future use + + + + This number is outside the allowable range for 8-bit signed integers + This number is outside the allowable range for 8-bit signed integers + + + + This number is outside the allowable range for hexadecimal 8-bit signed integers + This number is outside the allowable range for hexadecimal 8-bit signed integers + + + + This number is outside the allowable range for 8-bit unsigned integers + This number is outside the allowable range for 8-bit unsigned integers + + + + This number is outside the allowable range for 16-bit signed integers + This number is outside the allowable range for 16-bit signed integers + + + + This number is outside the allowable range for 16-bit unsigned integers + This number is outside the allowable range for 16-bit unsigned integers + + + + This number is outside the allowable range for 32-bit signed integers + This number is outside the allowable range for 32-bit signed integers + + + + This number is outside the allowable range for 32-bit unsigned integers + This number is outside the allowable range for 32-bit unsigned integers + + + + This number is outside the allowable range for 64-bit signed integers + This number is outside the allowable range for 64-bit signed integers + + + + This number is outside the allowable range for 64-bit unsigned integers + This number is outside the allowable range for 64-bit unsigned integers + + + + This number is outside the allowable range for signed native integers + This number is outside the allowable range for signed native integers + + + + This number is outside the allowable range for unsigned native integers + This number is outside the allowable range for unsigned native integers + + + + Invalid floating point number + Invalid floating point number + + + + This number is outside the allowable range for decimal literals + This number is outside the allowable range for decimal literals + + + + This number is outside the allowable range for 32-bit floats + This number is outside the allowable range for 32-bit floats + + + + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + + + + This is not a valid byte literal + This is not a valid byte literal + + + + This is not a valid character literal + This is not a valid character literal + + + + This Unicode encoding is only valid in string literals + This Unicode encoding is only valid in string literals + + + + This token is reserved for future use + This token is reserved for future use + + + + TABs are not allowed in F# code unless the #indent \"off\" option is used + TABs are not allowed in F# code unless the #indent \"off\" option is used + + + + Invalid line number: '{0}' + Invalid line number: '{0}' + + + + #if directive must appear as the first non-whitespace character on a line + #if directive must appear as the first non-whitespace character on a line + + + + #else has no matching #if + #else has no matching #if + + + + #endif required for #else + #endif required for #else + + + + #else directive must appear as the first non-whitespace character on a line + #else directive must appear as the first non-whitespace character on a line + + + + #endif has no matching #if + #endif has no matching #if + + + + #endif directive must appear as the first non-whitespace character on a line + #endif directive must appear as the first non-whitespace character on a line + + + + #if directive should be immediately followed by an identifier + #if directive should be immediately followed by an identifier + + + + Syntax error. Wrong nested #endif, unexpected tokens before it. + Syntax error. Wrong nested #endif, unexpected tokens before it. + + + + #! may only appear as the first line at the start of a file. + #! may only appear as the first line at the start of a file. + + + + Expected single line comment or end of line + Expected single line comment or end of line + + + + Infix operator member '{0}' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + Infix operator member '{0}' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + + + + Infix operator member '{0}' has {1} initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + Infix operator member '{0}' has {1} initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + + + + Infix operator member '{0}' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + Infix operator member '{0}' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... + + + + All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' + All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' + + + + The struct, record or union type '{0}' has the 'StructuralComparison' attribute but the type parameter '{1}' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter + The struct, record or union type '{0}' has the 'StructuralComparison' attribute but the type parameter '{1}' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter + + + + The struct, record or union type '{0}' has the 'StructuralComparison' attribute but the component type '{1}' does not satisfy the 'comparison' constraint + The struct, record or union type '{0}' has the 'StructuralComparison' attribute but the component type '{1}' does not satisfy the 'comparison' constraint + + + + The struct, record or union type '{0}' is not structurally comparable because the type parameter {1} does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '{2}' to clarify that the type is not comparable + The struct, record or union type '{0}' is not structurally comparable because the type parameter {1} does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '{2}' to clarify that the type is not comparable + + + + The struct, record or union type '{0}' is not structurally comparable because the type '{1}' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '{2}' to clarify that the type is not comparable + The struct, record or union type '{0}' is not structurally comparable because the type '{1}' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '{2}' to clarify that the type is not comparable + + + + The struct, record or union type '{0}' does not support structural equality because the type parameter {1} does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '{2}' to clarify that the type does not support structural equality + The struct, record or union type '{0}' does not support structural equality because the type parameter {1} does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '{2}' to clarify that the type does not support structural equality + + + + The struct, record or union type '{0}' does not support structural equality because the type '{1}' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '{2}' to clarify that the type does not support structural equality + The struct, record or union type '{0}' does not support structural equality because the type '{1}' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '{2}' to clarify that the type does not support structural equality + + + + The struct, record or union type '{0}' has the 'StructuralEquality' attribute but the type parameter '{1}' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter + The struct, record or union type '{0}' has the 'StructuralEquality' attribute but the type parameter '{1}' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter + + + + The struct, record or union type '{0}' has the 'StructuralEquality' attribute but the component type '{1}' does not satisfy the 'equality' constraint + The struct, record or union type '{0}' has the 'StructuralEquality' attribute but the component type '{1}' does not satisfy the 'equality' constraint + + + + Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. + Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. + + + + The value '{0}' is unused + The value '{0}' is unused + + + + The recursive object reference '{0}' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. + The recursive object reference '{0}' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. + + + + A getter property may have at most one argument group + A getter property may have at most one argument group + + + + A setter property may have at most two argument groups + A setter property may have at most two argument groups + + + + Invalid property getter or setter + Invalid property getter or setter + + + + An indexer property must be given at least one argument + An indexer property must be given at least one argument + + + + This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation + This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation + + + + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + + + + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + + + + The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>' + The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>' + + + + The module/namespace '{0}' from compilation unit '{1}' did not contain the module/namespace '{2}' + The module/namespace '{0}' from compilation unit '{1}' did not contain the module/namespace '{2}' + + + + The module/namespace '{0}' from compilation unit '{1}' did not contain the val '{2}' + The module/namespace '{0}' from compilation unit '{1}' did not contain the val '{2}' + + + + The module/namespace '{0}' from compilation unit '{1}' did not contain the namespace, module or type '{2}' + The module/namespace '{0}' from compilation unit '{1}' did not contain the namespace, module or type '{2}' + + + + The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case + The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case + + + + The parameter '{0}' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref<int>'. When used, a byref parameter is implicitly dereferenced. + The parameter '{0}' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref<int>'. When used, a byref parameter is implicitly dereferenced. + + + + The generic member '{0}' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. + The generic member '{0}' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. + + + + The attribute '{0}' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. + The attribute '{0}' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. + + + + Cannot call an abstract base member: '{0}' + Cannot call an abstract base member: '{0}' + + + + Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position + Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position + + + + This construct is for ML compatibility. {0}. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. + This construct is for ML compatibility. {0}. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. + + + + The type '{0}' has been marked as having an Explicit layout, but the field '{1}' has not been marked with the 'FieldOffset' attribute + The type '{0}' has been marked as having an Explicit layout, but the field '{1}' has not been marked with the 'FieldOffset' attribute + + + + Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' + Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' + + + + Invalid prefix operator + Invalid prefix operator + + + + Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. + Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. + + + + The file extensions '.ml' and '.mli' are for ML compatibility + The file extensions '.ml' and '.mli' are for ML compatibility + + + + Consider using a file with extension '.ml' or '.mli' instead + Consider using a file with extension '.ml' or '.mli' instead + + + + Active pattern '{0}' is not a function + Active pattern '{0}' is not a function + + + + Active pattern '{0}' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice<int,unit> = A x' + Active pattern '{0}' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice<int,unit> = A x' + + + + The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) + The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) + + + + Optional arguments must come at the end of the argument list, after any non-optional arguments + Optional arguments must come at the end of the argument list, after any non-optional arguments + + + + Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes + Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes + + + + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. + The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. + + + + MDB generation failed. Could not find compatible member {0} + MDB generation failed. Could not find compatible member {0} + + + + Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. + Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. + + + + The union case named '{0}' conflicts with the generated type '{1}' + The union case named '{0}' conflicts with the generated type '{1}' + + + + ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter + ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter + + + + DLLImport bindings must be static members in a class or function definitions in a module + DLLImport bindings must be static members in a class or function definitions in a module + + + + When mscorlib.dll or FSharp.Core.dll is explicitly referenced the {0} option must also be passed + When mscorlib.dll or FSharp.Core.dll is explicitly referenced the {0} option must also be passed + + + + FSharp.Core.sigdata not found alongside FSharp.Core. File expected in {0}. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. + FSharp.Core.sigdata not found alongside FSharp.Core. File expected in {0}. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. + + + + File '{0}' not found alongside FSharp.Core. File expected in {1}. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. + File '{0}' not found alongside FSharp.Core. File expected in {1}. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. + + + + Filename '{0}' contains invalid character '{1}' + Filename '{0}' contains invalid character '{1}' + + + + 'use!' bindings must be of the form 'use! <var> = <expr>' + 'use!' bindings must be of the form 'use! <var> = <expr>' + + + + Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. + Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. + + + + The type '{0}' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property + The type '{0}' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property + + + + End of file in triple-quote string begun at or before here + End of file in triple-quote string begun at or before here + + + + End of file in triple-quote string embedded in comment begun at or before here + End of file in triple-quote string embedded in comment begun at or before here + + + + This type test or downcast will ignore the unit-of-measure '{0}' + This type test or downcast will ignore the unit-of-measure '{0}' + + + + Expected type argument or static argument + Expected type argument or static argument + + + + Unmatched '<'. Expected closing '>' + Unmatched '<'. Expected closing '>' + + + + Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. + Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. + + + + Attempted to parse this as an operator name, but failed + Attempted to parse this as an operator name, but failed + + + + \U{0} is not a valid Unicode character escape sequence + \U{0} is not a valid Unicode character escape sequence + + + + '{0}' must be applied to an argument of type '{1}', but has been applied to an argument of type '{2}' + '{0}' must be applied to an argument of type '{1}', but has been applied to an argument of type '{2}' + + + + '{0}' can only be applied to optional arguments + '{0}' can only be applied to optional arguments + + + + The specified .NET Framework version '{0}' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. + The specified .NET Framework version '{0}' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. + + + + Invalid Magic value in CLR Header + Invalid Magic value in CLR Header + + + + Bad image format + Bad image format + + + + Private key expected + Private key expected + + + + RSA key expected + RSA key expected + + + + Invalid bit Length + Invalid bit Length + + + + Invalid RSAParameters structure - '{{0}}' expected + Invalid RSAParameters structure - '{{0}}' expected + + + + Invalid algId - 'Exponent' expected + Invalid algId - 'Exponent' expected + + + + Invalid signature size + Invalid signature size + + + + No signature directory + No signature directory + + + + Invalid Public Key blob + Invalid Public Key blob + + + + Exiting - too many errors + Exiting - too many errors + + + + The documentation file has no .xml suffix + The documentation file has no .xml suffix + + + + No implementation files specified + No implementation files specified + + + + The attribute {0} specified version '{1}', but this value is invalid and has been ignored + The attribute {0} specified version '{1}', but this value is invalid and has been ignored + + + + Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. + Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. + + + + The code in assembly '{0}' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. + The code in assembly '{0}' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. + + + + Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. + Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. + + + + Static linking may not include a .EXE + Static linking may not include a .EXE + + + + Static linking may not include a mixed managed/unmanaged DLL + Static linking may not include a mixed managed/unmanaged DLL + + + + Ignoring mixed managed/unmanaged assembly '{0}' during static linking + Ignoring mixed managed/unmanaged assembly '{0}' during static linking + + + + Assembly '{0}' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. + Assembly '{0}' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. + + + + Assembly '{0}' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. + Assembly '{0}' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. + + + + The key file '{0}' could not be opened + The key file '{0}' could not be opened + + + + A problem occurred writing the binary '{0}': {1} + A problem occurred writing the binary '{0}': {1} + + + + The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option + The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option + + + + Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' + Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' + + + + Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module + Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module + + + + Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module + Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module + + + + Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module + Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module + + + + The assembly '{0}' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. + The assembly '{0}' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. + + + + The resident compilation service was not used because a problem occured in communicating with the server. + The resident compilation service was not used because a problem occured in communicating with the server. + + + + Problem with filename '{0}': Illegal characters in path. + Problem with filename '{0}': Illegal characters in path. + + + + Passing a .resx file ({0}) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an <EmbeddedResource> item in the .fsproj project file. + Passing a .resx file ({0}) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an <EmbeddedResource> item in the .fsproj project file. + + + + Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). + Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). + + + + An {0} specified version '{1}', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. + An {0} specified version '{1}', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. + + + + Determinstic builds only support portable PDBs (--debug:portable or --debug:embedded) + Determinstic builds only support portable PDBs (--debug:portable or --debug:embedded) + + + + Character '{0}' is not allowed in provided namespace name '{1}' + Character '{0}' is not allowed in provided namespace name '{1}' + + + + The provided type '{0}' returned a member with a null or empty member name + The provided type '{0}' returned a member with a null or empty member name + + + + The provided type '{0}' returned a null member + The provided type '{0}' returned a null member + + + + The provided type '{0}' member info '{1}' has null declaring type + The provided type '{0}' member info '{1}' has null declaring type + + + + The provided type '{0}' has member '{1}' which has declaring type '{2}'. Expected declaring type to be the same as provided type. + The provided type '{0}' has member '{1}' which has declaring type '{2}'. Expected declaring type to be the same as provided type. + + + + Referenced assembly '{0}' has assembly level attribute '{1}' but no public type provider classes were found + Referenced assembly '{0}' has assembly level attribute '{1}' but no public type provider classes were found + + + + Type '{0}' from type provider '{1}' has an empty namespace. Use 'null' for the global namespace. + Type '{0}' from type provider '{1}' has an empty namespace. Use 'null' for the global namespace. + + + + Empty namespace found from the type provider '{0}'. Use 'null' for the global namespace. + Empty namespace found from the type provider '{0}'. Use 'null' for the global namespace. + + + + Provided type '{0}' has 'IsGenericType' as true, but generic types are not supported. + Provided type '{0}' has 'IsGenericType' as true, but generic types are not supported. + + + + Provided type '{0}' has 'IsArray' as true, but array types are not supported. + Provided type '{0}' has 'IsArray' as true, but array types are not supported. + + + + Invalid member '{0}' on provided type '{1}'. Provided type members must be public, and not be generic, virtual, or abstract. + Invalid member '{0}' on provided type '{1}'. Provided type members must be public, and not be generic, virtual, or abstract. + + + + Invalid member '{0}' on provided type '{1}'. Only properties, methods and constructors are allowed + Invalid member '{0}' on provided type '{1}'. Only properties, methods and constructors are allowed + + + + Property '{0}' on provided type '{1}' has CanRead=true but there was no value from GetGetMethod() + Property '{0}' on provided type '{1}' has CanRead=true but there was no value from GetGetMethod() + + + + Property '{0}' on provided type '{1}' has CanRead=false but GetGetMethod() returned a method + Property '{0}' on provided type '{1}' has CanRead=false but GetGetMethod() returned a method + + + + Property '{0}' on provided type '{1}' has CanWrite=true but there was no value from GetSetMethod() + Property '{0}' on provided type '{1}' has CanWrite=true but there was no value from GetSetMethod() + + + + Property '{0}' on provided type '{1}' has CanWrite=false but GetSetMethod() returned a method + Property '{0}' on provided type '{1}' has CanWrite=false but GetSetMethod() returned a method + + + + One or more errors seen during provided type setup + One or more errors seen during provided type setup + + + + Unexpected exception from provided type '{0}' member '{1}': {2} + Unexpected exception from provided type '{0}' member '{1}': {2} + + + + Unsupported constant type '{0}'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. + Unsupported constant type '{0}'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. + + + + Unsupported expression '{0}' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. + Unsupported expression '{0}' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. + + + + Expected provided type named '{0}' but provided type has 'Name' with value '{1}' + Expected provided type named '{0}' but provided type has 'Name' with value '{1}' + + + + Event '{0}' on provided type '{1}' has no value from GetAddMethod() + Event '{0}' on provided type '{1}' has no value from GetAddMethod() + + + + Event '{0}' on provided type '{1}' has no value from GetRemoveMethod() + Event '{0}' on provided type '{1}' has no value from GetRemoveMethod() + + + + Assembly attribute '{0}' refers to a designer assembly '{1}' which cannot be loaded or doesn't exist. {2} + Assembly attribute '{0}' refers to a designer assembly '{1}' which cannot be loaded or doesn't exist. {2} + + + + The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. + The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. + + + + The type provider '{0}' reported an error: {1} + The type provider '{0}' reported an error: {1} + + + + The type provider '{0}' used an invalid parameter in the ParameterExpression: {1} + The type provider '{0}' used an invalid parameter in the ParameterExpression: {1} + + + + The type provider '{0}' provided a method with a name '{1}' and metadata token '{2}', which is not reported among its methods of its declaring type '{3}' + The type provider '{0}' provided a method with a name '{1}' and metadata token '{2}', which is not reported among its methods of its declaring type '{3}' + + + + The type provider '{0}' provided a constructor which is not reported among the constructors of its declaring type '{1}' + The type provider '{0}' provided a constructor which is not reported among the constructors of its declaring type '{1}' + + + + A direct reference to the generated type '{0}' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = <path>'. This indicates that a type provider adds generated types to your assembly. + A direct reference to the generated type '{0}' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = <path>'. This indicates that a type provider adds generated types to your assembly. + + + + Expected provided type with path '{0}' but provided type has path '{1}' + Expected provided type with path '{0}' but provided type has path '{1}' + + + + Unexpected 'null' return value from provided type '{0}' member '{1}' + Unexpected 'null' return value from provided type '{0}' member '{1}' + + + + Unexpected exception from member '{0}' of provided type '{1}' member '{2}': {3} + Unexpected exception from member '{0}' of provided type '{1}' member '{2}': {3} + + + + Nested provided types do not take static arguments or generic parameters + Nested provided types do not take static arguments or generic parameters + + + + Invalid static argument to provided type. Expected an argument of kind '{0}'. + Invalid static argument to provided type. Expected an argument of kind '{0}'. + + + + An error occured applying the static arguments to a provided type + An error occured applying the static arguments to a provided type + + + + Unknown static argument kind '{0}' when resolving a reference to a provided type or method '{1}' + Unknown static argument kind '{0}' when resolving a reference to a provided type or method '{1}' + + + + invalid namespace for provided type + invalid namespace for provided type + + + + invalid full name for provided type + invalid full name for provided type + + + + The type provider returned 'null', which is not a valid return value from '{0}' + The type provider returned 'null', which is not a valid return value from '{0}' + + + + The type provider constructor has thrown an exception: {0} + The type provider constructor has thrown an exception: {0} + + + + Type provider '{0}' returned null from GetInvokerExpression. + Type provider '{0}' returned null from GetInvokerExpression. + + + + The type provider '{0}' returned an invalid type from 'ApplyStaticArguments'. A type with name '{1}' was expected, but a type with name '{2}' was returned. + The type provider '{0}' returned an invalid type from 'ApplyStaticArguments'. A type with name '{1}' was expected, but a type with name '{2}' was returned. + + + + The type provider '{0}' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '{1}' was expected, but a method with name '{2}' was returned. + The type provider '{0}' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '{1}' was expected, but a method with name '{2}' was returned. + + + + This type test or downcast will erase the provided type '{0}' to the type '{1}' + This type test or downcast will erase the provided type '{0}' to the type '{1}' + + + + This downcast will erase the provided type '{0}' to the type '{1}'. + This downcast will erase the provided type '{0}' to the type '{1}'. + + + + This type test with a provided type '{0}' is not allowed because this provided type will be erased to '{1}' at runtime. + This type test with a provided type '{0}' is not allowed because this provided type will be erased to '{1}' at runtime. + + + + Cannot inherit from erased provided type + Cannot inherit from erased provided type + + + + Assembly '{0}' hase TypeProviderAssembly attribute with invalid value '{1}'. The value should be a valid assembly name + Assembly '{0}' hase TypeProviderAssembly attribute with invalid value '{1}'. The value should be a valid assembly name + + + + Invalid member name. Members may not have name '.ctor' or '.cctor' + Invalid member name. Members may not have name '.ctor' or '.cctor' + + + + The function or member '{0}' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '{1}'. + The function or member '{0}' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '{1}'. + + + + The number of type arguments did not match: '{0}' given, '{1}' expected. This may be related to a previously reported error. + The number of type arguments did not match: '{0}' given, '{1}' expected. This may be related to a previously reported error. + + + + Cannot override inherited member '{0}' because it is sealed + Cannot override inherited member '{0}' because it is sealed + + + + The type provider '{0}' reported an error in the context of provided type '{1}', member '{2}'. The error: {3} + The type provider '{0}' reported an error in the context of provided type '{1}', member '{2}'. The error: {3} + + + + An exception occurred when accessing the '{0}' of a provided type: {1} + An exception occurred when accessing the '{0}' of a provided type: {1} + + + + The '{0}' of a provided type was null or empty. + The '{0}' of a provided type was null or empty. + + + + Character '{0}' is not allowed in provided type name '{1}' + Character '{0}' is not allowed in provided type name '{1}' + + + + In queries, '{0}' must use a simple pattern + In queries, '{0}' must use a simple pattern + + + + A custom query operation for '{0}' is required but not specified + A custom query operation for '{0}' is required but not specified + + + + Named static arguments must come after all unnamed static arguments + Named static arguments must come after all unnamed static arguments + + + + The static parameter '{0}' of the provided type or method '{1}' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '{2}<{3}=...>'. + The static parameter '{0}' of the provided type or method '{1}' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '{2}<{3}=...>'. + + + + No static parameter exists with name '{0}' + No static parameter exists with name '{0}' + + + + The static parameter '{0}' has already been given a value + The static parameter '{0}' has already been given a value + + + + Multiple static parameters exist with name '{0}' + Multiple static parameters exist with name '{0}' + + + + A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression + A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression + + + + A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression + A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression + + + + The custom operation '{0}' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. + The custom operation '{0}' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. + + + + An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. + An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. + + + + Invalid argument to 'methodhandleof' during codegen + Invalid argument to 'methodhandleof' during codegen + + + + A reference to a provided type was missing a value for the static parameter '{0}'. You may need to recompile one or more referenced assemblies. + A reference to a provided type was missing a value for the static parameter '{0}'. You may need to recompile one or more referenced assemblies. + + + + A reference to a provided type had an invalid value '{0}' for a static parameter. You may need to recompile one or more referenced assemblies. + A reference to a provided type had an invalid value '{0}' for a static parameter. You may need to recompile one or more referenced assemblies. + + + + '{0}' is not used correctly. This is a custom operation in this query or computation expression. + '{0}' is not used correctly. This is a custom operation in this query or computation expression. + + + + '{0}' is not used correctly. Usage: {1}. This is a custom operation in this query or computation expression. + '{0}' is not used correctly. Usage: {1}. This is a custom operation in this query or computation expression. + + + + {0} var in collection {1} (outerKey = innerKey). Note that parentheses are required after '{2}' + {0} var in collection {1} (outerKey = innerKey). Note that parentheses are required after '{2}' + + + + {0} var in collection {1} (outerKey = innerKey) into group. Note that parentheses are required after '{2}' + {0} var in collection {1} (outerKey = innerKey) into group. Note that parentheses are required after '{2}' + + + + {0} var in collection + {0} var in collection + + + + '{0}' must be followed by a variable name. Usage: {1}. + '{0}' must be followed by a variable name. Usage: {1}. + + + + Incorrect syntax for '{0}'. Usage: {1}. + Incorrect syntax for '{0}'. Usage: {1}. + + + + '{0}' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... {1} ... + '{0}' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... {1} ... + + + + '{0}' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected {1} argument(s), but given {2}. + '{0}' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected {1} argument(s), but given {2}. + + + + Expected an expression after this point + Expected an expression after this point + + + + Expected a type after this point + Expected a type after this point + + + + Unmatched '[<'. Expected closing '>]' + Unmatched '[<'. Expected closing '>]' + + + + Unexpected end of input in 'match' expression. Expected 'match <expr> with | <pat> -> <expr> | <pat> -> <expr> ...'. + Unexpected end of input in 'match' expression. Expected 'match <expr> with | <pat> -> <expr> | <pat> -> <expr> ...'. + + + + Unexpected end of input in 'try' expression. Expected 'try <expr> with <rules>' or 'try <expr> finally <expr>'. + Unexpected end of input in 'try' expression. Expected 'try <expr> with <rules>' or 'try <expr> finally <expr>'. + + + + Unexpected end of input in 'while' expression. Expected 'while <expr> do <expr>'. + Unexpected end of input in 'while' expression. Expected 'while <expr> do <expr>'. + + + + Unexpected end of input in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. + Unexpected end of input in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. + + + + Unexpected end of input in 'match' or 'try' expression + Unexpected end of input in 'match' or 'try' expression + + + + Unexpected end of input in 'then' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + Unexpected end of input in 'then' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + + + + Unexpected end of input in 'else' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + Unexpected end of input in 'else' branch of conditional expression. Expected 'if <expr> then <expr>' or 'if <expr> then <expr> else <expr>'. + + + + Unexpected end of input in body of lambda expression. Expected 'fun <pat> ... <pat> -> <expr>'. + Unexpected end of input in body of lambda expression. Expected 'fun <pat> ... <pat> -> <expr>'. + + + + Unexpected end of input in type arguments + Unexpected end of input in type arguments + + + + Unexpected end of input in type signature + Unexpected end of input in type signature + + + + Unexpected end of input in type definition + Unexpected end of input in type definition + + + + Unexpected end of input in object members + Unexpected end of input in object members + + + + Unexpected end of input in value, function or member definition + Unexpected end of input in value, function or member definition + + + + Unexpected end of input in expression + Unexpected end of input in expression + + + + Unexpected end of type. Expected a name after this point. + Unexpected end of type. Expected a name after this point. + + + + Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + + + + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. + + + + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. + + + + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. + Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. + + + + Missing 'do' in 'while' expression. Expected 'while <expr> do <expr>'. + Missing 'do' in 'while' expression. Expected 'while <expr> do <expr>'. + + + + Missing 'do' in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. + Missing 'do' in 'for' expression. Expected 'for <pat> in <expr> do <expr>'. + + + + Invalid join relation in '{0}'. Expected 'expr <op> expr', where <op> is =, =?, ?= or ?=?. + Invalid join relation in '{0}'. Expected 'expr <op> expr', where <op> is =, =?, ?= or ?=?. + + + + Calls + Calls + + + + Invalid number of generic arguments to type '{0}' in provided type. Expected '{1}' arguments, given '{2}'. + Invalid number of generic arguments to type '{0}' in provided type. Expected '{1}' arguments, given '{2}'. + + + + Invalid value '{0}' for unit-of-measure parameter '{1}' + Invalid value '{0}' for unit-of-measure parameter '{1}' + + + + Invalid value unit-of-measure parameter '{0}' + Invalid value unit-of-measure parameter '{0}' + + + + Property '{0}' on provided type '{1}' is neither readable nor writable as it has CanRead=false and CanWrite=false + Property '{0}' on provided type '{1}' is neither readable nor writable as it has CanRead=false and CanWrite=false + + + + A use of 'into' must be followed by the remainder of the computation + A use of 'into' must be followed by the remainder of the computation + + + + The operator '{0}' does not accept the use of 'into' + The operator '{0}' does not accept the use of 'into' + + + + The definition of the custom operator '{0}' does not use a valid combination of attribute flags + The definition of the custom operator '{0}' does not use a valid combination of attribute flags + + + + This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. + This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. + + + + 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. + + + + Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. + Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. + + + + To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. + To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. + + + + Type '{0}' is illegal because in byref<T>, T cannot contain byref types. + Type '{0}' is illegal because in byref<T>, T cannot contain byref types. + + + + F# supports array ranks between 1 and 32. The value {0} is not allowed. + F# supports array ranks between 1 and 32. The value {0} is not allowed. + + + + In queries, use the form 'for x in n .. m do ...' for ranging over integers + In queries, use the form 'for x in n .. m do ...' for ranging over integers + + + + 'while' expressions may not be used in queries + 'while' expressions may not be used in queries + + + + 'try/finally' expressions may not be used in queries + 'try/finally' expressions may not be used in queries + + + + 'use' expressions may not be used in queries + 'use' expressions may not be used in queries + + + + 'let!', 'use!' and 'do!' expressions may not be used in queries + 'let!', 'use!' and 'do!' expressions may not be used in queries + + + + 'return' and 'return!' may not be used in queries + 'return' and 'return!' may not be used in queries + + + + This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. + This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. + + + + 'try/with' expressions may not be used in queries + 'try/with' expressions may not be used in queries + + + + This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. + This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. + + + + Too many static parameters. Expected at most {0} parameters, but got {1} unnamed and {2} named parameters. + Too many static parameters. Expected at most {0} parameters, but got {1} unnamed and {2} named parameters. + + + + Invalid provided literal value '{0}' + Invalid provided literal value '{0}' + + + + The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. + The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. + + + + This member, function or value declaration may not be declared 'inline' + This member, function or value declaration may not be declared 'inline' + + + + The provider '{0}' returned a non-generated type '{1}' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. + The provider '{0}' returned a non-generated type '{1}' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. + + + + Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' + Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' + + + + A quotation may not involve an assignment to or taking the address of a captured local variable + A quotation may not involve an assignment to or taking the address of a captured local variable + + + + + 1 overload + + 1 overload + + + + + {0} overloads + + {0} overloads + + + + Erased to + Erased to + + + + Unexpected token '{0}' or incomplete expression + Unexpected token '{0}' or incomplete expression + + + + Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. + Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. + + + + Type name cannot be empty. + Type name cannot be empty. + + + + Problem reading assembly '{0}': {1} + Problem reading assembly '{0}': {1} + + + + Invalid provided field. Provided fields of erased provided types must be literals. + Invalid provided field. Provided fields of erased provided types must be literals. + + + + (loading description...) + (loading description...) + + + + (description unavailable...) + (description unavailable...) + + + + A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. + A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. + + + + 'match' expressions may not be used in queries + 'match' expressions may not be used in queries + + + + Infix operator member '{0}' has {1} initial argument(s). Expected a tuple of 3 arguments + Infix operator member '{0}' has {1} initial argument(s). Expected a tuple of 3 arguments + + + + The operator '{0}' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + The operator '{0}' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. + + + + '{0}' must be followed by 'in'. Usage: {1}. + '{0}' must be followed by 'in'. Usage: {1}. + + + + Neither 'member val' nor 'override val' definitions are permitted in object expressions. + Neither 'member val' nor 'override val' definitions are permitted in object expressions. + + + + Copy-and-update record expressions must include at least one field. + Copy-and-update record expressions must include at least one field. + + + + '_' cannot be used as field name + '_' cannot be used as field name + + + + The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. + The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. + + + + A property's getter and setter must have the same type. Property '{0}' has getter of type '{1}' but setter of type '{2}'. + A property's getter and setter must have the same type. Property '{0}' has getter of type '{1}' but setter of type '{2}'. + + + + Array method '{0}' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. + Array method '{0}' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. + + + + The union case '{0}' does not have a field named '{1}'. + The union case '{0}' does not have a field named '{1}'. + + + + Union case/exception field '{0}' cannot be used more than once. + Union case/exception field '{0}' cannot be used more than once. + + + + Named field '{0}' is used more than once. + Named field '{0}' is used more than once. + + + + Named field '{0}' conflicts with autogenerated name for anonymous field. + Named field '{0}' conflicts with autogenerated name for anonymous field. + + + + This literal expression or attribute argument results in an arithmetic overflow. + This literal expression or attribute argument results in an arithmetic overflow. + + + + This is not valid literal expression. The [<Literal>] attribute will be ignored. + This is not valid literal expression. The [<Literal>] attribute will be ignored. + + + + System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. + System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. + + + + The mutable local '{0}' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. + The mutable local '{0}' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. + + + + A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid + A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid + + + + An error occured applying the static arguments to a provided method + An error occured applying the static arguments to a provided method + + + + Unexpected character '{0}' in preprocessor expression + Unexpected character '{0}' in preprocessor expression + + + + Unexpected token '{0}' in preprocessor expression + Unexpected token '{0}' in preprocessor expression + + + + Incomplete preprocessor expression + Incomplete preprocessor expression + + + + Missing token '{0}' in preprocessor expression + Missing token '{0}' in preprocessor expression + + + + An error occurred while reading the F# metadata node at position {0} in table '{1}' of assembly '{2}'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. + An error occurred while reading the F# metadata node at position {0} in table '{1}' of assembly '{2}'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. + + + + Type inference caused the type variable {0} to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. + Type inference caused the type variable {0} to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. + + + + Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. + Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. + + + + Redundant arguments are being ignored in function '{0}'. Expected {1} but got {2} arguments. + Redundant arguments are being ignored in function '{0}'. Expected {1} but got {2} arguments. + + + + Lowercase literal '{0}' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. + Lowercase literal '{0}' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. + + + + This literal pattern does not take arguments + This literal pattern does not take arguments + + + + Constructors are not permitted as extension members - they must be defined as part of the original definition of the type + Constructors are not permitted as extension members - they must be defined as part of the original definition of the type + + + + Invalid response file '{0}' ( '{1}' ) + Invalid response file '{0}' ( '{1}' ) + + + + Response file '{0}' not found in '{1}' + Response file '{0}' not found in '{1}' + + + + Response file name '{0}' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long + Response file name '{0}' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long + + + + Cannot find FSharp.Core.dll in compiler's directory + Cannot find FSharp.Core.dll in compiler's directory + + + + One tuple type is a struct tuple, the other is a reference tuple + One tuple type is a struct tuple, the other is a reference tuple + + + + This provided method requires static parameters + This provided method requires static parameters + + + + The conversion from {0} to {1} is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. + The conversion from {0} to {1} is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. + + + + The conversion from {0} to {1} is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. + The conversion from {0} to {1} is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. + + + + The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored + The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored + + + + In a recursive declaration group, 'open' declarations must come first in each module + In a recursive declaration group, 'open' declarations must come first in each module + + + + In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations + In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations + + + + This declaration is not supported in recursive declaration groups + This declaration is not supported in recursive declaration groups + + + + Invalid use of 'rec' keyword + Invalid use of 'rec' keyword + + + + If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. + If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. + + + + The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. + The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. + + + + Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + + + + Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. + Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. + + + + {0} is an active pattern and cannot be treated as a discriminated union case with named fields. + {0} is an active pattern and cannot be treated as a discriminated union case with named fields. + + + + The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. + The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. + + + + The system type '{0}' was required but no referenced system DLL contained this type + The system type '{0}' was required but no referenced system DLL contained this type + + + + The member '{0}' matches multiple overloads of the same method.\nPlease restrict it to one of the following:{1}. + The member '{0}' matches multiple overloads of the same method.\nPlease restrict it to one of the following:{1}. + + + + Method or object constructor '{0}' is not static + Method or object constructor '{0}' is not static + + + + Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? + Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? + + + + Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. + Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. + + + + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + + + + Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. + Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. + + + + Used to verify code during debugging. + Used to verify code during debugging. + + + + Used as the name of the base class object. + Used as the name of the base class object. + + + + In verbose syntax, indicates the start of a code block. + In verbose syntax, indicates the start of a code block. + + + + In verbose syntax, indicates the start of a class definition. + In verbose syntax, indicates the start of a class definition. + + + + Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. + Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. + + + + Used to declare a delegate. + Used to declare a delegate. + + + + Used in looping constructs or to execute imperative code. + Used in looping constructs or to execute imperative code. + + + + In verbose syntax, indicates the end of a block of code in a looping expression. + In verbose syntax, indicates the end of a block of code in a looping expression. + + + + Used to convert to a type that is lower in the inheritance chain. + Used to convert to a type that is lower in the inheritance chain. + + + + In a for expression, used when counting in reverse. + In a for expression, used when counting in reverse. + + + + Used in conditional branching. A short form of else if. + Used in conditional branching. A short form of else if. + + + + Used in conditional branching. + Used in conditional branching. + + + + In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. + In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. + + + + Used to declare an exception type. + Used to declare an exception type. + + + + Indicates that a declared program element is defined in another binary or assembly. + Indicates that a declared program element is defined in another binary or assembly. + + + + Used as a Boolean literal. + Used as a Boolean literal. + + + + Used together with try to introduce a block of code that executes regardless of whether an exception occurs. + Used together with try to introduce a block of code that executes regardless of whether an exception occurs. + + + + Used in looping constructs. + Used in looping constructs. + + + + Used in lambda expressions, also known as anonymous functions. + Used in lambda expressions, also known as anonymous functions. + + + + Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. + Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. + + + + Used to reference the top-level .NET namespace. + Used to reference the top-level .NET namespace. + + + + Used in conditional branching constructs. + Used in conditional branching constructs. + + + + Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. + Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. + + + + Used to specify a base class or base interface. + Used to specify a base class or base interface. + + + + Used to indicate a function that should be integrated directly into the caller's code. + Used to indicate a function that should be integrated directly into the caller's code. + + + + Used to declare and implement interfaces. + Used to declare and implement interfaces. + + + + Used to specify that a member is visible inside an assembly but not outside it. + Used to specify that a member is visible inside an assembly but not outside it. + + + + Used to specify a computation that is to be performed only when a result is needed. + Used to specify a computation that is to be performed only when a result is needed. + + + + Used to associate, or bind, a name to a value or function. + Used to associate, or bind, a name to a value or function. + + + + Used in computation expressions to bind a name to the result of another computation expression. + Used in asynchronous workflows to bind a name to the result of an asynchronous computation, or, in other computation expressions, used to bind a name to a result, which is of the computation type. + + + + Used to branch by comparing a value to a pattern. + Used to branch by comparing a value to a pattern. + + + + Used to declare a property or method in an object type. + Used to declare a property or method in an object type. + + + + Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. + Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. + + + + Used to declare a variable, that is, a value that can be changed. + Used to declare a variable, that is, a value that can be changed. + + + + Used to associate a name with a group of related types and modules, to logically separate it from other code. + Used to associate a name with a group of related types and modules, to logically separate it from other code. + + + + Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. + Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. + + + + Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. + Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. + + + + Indicates the absence of an object. Also used in generic parameter constraints. + Indicates the absence of an object. Also used in generic parameter constraints. + + + + Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. + Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. + + + + Used to make the contents of a namespace or module available without qualification. + Used to make the contents of a namespace or module available without qualification. + + + + Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. + Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. + + + + Used to implement a version of an abstract or virtual method that differs from the base version. + Used to implement a version of an abstract or virtual method that differs from the base version. + + + + Restricts access to a member to code in the same type or module. + Restricts access to a member to code in the same type or module. + + + + Allows access to a member from outside the type. + Allows access to a member from outside the type. + + + + Used to indicate that a function is recursive. + Used to indicate that a function is recursive. + + + + Used to provide a value for the result of the containing computation expression. + Used to indicate a value to provide as the result of a computation expression. + + + + Used to provide a value for the result of the containing computation expression, where that value itself comes from the result another computation expression. + Used to indicate a computation expression that, when evaluated, provides the result of the containing computation expression. + + + + Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. + Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. + + + + Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. + Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. + + + + Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. + Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. + + + + Used in conditional expressions. Also used to perform side effects after object construction. + Used in conditional expressions. Also used to perform side effects after object construction. + + + + Used in for loops to indicate a range. + Used in for loops to indicate a range. + + + + Used to introduce a block of code that might generate an exception. Used together with with or finally. + Used to introduce a block of code that might generate an exception. Used together with with or finally. + + + + Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. + Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. + + + + Used to convert to a type that is higher in the inheritance chain. + Used to convert to a type that is higher in the inheritance chain. + + + + Used instead of let for values that implement IDisposable + Used instead of let for values that implement IDisposable + + + + Used instead of let! in computation expressions for computation expression results that implement IDisposable. + Used instead of let! in computation expressions for computation expression results that implement IDisposable. + + + + Used in a signature to indicate a value, or in a type to declare a member, in limited situations. + Used in a signature to indicate a value, or in a type to declare a member, in limited situations. + + + + Indicates the .NET void type. Used when interoperating with other .NET languages. + Indicates the .NET void type. Used when interoperating with other .NET languages. + + + + Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. + Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. + + + + Introduces a looping construct. + Introduces a looping construct. + + + + Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. + Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. + + + + Used in a sequence expression to produce a value for a sequence. + Used in a sequence expression to produce a value for a sequence. + + + + Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. + Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. + + + + In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions + In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions + + + + Assigns a value to a variable. + Assigns a value to a variable. + + + + Converts a type to type that is higher in the hierarchy. + Converts a type to type that is higher in the hierarchy. + + + + Converts a type to a type that is lower in the hierarchy. + Converts a type to a type that is lower in the hierarchy. + + + + Delimits a typed code quotation. + Delimits a typed code quotation. + + + + Delimits a untyped code quotation. + Delimits a untyped code quotation. + + + + {0} '{1}' not found in assembly '{2}'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. + {0} '{1}' not found in assembly '{2}'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. + + + + {0} '{1}' not found in type '{2}' from assembly '{3}'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. + {0} '{1}' not found in type '{2}' from assembly '{3}'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. + + + + is + is + + + + This value is not a function and cannot be applied. + This value is not a function and cannot be applied. + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via {0}.[index] instead? + This value is not a function and cannot be applied. Did you intend to access the indexer via {0}.[index] instead? + + + + This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? + This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? + + + + This value is not a function and cannot be applied. Did you forget to terminate a declaration? + This value is not a function and cannot be applied. Did you forget to terminate a declaration? + + + + The argument names in the signature '{0}' and implementation '{1}' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. + The argument names in the signature '{0}' and implementation '{1}' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. + + + + An error occurred while reading the F# metadata of assembly '{0}'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct. + An error occurred while reading the F# metadata of assembly '{0}'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct. + + + + This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + + + + This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'. + This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'. + + + + This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. + This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. + + + + Used in computation expressions to pattern match directly over the result of another computation expression. + Used in computation expressions to pattern match directly over the result of another computation expression. + + + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + + + + This type does not inherit Attribute, it will not work correctly with other .NET languages. + This type does not inherit Attribute, it will not work correctly with other .NET languages. + + + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + + + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 87e9fb2e572..13329c3ef1c 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -5237,11 +5237,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 839d65654bb..14ed068f52e 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -5237,11 +5237,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 b0fe478b712..48c95c12a8b 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -5237,11 +5237,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 2d65a31b302..00c00a4f861 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -5239,11 +5239,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 1bb2aea5e39..874cc065e0f 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -5237,11 +5237,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 17011e1f05d..4ec4213e36f 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -5237,11 +5237,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 c76d1961070..dfb0f519c6a 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -5237,11 +5237,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 49a5c382617..5882107b227 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -5237,11 +5237,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 f302bb7137b..82470be3f70 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -5237,11 +5237,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 1626b50c116..7b2bce8e538 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -5237,11 +5237,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 9f0a87c0f32..5160c36eeec 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -5237,11 +5237,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/testfiles/test.fs b/testfiles/test.fs new file mode 100644 index 00000000000..604f475fd5c --- /dev/null +++ b/testfiles/test.fs @@ -0,0 +1,247 @@ +module Test + +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 + + let result = 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 + + [] + module Extensions2 = + type System.Int32 with + static member (++)(a: int, b: string) = a + + let f (x: string) = 1 ++ x + // 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 + + +/// 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. + + + +#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 + let result2 = v * v + let result3 = v - v + let result4 = v / v + let result5 = -v + let result6 = v ||| v + let result7 = v &&& v + let result8 = v ^^^ v + let result9 = LanguagePrimitives.GenericZero + let result10 = LanguagePrimitives.GenericOne + let result11 = sign v + let result12 = abs v + let result13 = sqrt v + let result14 = sin v + let result15 = cos v + let result16 = tan v + let result17 = LanguagePrimitives.DivideByInt v 4 + + +/// 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 + () + + +/// 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 + + let v3 = count [3] + + let v5 = count (ResizeArray [| 3 |]) + +/// 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 + + let v1 = [|3|].Count // sanity check + + let v3 = count [3] + + let v4 = count [| 3 |] + + let v5 = count (dict [| 1,3 |]) + + let v6 = count (ResizeArray [| 3 |]) // intrinsic from .NET + + + + +/// 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 proprty 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 + + let v1 = countm seqv + +/// A random example +module ContainsKeyExample = + let inline containsKey (k: ^Key) (a : ^A when ^A : (member ContainsKey : ^Key -> bool)) = + (^A : (member ContainsKey : ^Key -> bool) (a,k)) + + let v5 = containsKey 1 (dict [| 1,3 |]) + + // Note that without 'inline' this doesn't become generic + let inline f x = containsKey x (dict [| (x,1) |]) + +(* +/// 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" + +module Errors = + open System + type System.Int32 with + static member inline (+)(a, b) = Array.map2 (+) a b + + let _ = [|1;2;3|] + [|2;3;4|] //Okay + let _ = [|TimeSpan.Zero|] + [|TimeSpan.Zero|] //Okay + let _ = [|1m|] + [|2m|] //Okay + let _ = [|1uy|] + [|2uy|] //Okay + let _ = [|1L|] + [|2L|] //Okay + let _ = [|1I|] + [|2I|] //Okay + let _ = [| [|1 ; 1|]; [|2|] |] + [| [|2; 2|]; [|3|] |] //Okay + let _ = [|"1"|] + [|"2"|] //error FS0001 + let _ = [|1.f|] + [|2.f|] //error FS0001 + let _ = [|1.0|] + [|2.0|] //error FS0001 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 27c9e6c3a40..a8bc5fb51f7 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 381e5b9a658..21836cabd2b 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1782,8 +1782,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/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 6482281b893..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' \ No newline at end of file +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) ())