diff --git a/src/fsharp/CheckComputationExpressions.fs b/src/fsharp/CheckComputationExpressions.fs index 22a37e6417c..ae78f8d9b3a 100644 --- a/src/fsharp/CheckComputationExpressions.fs +++ b/src/fsharp/CheckComputationExpressions.fs @@ -929,6 +929,10 @@ let TcComputationExpression cenv env (overallTy: OverallTy) tpenv (mWhole, inter | SynExpr.ForEach (spForLoop, SeqExprOnly _seqExprOnly, isFromSource, pat, sourceExpr, innerComp, _) -> + let sourceExpr = + match RewriteRangeExpr sourceExpr with + | Some e -> e + | None -> sourceExpr let wrappedSourceExpr = mkSourceExprConditional isFromSource sourceExpr let mFor = match spForLoop with DebugPointAtFor.Yes m -> m.NoteDebugPoint(RangeDebugPointKind.For) | _ -> pat.Range let mPat = pat.Range @@ -1727,6 +1731,10 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = let rec tryTcSequenceExprBody env genOuterTy tpenv comp = match comp with | SynExpr.ForEach (spFor, SeqExprOnly _seqExprOnly, _isFromSource, pat, pseudoEnumExpr, innerComp, m) -> + let pseudoEnumExpr = + match RewriteRangeExpr pseudoEnumExpr with + | Some e -> e + | None -> pseudoEnumExpr // This expression is not checked with the knowledge it is an IEnumerable, since we permit other enumerable types with GetEnumerator/MoveNext methods, as does C# let pseudoEnumExpr, arb_ty, tpenv = TcExprOfUnknownType cenv env tpenv pseudoEnumExpr let enumExpr, enumElemTy = ConvertArbitraryExprToEnumerable cenv arb_ty env pseudoEnumExpr @@ -1932,31 +1940,70 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = let delayedExpr = mkDelayedExpr coreExpr.Range coreExpr delayedExpr, tpenv -let TcSequenceExpressionEntry (cenv: cenv) env (overallTy: OverallTy) tpenv (isArrayOrList, isNotNakedRefCell, comp) m = +let TcSequenceExpressionEntry (cenv: cenv) env (overallTy: OverallTy) tpenv (hasBuilder, comp) m = + match RewriteRangeExpr comp with + | Some replacementExpr -> + TcExpr cenv overallTy env tpenv replacementExpr + | None -> + let implicitYieldEnabled = cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield let validateObjectSequenceOrRecordExpression = not implicitYieldEnabled - if not isArrayOrList then - match comp with - | SynExpr.New _ -> - errorR(Error(FSComp.SR.tcInvalidObjectExpressionSyntaxForm(), m)) - | SimpleSemicolonSequence cenv false _ when validateObjectSequenceOrRecordExpression -> - errorR(Error(FSComp.SR.tcInvalidObjectSequenceOrRecordExpression(), m)) - | _ -> - () - if not !isNotNakedRefCell && not cenv.g.compilingFslib then + match comp with + | SynExpr.New _ -> + errorR(Error(FSComp.SR.tcInvalidObjectExpressionSyntaxForm(), m)) + | SimpleSemicolonSequence cenv false _ when validateObjectSequenceOrRecordExpression -> + errorR(Error(FSComp.SR.tcInvalidObjectSequenceOrRecordExpression(), m)) + | _ -> + () + if not hasBuilder && not cenv.g.compilingFslib then error(Error(FSComp.SR.tcInvalidSequenceExpressionSyntaxForm(), m)) TcSequenceExpression cenv env tpenv comp overallTy m -let TcArrayOrListSequenceExpression (cenv: cenv) env overallTy tpenv (isArray, comp) m = +let TcArrayOrListComputedExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (isArray, comp) m = + // The syntax '[ n .. m ]' and '[ n .. step .. m ]' is not really part of array or list syntax. + // It could be in the future, e.g. '[ 1; 2..30; 400 ]' + // + // The elaborated form of '[ n .. m ]' is 'List.ofSeq (seq (op_Range n m))' and this shouldn't change + match RewriteRangeExpr comp with + | Some replacementExpr -> + let genCollElemTy = NewInferenceType () + + let genCollTy = (if isArray then mkArrayType else mkListTy) cenv.g genCollElemTy + + UnifyTypes cenv env m overallTy.Commit genCollTy + + let exprTy = mkSeqTy cenv.g genCollElemTy + + let expr, tpenv = TcExpr cenv (MustEqual exprTy) env tpenv replacementExpr + let expr = + if cenv.g.compilingFslib then + //warning(Error(FSComp.SR.fslibUsingComputedListOrArray(), expr.Range)) + expr + else + // We add a call to 'seq ... ' to make sure sequence expression compilation gets applied to the contents of the + // comprehension. But don't do this in FSharp.Core.dll since 'seq' may not yet be defined. + mkCallSeq cenv.g m genCollElemTy expr + + let expr = mkCoerceExpr(expr, exprTy, expr.Range, overallTy.Commit) + + let expr = + if isArray then + mkCallSeqToArray cenv.g m genCollElemTy expr + else + mkCallSeqToList cenv.g m genCollElemTy expr + expr, tpenv + + | None -> + // LanguageFeatures.ImplicitYield do not require this validation let implicitYieldEnabled = cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield let validateExpressionWithIfRequiresParenthesis = not implicitYieldEnabled let acceptDeprecatedIfThenExpression = not implicitYieldEnabled match comp with - | SynExpr.CompExpr (_, _, (SimpleSemicolonSequence cenv acceptDeprecatedIfThenExpression elems as body), _) -> - match body with + | SimpleSemicolonSequence cenv acceptDeprecatedIfThenExpression elems -> + match comp with | SimpleSemicolonSequence cenv false _ -> () | _ when validateExpressionWithIfRequiresParenthesis -> errorR(Deprecated(FSComp.SR.tcExpressionWithIfRequiresParenthesis(), m)) | _ -> () @@ -1986,12 +2033,12 @@ let TcArrayOrListSequenceExpression (cenv: cenv) env overallTy tpenv (isArray, c // let x : seq = [ yield 1; if true then yield 2 ] TcPropagatingExprLeafThenConvert cenv overallTy genCollTy env (* canAdhoc *) m (fun () -> - let exprty = mkSeqTy cenv.g genCollElemTy + let exprTy = mkSeqTy cenv.g genCollElemTy // Check the comprehension - let expr, tpenv = TcExpr cenv (MustEqual exprty) env tpenv comp + let expr, tpenv = TcSequenceExpression cenv env tpenv comp (MustEqual exprTy) m - let expr = mkCoerceIfNeeded cenv.g exprty (tyOfExpr cenv.g expr) expr + let expr = mkCoerceIfNeeded cenv.g exprTy (tyOfExpr cenv.g expr) expr let expr = if cenv.g.compilingFslib then @@ -2002,7 +2049,7 @@ let TcArrayOrListSequenceExpression (cenv: cenv) env overallTy tpenv (isArray, c // comprehension. But don't do this in FSharp.Core.dll since 'seq' may not yet be defined. mkCallSeq cenv.g m genCollElemTy expr - let expr = mkCoerceExpr(expr, exprty, expr.Range, overallTy.Commit) + let expr = mkCoerceExpr(expr, exprTy, expr.Range, overallTy.Commit) let expr = if isArray then diff --git a/src/fsharp/CheckComputationExpressions.fsi b/src/fsharp/CheckComputationExpressions.fsi index c5644c756d6..451b5b4bfc2 100644 --- a/src/fsharp/CheckComputationExpressions.fsi +++ b/src/fsharp/CheckComputationExpressions.fsi @@ -8,9 +8,9 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -val TcSequenceExpressionEntry: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> isArrayOrList:bool * isNotNakedRefCell:bool ref * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv +val TcSequenceExpressionEntry: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> hasBuilder:bool * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv -val TcArrayOrListSequenceExpression: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> isArray:bool * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv +val TcArrayOrListComputedExpression: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> isArray:bool * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv val TcComputationExpression: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> mWhole:range * interpExpr:Expr * builderTy:TType * comp:SynExpr -> Expr * UnscopedTyparEnv diff --git a/src/fsharp/CheckDeclarations.fs b/src/fsharp/CheckDeclarations.fs index f8942a5beb2..b5cbade689a 100644 --- a/src/fsharp/CheckDeclarations.fs +++ b/src/fsharp/CheckDeclarations.fs @@ -5806,7 +5806,7 @@ let TypeCheckOneImplFile cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring, tcSequenceExpressionEntry=TcSequenceExpressionEntry, - tcArrayOrListSequenceExpression=TcArrayOrListSequenceExpression, + tcArrayOrListSequenceExpression=TcArrayOrListComputedExpression, tcComputationExpression=TcComputationExpression) let envinner, mtypeAcc = MakeInitialEnv env @@ -5913,7 +5913,7 @@ let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, condition (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring, tcSequenceExpressionEntry=TcSequenceExpressionEntry, - tcArrayOrListSequenceExpression=TcArrayOrListSequenceExpression, + tcArrayOrListSequenceExpression=TcArrayOrListComputedExpression, tcComputationExpression=TcComputationExpression) let envinner, mtypeAcc = MakeInitialEnv tcEnv diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index eb0ebc16028..09fc6debba3 100644 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -59,7 +59,7 @@ let mkConsListPat (g: TcGlobals) ty ph pt = TPat_unioncase(g.cons_ucref, [ty], [ exception BakedInMemberConstraintName of string * range exception FunctionExpected of DisplayEnv * TType * range exception NotAFunction of DisplayEnv * TType * range * range -exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range +exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range * bool exception Recursion of DisplayEnv * Ident * TType * TType * range exception RecursiveUseCheckedAtRuntime of DisplayEnv * ValRef * range exception LetRecEvaluatedOutOfOrder of DisplayEnv * ValRef * ValRef * range @@ -406,10 +406,10 @@ type TcFileState = isInternalTestSpanStackReferring: bool // forward call - TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * bool ref * SynExpr -> range -> Expr * UnscopedTyparEnv + TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv // forward call - TcArrayOrListSequenceExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + TcArrayOrListComputedExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv // forward call TcComputationExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv @@ -441,7 +441,7 @@ type TcFileState = conditionalDefines = conditionalDefines isInternalTestSpanStackReferring = isInternalTestSpanStackReferring TcSequenceExpressionEntry = tcSequenceExpressionEntry - TcArrayOrListSequenceExpression = tcArrayOrListSequenceExpression + TcArrayOrListComputedExpression = tcArrayOrListSequenceExpression TcComputationExpression = tcComputationExpression } @@ -3735,18 +3735,24 @@ let buildApp cenv expr resultTy arg m = //------------------------------------------------------------------------- type DelayedItem = - /// DelayedTypeApp (typeArgs, mTypeArgs, mExprAndTypeArgs) - /// /// Represents the in "item" - | DelayedTypeApp of SynType list * range * range - - /// DelayedApp (isAtomic, argExpr, mFuncAndArg) - /// - /// Represents the args in "item args", or "item.[args]". - | DelayedApp of ExprAtomicFlag * SynExpr * range + | DelayedTypeApp of + typeArgs: SynType list * + mTypeArgs: range * + mExprAndTypeArgs: range + + /// Represents the args in "item args", or "item.Property(args)". + | DelayedApp of + isAtomic: ExprAtomicFlag * + isSugar: bool * + synLeftExprOpt: SynExpr option * + argExpr: SynExpr * + mFuncAndArg: range /// Represents the long identifiers in "item.Ident1", or "item.Ident1.Ident2" etc. - | DelayedDotLookup of Ident list * range + | DelayedDotLookup of + idents: Ident list * + range /// Represents an incomplete "item." | DelayedDot @@ -3817,6 +3823,9 @@ type ValSpecResult = partialValReprInfo: PartialValReprInfo * declKind: DeclKind +type DecodedIndexArg = + | IndexArgRange of (SynExpr * bool) option * (SynExpr * bool) option * range * range + | IndexArgItem of SynExpr * bool * range //------------------------------------------------------------------------- // Additional data structures used by checking recursive bindings //------------------------------------------------------------------------- @@ -5058,7 +5067,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let activePatResTys = NewInferenceTypes apinfo.Names let activePatType = apinfo.OverallType cenv.g m ty activePatResTys isStructRetTy - let delayed = activePatArgsAsSynExprs |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, arg, unionRanges (rangeOfLid longId) arg.Range)) + let delayed = activePatArgsAsSynExprs |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, arg, unionRanges (rangeOfLid longId) arg.Range)) let activePatExpr, tpenv = PropagateThenTcDelayed cenv (MustEqual activePatType) env tpenv m vexp vexpty ExprAtomicFlag.NonAtomic delayed if idx >= activePatResTys.Length then error(Error(FSComp.SR.tcInvalidIndexIntoActivePatternArray(), m)) @@ -5316,7 +5325,7 @@ and RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv e let rec dummyCheckedDelayed delayed = match delayed with - | DelayedApp (_hpa, arg, _mExprAndArg) :: otherDelayed -> + | DelayedApp (_hpa, _, _, arg, _mExprAndArg) :: otherDelayed -> RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects cenv env tpenv arg dummyCheckedDelayed otherDelayed | _ -> () @@ -5366,7 +5375,7 @@ and TcExprNoRecover cenv (ty: OverallTy) (env: TcEnv) tpenv (expr: SynExpr) = if GetCtorShapeCounter env > 0 then AdjustCtorShapeCounter (fun x -> x - 1) env else env - TcExprThen cenv ty env tpenv expr [] + TcExprThen cenv ty env tpenv false expr [] // This recursive entry is only used from one callsite (DiscardAfterMissingQualificationAfterDot) // and has been added relatively late in F# 4.0 to preserve the structure of previous code. It pushes a 'delayed' parameter @@ -5375,7 +5384,7 @@ and TcExprOfUnknownTypeThen cenv env tpenv expr delayed = let exprty = NewInferenceType () let expr', tpenv = try - TcExprThen cenv (MustEqual exprty) env tpenv expr delayed + TcExprThen cenv (MustEqual exprty) env tpenv false expr delayed with e -> let m = expr.Range errorRecovery e m @@ -5424,41 +5433,73 @@ and TryTcStmt cenv env tpenv synExpr = /// During checking of expressions of the form (x(y)).z(w1, w2) /// keep a stack of things on the right. This lets us recognize /// method applications and other item-based syntax. -and TcExprThen cenv (overallTy: OverallTy) env tpenv synExpr delayed = +and TcExprThen cenv (overallTy: OverallTy) env tpenv isArg synExpr delayed = match synExpr with | LongOrSingleIdent (isOpt, longId, altNameRefCellOpt, mLongId) -> if isOpt then errorR(Error(FSComp.SR.tcSyntaxErrorUnexpectedQMark(), mLongId)) // Check to see if pattern translation decided to use an alternative identifier. match altNameRefCellOpt with - | Some {contents = SynSimplePatAlternativeIdInfo.Decided altId} -> TcExprThen cenv overallTy env tpenv (SynExpr.LongIdent (isOpt, LongIdentWithDots([altId], []), None, mLongId)) delayed + | Some {contents = SynSimplePatAlternativeIdInfo.Decided altId} -> + TcExprThen cenv overallTy env tpenv isArg (SynExpr.LongIdent (isOpt, LongIdentWithDots([altId], []), None, mLongId)) delayed | _ -> TcLongIdentThen cenv overallTy env tpenv longId delayed // f x - | SynExpr.App (hpa, _, func, arg, mFuncAndArg) -> - TcExprThen cenv overallTy env tpenv func ((DelayedApp (hpa, arg, mFuncAndArg)) :: delayed) + // f(x) // hpa=true + // f[x] // hpa=true + | SynExpr.App (hpa, isInfix, func, arg, mFuncAndArg) -> + + // func (arg)[arg2] gives warning that .[ must be used. + match delayed with + | DelayedApp (hpa2, isSugar2, _, arg2, _) :: _ when not isInfix && (hpa = ExprAtomicFlag.NonAtomic) && isAdjacentListExpr isSugar2 hpa2 (Some synExpr) arg2 -> + let mWarning = unionRanges arg.Range arg2.Range + match arg with + | SynExpr.Paren _ -> + if cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + warning(Error(FSComp.SR.tcParenThenAdjacentListArgumentNeedsAdjustment(), mWarning)) + elif not (cenv.g.langVersion.IsExplicitlySpecifiedAs50OrBefore()) then + informationalWarning(Error(FSComp.SR.tcParenThenAdjacentListArgumentReserved(), mWarning)) + | SynExpr.ArrayOrListComputed _ + | SynExpr.ArrayOrList _ -> + if cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + warning(Error(FSComp.SR.tcListThenAdjacentListArgumentNeedsAdjustment(), mWarning)) + elif not (cenv.g.langVersion.IsExplicitlySpecifiedAs50OrBefore()) then + informationalWarning(Error(FSComp.SR.tcListThenAdjacentListArgumentReserved(), mWarning)) + | _ -> + if cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + warning(Error(FSComp.SR.tcOtherThenAdjacentListArgumentNeedsAdjustment(), mWarning)) + elif not (cenv.g.langVersion.IsExplicitlySpecifiedAs50OrBefore()) then + informationalWarning(Error(FSComp.SR.tcOtherThenAdjacentListArgumentReserved(), mWarning)) + + | _ -> () + + TcExprThen cenv overallTy env tpenv false func ((DelayedApp (hpa, isInfix, Some func, arg, mFuncAndArg)) :: delayed) // e | SynExpr.TypeApp (func, _, typeArgs, _, _, mTypeArgs, mFuncAndTypeArgs) -> - TcExprThen cenv overallTy env tpenv func ((DelayedTypeApp (typeArgs, mTypeArgs, mFuncAndTypeArgs)) :: delayed) + TcExprThen cenv overallTy env tpenv false func ((DelayedTypeApp (typeArgs, mTypeArgs, mFuncAndTypeArgs)) :: delayed) // e1.id1 // e1.id1.id2 // etc. | SynExpr.DotGet (e1, _, LongIdentWithDots(longId, _), _) -> - TcExprThen cenv overallTy env tpenv e1 ((DelayedDotLookup (longId, synExpr.RangeWithoutAnyExtraDot)) :: delayed) + TcExprThen cenv overallTy env tpenv false e1 ((DelayedDotLookup (longId, synExpr.RangeWithoutAnyExtraDot)) :: delayed) // e1.[e2] // e1.[e21, ..., e2n] // etc. - | SynExpr.DotIndexedGet (e1, e2, mDot, mWholeExpr) -> - TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv synExpr e1 e2 delayed + | SynExpr.DotIndexedGet (e1, IndexerArgs indexArgs, mDot, mWholeExpr) -> + if not isArg && cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + informationalWarning(Error(FSComp.SR.tcIndexNotationDeprecated(), mDot)) + TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv None e1 indexArgs delayed // e1.[e2] <- e3 // e1.[e21, ..., e2n] <- e3 // etc. - | SynExpr.DotIndexedSet (e1, e2, _, _, mDot, mWholeExpr) -> - TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv synExpr e1 e2 delayed + | SynExpr.DotIndexedSet (e1, IndexerArgs indexArgs, e3, mOfLeftOfSet, mDot, mWholeExpr) -> + if cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + warning(Error(FSComp.SR.tcIndexNotationDeprecated(), mDot)) + TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv (Some (e3, mOfLeftOfSet)) e1 indexArgs delayed | _ -> match delayed with @@ -5576,6 +5617,11 @@ and TcAdjustExprForTypeDirectedConversions cenv (overallTy: OverallTy) actualTy and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = match synExpr with + // ( * ) + | SynExpr.Paren(SynExpr.IndexRange (None, opm, None, _m1, _m2, _), _, _, _) -> + let replacementExpr = SynExpr.Ident(ident(CompileOpName "*", opm)) + TcExpr cenv overallTy env tpenv replacementExpr + | 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. @@ -5818,15 +5864,20 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = | SynExpr.ForEach (spForLoop, SeqExprOnly seqExprOnly, isFromSource, pat, enumSynExpr, bodySynExpr, m) -> assert isFromSource if seqExprOnly then warning (Error(FSComp.SR.tcExpressionRequiresSequence(), m)) + let enumSynExpr = + match RewriteRangeExpr enumSynExpr with + | Some e -> e + | None -> enumSynExpr TcForEachExpr cenv overallTy env tpenv (pat, enumSynExpr, bodySynExpr, m, spForLoop) - | SynExpr.CompExpr (isArrayOrList, isNotNakedRefCell, comp, m) -> + | SynExpr.ComputationExpr (hasSeqBuilder, comp, m) -> let env = ExitFamilyRegion env - cenv.TcSequenceExpressionEntry cenv env overallTy tpenv (isArrayOrList, isNotNakedRefCell, comp) m + cenv.TcSequenceExpressionEntry cenv env overallTy tpenv (hasSeqBuilder, comp) m - | SynExpr.ArrayOrListOfSeqExpr (isArray, comp, m) -> + | SynExpr.ArrayOrListComputed (isArray, comp, m) -> + let env = ExitFamilyRegion env CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy.Commit, env.eAccessRights) - cenv.TcArrayOrListSequenceExpression cenv env overallTy tpenv (isArray, comp) m + cenv.TcArrayOrListComputedExpression cenv env overallTy tpenv (isArray, comp) m | SynExpr.LetOrUse _ -> TcLinearExprs (TcExprThatCanBeCtorBody cenv) cenv env overallTy tpenv false synExpr (fun x -> x) @@ -5914,24 +5965,27 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = if lidwd.ThereIsAnExtraDotAtTheEnd then // just drop rhs on the floor let mExprAndDotLookup = unionRanges e1.Range (rangeOfLid longId) - TcExprThen cenv overallTy env tpenv e1 [DelayedDotLookup(longId, mExprAndDotLookup)] + TcExprThen cenv overallTy env tpenv false e1 [DelayedDotLookup(longId, mExprAndDotLookup)] else let mExprAndDotLookup = unionRanges e1.Range (rangeOfLid longId) - TcExprThen cenv overallTy env tpenv e1 [DelayedDotLookup(longId, mExprAndDotLookup); MakeDelayedSet(e2, mStmt)] + TcExprThen cenv overallTy env tpenv false e1 [DelayedDotLookup(longId, mExprAndDotLookup); MakeDelayedSet(e2, mStmt)] /// e1 <- e2 | SynExpr.Set (e1, e2, mStmt) -> - TcExprThen cenv overallTy env tpenv e1 [MakeDelayedSet(e2, mStmt)] + TcExprThen cenv overallTy env tpenv false e1 [MakeDelayedSet(e2, mStmt)] /// e1.longId(e2) <- e3, very rarely used named property setters | SynExpr.DotNamedIndexedPropertySet (e1, (LongIdentWithDots(longId, _) as lidwd), e2, e3, mStmt) -> if lidwd.ThereIsAnExtraDotAtTheEnd then // just drop rhs on the floor let mExprAndDotLookup = unionRanges e1.Range (rangeOfLid longId) - TcExprThen cenv overallTy env tpenv e1 [DelayedDotLookup(longId, mExprAndDotLookup)] + TcExprThen cenv overallTy env tpenv false e1 [DelayedDotLookup(longId, mExprAndDotLookup)] else let mExprAndDotLookup = unionRanges e1.Range (rangeOfLid longId) - TcExprThen cenv overallTy env tpenv e1 [DelayedDotLookup(longId, mExprAndDotLookup); DelayedApp(ExprAtomicFlag.Atomic, e2, mStmt); MakeDelayedSet(e3, mStmt)] + TcExprThen cenv overallTy env tpenv false e1 + [ DelayedDotLookup(longId, mExprAndDotLookup); + DelayedApp(ExprAtomicFlag.Atomic, false, None, e2, mStmt) + MakeDelayedSet(e3, mStmt)] | SynExpr.LongIdentSet (lidwd, e2, m) -> if lidwd.ThereIsAnExtraDotAtTheEnd then @@ -5946,7 +6000,9 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = // just drop rhs on the floor TcLongIdentThen cenv overallTy env tpenv lidwd [ ] else - TcLongIdentThen cenv overallTy env tpenv lidwd [ DelayedApp(ExprAtomicFlag.Atomic, e1, mStmt); MakeDelayedSet(e2, mStmt) ] + TcLongIdentThen cenv overallTy env tpenv lidwd + [ DelayedApp(ExprAtomicFlag.Atomic, false, None, e1, mStmt) + MakeDelayedSet(e2, mStmt) ] | SynExpr.TraitCall (tps, memSpfn, arg, m) -> TcNonPropagatingExprLeafThenConvert cenv overallTy env m (fun () -> @@ -6028,6 +6084,31 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = | SynExpr.MatchBang (_, _, _, m) -> error(Error(FSComp.SR.tcConstructRequiresComputationExpression(), m)) + | SynExpr.IndexFromEnd (range=m) + | SynExpr.IndexRange (range=m) -> + error(Error(FSComp.SR.tcInvalidIndexerExpression(), m)) + +// Converts 'a..b' to a call to the '(..)' operator in FSharp.Core +// Converts 'a..b..c' to a call to the '(.. ..)' operator in FSharp.Core +// +// NOTE: we could eliminate these more efficiently in LowerCallsAndSeqs.fs, since +// [| 1..4 |] +// becomes [| for i in (..) 1 4 do yield i |] +// instead of generating the array directly from the ranges +and RewriteRangeExpr expr = + match expr with + // a..b..c (parsed as (a..b)..c ) + | SynExpr.IndexRange(Some (SynExpr.IndexRange(Some expr1, _, Some synStepExpr, _, _, _)), _, Some expr2, _m1, _m2, wholem) -> + Some (mkSynTrifix wholem ".. .." expr1 synStepExpr expr2) + // a..b + | SynExpr.IndexRange (Some expr1, opm, Some expr2, _m1, _m2, wholem) -> + let otherExpr = + match mkSynInfix opm expr1 ".." expr2 with + | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, wholem) + | _ -> failwith "impossible" + Some otherExpr + | _ -> None + /// Check lambdas as a group, to catch duplicate names in patterns and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = match e with @@ -6063,18 +6144,95 @@ and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = conditionallySuppressErrorReporting (not isFirst && synExprContainsError e) (fun () -> TcExpr cenv overallTy env tpenv e) +and (|IndexArgOptionalFromEnd|) indexArg = + match indexArg with + | SynExpr.IndexFromEnd (a, m) -> (a, true, m) + | expr -> (expr, false, expr.Range) + +and DecodeIndexArg indexArg = + match indexArg with + | SynExpr.IndexRange (info1, _opm, info2, m1, m2, _) -> + let info1 = + match info1 with + | Some (IndexArgOptionalFromEnd (expr1, isFromEnd1, _)) -> Some (expr1, isFromEnd1) + | None -> None + let info2 = + match info2 with + | Some (IndexArgOptionalFromEnd (expr2, isFromEnd2, _)) -> Some (expr2, isFromEnd2) + | None -> None + IndexArgRange (info1, info2, m1, m2) + | IndexArgOptionalFromEnd (expr, isFromEnd, m) -> + IndexArgItem(expr, isFromEnd, m) + +and (|IndexerArgs|) e = + match e with + | SynExpr.IndexRange _ -> [e] + | SynExpr.IndexFromEnd _ -> [e] + | SynExpr.Tuple (false, args, _, _) -> args + | e -> [e] + +and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv (setInfo: _ option) synLeftExpr indexArgs delayed = + let leftExpr, e1ty, tpenv = TcExprOfUnknownType cenv env tpenv synLeftExpr + let expandedIndexArgs = ExpandIndexArgs (Some synLeftExpr) indexArgs + TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo (Some synLeftExpr) leftExpr e1ty expandedIndexArgs indexArgs delayed + +// Eliminate GetReverseIndex from index args +and ExpandIndexArgs (synLeftExprOpt: SynExpr option) indexArgs = + + // xs.GetReverseIndex rank offset - 1 + let rewriteReverseExpr (rank: int) (offset: SynExpr) (range: range) = + let rankExpr = SynExpr.Const(SynConst.Int32(rank), range) + let sliceArgs = SynExpr.Paren(SynExpr.Tuple(false, [rankExpr; offset], [], range), range, Some range, range) + match synLeftExprOpt with + | None -> error(Error(FSComp.SR.tcInvalidUseOfReverseIndex(), range)) + | Some xsId -> + mkSynApp1 + (mkSynDot range range xsId (mkSynId (range.MakeSynthetic()) "GetReverseIndex")) + sliceArgs + range + + let mkSynSomeExpr (m: range) x = + let m = m.MakeSynthetic() + SynExpr.App (ExprAtomicFlag.NonAtomic, false, mkSynLidGet m FSharpLib.CorePath "Some", x, m) + + let mkSynNoneExpr (m: range) = + let m = m.MakeSynthetic() + mkSynLidGet m FSharpLib.CorePath "None" + + let expandedIndexArgs = + indexArgs + |> List.mapi ( fun pos indexerArg -> + match DecodeIndexArg indexerArg with + | IndexArgItem(expr, fromEnd, range) -> + [ if fromEnd then rewriteReverseExpr pos expr range else expr ] + | IndexArgRange(info1, info2, range1, range2) -> + [ + match info1 with + | Some (a1, isFromEnd1) -> + yield mkSynSomeExpr range1 (if isFromEnd1 then rewriteReverseExpr pos a1 range1 else a1) + | None -> + yield mkSynNoneExpr range1 + match info2 with + | Some (a2, isFromEnd2) -> + yield mkSynSomeExpr range2 (if isFromEnd2 then rewriteReverseExpr pos a2 range2 else a2) + | None -> + yield mkSynNoneExpr range1 + ] + ) + |> List.collect id + + expandedIndexArgs + // Check expr.[idx] // This is a little over complicated for my liking. Basically we want to interpret e1.[idx] as e1.Item(idx). // However it's not so simple as all that. First "Item" can have a different name according to an attribute in -// .NET metadata. This means we manually typecheck 'e1' and look to see if it has a nominal type. We then +// .NET metadata. This means we manually typecheck 'expr 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 = +and TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo synLeftExprOpt expr e1ty expandedIndexArgs indexArgs delayed = 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 // has a member called 'Item' - let isIndex = indexArgs |> List.forall( fun x -> match x with SynIndexerArg.One _ -> true | _ -> false) + let isIndex = indexArgs |> List.forall (fun indexArg -> match DecodeIndexArg indexArg with IndexArgItem _ -> true | _ -> false) let propName = if isIndex then FoldPrimaryHierarchyOfType (fun ty acc -> @@ -6104,47 +6262,10 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg let idxRange = indexArgs |> List.map (fun e -> e.Range) |> List.reduce unionRanges - // xs.GetReverseIndex rank offset - 1 - let rewriteReverseExpr (rank: int) (offset: SynExpr) (range: range) = - let rankExpr = SynExpr.Const(SynConst.Int32(rank), range) - let sliceArgs = SynExpr.Paren(SynExpr.Tuple(false, [rankExpr; offset], [], range), range, Some range, range) - let xsId = e1 - - mkSynApp1 - (mkSynDot range range xsId (mkSynId range "GetReverseIndex")) - sliceArgs - range - - let rewriteReverseOption (app: SynExpr) (rank: int) (range: range) = - match app with - | SynExpr.App(atomicFlag, isInfix, funcExpr, e1, outerRange) -> SynExpr.App(atomicFlag, isInfix, funcExpr, rewriteReverseExpr rank e1 range, outerRange) - | _ -> app - - let expandedIndexArgs = - indexArgs - |> List.mapi ( fun pos indexerArg -> - match indexerArg with - | SynIndexerArg.One(expr, fromEnd, range) -> - [ if fromEnd then rewriteReverseExpr pos expr range else expr ] - | SynIndexerArg.Two - ( - a1, - fromEnd1, - a2, - fromEnd2, - range1, - range2) -> - [ - if fromEnd1 then rewriteReverseOption a1 pos range1 else a1 ; - if fromEnd2 then rewriteReverseOption a2 pos range2 else a2 - ] - ) - |> List.collect id - let MakeIndexParam setSliceArrayOption = - match indexArgs with + match List.map DecodeIndexArg indexArgs with | [] -> failwith "unexpected empty index list" - | [SynIndexerArg.One _] -> SynExpr.Paren (expandedIndexArgs.Head, range0, None, idxRange) + | [IndexArgItem _] -> SynExpr.Paren (expandedIndexArgs.Head, range0, None, idxRange) | _ -> SynExpr.Paren (SynExpr.Tuple (false, expandedIndexArgs @ Option.toList setSliceArrayOption, [], idxRange), range0, None, idxRange) let attemptArrayString = @@ -6154,114 +6275,121 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg let info = if isArray then let fixedIndex3d4dEnabled = cenv.g.langVersion.SupportsFeature LanguageFeature.FixedIndexSlice3d4d - match wholeExpr with - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _; SynIndexerArg.One _], _, _) -> Some (indexOpPath, "GetArray2D", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _;], _, _) -> Some (indexOpPath, "GetArray3D", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _], _, _) -> Some (indexOpPath, "GetArray4D", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _], _, _) -> Some (indexOpPath, "GetArray", expandedIndexArgs) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _; SynIndexerArg.One _], e3, _, _, _) -> Some (indexOpPath, "SetArray2D", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _;], e3, _, _, _) -> Some (indexOpPath, "SetArray3D", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _; SynIndexerArg.One _], e3, _, _, _) -> Some (indexOpPath, "SetArray4D", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _], e3, _, _, _) -> Some (indexOpPath, "SetArray", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice2DFixed1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice2DFixed2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice2D", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice3D", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4D", expandedIndexArgs) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice2D", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice2DFixed1", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice2DFixed2", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3D", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4D", (expandedIndexArgs @ [e3])) - | _ when fixedIndex3d4dEnabled -> - match wholeExpr with - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedSingle1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedSingle2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedSingle3", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedDouble1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedDouble2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice3DFixedDouble3", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedSingle1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedSingle2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedSingle3", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedSingle4", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble3", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble4", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble5", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedDouble6", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedTriple1", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedTriple2", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedTriple3", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetArraySlice4DFixedTriple4", expandedIndexArgs) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle1", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle2", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle3", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble1", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble2", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble3", (expandedIndexArgs @ [e3])) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle1", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle2", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle3", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle4", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble1", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble2", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble3", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble4", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble5", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble6", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple1", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple2", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _;SynIndexerArg.One _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple3", expandedIndexArgs @ [e3]) - | SynExpr.DotIndexedSet (_, [SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.One _;SynIndexerArg.Two _], e3, _, _, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple4", expandedIndexArgs @ [e3]) - | _ -> None + let indexArgs = List.map DecodeIndexArg indexArgs + match indexArgs, setInfo with + | [IndexArgItem _; IndexArgItem _], None -> Some (indexOpPath, "GetArray2D", expandedIndexArgs) + | [IndexArgItem _; IndexArgItem _; IndexArgItem _;], None -> Some (indexOpPath, "GetArray3D", expandedIndexArgs) + | [IndexArgItem _; IndexArgItem _; IndexArgItem _; IndexArgItem _], None -> Some (indexOpPath, "GetArray4D", expandedIndexArgs) + | [IndexArgItem _], None -> Some (indexOpPath, "GetArray", expandedIndexArgs) + | [IndexArgItem _; IndexArgItem _], Some (e3, _) -> Some (indexOpPath, "SetArray2D", (expandedIndexArgs @ [e3])) + | [IndexArgItem _; IndexArgItem _; IndexArgItem _;], Some (e3, _) -> Some (indexOpPath, "SetArray3D", (expandedIndexArgs @ [e3])) + | [IndexArgItem _; IndexArgItem _; IndexArgItem _; IndexArgItem _], Some (e3, _) -> Some (indexOpPath, "SetArray4D", (expandedIndexArgs @ [e3])) + | [IndexArgItem _], Some (e3, _) -> Some (indexOpPath, "SetArray", (expandedIndexArgs @ [e3])) + | [IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice2DFixed1", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice2DFixed2", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice2D", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice3D", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4D", expandedIndexArgs) + | [IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice2D", (expandedIndexArgs @ [e3])) + | [IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice2DFixed1", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice2DFixed2", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3D", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4D", (expandedIndexArgs @ [e3])) + | _ when fixedIndex3d4dEnabled -> + match indexArgs, setInfo with + | [IndexArgItem _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice3DFixedSingle1", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice3DFixedSingle2", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice3DFixedSingle3", expandedIndexArgs) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice3DFixedDouble1", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice3DFixedDouble2", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice3DFixedDouble3", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedSingle1", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedSingle2", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedSingle3", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedSingle4", expandedIndexArgs) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble1", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble2", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble3", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble4", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble5", expandedIndexArgs) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedDouble6", expandedIndexArgs) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedTriple1", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedTriple2", expandedIndexArgs) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _;IndexArgItem _], None -> Some (sliceOpPath, "GetArraySlice4DFixedTriple3", expandedIndexArgs) + | [IndexArgItem _;IndexArgItem _;IndexArgItem _;IndexArgRange _], None -> Some (sliceOpPath, "GetArraySlice4DFixedTriple4", expandedIndexArgs) + | [IndexArgItem _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle1", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle2", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedSingle3", (expandedIndexArgs @ [e3])) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble1", (expandedIndexArgs @ [e3])) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble2", (expandedIndexArgs @ [e3])) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice3DFixedDouble3", (expandedIndexArgs @ [e3])) + | [IndexArgItem _;IndexArgRange _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle1", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle2", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle3", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgRange _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedSingle4", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble1", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble2", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgRange _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble3", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble4", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgItem _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble5", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgRange _;IndexArgItem _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedDouble6", expandedIndexArgs @ [e3]) + | [IndexArgRange _;IndexArgItem _;IndexArgItem _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple1", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgRange _;IndexArgItem _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple2", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgItem _;IndexArgRange _;IndexArgItem _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple3", expandedIndexArgs @ [e3]) + | [IndexArgItem _;IndexArgItem _;IndexArgItem _;IndexArgRange _], Some (e3, _) -> Some (sliceOpPath, "SetArraySlice4DFixedTriple4", expandedIndexArgs @ [e3]) | _ -> None + | _ -> None elif isString then - match wholeExpr with - | SynExpr.DotIndexedGet (_, [SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetStringSlice", expandedIndexArgs) - | SynExpr.DotIndexedGet (_, [SynIndexerArg.One _], _, _) -> Some (indexOpPath, "GetString", expandedIndexArgs) + match List.map DecodeIndexArg indexArgs, setInfo with + | [IndexArgRange _], None -> Some (sliceOpPath, "GetStringSlice", expandedIndexArgs) + | [IndexArgItem _], None -> Some (indexOpPath, "GetString", expandedIndexArgs) | _ -> None else None match info with - | None -> None - | Some (path, functionName, indexArgs) -> - let operPath = mkSynLidGet mDot path (CompileOpName functionName) - let f, fty, tpenv = TcExprOfUnknownType cenv env tpenv operPath - let domainTy, resultTy = UnifyFunctionType (Some mWholeExpr) cenv env.DisplayEnv mWholeExpr fty - UnifyTypes cenv env mWholeExpr domainTy e1ty - let f', resultTy = buildApp cenv (MakeApplicableExprNoFlex cenv f) resultTy e1' mWholeExpr - let delayed = List.foldBack (fun idx acc -> DelayedApp(ExprAtomicFlag.Atomic, idx, mWholeExpr) :: acc) indexArgs delayed // atomic, otherwise no ar.[1] <- xyz - Some (PropagateThenTcDelayed cenv overallTy env tpenv mWholeExpr f' resultTy ExprAtomicFlag.Atomic delayed ) + | None -> None + | Some (path, functionName, indexArgs) -> + let operPath = mkSynLidGet (mDot.MakeSynthetic()) path (CompileOpName functionName) + let f, fty, tpenv = TcExprOfUnknownType cenv env tpenv operPath + let domainTy, resultTy = UnifyFunctionType (Some mWholeExpr) cenv env.DisplayEnv mWholeExpr fty + UnifyTypes cenv env mWholeExpr domainTy e1ty + let f', resultTy = buildApp cenv (MakeApplicableExprNoFlex cenv f) resultTy expr mWholeExpr + let delayed = List.foldBack (fun idx acc -> DelayedApp(ExprAtomicFlag.Atomic, true, None, idx, mWholeExpr) :: acc) indexArgs delayed // atomic, otherwise no ar.[1] <- xyz + Some (PropagateThenTcDelayed cenv overallTy env tpenv mWholeExpr f' resultTy ExprAtomicFlag.Atomic delayed ) match attemptArrayString with | Some res -> res - | None -> - if isNominal || Option.isSome propName then + | None when isNominal || Option.isSome propName -> let nm = match propName with | None -> "Item" | Some nm -> nm let delayed = - match wholeExpr with + match setInfo with // e1.[e2] - | SynExpr.DotIndexedGet _ -> - DelayedDotLookup([ident(nm, mWholeExpr)], mWholeExpr) :: DelayedApp(ExprAtomicFlag.Atomic, MakeIndexParam None, mWholeExpr) :: delayed - // e1.[e2] <- e3 - | SynExpr.DotIndexedSet (_, _, e3, mOfLeftOfSet, _, _) -> - match isIndex with - | true -> DelayedDotLookup([ident(nm, mOfLeftOfSet)], mOfLeftOfSet) :: DelayedApp(ExprAtomicFlag.Atomic, MakeIndexParam None, mOfLeftOfSet) :: MakeDelayedSet(e3, mWholeExpr) :: delayed - | false -> DelayedDotLookup([ident("SetSlice", mOfLeftOfSet)], mOfLeftOfSet) :: DelayedApp(ExprAtomicFlag.Atomic, MakeIndexParam (Some e3), mWholeExpr) :: delayed + | None -> + [ DelayedDotLookup([ ident(nm, mWholeExpr)], mWholeExpr) + DelayedApp(ExprAtomicFlag.Atomic, true, synLeftExprOpt, MakeIndexParam None, mWholeExpr) + yield! delayed ] + // e1.[e2] <- e3 --> e1.Item(e2) <- e3 + | Some (e3, mOfLeftOfSet) -> + if isIndex then + [ DelayedDotLookup([ident(nm, mOfLeftOfSet)], mOfLeftOfSet) + DelayedApp(ExprAtomicFlag.Atomic, true, synLeftExprOpt, MakeIndexParam None, mOfLeftOfSet) + MakeDelayedSet(e3, mWholeExpr) + yield! delayed ] + else + [ DelayedDotLookup([ident("SetSlice", mOfLeftOfSet)], mOfLeftOfSet) + DelayedApp(ExprAtomicFlag.Atomic, true, synLeftExprOpt, MakeIndexParam (Some e3), mWholeExpr) + yield! delayed ] - | _ -> error(InternalError("unreachable", mWholeExpr)) - PropagateThenTcDelayed cenv overallTy env tpenv mDot (MakeApplicableExprNoFlex cenv e1') e1ty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mDot (MakeApplicableExprNoFlex cenv expr) e1ty ExprAtomicFlag.Atomic delayed - else + | _ -> // deprecated constrained lookup error(Error(FSComp.SR.tcObjectOfIndeterminateTypeUsedRequireTypeConstraint(), mWholeExpr)) @@ -7497,7 +7625,7 @@ and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableEx // Note this case should not occur: would eventually give an "Unexpected type application" error in TcDelayed propagate isAddrOf delayedList' mExprAndTypeArgs exprty - | DelayedApp (_, arg, mExprAndArg) :: delayedList' -> + | DelayedApp (atomicFlag, isSugar, synLeftExprOpt, synArg, mExprAndArg) :: delayedList' -> let denv = env.DisplayEnv match UnifyFunctionTypeUndoIfFailed cenv denv mExpr exprty with | ValueSome (_, resultTy) -> @@ -7514,20 +7642,54 @@ and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableEx propagate isAddrOf delayedList' mExprAndArg resultTy | _ -> - let mArg = arg.Range - match arg with - | SynExpr.CompExpr _ -> () - | SynExpr.ArrayOrListOfSeqExpr (false, _, _) -> - // 'delayed' is about to be dropped on the floor, first do rudimentary checking to get name resolutions in its body - RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed - if IsIndexerType cenv.g cenv.amap expr.Type then - match expr.Expr with - | Expr.Val (d, _, _) -> - error (NotAFunctionButIndexer(denv, overallTy.Commit, Some d.DisplayName, mExpr, mArg)) - | _ -> - error (NotAFunctionButIndexer(denv, overallTy.Commit, None, mExpr, mArg)) + let mArg = synArg.Range + match synArg with + // async { ... } + // seq { ... } + | SynExpr.ComputationExpr _ -> () + + // expr[idx] + // expr[idx1, idx2] + // expr[idx1..] + // expr[..idx1] + // expr[idx1..idx2] + | SynExpr.ArrayOrListComputed(false, _, _) -> + let isAdjacent = isAdjacentListExpr isSugar atomicFlag synLeftExprOpt synArg + if isAdjacent && cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + // This is the non-error path + () else - error (NotAFunction(denv, overallTy.Commit, mExpr, mArg)) + // This is the error path. The error we give depends on what's enabled. + // + // First, 'delayed' is about to be dropped on the floor, do rudimentary checking to get name resolutions in its body + RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed + let vName = + match expr.Expr with + | Expr.Val (d, _, _) -> Some d.DisplayName + | _ -> None + if isAdjacent then + if IsIndexerType cenv.g cenv.amap expr.Type then + if cenv.g.langVersion.IsExplicitlySpecifiedAs50OrBefore() then + error (NotAFunctionButIndexer(denv, overallTy.Commit, vName, mExpr, mArg, false)) + match vName with + | Some nm -> + error(Error(FSComp.SR.tcNotAFunctionButIndexerNamedIndexingNotYetEnabled(nm, nm), mExprAndArg)) + | _ -> + error(Error(FSComp.SR.tcNotAFunctionButIndexerIndexingNotYetEnabled(), mExprAndArg)) + else + match vName with + | Some nm -> + error(Error(FSComp.SR.tcNotAnIndexerNamedIndexingNotYetEnabled(nm), mExprAndArg)) + | _ -> + error(Error(FSComp.SR.tcNotAnIndexerIndexingNotYetEnabled(), mExprAndArg)) + else + if IsIndexerType cenv.g cenv.amap expr.Type then + let old = not (cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot) + error (NotAFunctionButIndexer(denv, overallTy.Commit, vName, mExpr, mArg, old)) + else + error (NotAFunction(denv, overallTy.Commit, mExpr, mArg)) + + // f x (where 'f' is not a function) | _ -> // 'delayed' is about to be dropped on the floor, first do rudimentary checking to get name resolutions in its body RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed @@ -7539,7 +7701,6 @@ and PropagateThenTcDelayed cenv (overallTy: OverallTy) env tpenv mExpr expr expr Propagate cenv overallTy env tpenv expr exprty delayed TcDelayed cenv overallTy env tpenv mExpr expr exprty atomicFlag delayed - /// Typecheck "expr ... " constructs where "..." is a sequence of applications, /// type applications and dot-notation projections. and TcDelayed cenv (overallTy: OverallTy) env tpenv mExpr expr exprty (atomicFlag: ExprAtomicFlag) delayed = @@ -7562,12 +7723,15 @@ and TcDelayed cenv (overallTy: OverallTy) env tpenv mExpr expr exprty (atomicFla // expr.M where x.M is a .NET method or index property | DelayedDotLookup (longId, mDotLookup) :: otherDelayed -> TcLookupThen cenv overallTy env tpenv mExpr expr.Expr exprty longId otherDelayed mDotLookup + // f x - | DelayedApp (hpa, arg, mExprAndArg) :: otherDelayed -> - TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty arg hpa otherDelayed + | DelayedApp (atomicFlag, isSugar, synLeftExpr, synArg, mExprAndArg) :: otherDelayed -> + TcApplicationThen cenv overallTy env tpenv mExprAndArg synLeftExpr expr exprty synArg atomicFlag isSugar otherDelayed + // f | DelayedTypeApp (_, mTypeArgs, _mExprAndTypeArgs) :: _ -> error(Error(FSComp.SR.tcUnexpectedTypeArguments(), mTypeArgs)) + | DelayedSet (synExpr2, mStmt) :: otherDelayed -> if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mExpr)) UnifyTypes cenv env mExpr overallTy.Commit cenv.g.unit_ty @@ -7579,7 +7743,6 @@ and TcDelayed cenv (overallTy: OverallTy) env tpenv mExpr expr exprty (atomicFla let v, _ve = mkCompGenLocal mExpr "addr" (mkByrefTy cenv.g vty) mkCompGenLet mStmt v exprAddress (mkAddrSet mStmt (mkLocalValRef v) expr2), tpenv - /// Convert the delayed identifiers to a dot-lookup. /// /// TcItemThen: For StaticItem [.Lookup], mPrior is the range of StaticItem @@ -7707,47 +7870,99 @@ and TcNameOfExprResult cenv (lastIdent: Ident) m = Expr.Const(Const.String(lastIdent.idText), constRange, cenv.g.string_ty) //------------------------------------------------------------------------- -// TcFunctionApplicationThen: Typecheck "expr x" + projections +// TcApplicationThen: Typecheck "expr x" + projections //------------------------------------------------------------------------- -and TcFunctionApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg expr exprty (synArg: SynExpr) atomicFlag delayed = +// leftExpr[idx] gives a warning +and isAdjacentListExpr isSugar atomicFlag (synLeftExprOpt: SynExpr option) (synArg: SynExpr) = + not isSugar && + if atomicFlag = ExprAtomicFlag.Atomic then + match synArg with + | SynExpr.ArrayOrList (false, _, _) + | SynExpr.ArrayOrListComputed (false, _, _) -> true + | _ -> false + else + match synLeftExprOpt with + | Some synLeftExpr -> + match synArg with + | SynExpr.ArrayOrList (false, _, _) + | SynExpr.ArrayOrListComputed (false, _, _) -> + synLeftExpr.Range.IsAdjacentTo synArg.Range + | _ -> false + | _ -> false + +// Check f x +// Check f[x] +// Check seq { expr } +// Check async { expr } +and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftExprOpt leftExpr exprty (synArg: SynExpr) atomicFlag isSugar delayed = let denv = env.DisplayEnv let mArg = synArg.Range - let mFunExpr = expr.Range + let mLeftExpr = leftExpr.Range // If the type of 'synArg' unifies as a function type, then this is a function application, otherwise - // it is an error or a computation expression - match UnifyFunctionTypeUndoIfFailed cenv denv mFunExpr exprty with + // it is an error or a computation expression or indexer or delegate invoke + match UnifyFunctionTypeUndoIfFailed cenv denv mLeftExpr exprty with | ValueSome (domainTy, resultTy) -> - match expr with + + // atomicLeftExpr[idx] unifying as application gives a warning + if not isSugar then + match synArg, atomicFlag with + | (SynExpr.ArrayOrList (false, _, _) | SynExpr.ArrayOrListComputed (false, _, _)), ExprAtomicFlag.Atomic -> + if cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot then + informationalWarning(Error(FSComp.SR.tcHighPrecedenceFunctionApplicationToListDeprecated(), mExprAndArg)) + elif not (cenv.g.langVersion.IsExplicitlySpecifiedAs50OrBefore()) then + informationalWarning(Error(FSComp.SR.tcHighPrecedenceFunctionApplicationToListReserved(), mExprAndArg)) + | _ -> () + + match leftExpr with | ApplicableExpr(_, NameOfExpr cenv.g _, _) when cenv.g.langVersion.SupportsFeature LanguageFeature.NameOf -> let replacementExpr = TcNameOfExpr cenv env tpenv synArg TcDelayed cenv overallTy env tpenv mExprAndArg (ApplicableExpr(cenv, replacementExpr, true)) cenv.g.string_ty ExprAtomicFlag.Atomic delayed | _ -> // Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library. // Set a flag in the syntax tree to say we noticed a leading 'seq' - match synArg with - | SynExpr.CompExpr (false, isNotNakedRefCell, _comp, _m) -> - isNotNakedRefCell := - !isNotNakedRefCell - || - (match expr with - | ApplicableExpr(_, Expr.Op(TOp.Coerce, _, [SeqExpr cenv.g], _), _) -> true - | _ -> false) - | _ -> () + // + // Note that 'seq' predated computation expressions and is not actually a computation expression builder + // though users don't realise that. + let synArg = + match synArg with + | SynExpr.ComputationExpr (false, comp, m) when + (match leftExpr with + | ApplicableExpr(_, Expr.Op(TOp.Coerce, _, [SeqExpr cenv.g], _), _) -> true + | _ -> false) -> + SynExpr.ComputationExpr (true, comp, m) + | _ -> synArg let arg, tpenv = TcExprFlex2 cenv domainTy env false tpenv synArg - let exprAndArg, resultTy = buildApp cenv expr resultTy arg mExprAndArg + let exprAndArg, resultTy = buildApp cenv leftExpr resultTy arg mExprAndArg TcDelayed cenv overallTy env tpenv mExprAndArg exprAndArg resultTy atomicFlag delayed | ValueNone -> - // OK, 'expr' doesn't have function type, but perhaps 'expr' is a computation expression builder, and 'arg' is '{ ... }' + // Type-directed invokables + match synArg with - | SynExpr.CompExpr (false, _isNotNakedRefCell, comp, _m) -> - let bodyOfCompExpr, tpenv = cenv.TcComputationExpression cenv env overallTy tpenv (mFunExpr, expr.Expr, exprty, comp) + // leftExpr[idx] + // leftExpr[idx] <- expr2 + | SynExpr.ArrayOrListComputed(false, IndexerArgs indexArgs, m) + when + isAdjacentListExpr isSugar atomicFlag synLeftExprOpt synArg && + cenv.g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot -> + + let expandedIndexArgs = ExpandIndexArgs synLeftExprOpt indexArgs + let setInfo, delayed = + match delayed with + | DelayedSet(e3, _) :: rest -> Some (e3, unionRanges leftExpr.Range synArg.Range), rest + | _ -> None, delayed + TcIndexingThen cenv env overallTy mExprAndArg m tpenv setInfo synLeftExprOpt leftExpr.Expr exprty expandedIndexArgs indexArgs delayed + + // Perhaps 'leftExpr' is a computation expression builder, and 'arg' is '{ ... }' + | SynExpr.ComputationExpr (false, comp, _m) -> + let bodyOfCompExpr, tpenv = cenv.TcComputationExpression cenv env overallTy tpenv (mLeftExpr, leftExpr.Expr, exprty, comp) TcDelayed cenv overallTy env tpenv mExprAndArg (MakeApplicableExprNoFlex cenv bodyOfCompExpr) (tyOfExpr cenv.g bodyOfCompExpr) ExprAtomicFlag.NonAtomic delayed + | _ -> - error (NotAFunction(denv, overallTy.Commit, mFunExpr, mArg)) + error (NotAFunction(denv, overallTy.Commit, mLeftExpr, mArg)) //------------------------------------------------------------------------- // TcLongIdentThen: Typecheck "A.B.C.E.F ... " constructs @@ -7821,7 +8036,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte match delayed with // This is where the constructor is applied to an argument - | DelayedApp (atomicFlag, (FittedArgs args as origArg), mExprAndArg) :: otherDelayed -> + | DelayedApp (atomicFlag, _, _, (FittedArgs args as origArg), mExprAndArg) :: otherDelayed -> // assert the overall result type if possible if isNil otherDelayed then UnifyOverallType cenv env mExprAndArg overallTy ucaseAppTy @@ -7967,7 +8182,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte // Static method calls Type.Foo(arg1, ..., argn) let meths = List.map (fun minfo -> minfo, None) minfos match delayed with - | DelayedApp (atomicFlag, arg, mExprAndArg) :: otherDelayed -> + | DelayedApp (atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag otherDelayed | DelayedTypeApp(tys, mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -7981,7 +8196,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte CallNameResolutionSinkReplacing cenv.tcSink (mItem, env.NameEnv, item, [], ItemOccurence.Use, env.eAccessRights) match otherDelayed with - | DelayedApp(atomicFlag, arg, mExprAndArg) :: otherDelayed -> + | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [arg] atomicFlag otherDelayed | _ -> TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndTypeArgs mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [] ExprAtomicFlag.Atomic otherDelayed @@ -7997,7 +8212,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) match otherDelayed with - | DelayedApp(atomicFlag, arg, mExprAndArg) :: otherDelayed -> + | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag otherDelayed | _ -> TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic otherDelayed @@ -8015,12 +8230,12 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | minfo :: _ -> minfo.ApparentEnclosingType | [] -> error(Error(FSComp.SR.tcTypeHasNoAccessibleConstructor(), mItem)) match delayed with - | DelayedApp (_, arg, mExprAndArg) :: otherDelayed -> + | DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> CallExprHasTypeSink cenv.tcSink (mExprAndArg, env.NameEnv, objTy, env.eAccessRights) TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [arg] mExprAndArg otherDelayed (Some afterResolution) - | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: DelayedApp (_, arg, mExprAndArg) :: otherDelayed -> + | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> let objTyAfterTyArgs, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs objTy tinstEnclosing tyargs CallExprHasTypeSink cenv.tcSink (mExprAndArg, env.NameEnv, objTyAfterTyArgs, env.eAccessRights) @@ -8122,8 +8337,8 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | SynExpr.While _ | SynExpr.For _ | SynExpr.ForEach _ - | SynExpr.ArrayOrListOfSeqExpr _ - | SynExpr.CompExpr _ + | SynExpr.ArrayOrListComputed _ + | SynExpr.ComputationExpr _ | SynExpr.Lambda _ | SynExpr.MatchLambda _ | SynExpr.Match _ @@ -8157,16 +8372,18 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | SynExpr.LetOrUseBang _ | SynExpr.DoBang _ | SynExpr.TraitCall _ + | SynExpr.IndexFromEnd _ + | SynExpr.IndexRange _ -> false - // Propagate the known application structure into function types Propagate cenv overallTy env tpenv (MakeApplicableExprNoFlex cenv expr) (tyOfExpr g expr) delayed // Take all simple arguments and process them before applying the constraint. let delayed1, delayed2 = - let pred = (function DelayedApp (_, arg, _) -> isSimpleArgument arg | _ -> false) + let pred = (function DelayedApp (_, _, _, arg, _) -> isSimpleArgument arg | _ -> false) List.takeWhile pred delayed, List.skipWhile pred delayed + let intermediateTy = if isNil delayed2 then overallTy.Commit else NewInferenceType () let resultExpr, tpenv = TcDelayed cenv (MustEqual intermediateTy) env tpenv mItem (MakeApplicableExprNoFlex cenv expr) (tyOfExpr g expr) ExprAtomicFlag.NonAtomic delayed1 @@ -8181,9 +8398,9 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | Item.DelegateCtor ty -> match delayed with - | DelayedApp (atomicFlag, arg, mItemAndArg) :: otherDelayed -> + | DelayedApp (atomicFlag, _, _, arg, mItemAndArg) :: otherDelayed -> TcNewDelegateThen cenv overallTy env tpenv mItem mItemAndArg ty arg atomicFlag otherDelayed - | DelayedTypeApp(tyargs, _mTypeArgs, mItemAndTypeArgs) :: DelayedApp (atomicFlag, arg, mItemAndArg) :: otherDelayed -> + | DelayedTypeApp(tyargs, _mTypeArgs, mItemAndTypeArgs) :: DelayedApp (atomicFlag, _, _, arg, mItemAndArg) :: otherDelayed -> let ty, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mItemAndTypeArgs ty tinstEnclosing tyargs // Report information about the whole expression including type arguments to VS @@ -8372,9 +8589,9 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte and GetSynMemberApplicationArgs delayed tpenv = match delayed with - | DelayedApp (atomicFlag, arg, _) :: otherDelayed -> + | DelayedApp (atomicFlag, _, _, arg, _) :: otherDelayed -> atomicFlag, None, [arg], otherDelayed, tpenv - | DelayedTypeApp(tyargs, mTypeArgs, _) :: DelayedApp (atomicFlag, arg, _mExprAndArg) :: otherDelayed -> + | DelayedTypeApp(tyargs, mTypeArgs, _) :: DelayedApp (atomicFlag, _, _, arg, _mExprAndArg) :: otherDelayed -> (atomicFlag, Some (tyargs, mTypeArgs), [arg], otherDelayed, tpenv) | DelayedTypeApp(tyargs, mTypeArgs, _) :: otherDelayed -> (ExprAtomicFlag.Atomic, Some (tyargs, mTypeArgs), [], otherDelayed, tpenv) @@ -8677,7 +8894,7 @@ and TcMethodApplication let curriedCallerArgs, exprTy, delayed = match calledMeths with | [calledMeth] when not isProp && calledMeth.NumArgs.Length > 1 -> - [], MustEqual (NewInferenceType ()), [ for x in curriedCallerArgs -> DelayedApp(ExprAtomicFlag.NonAtomic, x, x.Range) ] @ delayed + [], MustEqual (NewInferenceType ()), [ for x in curriedCallerArgs -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, x, x.Range) ] @ delayed | _ when not isProp && calledMeths |> List.exists (fun calledMeth -> calledMeth.NumArgs.Length > 1) -> // This condition should only apply when multiple conflicting curried extension members are brought into scope error(Error(FSComp.SR.tcOverloadsCannotHaveCurriedArguments(), mMethExpr)) diff --git a/src/fsharp/CheckExpressions.fsi b/src/fsharp/CheckExpressions.fsi index bef3163d4ca..e430ce66fa0 100644 --- a/src/fsharp/CheckExpressions.fsi +++ b/src/fsharp/CheckExpressions.fsi @@ -115,7 +115,7 @@ type TcEnv = exception BakedInMemberConstraintName of string * range exception FunctionExpected of DisplayEnv * TType * range exception NotAFunction of DisplayEnv * TType * range * range -exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range +exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range * bool exception Recursion of DisplayEnv * Ident * TType * TType * range exception RecursiveUseCheckedAtRuntime of DisplayEnv * ValRef * range exception LetRecEvaluatedOutOfOrder of DisplayEnv * ValRef * ValRef * range @@ -227,9 +227,11 @@ type TcFileState = isInternalTestSpanStackReferring: bool // forward call - TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * bool ref * SynExpr -> range -> Expr * UnscopedTyparEnv + TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + // forward call - TcArrayOrListSequenceExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + TcArrayOrListComputedExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + // forward call TcComputationExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv } @@ -246,7 +248,7 @@ type TcFileState = tcVal: TcValF * isInternalTestSpanStackReferring: bool * // forward call to CheckComputationExpressions.fs - tcSequenceExpressionEntry: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * bool ref * SynExpr -> range -> Expr * UnscopedTyparEnv) * + tcSequenceExpressionEntry: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * // forward call to CheckComputationExpressions.fs tcArrayOrListSequenceExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * // forward call to CheckComputationExpressions.fs @@ -657,6 +659,10 @@ val TcConst: cenv: TcFileState -> overallTy: TType -> m: range -> env: TcEnv -> /// Check a syntactic expression and convert it to a typed tree expression val TcExpr: cenv:TcFileState -> ty:OverallTy -> env:TcEnv -> tpenv:UnscopedTyparEnv -> expr:SynExpr -> Expr * UnscopedTyparEnv +/// Converts 'a..b' to a call to the '(..)' operator in FSharp.Core +/// Converts 'a..b..c' to a call to the '(.. ..)' operator in FSharp.Core +val RewriteRangeExpr: expr: SynExpr -> SynExpr option + /// Check a syntactic expression and convert it to a typed tree expression val TcExprOfUnknownType: cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> expr:SynExpr -> Expr * TType * UnscopedTyparEnv diff --git a/src/fsharp/CompilerDiagnostics.fs b/src/fsharp/CompilerDiagnostics.fs index 8ce2fe9e148..c689c68deb3 100644 --- a/src/fsharp/CompilerDiagnostics.fs +++ b/src/fsharp/CompilerDiagnostics.fs @@ -52,7 +52,7 @@ exception HashIncludeNotAllowedInNonScript of range exception HashReferenceNotAllowedInNonScript of range /// This exception is an old-style way of reporting a diagnostic -exception HashLoadedSourceHasIssues of (*warnings*) exn list * (*errors*) exn list * range +exception HashLoadedSourceHasIssues of informationals: exn list * warnings: exn list * errors: exn list * range /// This exception is an old-style way of reporting a diagnostic exception HashLoadedScriptConsideredSource of range @@ -182,7 +182,7 @@ let GetRangeOfDiagnostic(err: PhasedDiagnostic) = | NotAFunction(_, _, mfun, _) -> Some mfun - | NotAFunctionButIndexer(_, _, _, mfun, _) -> + | NotAFunctionButIndexer(_, _, _, mfun, _, _) -> Some mfun | IllegalFileNameChar _ -> Some rangeCmdArgs @@ -202,7 +202,7 @@ let GetRangeOfDiagnostic(err: PhasedDiagnostic) = | MSBuildReferenceResolutionWarning(_, _, m) | MSBuildReferenceResolutionError(_, _, m) | AssemblyNotResolved(_, m) - | HashLoadedSourceHasIssues(_, _, m) + | HashLoadedSourceHasIssues(_, _, _, m) | HashLoadedScriptConsideredSource m -> Some m // Strip TargetInvocationException wrappers @@ -367,18 +367,20 @@ let GetWarningLevel err = // Level 2 | _ -> 2 -let warningOn err level specificWarnOn = - let n = GetDiagnosticNumber err +let IsWarningOrInfoEnabled (err, severity) n level specificWarnOn = List.contains n specificWarnOn || - // Some specific warnings are never on by default, i.e. unused variable warnings + // Some specific warnings/informational are never on by default, i.e. unused variable warnings match n with | 1182 -> false // chkUnusedValue - off by default | 3180 -> false // abImplicitHeapAllocation - off by default + | 3366 -> false //tcIndexNotationDeprecated - currently off by default | 3517 -> false // optFailedToInlineSuggestedValue - off by default | 3388 -> false // tcSubsumptionImplicitConversionUsed - off by default | 3389 -> false // tcBuiltInImplicitConversionUsed - off by default | 3390 -> false // tcImplicitConversionUsedForMethodArg - off by default - | _ -> level >= GetWarningLevel err + | _ -> + (severity = FSharpDiagnosticSeverity.Info) || + (severity = FSharpDiagnosticSeverity.Warning && level >= GetWarningLevel err) let SplitRelatedDiagnostics(err: PhasedDiagnostic) : PhasedDiagnostic * PhasedDiagnostic list = let ToPhased e = {Exception=e; Phase = err.Phase} @@ -561,6 +563,7 @@ let HashReferenceNotAllowedInNonScriptE() = DeclareResourceString("HashReference let HashDirectiveNotAllowedInNonScriptE() = DeclareResourceString("HashDirectiveNotAllowedInNonScript", "") let FileNameNotResolvedE() = DeclareResourceString("FileNameNotResolved", "%s%s") let AssemblyNotResolvedE() = DeclareResourceString("AssemblyNotResolved", "%s") +let HashLoadedSourceHasIssues0E() = DeclareResourceString("HashLoadedSourceHasIssues0", "") let HashLoadedSourceHasIssues1E() = DeclareResourceString("HashLoadedSourceHasIssues1", "") let HashLoadedSourceHasIssues2E() = DeclareResourceString("HashLoadedSourceHasIssues2", "") let HashLoadedScriptConsideredSourceE() = DeclareResourceString("HashLoadedScriptConsideredSource", "") @@ -859,10 +862,15 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa | InterfaceNotRevealed(denv, ity, _) -> os.Append(InterfaceNotRevealedE().Format (NicePrint.minimalStringOfType denv ity)) |> ignore - | NotAFunctionButIndexer(_, _, name, _, _) -> - match name with - | Some name -> os.Append(FSComp.SR.notAFunctionButMaybeIndexerWithName name) |> ignore - | _ -> os.Append(FSComp.SR.notAFunctionButMaybeIndexer()) |> ignore + | NotAFunctionButIndexer(_, _, name, _, _, old) -> + if old then + match name with + | Some name -> os.Append(FSComp.SR.notAFunctionButMaybeIndexerWithName name) |> ignore + | _ -> os.Append(FSComp.SR.notAFunctionButMaybeIndexer()) |> ignore + else + match name with + | Some name -> os.Append(FSComp.SR.notAFunctionButMaybeIndexerWithName2 name) |> ignore + | _ -> os.Append(FSComp.SR.notAFunctionButMaybeIndexer2()) |> ignore | NotAFunction(_, _, _, marg) -> if marg.StartColumn = 0 then @@ -1179,7 +1187,7 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa let (|NONTERM_Category_Expr|_|) = function | Parser.NONTERM_argExpr|Parser.NONTERM_minusExpr|Parser.NONTERM_parenExpr|Parser.NONTERM_atomicExpr | Parser.NONTERM_appExpr|Parser.NONTERM_tupleExpr|Parser.NONTERM_declExpr|Parser.NONTERM_braceExpr|Parser.NONTERM_braceBarExpr - | Parser.NONTERM_typedSeqExprBlock + | Parser.NONTERM_typedSequentialExprBlock | Parser.NONTERM_interactiveExpr -> Some() | _ -> None @@ -1607,10 +1615,13 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa | IllegalFileNameChar(fileName, invalidChar) -> os.Append(FSComp.SR.buildUnexpectedFileNameCharacter(fileName, string invalidChar)|>snd) |> ignore - | HashLoadedSourceHasIssues(warnings, errors, _) -> + | HashLoadedSourceHasIssues(infos, warnings, errors, _) -> let Emit(l: exn list) = OutputExceptionR os (List.head l) - if errors=[] then + if isNil warnings && isNil errors then + os.Append(HashLoadedSourceHasIssues0E().Format) |> ignore + Emit infos + elif isNil errors then os.Append(HashLoadedSourceHasIssues1E().Format) |> ignore Emit warnings else @@ -1866,14 +1877,45 @@ let OutputDiagnosticContext prefix fileLineFunction os err = Printf.bprintf os "%s%s\n" prefix line Printf.bprintf os "%s%s%s\n" prefix (String.make iA '-') (String.make iLen '^') -let ReportWarning options err = - warningOn err options.WarnLevel options.WarnOn && not (List.contains (GetDiagnosticNumber err) options.WarnOff) - -let ReportWarningAsError options err = - warningOn err options.WarnLevel options.WarnOn && - not (List.contains (GetDiagnosticNumber err) options.WarnAsWarn) && - ((options.GlobalWarnAsError && not (List.contains (GetDiagnosticNumber err) options.WarnOff)) || - List.contains (GetDiagnosticNumber err) options.WarnAsError) +let ReportDiagnosticAsInfo options (err, severity) = + match severity with + | FSharpDiagnosticSeverity.Error -> false + | FSharpDiagnosticSeverity.Warning -> false + | FSharpDiagnosticSeverity.Info -> + let n = GetDiagnosticNumber err + IsWarningOrInfoEnabled (err, severity) n options.WarnLevel options.WarnOn && + not (List.contains n options.WarnOff) + | FSharpDiagnosticSeverity.Hidden -> false + +let ReportDiagnosticAsWarning options (err, severity) = + match severity with + | FSharpDiagnosticSeverity.Error -> false + | FSharpDiagnosticSeverity.Warning -> + let n = GetDiagnosticNumber err + IsWarningOrInfoEnabled (err, severity) n options.WarnLevel options.WarnOn && + not (List.contains n options.WarnOff) + // Informational become warning if explicitly on and not explicitly off + | FSharpDiagnosticSeverity.Info -> + let n = GetDiagnosticNumber err + List.contains n options.WarnOn && + not (List.contains n options.WarnOff) + | FSharpDiagnosticSeverity.Hidden -> false + +let ReportDiagnosticAsError options (err, severity) = + match severity with + | FSharpDiagnosticSeverity.Error -> true + // Warnings become errors in some situations + | FSharpDiagnosticSeverity.Warning -> + let n = GetDiagnosticNumber err + IsWarningOrInfoEnabled (err, severity) n options.WarnLevel options.WarnOn && + not (List.contains n options.WarnAsWarn) && + ((options.GlobalWarnAsError && not (List.contains n options.WarnOff)) || + List.contains n options.WarnAsError) + // Informational become errors if explicitly WarnAsError + | FSharpDiagnosticSeverity.Info -> + let n = GetDiagnosticNumber err + List.contains n options.WarnAsError + | FSharpDiagnosticSeverity.Hidden -> false //---------------------------------------------------------------------------- // Scoped #nowarn pragmas diff --git a/src/fsharp/CompilerDiagnostics.fsi b/src/fsharp/CompilerDiagnostics.fsi index 3eb231abf97..e336a83c18a 100644 --- a/src/fsharp/CompilerDiagnostics.fsi +++ b/src/fsharp/CompilerDiagnostics.fsi @@ -24,7 +24,7 @@ exception HashIncludeNotAllowedInNonScript of range exception HashReferenceNotAllowedInNonScript of range /// This exception is an old-style way of reporting a diagnostic -exception HashLoadedSourceHasIssues of (*warnings*) exn list * (*errors*) exn list * range +exception HashLoadedSourceHasIssues of informationals: exn list * warnings: exn list * errors: exn list * range /// This exception is an old-style way of reporting a diagnostic exception HashLoadedScriptConsideredSource of range @@ -101,10 +101,13 @@ val GetErrorLoggerFilteringByScopedPragmas: checkFile:bool * ScopedPragma list * val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string -/// Indicates if we should report a warning -val ReportWarning: FSharpDiagnosticOptions -> PhasedDiagnostic -> bool +/// Indicates if we should report a diagnostic as a warning +val ReportDiagnosticAsInfo: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool + +/// Indicates if we should report a diagnostic as a warning +val ReportDiagnosticAsWarning: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool /// Indicates if we should report a warning as an error -val ReportWarningAsError: FSharpDiagnosticOptions -> PhasedDiagnostic -> bool +val ReportDiagnosticAsError: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool diff --git a/src/fsharp/ErrorLogger.fs b/src/fsharp/ErrorLogger.fs index ed4469d7fcb..e3fc0c73961 100644 --- a/src/fsharp/ErrorLogger.fs +++ b/src/fsharp/ErrorLogger.fs @@ -385,6 +385,9 @@ module ErrorLoggerExtensions = member x.Warning exn = x.EmitDiagnostic (exn, FSharpDiagnosticSeverity.Warning) + member x.InformationalWarning exn = + x.EmitDiagnostic (exn, FSharpDiagnosticSeverity.Info) + member x.Error exn = x.ErrorR exn raise (ReportedError (Some exn)) @@ -465,6 +468,9 @@ let errorR exn = CompileThreadStatic.ErrorLogger.ErrorR exn /// Raises a warning with error recovery and returns unit. let warning exn = CompileThreadStatic.ErrorLogger.Warning exn +/// Raises a warning with error recovery and returns unit. +let informationalWarning exn = CompileThreadStatic.ErrorLogger.InformationalWarning exn + /// Raises a special exception and returns 'T - can be caught later at an errorRecovery point. let error exn = CompileThreadStatic.ErrorLogger.Error exn diff --git a/src/fsharp/ErrorLogger.fsi b/src/fsharp/ErrorLogger.fsi index cdecdafdc6f..84243a68e65 100644 --- a/src/fsharp/ErrorLogger.fsi +++ b/src/fsharp/ErrorLogger.fsi @@ -198,12 +198,18 @@ val SetThreadBuildPhaseNoUnwind: phase:BuildPhase -> unit val SetThreadErrorLoggerNoUnwind: errorLogger:ErrorLogger -> unit +/// Reports an error diagnostic and continues val errorR: exn:exn -> unit +/// Reports a warning diagnostic val warning: exn:exn -> unit +/// Reports an error and raises a ReportedError exception val error: exn:exn -> 'a +/// Reports an informational diagnostic +val informationalWarning: exn:exn -> unit + val simulateError: p:PhasedDiagnostic -> 'a val diagnosticSink: phasedError:PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index b9fdbd2cadd..9bf9937c1e7 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -594,7 +594,7 @@ tcExpressionWithIfRequiresParenthesis,"This list or array expression includes an 748,tcConstructRequiresComputationExpressions,"This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'." 749,tcConstructRequiresSequenceOrComputations,"This construct may only be used within sequence or computation expressions" 750,tcConstructRequiresComputationExpression,"This construct may only be used within computation expressions" -751,tcInvalidIndexerExpression,"Invalid indexer expression" +751,tcInvalidIndexerExpression,"Incomplete expression or invalid use of indexer syntax" 752,tcObjectOfIndeterminateTypeUsedRequireTypeConstraint,"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" 753,tcCannotInheritFromVariableType,"Cannot inherit from a variable type" 754,tcObjectConstructorsOnTypeParametersCannotTakeArguments,"Calls to object constructors on type parameters cannot be given arguments" @@ -1232,6 +1232,8 @@ invalidFullNameForProvidedType,"invalid full name for provided type" featureOverloadsForCustomOperations,"overloads for custom operations" featureExpandedMeasurables,"more types support units of measure" featurePrintfBinaryFormat,"binary formatting for integers" +featureIndexerNotationWithoutDot,"expr[idx] notation for indexing and slicing" +featureRefCellNotationInformationals,"informational messages related to reference cells" featureDiscardUseValue,"discard pattern in use binding" featureNonVariablePatternsToRightOfAsPatterns,"non-variable patterns to the right of 'as' patterns" featureAttributesToRightOfModuleKeyword,"attributes to the right of the 'module' keyword" @@ -1459,8 +1461,10 @@ keywordDescriptionUntypedQuotation,"Delimits a untyped code quotation." 3216,itemNotFoundInTypeDuringDynamicCodeGen,"%s '%s' not found in type '%s' from assembly '%s'. 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." descriptionWordIs,"is" notAFunction,"This value is not a function and cannot be applied." -notAFunctionButMaybeIndexerWithName,"This value is not a function and cannot be applied. Did you intend to access the indexer via %s.[index] instead?" -notAFunctionButMaybeIndexer,"This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead?" +notAFunctionButMaybeIndexerWithName,"This value is not a function and cannot be applied. Did you intend to access the indexer via '%s.[index]'?" +notAFunctionButMaybeIndexer,"This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr.[index]'?" +notAFunctionButMaybeIndexerWithName2,"This value is not a function and cannot be applied. Did you intend to access the indexer via '%s[index]'?" +notAFunctionButMaybeIndexer2,"This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'?" 3217,notAFunctionButMaybeIndexerErrorCode,"" notAFunctionButMaybeDeclaration,"This value is not a function and cannot be applied. Did you forget to terminate a declaration?" 3218,ArgumentsInSigAndImplMismatch,"The argument names in the signature '%s' and implementation '%s' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling." @@ -1533,11 +1537,29 @@ featureAdditionalImplicitConversions,"additional type-directed conversions" featureStructActivePattern,"struct representation for active patterns" featureRelaxWhitespace2,"whitespace relaxation v2" 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" +3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." +3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." +3355,tcNotAnIndexerNamedIndexingNotYetEnabled,"The value '%s' is not a function and does not support index notation." +3355,tcNotAnIndexerIndexingNotYetEnabled,"This expression is not a function and does not support index notation." 3360,typrelInterfaceWithConcreteAndVariable,"'%s' cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify." 3361,typrelInterfaceWithConcreteAndVariableObjectExpression,"You cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify." featureInterfacesWithMultipleGenericInstantiation,"interfaces with multiple generic instantiation" 3362,tcLiteralFieldAssignmentWithArg,"Cannot assign '%s' to a value marked literal" 3363,tcLiteralFieldAssignmentNoArg,"Cannot assign a value to another value marked literal" +3364,tcInvalidUseOfReverseIndex,"Invalid use of reverse index in list expression." +3365,tcHighPrecedenceFunctionApplicationToListDeprecated,"The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'." +3366,tcIndexNotationDeprecated,"The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code." +3367,tcHighPrecedenceFunctionApplicationToListReserved,"The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'." +3368,tcParenThenAdjacentListArgumentReserved,"The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'." +3368,tcListThenAdjacentListArgumentReserved,"The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'." +3368,tcOtherThenAdjacentListArgumentReserved,"The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'." +3369,tcParenThenAdjacentListArgumentNeedsAdjustment,"The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'." +3369,tcListThenAdjacentListArgumentNeedsAdjustment,"The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'." +3369,tcOtherThenAdjacentListArgumentNeedsAdjustment,"The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'." +3370,chkInfoRefcellDeref,"The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'." +3370,chkInfoRefcellAssign,"The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'." +3370,chkInfoRefcellIncr,"The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'." +3370,chkInfoRefcellDecr,"The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'." forFormatInvalidForInterpolated,"Interpolated strings may not use '%%' format specifiers unless each is given an expression, e.g. '%%d{{1+1}}'." forFormatInvalidForInterpolated2,".NET-style format specifiers such as '{{x,3}}' or '{{x:N5}}' may not be mixed with '%%' format specifiers." forFormatInvalidForInterpolated3,"The '%%P' specifier may not be used explicitly." diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index 288a96c8efd..bf1c66b0f29 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -1080,6 +1080,9 @@ Assembly reference '{0}' was not found or is invalid + + One or more informational messages in loaded file.\n + One or more warnings in loaded file.\n diff --git a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index ab1c7adefad..cda7c06e099 100644 --- a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -408,7 +408,7 @@ ParserAndUntypedAST\lex.fsl - --module FSharp.Compiler.Parser --open FSharp.Compiler --open FSharp.Compiler.Syntax --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing + -v --module FSharp.Compiler.Parser --open FSharp.Compiler --open FSharp.Compiler.Syntax --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing ParserAndUntypedAST\pars.fsy diff --git a/src/fsharp/LanguageFeatures.fs b/src/fsharp/LanguageFeatures.fs index 421885db620..aefb69f1de8 100644 --- a/src/fsharp/LanguageFeatures.fs +++ b/src/fsharp/LanguageFeatures.fs @@ -39,6 +39,8 @@ type LanguageFeature = | ExpandedMeasurables | StructActivePattern | PrintfBinaryFormat + | IndexerNotationWithoutDot + | RefCellNotationInformationals | UseBindingValueDiscard | NonVariablePatternsToRightOfAsPatterns | AttributesToRightOfModuleKeyword @@ -88,6 +90,8 @@ type LanguageVersion (specifiedVersionAsString) = LanguageFeature.ResumableStateMachines, previewVersion LanguageFeature.StructActivePattern, previewVersion LanguageFeature.PrintfBinaryFormat, previewVersion + LanguageFeature.IndexerNotationWithoutDot, previewVersion + LanguageFeature.RefCellNotationInformationals, previewVersion LanguageFeature.UseBindingValueDiscard, previewVersion LanguageFeature.NonVariablePatternsToRightOfAsPatterns, previewVersion LanguageFeature.AttributesToRightOfModuleKeyword, previewVersion @@ -117,6 +121,14 @@ type LanguageVersion (specifiedVersionAsString) = | true, v -> v <= specified | false, _ -> false + /// Has preview been explicitly specified + member _.IsExplicitlySpecifiedAs50OrBefore() = + match specifiedVersionAsString with + | "4.6" -> true + | "4.7" -> true + | "5.0" -> true + | _ -> false + /// Has preview been explicitly specified member _.IsPreviewEnabled = specified = previewVersion @@ -169,6 +181,8 @@ type LanguageVersion (specifiedVersionAsString) = | LanguageFeature.ExpandedMeasurables -> FSComp.SR.featureExpandedMeasurables() | LanguageFeature.StructActivePattern -> FSComp.SR.featureStructActivePattern() | LanguageFeature.PrintfBinaryFormat -> FSComp.SR.featurePrintfBinaryFormat() + | LanguageFeature.IndexerNotationWithoutDot -> FSComp.SR.featureIndexerNotationWithoutDot() + | LanguageFeature.RefCellNotationInformationals -> FSComp.SR.featureRefCellNotationInformationals() | LanguageFeature.UseBindingValueDiscard -> FSComp.SR.featureDiscardUseValue() | LanguageFeature.NonVariablePatternsToRightOfAsPatterns -> FSComp.SR.featureNonVariablePatternsToRightOfAsPatterns() | LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword() diff --git a/src/fsharp/LanguageFeatures.fsi b/src/fsharp/LanguageFeatures.fsi index 6ca6693ce27..c51d0854e90 100644 --- a/src/fsharp/LanguageFeatures.fsi +++ b/src/fsharp/LanguageFeatures.fsi @@ -29,6 +29,8 @@ type LanguageFeature = | ExpandedMeasurables | StructActivePattern | PrintfBinaryFormat + | IndexerNotationWithoutDot + | RefCellNotationInformationals | UseBindingValueDiscard | NonVariablePatternsToRightOfAsPatterns | AttributesToRightOfModuleKeyword @@ -45,6 +47,9 @@ type LanguageVersion = /// Has preview been explicitly specified member IsPreviewEnabled: bool + /// Has been explicitly specified as 4.6, 4.7 or 5.0 + member IsExplicitlySpecifiedAs50OrBefore: unit -> bool + /// Does the selected LanguageVersion support the specified feature member SupportsFeature: LanguageFeature -> bool diff --git a/src/fsharp/LexFilter.fs b/src/fsharp/LexFilter.fs index f668af52987..6084c450f26 100644 --- a/src/fsharp/LexFilter.fs +++ b/src/fsharp/LexFilter.fs @@ -4,6 +4,7 @@ /// Implements the offside rule and a couple of other lexical transformations. module internal FSharp.Compiler.LexFilter +open System.Collections.Generic open Internal.Utilities.Text.Lexing open FSharp.Compiler open Internal.Utilities.Library @@ -460,7 +461,7 @@ type TokenTupPool() = let maxSize = 100 let mutable currentPoolSize = 0 - let stack = System.Collections.Generic.Stack(10) + let stack = Stack(10) member this.Rent() = if stack.Count = 0 then @@ -653,7 +654,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu // Fetch a raw token, either from the old lexer or from our delayedStack //-------------------------------------------------------------------------- - let delayedStack = System.Collections.Generic.Stack() + let delayedStack = Stack() let mutable tokensThatNeedNoProcessingCount = 0 let delayToken tokenTup = delayedStack.Push tokenTup @@ -716,6 +717,8 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu let relaxWhitespace2 = lexbuf.SupportsFeature LanguageFeature.RelaxWhitespace2 + //let indexerNotationWithoutDot = lexbuf.SupportsFeature LanguageFeature.IndexerNotationWithoutDot + let pushCtxt tokenTup (newCtxt: Context) = let rec undentationLimit strict stack = match newCtxt, stack with @@ -979,13 +982,17 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu let tokenEndPos = leftTokenTup.LexbufState.EndPos (tokenEndPos = lparenStartPos) - let nextTokenIsAdjacentLParenOrLBrack (tokenTup: TokenTup) = + let nextTokenIsAdjacentLBrack (tokenTup: TokenTup) = let lookaheadTokenTup = peekNextTokenTup() match lookaheadTokenTup.Token with - | LPAREN | LBRACK -> - if isAdjacent tokenTup lookaheadTokenTup then Some(lookaheadTokenTup.Token) else None - | _ -> - None + | LBRACK -> isAdjacent tokenTup lookaheadTokenTup + | _ -> false + + let nextTokenIsAdjacentLParen (tokenTup: TokenTup) = + let lookaheadTokenTup = peekNextTokenTup() + match lookaheadTokenTup.Token with + | LPAREN -> isAdjacent tokenTup lookaheadTokenTup + | _ -> false let nextTokenIsAdjacent firstTokenTup = let lookaheadTokenTup = peekNextTokenTup() @@ -1023,7 +1030,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu // On successful parse of a set of type parameters, look for an adjacent (, e.g. // M(args) // and insert a HIGH_PRECEDENCE_PAREN_APP - if not hasAfterOp && (match nextTokenIsAdjacentLParenOrLBrack lookaheadTokenTup with Some LPAREN -> true | _ -> false) then + if not hasAfterOp && nextTokenIsAdjacentLParen lookaheadTokenTup then let dotTokenTup = peekNextTokenTup() stack <- (pool.UseLocation(dotTokenTup, HIGH_PRECEDENCE_PAREN_APP), false) :: stack true @@ -1037,7 +1044,7 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu // On successful parse of a set of type parameters, look for an adjacent (, e.g. // M>(args) // and insert a HIGH_PRECEDENCE_PAREN_APP - if afterOp.IsNone && (match nextTokenIsAdjacentLParenOrLBrack lookaheadTokenTup with Some LPAREN -> true | _ -> false) then + if afterOp.IsNone && nextTokenIsAdjacentLParen lookaheadTokenTup then let dotTokenTup = peekNextTokenTup() stack <- (pool.UseLocation(dotTokenTup, HIGH_PRECEDENCE_PAREN_APP), false) :: stack true @@ -2349,6 +2356,20 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu | _ -> returnToken tokenLexbufState token + and insertHighPrecedenceApp (tokenTup: TokenTup) = + let dotTokenTup = peekNextTokenTup() + if debug then dprintf "inserting HIGH_PRECEDENCE_PAREN_APP at dotTokenPos = %a\n" outputPos (startPosOfTokenTup dotTokenTup) + let hpa = + if nextTokenIsAdjacentLParen tokenTup then + HIGH_PRECEDENCE_PAREN_APP + elif nextTokenIsAdjacentLBrack tokenTup then + HIGH_PRECEDENCE_BRACK_APP + else + failwith "unreachable" + delayToken(pool.UseLocation(dotTokenTup, hpa)) + delayToken tokenTup + true + and rulesForBothSoftWhiteAndHardWhite(tokenTup: TokenTup) = match tokenTup.Token with | HASH_IDENT ident -> @@ -2358,18 +2379,15 @@ type LexFilterImpl (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbu delayToken(TokenTup(HASH, hashPos, tokenTup.LastTokenPos)) true + // Insert HIGH_PRECEDENCE_BRACK_APP if needed + // ident[3] + | IDENT _ when nextTokenIsAdjacentLBrack tokenTup -> + insertHighPrecedenceApp tokenTup + // Insert HIGH_PRECEDENCE_PAREN_APP if needed - | IDENT _ when (nextTokenIsAdjacentLParenOrLBrack tokenTup).IsSome -> - let dotTokenTup = peekNextTokenTup() - if debug then dprintf "inserting HIGH_PRECEDENCE_PAREN_APP at dotTokenPos = %a\n" outputPos (startPosOfTokenTup dotTokenTup) - let hpa = - match nextTokenIsAdjacentLParenOrLBrack tokenTup with - | Some LPAREN -> HIGH_PRECEDENCE_PAREN_APP - | Some LBRACK -> HIGH_PRECEDENCE_BRACK_APP - | _ -> failwith "unreachable" - delayToken(pool.UseLocation(dotTokenTup, hpa)) - delayToken tokenTup - true + // ident(3) + | IDENT _ when nextTokenIsAdjacentLParen tokenTup -> + insertHighPrecedenceApp tokenTup // Insert HIGH_PRECEDENCE_TYAPP if needed | DELEGATE | IDENT _ | IEEE64 _ | IEEE32 _ | DECIMAL _ | INT8 _ | INT16 _ | INT32 _ | INT64 _ | NATIVEINT _ | UINT8 _ | UINT16 _ | UINT32 _ | UINT64 _ | UNATIVEINT _ | BIGNUM _ when peekAdjacentTypars false tokenTup -> @@ -2510,7 +2528,7 @@ type LexFilter (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbuf: U // We don't interact with lexbuf state at all, any inserted tokens have same state/location as the real one read, so // we don't have to do any of the wrapped lexbuf magic that you see in LexFilterImpl. - let delayedStack = System.Collections.Generic.Stack() + let delayedStack = Stack() let delayToken tok = delayedStack.Push tok let popNextToken() = @@ -2528,18 +2546,16 @@ type LexFilter (lightStatus: LightSyntaxStatus, compilingFsLib, lexer, lexbuf: U member _.LexBuffer = inner.LexBuffer - member _.GetToken () = - let rec loop() = - let token = popNextToken() - match token with - | RBRACE _ -> - insertComingSoonTokens RBRACE_COMING_SOON RBRACE_IS_HERE - loop() - | RPAREN -> - insertComingSoonTokens RPAREN_COMING_SOON RPAREN_IS_HERE - loop() - | OBLOCKEND -> - insertComingSoonTokens OBLOCKEND_COMING_SOON OBLOCKEND_IS_HERE - loop() - | _ -> token - loop() + member lexer.GetToken () = + let token = popNextToken() + match token with + | RBRACE _ -> + insertComingSoonTokens RBRACE_COMING_SOON RBRACE_IS_HERE + lexer.GetToken() + | RPAREN -> + insertComingSoonTokens RPAREN_COMING_SOON RPAREN_IS_HERE + lexer.GetToken() + | OBLOCKEND -> + insertComingSoonTokens OBLOCKEND_COMING_SOON OBLOCKEND_IS_HERE + lexer.GetToken() + | _ -> token diff --git a/src/fsharp/LowerCallsAndSeqs.fs b/src/fsharp/LowerCallsAndSeqs.fs index 82cdbd2c23b..ec6a327b6e3 100644 --- a/src/fsharp/LowerCallsAndSeqs.fs +++ b/src/fsharp/LowerCallsAndSeqs.fs @@ -1012,7 +1012,7 @@ let (|OptionalCoerce|) expr = | Expr.Op (TOp.Coerce, _, [arg], _) -> arg | _ -> expr -// Making 'seq' optional means this kicks in for FSharp.Core, see TcArrayOrListSequenceExpression +// Making 'seq' optional means this kicks in for FSharp.Core, see TcArrayOrListComputedExpression // which only adds a 'seq' call outside of FSharp.Core let (|OptionalSeq|_|) g amap expr = match expr with diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 6e0e9f36076..94f850245c8 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -765,6 +765,11 @@ and CheckValRef (cenv: cenv) (env: env) v m (context: PermitByRefExpr) = if valRefEq cenv.g v cenv.g.addrof_vref then errorR(Error(FSComp.SR.chkNoFirstClassAddressOf(), m)) if valRefEq cenv.g v cenv.g.reraise_vref then errorR(Error(FSComp.SR.chkNoFirstClassRethrow(), m)) if valRefEq cenv.g v cenv.g.nameof_vref then errorR(Error(FSComp.SR.chkNoFirstClassNameOf(), m)) + if cenv.g.langVersion.SupportsFeature LanguageFeature.RefCellNotationInformationals then + if valRefEq cenv.g v cenv.g.refcell_deref_vref then informationalWarning(Error(FSComp.SR.chkInfoRefcellDeref(), m)) + if valRefEq cenv.g v cenv.g.refcell_assign_vref then informationalWarning(Error(FSComp.SR.chkInfoRefcellAssign(), m)) + if valRefEq cenv.g v cenv.g.refcell_incr_vref then informationalWarning(Error(FSComp.SR.chkInfoRefcellIncr(), m)) + if valRefEq cenv.g v cenv.g.refcell_decr_vref then informationalWarning(Error(FSComp.SR.chkInfoRefcellDecr(), m)) // ByRefLike-typed values can only occur in permitting contexts if context.Disallow && isByrefLikeTy cenv.g m v.Type then diff --git a/src/fsharp/SyntaxTree.fs b/src/fsharp/SyntaxTree.fs index 35fb935e6c0..7d12a8e6965 100644 --- a/src/fsharp/SyntaxTree.fs +++ b/src/fsharp/SyntaxTree.fs @@ -535,14 +535,25 @@ type SynExpr = bodyExpr: SynExpr * range: range - | ArrayOrListOfSeqExpr of + | ArrayOrListComputed of isArray: bool * expr: SynExpr * range: range - | CompExpr of - isArrayOrList: bool * - isNotNakedRefCell: bool ref * + | IndexRange of + expr1: SynExpr option * + opm: range * + expr2: SynExpr option* + range1: range * + range2: range * + range: range + + | IndexFromEnd of + expr: SynExpr * + range: range + + | ComputationExpr of + hasSeqBuilder: bool * expr: SynExpr * range: range @@ -672,13 +683,13 @@ type SynExpr = | DotIndexedGet of objectExpr: SynExpr * - indexExprs: SynIndexerArg list * + indexArgs: SynExpr * dotRange: range * range: range | DotIndexedSet of objectExpr: SynExpr * - indexExprs: SynIndexerArg list * + indexArgs: SynExpr * valueExpr: SynExpr * leftOfSetRange: range * dotRange: range * @@ -846,8 +857,8 @@ type SynExpr = | SynExpr.While (range=m) | SynExpr.For (range=m) | SynExpr.ForEach (range=m) - | SynExpr.CompExpr (range=m) - | SynExpr.ArrayOrListOfSeqExpr (range=m) + | SynExpr.ComputationExpr (range=m) + | SynExpr.ArrayOrListComputed (range=m) | SynExpr.Lambda (range=m) | SynExpr.Match (range=m) | SynExpr.MatchLambda (range=m) @@ -877,6 +888,8 @@ type SynExpr = | SynExpr.LibraryOnlyUnionCaseFieldSet (range=m) | SynExpr.LibraryOnlyILAssembly (range=m) | SynExpr.LibraryOnlyStaticOptimization (range=m) + | SynExpr.IndexRange (range=m) + | SynExpr.IndexFromEnd (range=m) | SynExpr.TypeTest (range=m) | SynExpr.Upcast (range=m) | SynExpr.AddressOf (range=m) @@ -932,24 +945,6 @@ type SynInterpolatedStringPart = | String of value: string * range: range | FillExpr of fillExpr: SynExpr * qualifiers: Ident option -[] -type SynIndexerArg = - | Two of - expr1: SynExpr * - fromEnd1: bool * - expr2: SynExpr * - fromEnd2: bool * - range1: range * - range2: range - - | One of - expr: SynExpr * - fromEnd: bool * range - - member x.Range = match x with Two (e1, _, e2, _, _, _) -> unionRanges e1.Range e2.Range | One (e, _, _) -> e.Range - - member x.Exprs = match x with Two (e1, _, e2, _, _, _) -> [e1;e2] | One (e, _, _) -> [e] - [] type SynSimplePat = | Id of diff --git a/src/fsharp/SyntaxTree.fsi b/src/fsharp/SyntaxTree.fsi index cb51521b079..8e676ea3b4e 100644 --- a/src/fsharp/SyntaxTree.fsi +++ b/src/fsharp/SyntaxTree.fsi @@ -651,15 +651,33 @@ type SynExpr = range: range /// F# syntax: [ expr ], [| expr |] - | ArrayOrListOfSeqExpr of + | ArrayOrListComputed of isArray: bool * expr: SynExpr * range: range + /// F# syntax: expr.. + /// F# syntax: ..expr + /// F# syntax: expr..expr + /// F# syntax: * + /// A two-element range indexer argument a..b, a.., ..b. Also used to represent + /// a range in a list, array or sequence expression. + | IndexRange of + expr1: SynExpr option * + opm: range * + expr2: SynExpr option* + range1: range * + range2: range * + range: range + + /// F# syntax: ^expr + | IndexFromEnd of + expr: SynExpr * + range: range + /// F# syntax: { expr } - | CompExpr of - isArrayOrList: bool * - isNotNakedRefCell: bool ref * + | ComputationExpr of + hasSeqBuilder: bool * expr: SynExpr * range: range @@ -829,14 +847,14 @@ type SynExpr = /// F# syntax: expr.[expr, ..., expr] | DotIndexedGet of objectExpr: SynExpr * - indexExprs: SynIndexerArg list * + indexArgs: SynExpr * dotRange: range * range: range /// F# syntax: expr.[expr, ..., expr] <- expr | DotIndexedSet of objectExpr: SynExpr * - indexExprs: SynIndexerArg list * + indexArgs: SynExpr * valueExpr: SynExpr * leftOfSetRange: range * dotRange: range * @@ -1040,29 +1058,6 @@ type SynInterpolatedStringPart = | String of value: string * range: range | FillExpr of fillExpr: SynExpr * qualifiers: Ident option -/// Represents a syntax tree for an F# indexer expression argument -[] -type SynIndexerArg = - /// A two-element range indexer argument - | Two of - expr1: SynExpr * - fromEnd1: bool * - expr2: SynExpr * - fromEnd2: bool * - range1: range * - range2: range - - /// A one-element item indexer argument - | One of - expr: SynExpr * - fromEnd: bool * range - - /// Gets the syntax range of this construct - member Range: range - - /// Get the one or two expressions as a list - member Exprs: SynExpr list - /// Represents a syntax tree for simple F# patterns [] type SynSimplePat = diff --git a/src/fsharp/SyntaxTreeOps.fs b/src/fsharp/SyntaxTreeOps.fs index 3b04005ad5f..207a122ed9c 100644 --- a/src/fsharp/SyntaxTreeOps.fs +++ b/src/fsharp/SyntaxTreeOps.fs @@ -77,7 +77,7 @@ let rec IsControlFlowExpression e = | SynExpr.LetOrUse _ | SynExpr.Sequential _ // Treat "ident { ... }" as a control flow expression - | SynExpr.App (_, _, SynExpr.Ident _, SynExpr.CompExpr _, _) + | SynExpr.App (_, _, SynExpr.Ident _, SynExpr.ComputationExpr _, _) | SynExpr.IfThenElse _ | SynExpr.LetOrUseBang _ | SynExpr.Match _ @@ -304,15 +304,10 @@ let mkSynApp5 f x1 x2 x3 x4 x5 m = mkSynApp1 (mkSynApp4 f x1 x2 x3 x4 m) x5 m let mkSynDotParenSet m a b c = mkSynTrifix m parenSet a b c -let mkSynDotBrackGet m mDot a b fromEnd = SynExpr.DotIndexedGet (a, [SynIndexerArg.One (b, fromEnd, m)], mDot, m) +let mkSynDotBrackGet m mDot a b = SynExpr.DotIndexedGet (a, b, mDot, m) let mkSynQMarkSet m a b c = mkSynTrifix m qmarkSet a b c -let mkSynDotBrackSliceGet m mDot arr sliceArg = SynExpr.DotIndexedGet (arr, [sliceArg], mDot, m) - -let mkSynDotBrackSeqSliceGet m mDot arr (argsList: list) = - SynExpr.DotIndexedGet (arr, argsList, mDot, m) - let mkSynDotParenGet lhsm dotm a b = match b with | SynExpr.Tuple (false, [_;_], _, _) -> @@ -652,8 +647,8 @@ let rec synExprContainsError inpExpr = | SynExpr.TypeTest (e, _, _) | SynExpr.Upcast (e, _, _) | SynExpr.AddressOf (_, e, _, _) - | SynExpr.CompExpr (_, _, e, _) - | SynExpr.ArrayOrListOfSeqExpr (_, e, _) + | SynExpr.ComputationExpr (_, e, _) + | SynExpr.ArrayOrListComputed (_, e, _) | SynExpr.Typed (e, _, _) | SynExpr.FromParseError (e, _) | SynExpr.Do (e, _) @@ -733,11 +728,18 @@ let rec synExprContainsError inpExpr = | SynExpr.IfThenElse (_, _, e1, _, e2, _, e3opt, _, _, _, _) -> walkExpr e1 || walkExpr e2 || walkExprOpt e3opt - | SynExpr.DotIndexedGet (e1, es, _, _) -> - walkExpr e1 || walkExprs [ for e in es do yield! e.Exprs ] + | SynExpr.IndexRange (expr1, _, expr2, _, _, _) -> + (match expr1 with Some e -> walkExpr e | None -> false) || + (match expr2 with Some e -> walkExpr e | None -> false) + + | SynExpr.IndexFromEnd (e, _) -> + walkExpr e + + | SynExpr.DotIndexedGet (e1, indexArgs, _, _) -> + walkExpr e1 || walkExpr indexArgs - | SynExpr.DotIndexedSet (e1, es, e2, _, _, _) -> - walkExpr e1 || walkExprs [ for e in es do yield! e.Exprs ] || walkExpr e2 + | SynExpr.DotIndexedSet (e1, indexArgs, e2, _, _, _) -> + walkExpr e1 || walkExpr indexArgs || walkExpr e2 | SynExpr.DotNamedIndexedPropertySet (e1, _, e2, e3, _) -> walkExpr e1 || walkExpr e2 || walkExpr e3 diff --git a/src/fsharp/SyntaxTreeOps.fsi b/src/fsharp/SyntaxTreeOps.fsi index e5b2a4a5eab..c4274fb9584 100644 --- a/src/fsharp/SyntaxTreeOps.fsi +++ b/src/fsharp/SyntaxTreeOps.fsi @@ -119,13 +119,13 @@ val mkSynApp5: f:SynExpr -> x1:SynExpr -> x2:SynExpr -> x3:SynExpr -> x4:SynExpr val mkSynDotParenSet: m:range -> a:SynExpr -> b:SynExpr -> c:SynExpr -> SynExpr -val mkSynDotBrackGet: m:range -> mDot:range -> a:SynExpr -> b:SynExpr -> fromEnd:bool -> SynExpr +val mkSynDotBrackGet: m:range -> mDot:range -> a:SynExpr -> b:SynExpr -> SynExpr val mkSynQMarkSet: m:range -> a:SynExpr -> b:SynExpr -> c:SynExpr -> SynExpr -val mkSynDotBrackSliceGet: m:range -> mDot:range -> arr:SynExpr -> sliceArg:SynIndexerArg -> SynExpr +//val mkSynDotBrackSliceGet: m:range -> mDot:range -> arr:SynExpr -> sliceArg:SynIndexerArg -> SynExpr -val mkSynDotBrackSeqSliceGet: m:range -> mDot:range -> arr:SynExpr -> argsList:SynIndexerArg list -> SynExpr +//val mkSynDotBrackSeqSliceGet: m:range -> mDot:range -> arr:SynExpr -> argsList:SynIndexerArg list -> SynExpr val mkSynDotParenGet: lhsm:range -> dotm:range -> a:SynExpr -> b:SynExpr -> SynExpr diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 6044cc4d04b..fa82099c85a 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -641,6 +641,10 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_unchecked_unary_plus_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_UnaryPlus" , None , None , [vara], mk_unop_ty varaTy) let v_unchecked_unary_minus_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_UnaryNegation" , None , None , [vara], mk_unop_ty varaTy) let v_unchecked_unary_not_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "not" , None , Some "Not" , [], mk_unop_ty v_bool_ty) + let v_refcell_deref_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Dereference" , None , None , [vara], ([[mkRefCellTy varaTy]], varaTy)) + let v_refcell_assign_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_ColonEquals" , None , None , [vara], ([[mkRefCellTy varaTy]; [varaTy]], v_unit_ty)) + let v_refcell_incr_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "incr" , None , Some "Increment" , [], ([[mkRefCellTy v_int_ty]], v_unit_ty)) + let v_refcell_decr_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "decr" , None , Some "Decrement" , [], ([[mkRefCellTy v_int_ty]], v_unit_ty)) let v_checked_addition_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_Addition" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) let v_checked_subtraction_info = makeIntrinsicValRef(fslib_MFOperatorsChecked_nleref, "op_Subtraction" , None , None , [vara;varb;varc], mk_binop_ty3 varaTy varbTy varcTy) @@ -1317,6 +1321,10 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val unchecked_subtraction_vref = ValRefForIntrinsic v_unchecked_subtraction_info member val unchecked_multiply_vref = ValRefForIntrinsic v_unchecked_multiply_info member val unchecked_defaultof_vref = ValRefForIntrinsic v_unchecked_defaultof_info + member val refcell_deref_vref = ValRefForIntrinsic v_refcell_deref_info + member val refcell_assign_vref = ValRefForIntrinsic v_refcell_assign_info + member val refcell_incr_vref = ValRefForIntrinsic v_refcell_incr_info + member val refcell_decr_vref = ValRefForIntrinsic v_refcell_decr_info member _.bitwise_or_info = v_bitwise_or_info member _.bitwise_and_info = v_bitwise_and_info diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index c4428ce2624..6b652f057e9 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -76,7 +76,7 @@ type ErrorLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, nameFo override x.ErrorCount = errors override x.DiagnosticSink(err, severity) = - if severity = FSharpDiagnosticSeverity.Error || ReportWarningAsError tcConfigB.errorSeverityOptions err then + if ReportDiagnosticAsError tcConfigB.errorSeverityOptions (err, severity) then if errors >= tcConfigB.maxErrors then x.HandleTooManyErrors(FSComp.SR.fscTooManyErrors()) exiter.Exit 1 @@ -91,7 +91,10 @@ type ErrorLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, nameFo | :? KeyNotFoundException, None -> Debug.Assert(false, sprintf "Lookup exception in compiler: %s" (err.Exception.ToString())) | _ -> () - elif ReportWarning tcConfigB.errorSeverityOptions err then + elif ReportDiagnosticAsWarning tcConfigB.errorSeverityOptions (err, severity) then + x.HandleIssue(tcConfigB, err, FSharpDiagnosticSeverity.Warning) + + elif ReportDiagnosticAsInfo tcConfigB.errorSeverityOptions (err, severity) then x.HandleIssue(tcConfigB, err, severity) diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 8d9e85fd273..13983a01d36 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -566,15 +566,22 @@ type internal ErrorLoggerThatStopsOnFirstError(tcConfigB:TcConfigBuilder, fsiStd member x.ResetErrorCount() = errorCount <- 0 override x.DiagnosticSink(err, severity) = - if (severity = FSharpDiagnosticSeverity.Error) || ReportWarningAsError tcConfigB.errorSeverityOptions err then + if ReportDiagnosticAsError tcConfigB.errorSeverityOptions (err, severity) then fsiStdinSyphon.PrintError(tcConfigB,err) errorCount <- errorCount + 1 if tcConfigB.abortOnError then exit 1 (* non-zero exit code *) // STOP ON FIRST ERROR (AVOIDS PARSER ERROR RECOVERY) raise StopProcessing - else - DoWithDiagnosticColor severity (fun () -> - if ReportWarning tcConfigB.errorSeverityOptions err then + elif ReportDiagnosticAsWarning tcConfigB.errorSeverityOptions (err, severity) then + DoWithDiagnosticColor FSharpDiagnosticSeverity.Warning (fun () -> + fsiConsoleOutput.Error.WriteLine() + writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err + writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,severity)) err + fsiConsoleOutput.Error.WriteLine() + fsiConsoleOutput.Error.WriteLine() + fsiConsoleOutput.Error.Flush()) + elif ReportDiagnosticAsInfo tcConfigB.errorSeverityOptions (err, severity) then + DoWithDiagnosticColor FSharpDiagnosticSeverity.Info (fun () -> fsiConsoleOutput.Error.WriteLine() writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,severity)) err @@ -2400,7 +2407,7 @@ type internal FsiInteractionProcessor let parseExpression (tokenizer:LexFilter.LexFilter) = reusingLexbufForParsing tokenizer.LexBuffer (fun () -> - Parser.typedSeqExprEOF (fun _ -> tokenizer.GetToken()) tokenizer.LexBuffer) + Parser.typedSequentialExprEOF (fun _ -> tokenizer.GetToken()) tokenizer.LexBuffer) let mainThreadProcessParsedExpression ctok errorLogger (expr, istate) = istate |> InteractiveCatch errorLogger (fun istate -> diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index 7e83493df52..cbbdece5bd2 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -38,12 +38,6 @@ let exprFromParseError (e:SynExpr) = SynExpr.FromParseError (e, e.Range) let patFromParseError (e:SynPat) = SynPat.FromParseError(e, e.Range) -let mkSynOptionalExpr (m: range) xopt = - let m = m.MakeSynthetic() - match xopt with - | None -> mkSynLidGet m FSharpLib.CorePath "None" - | Some x -> SynExpr.App (ExprAtomicFlag.NonAtomic, false, mkSynLidGet m FSharpLib.CorePath "Some", x, m) - // record bindings returned by the recdExprBindings rule has shape: // (binding, separator-before-this-binding) // this function converts arguments from form @@ -314,8 +308,8 @@ let rangeOfLongIdent(lid:LongIdent) = %token COMMENT WHITESPACE HASH_LINE HASH_LIGHT INACTIVECODE LINE_COMMENT STRING_TEXT EOF %token HASH_IF HASH_ELSE HASH_ENDIF -%start signatureFile implementationFile interaction typedSeqExprEOF typEOF -%type typedSeqExprEOF +%start signatureFile implementationFile interaction typedSequentialExprEOF typEOF +%type typedSequentialExprEOF %type implementationFile %type signatureFile %type interaction @@ -330,7 +324,7 @@ let rangeOfLongIdent(lid:LongIdent) = %type declExprBlock %type headBindingPattern %type atomicExprAfterType -%type typedSeqExprBlock +%type typedSequentialExprBlock %type atomicExpr %type tyconDefnOrSpfnSimpleRepr %type <(SynEnumCase, SynUnionCase) Choice list> unionTypeRepr @@ -496,10 +490,9 @@ let rangeOfLongIdent(lid:LongIdent) = %right COLON_EQUALS %nonassoc pat_tuple expr_tuple %left COMMA -%nonassoc slice_expr /* matrix.[e COMMA e] has higher precedence than "e COMMA e" */ +%nonassoc open_range_expr +%left DOT_DOT /* for matrix.[1..2, 3..4] the ".." has higher precedence than expression "2 COMMA 3" */ %nonassoc interpolation_fill /* "...{3,N4}..." .NET style fill has higher precedence than "e COMMA e" */ -%nonassoc DOT_DOT /* for matrix.[1..2, 3..4] the ".." has higher precedence than expression "2 COMMA 3" */ -%nonassoc slice_comma /* for matrix.[1..2, 3..4] the ", " has higher precedence than ".." */ %nonassoc paren_pat_colon %nonassoc paren_pat_attribs %left OR BAR_BAR JOIN_IN @@ -1712,7 +1705,7 @@ classDefnMemberGetSetElements: { [$1;$3] } classDefnMemberGetSetElement: - | opt_inline opt_attributes bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSeqExprBlock + | opt_inline opt_attributes bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock { let mRhs = ($6 : SynExpr).Range ($1, $2, $3, $4, $6, mRhs) } @@ -1720,7 +1713,7 @@ classDefnMemberGetSetElement: /* The core of a member definition */ memberCore: /* Methods and simple getter properties */ - | opt_inline bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSeqExprBlock + | opt_inline bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock { let mRhs = $5.Range let optReturnType = $3 let bindingBuilder, mBindLhs = $2 @@ -1987,7 +1980,7 @@ classDefnMember: let isStatic, flags = $3 $4 $1 isStatic flags rangeStart } - | opt_attributes opt_declVisibility NEW atomicPattern optAsSpec EQUALS typedSeqExprBlock opt_ODECLEND + | opt_attributes opt_declVisibility NEW atomicPattern optAsSpec EQUALS typedSequentialExprBlock opt_ODECLEND { let mWholeBindLhs = rhs2 parseState 1 (if Option.isSome $5 then 5 else 4) let m = unionRanges mWholeBindLhs $7.Range let expr = $7 @@ -2017,7 +2010,7 @@ valDefnDecl: /* An auto-property definition in an object type definition */ autoPropsDefnDecl: - | VAL opt_mutable opt_access ident opt_typ EQUALS typedSeqExprBlock classMemberSpfnGetSet + | VAL opt_mutable opt_access ident opt_typ EQUALS typedSequentialExprBlock classMemberSpfnGetSet { let doc = grabXmlDoc(parseState, 5) let mGetSetOpt, getSet = $8 if $2 then @@ -2614,7 +2607,7 @@ defnBindings: /* A 'do ...' statement in the non-#light syntax */ doBinding: - | DO typedSeqExprBlock + | DO typedSequentialExprBlock { let mDoKwd = rhs parseState 1 let mWhole = unionRanges mDoKwd $2.Range // any attributes prior to the 'let' are left free, e.g. become top-level attributes @@ -2650,7 +2643,7 @@ hardwhiteLetBindings: /* A 'do ...' statement */ hardwhiteDoBinding: - | ODO typedSeqExprBlock hardwhiteDefnBindingsTerminator + | ODO typedSequentialExprBlock hardwhiteDefnBindingsTerminator { let mLetKwd = rhs parseState 1 let bindingSetRange = unionRanges mLetKwd $2.Range let seqPt = DebugPointAtBinding.NoneAtDo @@ -2868,7 +2861,7 @@ typedExprWithStaticOptimizationsBlock: { $1 } typedExprWithStaticOptimizations : - | typedSeqExpr opt_staticOptimizations + | typedSequentialExpr opt_staticOptimizations { $1, List.rev $2 } opt_staticOptimizations: @@ -2879,7 +2872,7 @@ opt_staticOptimizations: { [] } staticOptimization: - | WHEN staticOptimizationConditions EQUALS typedSeqExprBlock + | WHEN staticOptimizationConditions EQUALS typedSequentialExprBlock { ($2, $4) } staticOptimizationConditions: @@ -3313,20 +3306,20 @@ listPatternElements: { $1 :: $3 } /* The lexfilter likes to insert OBLOCKBEGIN/OBLOCKEND pairs */ -typedSeqExprBlock: - | OBLOCKBEGIN typedSeqExpr oblockend +typedSequentialExprBlock: + | OBLOCKBEGIN typedSequentialExpr oblockend { $2 } - | OBLOCKBEGIN typedSeqExpr recover + | OBLOCKBEGIN typedSequentialExpr recover { if not $3 then reportParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedEndOfFileExpression()) exprFromParseError $2 } - | typedSeqExpr + | typedSequentialExpr { $1 } /* The lexfilter likes to insert OBLOCKBEGIN/OBLOCKEND pairs */ declExprBlock: - | OBLOCKBEGIN typedSeqExpr oblockend + | OBLOCKBEGIN typedSequentialExpr oblockend { $2 } | declExpr @@ -3334,26 +3327,26 @@ declExprBlock: /* For some constructs the lex filter can't be sure to insert a matching OBLOCKEND, e.g. "function a -> b | c -> d" all in one line */ /* for these it only inserts a trailing ORIGHT_BLOCK_END */ -typedSeqExprBlockR: - | typedSeqExpr ORIGHT_BLOCK_END +typedSequentialExprBlockR: + | typedSequentialExpr ORIGHT_BLOCK_END { $1 } - | typedSeqExpr + | typedSequentialExpr { $1 } -typedSeqExpr: - | seqExpr COLON typeWithTypeConstraints +typedSequentialExpr: + | sequentialExpr COLON typeWithTypeConstraints { SynExpr.Typed ($1, $3, unionRanges $1.Range $3.Range) } - | seqExpr + | sequentialExpr { $1 } -typedSeqExprEOF: - | typedSeqExpr EOF +typedSequentialExprEOF: + | typedSequentialExpr EOF { checkEndOfFileError $2; $1 } -seqExpr: - | declExpr seps seqExpr +sequentialExpr: + | declExpr seps sequentialExpr { SynExpr.Sequential (DebugPointAtSequential.SuppressNeither, true, $1, $3, unionRanges $1.Range $3.Range) } | declExpr seps @@ -3362,10 +3355,10 @@ seqExpr: | declExpr %prec SEMICOLON { $1 } - | declExpr THEN seqExpr %prec prec_then_before + | declExpr THEN sequentialExpr %prec prec_then_before { SynExpr.Sequential (DebugPointAtSequential.SuppressNeither, false, $1, $3, unionRanges $1.Range $3.Range ) } - | declExpr OTHEN OBLOCKBEGIN typedSeqExpr oblockend %prec prec_then_before + | declExpr OTHEN OBLOCKBEGIN typedSequentialExpr oblockend %prec prec_then_before { SynExpr.Sequential (DebugPointAtSequential.SuppressNeither, false, $1, $4, unionRanges $1.Range $4.Range) } | hardwhiteLetBindings %prec prec_args_error @@ -3388,12 +3381,12 @@ recover: { debugPrint("recovering via EOF"); false } moreBinders: - | AND_BANG headBindingPattern EQUALS typedSeqExprBlock IN moreBinders %prec expr_let + | AND_BANG headBindingPattern EQUALS typedSequentialExprBlock IN moreBinders %prec expr_let { let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 5) (* TODO Pretty sure this is wrong *) let m = rhs parseState 1 (* TODO Pretty sure this is wrong *) (spBind, $1, true, $2, $4, m) :: $6 } - | OAND_BANG headBindingPattern EQUALS typedSeqExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders %prec expr_let + | OAND_BANG headBindingPattern EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders %prec expr_let { $5 "and!" (rhs parseState 1) // report unterminated error let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 5) (* TODO Pretty sure this is wrong *) let m = rhs parseState 1 (* TODO Pretty sure this is wrong *) @@ -3403,7 +3396,7 @@ moreBinders: { [] } declExpr: - | defnBindings IN typedSeqExpr %prec expr_let + | defnBindings IN typedSequentialExpr %prec expr_let { mkLocalBindings (unionRanges (rhs2 parseState 1 2) $3.Range, $1, $3) } | defnBindings IN error %prec expr_let @@ -3412,7 +3405,7 @@ declExpr: FSComp.SR.parsNoMatchingInForLet() -- leave this in for now - it's an unused error string */ - | hardwhiteLetBindings typedSeqExprBlock %prec expr_let + | hardwhiteLetBindings typedSequentialExprBlock %prec expr_let { let hwlb, m = $1 mkLocalBindings (unionRanges m $2.Range, hwlb, $2) } @@ -3421,7 +3414,7 @@ declExpr: reportParseErrorAt (match hwlb with (BindingSetPreAttrs(m, _, _, _, _)) -> m) (FSComp.SR.parsErrorInReturnForLetIncorrectIndentation()) mkLocalBindings (m, hwlb, arbExpr("declExpr2", (rhs parseState 2))) } - | hardwhiteLetBindings OBLOCKSEP typedSeqExprBlock %prec expr_let + | hardwhiteLetBindings OBLOCKSEP typedSequentialExprBlock %prec expr_let { let hwlb, m = $1 mkLocalBindings (unionRanges m $3.Range, hwlb, $3) } @@ -3440,29 +3433,29 @@ declExpr: | anonLambdaExpr %prec expr_fun { $1 } - | MATCH typedSeqExpr withClauses %prec expr_match + | MATCH typedSequentialExpr withClauses %prec expr_match { let mMatch = (rhs parseState 1) let mWith, (clauses, mLast) = $3 let spBind = DebugPointAtBinding.Yes(unionRanges mMatch mWith) SynExpr.Match (spBind, $2, clauses, unionRanges mMatch mLast) } - | MATCH typedSeqExpr recover %prec expr_match + | MATCH typedSequentialExpr recover %prec expr_match { if not $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileMatch()) // Produce approximate expression during error recovery exprFromParseError $2 } - | MATCH_BANG typedSeqExpr withClauses %prec expr_match + | MATCH_BANG typedSequentialExpr withClauses %prec expr_match { let mMatch = (rhs parseState 1) let mWith, (clauses, mLast) = $3 let spBind = DebugPointAtBinding.Yes(unionRanges mMatch mWith) SynExpr.MatchBang (spBind, $2, clauses, unionRanges mMatch mLast) } - | MATCH_BANG typedSeqExpr recover %prec expr_match + | MATCH_BANG typedSequentialExpr recover %prec expr_match { if not $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileMatch()) // Produce approximate expression during error recovery exprFromParseError $2 } - | TRY typedSeqExprBlockR withClauses %prec expr_try + | TRY typedSequentialExprBlockR withClauses %prec expr_try { let mTry = (rhs parseState 1) let spTry = DebugPointAtTry.Yes mTry let mWith, (clauses, mLast) = $3 @@ -3472,13 +3465,13 @@ declExpr: let mTryToLast = unionRanges mTry mLast SynExpr.TryWith ($2, mTryToWith, clauses, mWithToLast, mTryToLast, spTry, spWith) } - | TRY typedSeqExprBlockR recover %prec expr_try + | TRY typedSequentialExprBlockR recover %prec expr_try { // Produce approximate expression during error recovery // Include any expressions to make sure they gets type checked in case that generates useful results for intellisense if not $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileTry()) exprFromParseError $2 } - | TRY typedSeqExprBlockR FINALLY typedSeqExprBlock %prec expr_try + | TRY typedSequentialExprBlockR FINALLY typedSequentialExprBlock %prec expr_try { let mTry = rhs parseState 1 let spTry = DebugPointAtTry.Yes mTry let spFinally = DebugPointAtFinally.Yes (rhs parseState 3) @@ -3524,13 +3517,13 @@ declExpr: | OASSERT %prec expr_assert { raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsAssertIsNotFirstClassValue()) } - | WHILE declExpr doToken typedSeqExprBlock doneDeclEnd + | WHILE declExpr doToken typedSequentialExprBlock doneDeclEnd { let mWhileHeader = unionRanges (rhs parseState 1) $2.Range let spWhile = DebugPointAtWhile.Yes mWhileHeader let mWhileAll = unionRanges (rhs parseState 1) $4.Range SynExpr.While (spWhile, $2, $4, mWhileAll) } - | WHILE declExpr doToken typedSeqExprBlock recover + | WHILE declExpr doToken typedSequentialExprBlock recover { if not $5 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileWhile()) let mWhileHeader = unionRanges (rhs parseState 1) $2.Range let spWhile = DebugPointAtWhile.Yes mWhileHeader @@ -3565,13 +3558,13 @@ declExpr: let mWhileAll = unionRanges (rhs parseState 1) (rhs parseState 3) exprFromParseError (SynExpr.While (spWhile, arbExpr("whileGuard1", mWhileHeader), arbExpr("whileBody3", mWhileBodyArb), mWhileAll)) } - | FOR forLoopBinder doToken typedSeqExprBlock doneDeclEnd + | FOR forLoopBinder doToken typedSequentialExprBlock doneDeclEnd { let mForLoopHeader = rhs2 parseState 1 3 let spBind = DebugPointAtFor.Yes mForLoopHeader let (a, b, _) = $2 SynExpr.ForEach (spBind, SeqExprOnly false, true, a, b, $4, unionRanges (rhs parseState 1) $4.Range) } - | FOR forLoopBinder doToken typedSeqExprBlock ends_coming_soon_or_recover + | FOR forLoopBinder doToken typedSequentialExprBlock ends_coming_soon_or_recover { if not $5 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileFor()) let mForLoopHeader = rhs2 parseState 1 3 let spBind = DebugPointAtFor.Yes mForLoopHeader @@ -3606,14 +3599,14 @@ declExpr: let mForLoopAll = rhs2 parseState 1 3 SynExpr.ForEach (spBind, SeqExprOnly false, true, a, b, arbExpr("forLoopBody1", mForLoopBodyArb), mForLoopAll) } - | FOR forLoopRange doToken typedSeqExprBlock doneDeclEnd + | FOR forLoopRange doToken typedSequentialExprBlock doneDeclEnd { let mForLoopHeader = rhs2 parseState 1 3 let spBind = DebugPointAtFor.Yes mForLoopHeader let (a, b, c, d) = $2 let mForLoopAll = unionRanges (rhs parseState 1) $4.Range SynExpr.For (spBind, a, b, c, d, $4, mForLoopAll) } - | FOR forLoopRange doToken typedSeqExprBlock recover + | FOR forLoopRange doToken typedSequentialExprBlock recover { if not $5 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileFor()) // Still produce an expression let mForLoopHeader = rhs2 parseState 1 3 @@ -3650,7 +3643,7 @@ declExpr: exprFromParseError (SynExpr.For (spBind, a, b, c, d, arbExpr("declExpr11", mForLoopBodyArb), mForLoopAll)) } - | FOR error doToken typedSeqExprBlock doneDeclEnd + | FOR error doToken typedSequentialExprBlock doneDeclEnd { // silent recovery let mForLoopHeader = rhs2 parseState 1 2 let mForLoopAll = unionRanges (rhs parseState 1) $4.Range @@ -3691,29 +3684,29 @@ declExpr: { let mYieldAll = rhs parseState 1 SynExpr.YieldOrReturnFrom (($1, not $1), arbExpr("yield!", mYieldAll), mYieldAll) } - | BINDER headBindingPattern EQUALS typedSeqExprBlock IN opt_OBLOCKSEP moreBinders typedSeqExprBlock %prec expr_let + | BINDER headBindingPattern EQUALS typedSequentialExprBlock IN opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let { let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 5) let m = unionRanges (rhs parseState 1) $8.Range SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, $2, $4, $7, $8, m) } - | OBINDER headBindingPattern EQUALS typedSeqExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders typedSeqExprBlock %prec expr_let + | OBINDER headBindingPattern EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let { $5 (if $1 = "use" then "use!" else "let!") (rhs parseState 1) // report unterminated error let spBind = DebugPointAtBinding.Yes(unionRanges (rhs parseState 1) $4.Range) let m = unionRanges (rhs parseState 1) $8.Range SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, $2, $4, $7, $8, m) } - | OBINDER headBindingPattern EQUALS typedSeqExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP error %prec expr_let + | OBINDER headBindingPattern EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP error %prec expr_let { // error recovery that allows intellisense when writing incomplete computation expressions let spBind = DebugPointAtBinding.Yes(unionRanges (rhs parseState 1) $4.Range) let mAll = unionRanges (rhs parseState 1) (rhs parseState 7) let m = $4.Range.EndRange // zero-width range SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, $2, $4, [], SynExpr.ImplicitZero m, mAll) } - | DO_BANG typedSeqExpr IN opt_OBLOCKSEP typedSeqExprBlock %prec expr_let + | DO_BANG typedSequentialExpr IN opt_OBLOCKSEP typedSequentialExprBlock %prec expr_let { let spBind = DebugPointAtBinding.NoneAtDo SynExpr.LetOrUseBang(spBind, false, true, SynPat.Const(SynConst.Unit, $2.Range), $2, [], $5, unionRanges (rhs parseState 1) $5.Range) } - | ODO_BANG typedSeqExprBlock hardwhiteDefnBindingsTerminator %prec expr_let + | ODO_BANG typedSequentialExprBlock hardwhiteDefnBindingsTerminator %prec expr_let { SynExpr.DoBang ($2, unionRanges (rhs parseState 1) $2.Range) } | FOR forLoopBinder opt_OBLOCKSEP arrowThenExprR %prec expr_let @@ -3723,7 +3716,7 @@ declExpr: | FIXED declExpr { SynExpr.Fixed ($2, (unionRanges (rhs parseState 1) $2.Range)) } - | RARROW typedSeqExprBlockR + | RARROW typedSequentialExprBlockR { errorR(Error(FSComp.SR.parsArrowUseIsLimited(), lhs parseState)) SynExpr.YieldOrReturn ((true, true), $2, (unionRanges (rhs parseState 1) $2.Range)) } @@ -3892,6 +3885,32 @@ declExpr: { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression($2)) exprFromParseError(mkSynInfix (rhs parseState 2) $1 $2 (arbExpr("declExprInfix", (rhs parseState 3).StartRange))) } + | declExpr DOT_DOT declExpr + { let wholem = rhs2 parseState 1 3 + let opm = rhs parseState 2 + SynExpr.IndexRange(Some $1, opm, Some $3, rhs parseState 1, rhs parseState 3, wholem) } + + | declExpr DOT_DOT %prec open_range_expr + { let wholem = rhs2 parseState 1 2 + let opm = rhs parseState 2 + SynExpr.IndexRange(Some $1, opm, None, rhs parseState 1, opm, wholem) } + + | DOT_DOT declExpr %prec open_range_expr + { let wholem = rhs2 parseState 1 2 + let opm = rhs parseState 1 + SynExpr.IndexRange(None, opm, Some $2, opm, rhs parseState 2, wholem) } + + | STAR + { let m = rhs parseState 1 + SynExpr.IndexRange(None, m, None, m, m, m) } + + | INFIX_AT_HAT_OP declExpr + { if not (parseState.LexBuffer.SupportsFeature LanguageFeature.FromEndSlicing) then + raiseParseErrorAt (rhs parseState 1) (FSComp.SR.fromEndSlicingRequiresVFive()) + if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidPrefixOperator()) + let m = (rhs2 parseState 1 2) + SynExpr.IndexFromEnd($2, m) } + | minusExpr %prec expr_prefix_plus_minus { $1 } dynamicArg: @@ -3900,7 +3919,7 @@ dynamicArg: let arg2 = SynExpr.Const (con, con.Range (rhs parseState 1)) arg2 } - | LPAREN typedSeqExpr rparen + | LPAREN typedSequentialExpr rparen { $2 } withClauses: @@ -3985,7 +4004,7 @@ patternGuard: { None } patternResult: - | RARROW typedSeqExprBlockR + | RARROW typedSequentialExprBlockR { let mArrow = rhs parseState 1 mArrow, $2 } @@ -4004,10 +4023,10 @@ ifExprThen: | THEN declExpr %prec prec_then_if { $2, rhs parseState 1 } - | OTHEN OBLOCKBEGIN typedSeqExpr oblockend %prec prec_then_if + | OTHEN OBLOCKBEGIN typedSequentialExpr oblockend %prec prec_then_if { $3, rhs parseState 1 } - | OTHEN OBLOCKBEGIN typedSeqExpr recover %prec prec_then_if + | OTHEN OBLOCKBEGIN typedSequentialExpr recover %prec prec_then_if { if not $4 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileThen()) exprFromParseError $3, rhs parseState 1 } @@ -4019,11 +4038,11 @@ ifExprElifs: { let mElse = rhs parseState 1 Some mElse, Some $2 } - | OELSE OBLOCKBEGIN typedSeqExpr oblockend + | OELSE OBLOCKBEGIN typedSequentialExpr oblockend { let mElse = rhs parseState 1 Some mElse, Some $3 } - | OELSE OBLOCKBEGIN typedSeqExpr recover + | OELSE OBLOCKBEGIN typedSequentialExpr recover { let mElse = rhs parseState 1 if not $4 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileElse()) Some mElse, Some (exprFromParseError $3) } @@ -4123,8 +4142,8 @@ argExpr: atomicExpr: | atomicExpr HIGH_PRECEDENCE_BRACK_APP atomicExpr { let arg1, _ = $1 - let arg2, _ = $3 - SynExpr.App (ExprAtomicFlag.Atomic, false, arg1, arg2, unionRanges arg1.Range arg2.Range), true } + let arg2, hpa = $3 + SynExpr.App (ExprAtomicFlag.Atomic, false, arg1, arg2, unionRanges arg1.Range arg2.Range), hpa } | atomicExpr HIGH_PRECEDENCE_PAREN_APP atomicExpr { let arg1, _ = $1 @@ -4164,11 +4183,11 @@ atomicExpr: { $1, false } | LBRACK listExprElements RBRACK - { $2 (lhs parseState) false, false } + { $2 (lhs parseState), false } | LBRACK listExprElements recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) - exprFromParseError ($2 (rhs2 parseState 1 2) false), false } + exprFromParseError ($2 (rhs2 parseState 1 2)), false } | LBRACK error RBRACK { // silent recovery @@ -4220,89 +4239,32 @@ atomicExprQualification: if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError(lhs parseState) SynExpr.LibraryOnlyUnionCaseFieldGet (e, mkSynCaseName lhsm opNameCons, (fst $5), lhsm)) } - | LPAREN typedSeqExpr rparen + | LPAREN typedSequentialExpr rparen { (fun e lhsm dotm -> - mlCompatWarning (FSComp.SR.parsParenFormIsForML()) (lhs parseState) - mkSynDotParenGet lhsm dotm e $2) } - - | LBRACK typedSeqExpr RBRACK - { (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e $2 false) } - - | LBRACK typedSeqExpr recover + // Check for expr.( * ) + // Note that "*" is parsed as an expression (it is allowed in "foo.[3,*]") + match $2 with + | SynExpr.IndexRange (None, opm, None, _m1, _m2, _) -> + mkSynDot dotm lhsm e (ident(CompileOpName "*", opm)) + | _ -> + mlCompatWarning (FSComp.SR.parsParenFormIsForML()) (lhs parseState) + mkSynDotParenGet lhsm dotm e $2) } + + | LBRACK typedSequentialExpr RBRACK + { (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e $2) } + + | LBRACK typedSequentialExpr recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e $2 false)) } - - | LBRACK optRangeSeqExpr RBRACK - { (fun e lhsm dotm -> mkSynDotBrackSeqSliceGet lhsm dotm e $2) } - - | LBRACK optRangeSeqExpr recover - { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackSeqSliceGet lhsm dotm e $2)) } + (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e $2)) } | LBRACK error RBRACK { let mArg = rhs2 parseState 1 3 - (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr1", mArg)) false) } + (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr1", mArg))) } | LBRACK recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) let mArg = (rhs parseState 1).EndRange - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr2", mArg)) false)) } - -optRangeSeqExpr: - - | optRange COMMA optRangeSeqExpr %prec slice_comma { $1 :: $3 } - - | optRange { [$1] } - -optRange: - | rangeDeclExpr DOT_DOT rangeDeclExpr - { SynIndexerArg.Two( - mkSynOptionalExpr (rhs parseState 1) (Some (fst $1)), - (snd $1), - mkSynOptionalExpr (rhs parseState 3) (Some (fst $3)), - (snd $3), - (rhs parseState 1), - (rhs parseState 3)) } - - | rangeDeclExpr DOT_DOT - { SynIndexerArg.Two( - mkSynOptionalExpr (rhs parseState 1) (Some (fst $1)), - (snd $1), - mkSynOptionalExpr (rhs parseState 2) None, - false, - (rhs parseState 1), - (rhs parseState 2)) } - - | DOT_DOT rangeDeclExpr - { SynIndexerArg.Two( - mkSynOptionalExpr (rhs parseState 1) None, - false, - mkSynOptionalExpr (rhs parseState 2) (Some (fst $2)), - (snd $2), - (rhs parseState 2), - (rhs parseState 1)) } - - | STAR - { SynIndexerArg.Two( - mkSynOptionalExpr (rhs parseState 1) None, - false, - (mkSynOptionalExpr (rhs parseState 1) None), - false, - (rhs parseState 1), - (rhs parseState 1)) } - - | rangeDeclExpr - { SynIndexerArg.One((fst $1), (snd $1), (rhs parseState 1)) } - -rangeDeclExpr: - | declExpr %prec slice_expr - { $1, false } - - | INFIX_AT_HAT_OP declExpr %prec slice_expr - { if not (parseState.LexBuffer.SupportsFeature LanguageFeature.FromEndSlicing) then - raiseParseErrorAt (rhs parseState 1) (FSComp.SR.fromEndSlicingRequiresVFive()) - if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidPrefixOperator()) - $2, true } + (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr2", mArg)))) } /* the start of atomicExprAfterType must not overlap with the valid postfix tokens of the type syntax, e.g. new List(...) */ atomicExprAfterType: @@ -4341,10 +4303,10 @@ atomicExprAfterType: { $1 } beginEndExpr: - | BEGIN typedSeqExpr END + | BEGIN typedSequentialExpr END { SynExpr.Paren ($2, rhs parseState 1, Some(rhs parseState 3), rhs2 parseState 1 3) } - | BEGIN typedSeqExpr recover + | BEGIN typedSequentialExpr recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBegin()); exprFromParseError $2 } | BEGIN error END @@ -4354,11 +4316,11 @@ beginEndExpr: { mkSynUnit (lhs parseState) } quoteExpr: - | LQUOTE typedSeqExpr RQUOTE + | LQUOTE typedSequentialExpr RQUOTE { if $1 <> $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsMismatchedQuote(fst $1)) (SynExpr.Quote (mkSynIdGet (lhs parseState) (CompileOpName (fst $1)), snd $1, $2, false, lhs parseState)) } - | LQUOTE typedSeqExpr recover + | LQUOTE typedSequentialExpr recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatched(fst $1)) let mExpr = rhs2 parseState 1 2 exprFromParseError (SynExpr.Quote (mkSynIdGet (lhs parseState) (CompileOpName (fst $1)), snd $1, $2, false, mExpr)) } @@ -4371,12 +4333,12 @@ quoteExpr: exprFromParseError (SynExpr.Quote (mkSynIdGet (lhs parseState) (CompileOpName (fst $1)), snd $1, arbExpr("quoteExpr2", (rhs parseState 1).EndRange), false, rhs parseState 1)) } arrayExpr: - | LBRACK_BAR listExprElements BAR_RBRACK - { $2 (lhs parseState) true } + | LBRACK_BAR arrayExprElements BAR_RBRACK + { $2 (lhs parseState) } - | LBRACK_BAR listExprElements recover + | LBRACK_BAR arrayExprElements recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracketBar()) - exprFromParseError ($2 (rhs2 parseState 1 2) true) } + exprFromParseError ($2 (rhs2 parseState 1 2)) } | LBRACK_BAR error BAR_RBRACK { (* silent recovery *) SynExpr.ArrayOrList (true, [ ], lhs parseState) } @@ -4435,10 +4397,10 @@ parenExpr: //arbExpr("parenExpr2", lhsm) } parenExprBody: - | staticallyKnownHeadTypars COLON LPAREN classMemberSpfn rparen typedSeqExpr + | staticallyKnownHeadTypars COLON LPAREN classMemberSpfn rparen typedSequentialExpr { (fun m -> SynExpr.TraitCall ($1, $4, $6, m)) } /* disambiguate: x $a.id(x) */ - | typedSeqExpr + | typedSequentialExpr { (fun _m -> $1) } | inlineAssemblyExpr @@ -4488,60 +4450,35 @@ braceExprBody: | objExpr { $1 } - | monadicExprInitial - { let m, r = $1 in (m, r false) } + | computationExpr + { $1 } listExprElements: - | monadicExprInitial - { let m, r = $1 in (fun lhsm isArray -> SynExpr.ArrayOrListOfSeqExpr (isArray, r true m, lhsm)) } + | sequentialExpr + { (fun lhsm -> SynExpr.ArrayOrListComputed (false, $1, lhsm)) } | - { (fun lhsm isArray -> SynExpr.ArrayOrList (isArray, [ ], lhsm)) } + { (fun lhsm -> SynExpr.ArrayOrList (false, [ ], lhsm)) } -monadicExprInitial: - | seqExpr - { $1.Range, (fun isArrayOrList lhsm -> SynExpr.CompExpr (isArrayOrList, ref(isArrayOrList), $1, lhsm)) } +arrayExprElements: + | sequentialExpr + { (fun lhsm -> SynExpr.ArrayOrListComputed (true, $1, lhsm)) } - | rangeSequenceExpr - { $1 } - -rangeSequenceExpr: - | declExpr DOT_DOT declExpr - { let opm = (rhs parseState 2) - (unionRanges $1.Range $3.Range), (fun _isArray wholem -> - // in the case of "{ 1 .. 10 }", we want the range of the expression to include the curlies, that comes from a higher level rule in the grammar, - // passed down as 'wholem', so patch up that range here - match (mkSynInfix opm $1 ".." $3) with - | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, wholem) - | _ -> failwith "impossible") } - - | declExpr DOT_DOT declExpr DOT_DOT declExpr - { (unionRanges $1.Range $5.Range), (fun _isArray wholem -> mkSynTrifix wholem ".. .." $1 $3 $5) } - - | declExpr DOT_DOT recover - { if not $3 then reportParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedEndOfFileExpression()) - let opm = (rhs parseState 2) - let e = arbExpr("rangeSeqError1", (rhs parseState 3).StartRange) - (unionRanges $1.Range e.Range), (fun _isArray wholem -> - // in the case of "{ 1 .. 10 }", we want the range of the expression to include the curlies, that comes from a higher level rule in the grammar, - // passed down as 'wholem', so patch up that range here - match (mkSynInfix opm $1 ".." e) with - | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, wholem) - | _ -> failwith "impossible") } + | + { (fun lhsm -> SynExpr.ArrayOrList (true, [ ], lhsm)) } +computationExpr: + | sequentialExpr + { $1.Range, (fun lhsm -> SynExpr.ComputationExpr (false, $1, lhsm)) } arrowThenExprR: - | RARROW typedSeqExprBlockR + | RARROW typedSequentialExprBlockR { SynExpr.YieldOrReturn ((true, false), $2, unionRanges (rhs parseState 1) $2.Range) } - forLoopBinder: | parenPattern IN declExpr { ($1, $3, true) } - | parenPattern IN rangeSequenceExpr - { let m, r = $3 in ($1, r false m, true) } - | parenPattern IN ends_coming_soon_or_recover { if not $3 then reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsExpectedExpressionAfterToken()) ($1, arbExpr("forLoopBinder", (rhs parseState 2)), false) } @@ -4554,9 +4491,6 @@ forLoopRange: | parenPattern EQUALS declExpr forLoopDirection declExpr { idOfPat parseState (rhs parseState 1) $1, $3, $4, $5 } - | parenPattern EQUALS rangeSequenceExpr - { raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolEqualsInsteadOfIn()) } - forLoopDirection: | TO { true } @@ -4842,7 +4776,7 @@ braceBarExprCore: (fun isStruct -> SynExpr.AnonRecd (isStruct, None, [], m)) } anonLambdaExpr: - | FUN atomicPatterns RARROW typedSeqExprBlock + | FUN atomicPatterns RARROW typedSequentialExprBlock { let mAll = unionRanges (rhs parseState 1) $4.Range let mArrow = Some (rhs parseState 3) mkSynFunMatchLambdas parseState.SynArgNameGenerator false mAll $2 mArrow $4 } @@ -4852,12 +4786,12 @@ anonLambdaExpr: let mArrow = Some (rhs parseState 3) mkSynFunMatchLambdas parseState.SynArgNameGenerator false mAll $2 mArrow (arbExpr("anonLambdaExpr1", (rhs parseState 4))) } - | OFUN atomicPatterns RARROW typedSeqExprBlockR OEND + | OFUN atomicPatterns RARROW typedSequentialExprBlockR OEND { let mAll = unionRanges (rhs parseState 1) $4.Range let mArrow = Some (rhs parseState 3) mkSynFunMatchLambdas parseState.SynArgNameGenerator false mAll $2 mArrow $4 } - | OFUN atomicPatterns RARROW typedSeqExprBlockR recover + | OFUN atomicPatterns RARROW typedSequentialExprBlockR recover { if not $5 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedEndOfFileFunBody()); let mAll = unionRanges (rhs parseState 1) $4.Range let mArrow = Some (rhs parseState 3) diff --git a/src/fsharp/range.fs b/src/fsharp/range.fs index 68bf286fe4d..b9d43ee376b 100755 --- a/src/fsharp/range.fs +++ b/src/fsharp/range.fs @@ -56,6 +56,9 @@ type Position(code:int64) = override p.ToString() = sprintf "(%d,%d)" p.Line p.Column + member p.IsAdjacentTo(otherPos: Position) = + p.Line = otherPos.Line && p.Column + 1 = otherPos.Column + and pos = Position [] @@ -274,6 +277,9 @@ type Range(code1:int64, code2: int64) = member r.MakeSynthetic() = range(code1, code2 ||| isSyntheticMask) + member r.IsAdjacentTo(otherRange: Range) = + r.FileIndex = otherRange.FileIndex && r.End.Encoding = otherRange.Start.Encoding + member r.NoteDebugPoint(kind) = let code = match kind with @@ -391,7 +397,8 @@ module Range = let e = if (m1.EndLine > m2.EndLine || (m1.EndLine = m2.EndLine && m1.EndColumn > m2.EndColumn)) then m1 else m2 - range (m1.FileIndex, b.StartLine, b.StartColumn, e.EndLine, e.EndColumn) + let m = range (m1.FileIndex, b.StartLine, b.StartColumn, e.EndLine, e.EndColumn) + if m1.IsSynthetic || m2.IsSynthetic then m.MakeSynthetic() else m let rangeContainsRange (m1:range) (m2:range) = m1.FileIndex = m2.FileIndex && diff --git a/src/fsharp/range.fsi b/src/fsharp/range.fsi index 13d604afee4..8913f498b07 100755 --- a/src/fsharp/range.fsi +++ b/src/fsharp/range.fsi @@ -30,6 +30,9 @@ type Position = /// The encoding of the position as a 64-bit integer member internal Encoding: int64 + /// Check if the position is adjacent to another postition + member internal IsAdjacentTo: otherPos: Position -> bool + /// Decode a position fro a 64-bit integer static member internal Decode: int64 -> pos @@ -88,6 +91,9 @@ type Range = /// Note that a range indicates a debug point member internal NoteDebugPoint: kind: RangeDebugPointKind -> range + /// Check if the range is adjacent to another range + member internal IsAdjacentTo: otherRange: Range -> bool + /// Convert a range to string member internal ToShortString: unit -> string diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs index 51d38c55f10..a0d5572617e 100644 --- a/src/fsharp/service/FSharpCheckerResults.fs +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -1793,19 +1793,23 @@ module internal ParseAndCheckFile = let diagnostics = errorGroupedByFileName |> Array.map(fun (_,(pe,f)) -> pe.Exception,f) // Strip the build phase here. It will be replaced, in total, with TypeCheck let errors = [ for err, sev in diagnostics do if sev = FSharpDiagnosticSeverity.Error then yield err ] let warnings = [ for err, sev in diagnostics do if sev = FSharpDiagnosticSeverity.Warning then yield err ] + let infos = [ for err, sev in diagnostics do if sev = FSharpDiagnosticSeverity.Info then yield err ] - let message = HashLoadedSourceHasIssues(warnings,errors,rangeOfHashLoad) - if isNil errors then + let message = HashLoadedSourceHasIssues(infos, warnings, errors, rangeOfHashLoad) + if isNil errors && isNil warnings then + warning message + elif isNil errors then warning message else errorR message // Replay other background errors. for phasedError, sev in otherBackgroundDiagnostics do - if sev = FSharpDiagnosticSeverity.Warning then - warning phasedError.Exception - else - errorR phasedError.Exception + match sev with + | FSharpDiagnosticSeverity.Info -> informationalWarning phasedError.Exception + | FSharpDiagnosticSeverity.Warning -> warning phasedError.Exception + | FSharpDiagnosticSeverity.Error -> errorR phasedError.Exception + | FSharpDiagnosticSeverity.Hidden -> () | None -> // For non-scripts, check for disallow #r and #load. diff --git a/src/fsharp/service/FSharpParseFileResults.fs b/src/fsharp/service/FSharpParseFileResults.fs index 270797e9407..39e7f852aa6 100644 --- a/src/fsharp/service/FSharpParseFileResults.fs +++ b/src/fsharp/service/FSharpParseFileResults.fs @@ -160,7 +160,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, match expr with | SynExpr.TypeApp (_, _, _, _, _, _, range) when rangeContainsPos range pos -> Some range - | SynExpr.App(_, _, _, SynExpr.CompExpr (_, _, expr, _), range) when rangeContainsPos range pos -> + | SynExpr.App(_, _, _, SynExpr.ComputationExpr (_, expr, _), range) when rangeContainsPos range pos -> traverseSynExpr expr | SynExpr.App (_, _, _, _, range) when rangeContainsPos range pos -> Some range @@ -186,8 +186,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | SynExpr.App (_, _, _, _, range) when rangeContainsPos range pos -> getIdentRangeForFuncExprInApp traverseSynExpr argExpr pos - // Special case: `async { ... }` is actually a CompExpr inside of the argExpr of a SynExpr.App - | SynExpr.CompExpr (_, _, expr, range) when rangeContainsPos range pos -> + // Special case: `async { ... }` is actually a ComputationExpr inside of the argExpr of a SynExpr.App + | SynExpr.ComputationExpr (_, expr, range) when rangeContainsPos range pos -> getIdentRangeForFuncExprInApp traverseSynExpr expr pos | SynExpr.Paren (expr, _, _, range) when rangeContainsPos range pos -> @@ -499,8 +499,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | SynExpr.TypeTest (e, _, _) | SynExpr.Upcast (e, _, _) | SynExpr.AddressOf (_, e, _, _) - | SynExpr.CompExpr (_, _, e, _) - | SynExpr.ArrayOrListOfSeqExpr (_, e, _) + | SynExpr.ComputationExpr (_, e, _) + | SynExpr.ArrayOrListComputed (_, e, _) | SynExpr.Typed (e, _, _) | SynExpr.FromParseError (e, _) | SynExpr.DiscardAfterMissingQualificationAfterDot (e, _) @@ -660,11 +660,18 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | SynExpr.DotIndexedGet (e1, es, _, _) -> yield! walkExpr false e1 - yield! walkExprs [ for e in es do yield! e.Exprs ] + yield! walkExpr false es + + | SynExpr.IndexRange (expr1, _, expr2, _, _, _) -> + match expr1 with Some e -> yield! walkExpr false e | None -> () + match expr2 with Some e -> yield! walkExpr false e | None -> () + + | SynExpr.IndexFromEnd (e, _) -> + yield! walkExpr false e | SynExpr.DotIndexedSet (e1, es, e2, _, _, _) -> yield! walkExpr false e1 - yield! walkExprs [ for e in es do yield! e.Exprs ] + yield! walkExpr false es yield! walkExpr false e2 | SynExpr.DotNamedIndexedPropertySet (e1, _, e2, e3, _) -> diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index afab4e990e7..f22e061d18d 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -52,13 +52,6 @@ module internal CodeGenerationUtils = stringWriter.Dispose() indentWriter.Dispose() - let (|IndexerArg|) = function - | SynIndexerArg.Two(e1, _, e2, _, _, _) -> [e1; e2] - | SynIndexerArg.One (e, _, _) -> [e] - - let (|IndexerArgList|) xs = - List.collect (|IndexerArg|) xs - /// An recursive pattern that collect all sequential expressions to avoid StackOverflowException let rec (|Sequentials|_|) = function | SynExpr.Sequential (_, _, e, Sequentials es, _) -> @@ -808,9 +801,9 @@ module InterfaceStubGenerator = | SynExpr.For (_sequencePointInfoForForLoop, _ident, synExpr1, _, synExpr2, synExpr3, _range) -> List.tryPick walkExpr [synExpr1; synExpr2; synExpr3] - | SynExpr.ArrayOrListOfSeqExpr (_, synExpr, _range) -> + | SynExpr.ArrayOrListComputed (_, synExpr, _range) -> walkExpr synExpr - | SynExpr.CompExpr (_, _, synExpr, _range) -> + | SynExpr.ComputationExpr (_, synExpr, _range) -> walkExpr synExpr | SynExpr.Lambda (_, _, _synSimplePats, _, synExpr, _, _range) -> walkExpr synExpr @@ -871,13 +864,11 @@ module InterfaceStubGenerator = | SynExpr.Set (synExpr1, synExpr2, _range) -> List.tryPick walkExpr [synExpr1; synExpr2] - | SynExpr.DotIndexedGet (synExpr, IndexerArgList synExprList, _range, _range2) -> - Option.orElse (walkExpr synExpr) (List.tryPick walkExpr synExprList) + | SynExpr.DotIndexedGet (synExpr, indexArgs, _range, _range2) -> + Option.orElse (walkExpr synExpr) (walkExpr indexArgs) - | SynExpr.DotIndexedSet (synExpr1, IndexerArgList synExprList, synExpr2, _, _range, _range2) -> - [ yield synExpr1 - yield! synExprList - yield synExpr2 ] + | SynExpr.DotIndexedSet (synExpr1, indexArgs, synExpr2, _, _range, _range2) -> + [ synExpr1; indexArgs; synExpr2 ] |> List.tryPick walkExpr | SynExpr.JoinIn (synExpr1, _range, synExpr2, _range2) -> diff --git a/src/fsharp/service/ServiceParseTreeWalk.fs b/src/fsharp/service/ServiceParseTreeWalk.fs index 62614e6566b..715695347b4 100755 --- a/src/fsharp/service/ServiceParseTreeWalk.fs +++ b/src/fsharp/service/ServiceParseTreeWalk.fs @@ -405,16 +405,16 @@ module SyntaxTraversal = dive synExpr2 synExpr2.Range traverseSynExpr] |> pick expr - | SynExpr.ArrayOrListOfSeqExpr (_, synExpr, _range) -> traverseSynExpr synExpr + | SynExpr.ArrayOrListComputed (_, synExpr, _range) -> traverseSynExpr synExpr - | SynExpr.CompExpr (_, _, synExpr, _range) -> + | SynExpr.ComputationExpr (_, synExpr, _range) -> // now parser treats this syntactic expression as computation expression // { identifier } - // here we detect this situation and treat CompExpr { Identifier } as attempt to create record - // note: sequence expressions use SynExpr.CompExpr too - they need to be filtered out + // here we detect this situation and treat ComputationExpr { Identifier } as attempt to create record + // note: sequence expressions use SynExpr.ComputationExpr too - they need to be filtered out let isPartOfArrayOrList = match origPath with - | SyntaxNode.SynExpr(SynExpr.ArrayOrListOfSeqExpr _) :: _ -> true + | SyntaxNode.SynExpr(SynExpr.ArrayOrListComputed _) :: _ -> true | _ -> false let ok = match isPartOfArrayOrList, synExpr with @@ -511,18 +511,22 @@ module SyntaxTraversal = dive synExpr2 synExpr2.Range traverseSynExpr] |> pick expr - | SynExpr.DotIndexedGet (synExpr, synExprList, _range, _range2) -> + | SynExpr.IndexRange (expr1, _, expr2, _, _, _) -> + [ match expr1 with Some e -> dive e e.Range traverseSynExpr | None -> () + match expr2 with Some e -> dive e e.Range traverseSynExpr | None -> () ] + |> pick expr + + | SynExpr.IndexFromEnd (e, _) -> + traverseSynExpr e + + | SynExpr.DotIndexedGet (synExpr, indexArgs, _range, _range2) -> [yield dive synExpr synExpr.Range traverseSynExpr - for synExpr in synExprList do - for x in synExpr.Exprs do - yield dive x x.Range traverseSynExpr] + yield dive indexArgs indexArgs.Range traverseSynExpr] |> pick expr - | SynExpr.DotIndexedSet (synExpr, synExprList, synExpr2, _, _range, _range2) -> + | SynExpr.DotIndexedSet (synExpr, indexArgs, synExpr2, _, _range, _range2) -> [yield dive synExpr synExpr.Range traverseSynExpr - for synExpr in synExprList do - for x in synExpr.Exprs do - yield dive x x.Range traverseSynExpr + yield dive indexArgs indexArgs.Range traverseSynExpr yield dive synExpr2 synExpr2.Range traverseSynExpr] |> pick expr diff --git a/src/fsharp/service/ServiceParsedInputOps.fs b/src/fsharp/service/ServiceParsedInputOps.fs index 2f8345ab5d6..eff845781d5 100644 --- a/src/fsharp/service/ServiceParsedInputOps.fs +++ b/src/fsharp/service/ServiceParsedInputOps.fs @@ -455,46 +455,46 @@ module ParsedInput = and walkSynModuleOrNamespace isTopLevel (SynModuleOrNamespace(_, _, _, decls, _, Attributes attrs, _, r)) = List.tryPick walkAttribute attrs - |> Option.orElse (ifPosInRange r (fun _ -> List.tryPick (walkSynModuleDecl isTopLevel) decls)) + |> Option.orElseWith (fun () -> ifPosInRange r (fun _ -> List.tryPick (walkSynModuleDecl isTopLevel) decls)) and walkAttribute (attr: SynAttribute) = if isPosInRange attr.Range then Some EntityKind.Attribute else None - |> Option.orElse (walkExprWithKind (Some EntityKind.Type) attr.ArgExpr) + |> Option.orElseWith (fun () -> walkExprWithKind (Some EntityKind.Type) attr.ArgExpr) and walkTypar (SynTypar (ident, _, _)) = ifPosInRange ident.idRange (fun _ -> Some EntityKind.Type) and walkTyparDecl (SynTyparDecl.SynTyparDecl (Attributes attrs, typar)) = List.tryPick walkAttribute attrs - |> Option.orElse (walkTypar typar) + |> Option.orElseWith (fun () -> walkTypar typar) and walkTypeConstraint = function - | SynTypeConstraint.WhereTyparDefaultsToType (t1, t2, _) -> walkTypar t1 |> Option.orElse (walkType t2) + | SynTypeConstraint.WhereTyparDefaultsToType (t1, t2, _) -> walkTypar t1 |> Option.orElseWith (fun () -> walkType t2) | SynTypeConstraint.WhereTyparIsValueType(t, _) -> walkTypar t | SynTypeConstraint.WhereTyparIsReferenceType(t, _) -> walkTypar t | SynTypeConstraint.WhereTyparIsUnmanaged(t, _) -> walkTypar t | SynTypeConstraint.WhereTyparSupportsNull (t, _) -> walkTypar t | SynTypeConstraint.WhereTyparIsComparable(t, _) -> walkTypar t | SynTypeConstraint.WhereTyparIsEquatable(t, _) -> walkTypar t - | SynTypeConstraint.WhereTyparSubtypeOfType(t, ty, _) -> walkTypar t |> Option.orElse (walkType ty) + | SynTypeConstraint.WhereTyparSubtypeOfType(t, ty, _) -> walkTypar t |> Option.orElseWith (fun () -> walkType ty) | SynTypeConstraint.WhereTyparSupportsMember(ts, sign, _) -> - List.tryPick walkType ts |> Option.orElse (walkMemberSig sign) - | SynTypeConstraint.WhereTyparIsEnum(t, ts, _) -> walkTypar t |> Option.orElse (List.tryPick walkType ts) - | SynTypeConstraint.WhereTyparIsDelegate(t, ts, _) -> walkTypar t |> Option.orElse (List.tryPick walkType ts) + List.tryPick walkType ts |> Option.orElseWith (fun () -> walkMemberSig sign) + | SynTypeConstraint.WhereTyparIsEnum(t, ts, _) -> walkTypar t |> Option.orElseWith (fun () -> List.tryPick walkType ts) + | SynTypeConstraint.WhereTyparIsDelegate(t, ts, _) -> walkTypar t |> Option.orElseWith (fun () -> List.tryPick walkType ts) and walkPatWithKind (kind: EntityKind option) = function | SynPat.Ands (pats, _) -> List.tryPick walkPat pats | SynPat.As (pat1, pat2, _) -> List.tryPick walkPat [pat1; pat2] - | SynPat.Typed(pat, t, _) -> walkPat pat |> Option.orElse (walkType t) - | SynPat.Attrib(pat, Attributes attrs, _) -> walkPat pat |> Option.orElse (List.tryPick walkAttribute attrs) + | SynPat.Typed(pat, t, _) -> walkPat pat |> Option.orElseWith (fun () -> walkType t) + | SynPat.Attrib(pat, Attributes attrs, _) -> walkPat pat |> Option.orElseWith (fun () -> List.tryPick walkAttribute attrs) | SynPat.Or(pat1, pat2, _) -> List.tryPick walkPat [pat1; pat2] | SynPat.LongIdent(_, _, typars, ConstructorPats pats, _, r) -> ifPosInRange r (fun _ -> kind) - |> Option.orElse ( + |> Option.orElseWith (fun () -> typars |> Option.bind (fun (ValTyparDecls (typars, constraints, _)) -> List.tryPick walkTyparDecl typars - |> Option.orElse (List.tryPick walkTypeConstraint constraints))) - |> Option.orElse (List.tryPick walkPat pats) + |> Option.orElseWith (fun () -> List.tryPick walkTypeConstraint constraints))) + |> Option.orElseWith (fun () -> List.tryPick walkPat pats) | SynPat.Tuple(_, pats, _) -> List.tryPick walkPat pats | SynPat.Paren(pat, _) -> walkPat pat | SynPat.ArrayOrList(_, pats, _) -> List.tryPick walkPat pats @@ -506,9 +506,9 @@ module ParsedInput = and walkBinding (SynBinding(_, _, _, _, Attributes attrs, _, _, pat, returnInfo, e, _, _)) = List.tryPick walkAttribute attrs - |> Option.orElse (walkPat pat) - |> Option.orElse (walkExpr e) - |> Option.orElse ( + |> Option.orElseWith (fun () -> walkPat pat) + |> Option.orElseWith (fun () -> walkExpr e) + |> Option.orElseWith (fun () -> match returnInfo with | Some (SynBindingReturnInfo (t, _, _)) -> walkType t | None -> None) @@ -516,42 +516,38 @@ module ParsedInput = and walkInterfaceImpl (SynInterfaceImpl(_, bindings, _)) = List.tryPick walkBinding bindings - and walkIndexerArg = function - | SynIndexerArg.One (e, _, _) -> walkExpr e - | SynIndexerArg.Two(e1, _, e2, _, _, _) -> List.tryPick walkExpr [e1; e2] - and walkType = function | SynType.LongIdent ident -> // we protect it with try..with because System.Exception : rangeOfLidwd may raise // at FSharp.Compiler.Syntax.LongIdentWithDots.get_Range() in D:\j\workspace\release_ci_pa---3f142ccc\src\fsharp\ast.fs: line 156 try ifPosInRange ident.Range (fun _ -> Some EntityKind.Type) with _ -> None | SynType.App(ty, _, types, _, _, _, _) -> - walkType ty |> Option.orElse (List.tryPick walkType types) + walkType ty |> Option.orElseWith (fun () -> List.tryPick walkType types) | SynType.LongIdentApp(_, _, _, types, _, _, _) -> List.tryPick walkType types | SynType.Tuple(_, ts, _) -> ts |> List.tryPick (fun (_, t) -> walkType t) | SynType.Array(_, t, _) -> walkType t - | SynType.Fun(t1, t2, _) -> walkType t1 |> Option.orElse (walkType t2) + | SynType.Fun(t1, t2, _) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.WithGlobalConstraints(t, _, _) -> walkType t | SynType.HashConstraint(t, _) -> walkType t - | SynType.MeasureDivide(t1, t2, _) -> walkType t1 |> Option.orElse (walkType t2) + | SynType.MeasureDivide(t1, t2, _) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.MeasurePower(t, _, _) -> walkType t | SynType.Paren(t, _) -> walkType t | _ -> None and walkClause (SynMatchClause(pat, e1, _, e2, _, _)) = walkPatWithKind (Some EntityKind.Type) pat - |> Option.orElse (walkExpr e2) - |> Option.orElse (Option.bind walkExpr e1) + |> Option.orElseWith (fun () -> walkExpr e2) + |> Option.orElseWith (fun () -> Option.bind walkExpr e1) and walkExprWithKind (parentKind: EntityKind option) = function | SynExpr.LongIdent (_, LongIdentWithDots(_, dotRanges), _, r) -> match dotRanges with - | [] when isPosInRange r -> parentKind |> Option.orElse (Some (EntityKind.FunctionOrValue false)) + | [] when isPosInRange r -> parentKind |> Option.orElseWith (fun () -> Some (EntityKind.FunctionOrValue false)) | firstDotRange :: _ -> let firstPartRange = mkRange "" r.Start (mkPos firstDotRange.StartLine (firstDotRange.StartColumn - 1)) if isPosInRange firstPartRange then - parentKind |> Option.orElse (Some (EntityKind.FunctionOrValue false)) + parentKind |> Option.orElseWith (fun () -> Some (EntityKind.FunctionOrValue false)) else None | _ -> None | SynExpr.Paren (e, _, _, _) -> walkExprWithKind parentKind e @@ -562,45 +558,45 @@ module ParsedInput = | SynExpr.Record (_, _, fields, r) -> ifPosInRange r (fun _ -> fields |> List.tryPick (fun (_, e, _) -> e |> Option.bind (walkExprWithKind parentKind))) - | SynExpr.New (_, t, e, _) -> walkExprWithKind parentKind e |> Option.orElse (walkType t) + | SynExpr.New (_, t, e, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkType t) | SynExpr.ObjExpr (ty, _, bindings, ifaces, _, _) -> walkType ty - |> Option.orElse (List.tryPick walkBinding bindings) - |> Option.orElse (List.tryPick walkInterfaceImpl ifaces) + |> Option.orElseWith (fun () -> List.tryPick walkBinding bindings) + |> Option.orElseWith (fun () -> List.tryPick walkInterfaceImpl ifaces) | SynExpr.While (_, e1, e2, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] | SynExpr.For (_, _, e1, _, e2, e3, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2; e3] | SynExpr.ForEach (_, _, _, _, e1, e2, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] - | SynExpr.ArrayOrListOfSeqExpr (_, e, _) -> walkExprWithKind parentKind e - | SynExpr.CompExpr (_, _, e, _) -> walkExprWithKind parentKind e + | SynExpr.ArrayOrListComputed (_, e, _) -> walkExprWithKind parentKind e + | SynExpr.ComputationExpr (_, e, _) -> walkExprWithKind parentKind e | SynExpr.Lambda (body = e) -> walkExprWithKind parentKind e | SynExpr.MatchLambda (_, _, synMatchClauseList, _, _) -> List.tryPick walkClause synMatchClauseList | SynExpr.Match (_, e, synMatchClauseList, _) -> - walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkClause synMatchClauseList) + walkExprWithKind parentKind e |> Option.orElseWith (fun () -> List.tryPick walkClause synMatchClauseList) | SynExpr.Do (e, _) -> walkExprWithKind parentKind e | SynExpr.Assert (e, _) -> walkExprWithKind parentKind e | SynExpr.App (_, _, e1, e2, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] | SynExpr.TypeApp (e, _, tys, _, _, _, _) -> - walkExprWithKind (Some EntityKind.Type) e |> Option.orElse (List.tryPick walkType tys) - | SynExpr.LetOrUse (_, _, bindings, e, _) -> List.tryPick walkBinding bindings |> Option.orElse (walkExprWithKind parentKind e) - | SynExpr.TryWith (e, _, clauses, _, _, _, _) -> walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkClause clauses) + walkExprWithKind (Some EntityKind.Type) e |> Option.orElseWith (fun () -> List.tryPick walkType tys) + | SynExpr.LetOrUse (_, _, bindings, e, _) -> List.tryPick walkBinding bindings |> Option.orElseWith (fun () -> walkExprWithKind parentKind e) + | SynExpr.TryWith (e, _, clauses, _, _, _, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> List.tryPick walkClause clauses) | SynExpr.TryFinally (e1, e2, _, _, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] | SynExpr.Lazy (e, _) -> walkExprWithKind parentKind e | Sequentials es -> List.tryPick (walkExprWithKind parentKind) es | SynExpr.IfThenElse (_, _, e1, _, e2, _, e3, _, _, _, _) -> - List.tryPick (walkExprWithKind parentKind) [e1; e2] |> Option.orElse (match e3 with None -> None | Some e -> walkExprWithKind parentKind e) + List.tryPick (walkExprWithKind parentKind) [e1; e2] |> Option.orElseWith (fun () -> match e3 with None -> None | Some e -> walkExprWithKind parentKind e) | SynExpr.Ident ident -> ifPosInRange ident.idRange (fun _ -> Some (EntityKind.FunctionOrValue false)) | SynExpr.LongIdentSet (_, e, _) -> walkExprWithKind parentKind e | SynExpr.DotGet (e, _, _, _) -> walkExprWithKind parentKind e | SynExpr.DotSet (e, _, _, _) -> walkExprWithKind parentKind e | SynExpr.Set (e, _, _) -> walkExprWithKind parentKind e - | SynExpr.DotIndexedGet (e, args, _, _) -> walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkIndexerArg args) - | SynExpr.DotIndexedSet (e, args, _, _, _, _) -> walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkIndexerArg args) + | SynExpr.DotIndexedGet (e, args, _, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkExprWithKind parentKind args) + | SynExpr.DotIndexedSet (e, args, _, _, _, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkExprWithKind parentKind args) | SynExpr.NamedIndexedPropertySet (_, e1, e2, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] | SynExpr.DotNamedIndexedPropertySet (e1, _, e2, e3, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2; e3] - | SynExpr.TypeTest (e, t, _) -> walkExprWithKind parentKind e |> Option.orElse (walkType t) - | SynExpr.Upcast (e, t, _) -> walkExprWithKind parentKind e |> Option.orElse (walkType t) - | SynExpr.Downcast (e, t, _) -> walkExprWithKind parentKind e |> Option.orElse (walkType t) + | SynExpr.TypeTest (e, t, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkType t) + | SynExpr.Upcast (e, t, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkType t) + | SynExpr.Downcast (e, t, _) -> walkExprWithKind parentKind e |> Option.orElseWith (fun () -> walkType t) | SynExpr.InferredUpcast (e, _) -> walkExprWithKind parentKind e | SynExpr.InferredDowncast (e, _) -> walkExprWithKind parentKind e | SynExpr.AddressOf (_, e, _, _) -> walkExprWithKind parentKind e @@ -609,7 +605,7 @@ module ParsedInput = | SynExpr.YieldOrReturnFrom (_, e, _) -> walkExprWithKind parentKind e | SynExpr.Match (_, e, synMatchClauseList, _) | SynExpr.MatchBang (_, e, synMatchClauseList, _) -> - walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkClause synMatchClauseList) + walkExprWithKind parentKind e |> Option.orElseWith (fun () -> List.tryPick walkClause synMatchClauseList) | SynExpr.LetOrUseBang(_, _, _, _, e1, es, e2, _) -> [ yield e1 @@ -621,23 +617,23 @@ module ParsedInput = | SynExpr.DoBang (e, _) -> walkExprWithKind parentKind e | SynExpr.TraitCall (ts, sign, e, _) -> List.tryPick walkTypar ts - |> Option.orElse (walkMemberSig sign) - |> Option.orElse (walkExprWithKind parentKind e) + |> Option.orElseWith (fun () -> walkMemberSig sign) + |> Option.orElseWith (fun () -> walkExprWithKind parentKind e) | _ -> None and walkExpr = walkExprWithKind None and walkSimplePat = function | SynSimplePat.Attrib (pat, Attributes attrs, _) -> - walkSimplePat pat |> Option.orElse (List.tryPick walkAttribute attrs) - | SynSimplePat.Typed(pat, t, _) -> walkSimplePat pat |> Option.orElse (walkType t) + walkSimplePat pat |> Option.orElseWith (fun () -> List.tryPick walkAttribute attrs) + | SynSimplePat.Typed(pat, t, _) -> walkSimplePat pat |> Option.orElseWith (fun () -> walkType t) | _ -> None and walkField (SynField(Attributes attrs, _, _, t, _, _, _, _)) = - List.tryPick walkAttribute attrs |> Option.orElse (walkType t) + List.tryPick walkAttribute attrs |> Option.orElseWith (fun () -> walkType t) and walkValSig (SynValSig(Attributes attrs, _, _, t, _, _, _, _, _, _, _)) = - List.tryPick walkAttribute attrs |> Option.orElse (walkType t) + List.tryPick walkAttribute attrs |> Option.orElseWith (fun () -> walkType t) and walkMemberSig = function | SynMemberSig.Inherit (t, _) -> walkType t @@ -646,25 +642,25 @@ module ParsedInput = | SynMemberSig.ValField(f, _) -> walkField f | SynMemberSig.NestedType(SynTypeDefnSig.SynTypeDefnSig (info, repr, memberSigs, _), _) -> walkComponentInfo false info - |> Option.orElse (walkTypeDefnSigRepr repr) - |> Option.orElse (List.tryPick walkMemberSig memberSigs) + |> Option.orElseWith (fun () -> walkTypeDefnSigRepr repr) + |> Option.orElseWith (fun () -> List.tryPick walkMemberSig memberSigs) and walkMember = function | SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig | SynMemberDefn.Member(binding, _) -> walkBinding binding | SynMemberDefn.ImplicitCtor(_, Attributes attrs, SynSimplePats.SimplePats(simplePats, _), _, _, _) -> - List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat simplePats) - | SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElse (walkExpr e) + List.tryPick walkAttribute attrs |> Option.orElseWith (fun () -> List.tryPick walkSimplePat simplePats) + | SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElseWith (fun () -> walkExpr e) | SynMemberDefn.LetBindings(bindings, _, _, _) -> List.tryPick walkBinding bindings | SynMemberDefn.Interface(t, members, _) -> - walkType t |> Option.orElse (members |> Option.bind (List.tryPick walkMember)) + walkType t |> Option.orElseWith (fun () -> members |> Option.bind (List.tryPick walkMember)) | SynMemberDefn.Inherit(t, _, _) -> walkType t | SynMemberDefn.ValField(field, _) -> walkField field | SynMemberDefn.NestedType(tdef, _, _) -> walkTypeDefn tdef | SynMemberDefn.AutoProperty(Attributes attrs, _, _, t, _, _, _, _, e, _, _) -> List.tryPick walkAttribute attrs - |> Option.orElse (Option.bind walkType t) - |> Option.orElse (walkExpr e) + |> Option.orElseWith (fun () -> Option.bind walkType t) + |> Option.orElseWith (fun () -> walkExpr e) | _ -> None and walkEnumCase (SynEnumCase(Attributes attrs, _, _, _, _, _)) = List.tryPick walkAttribute attrs @@ -674,7 +670,7 @@ module ParsedInput = | SynUnionCaseKind.FullType(t, _) -> walkType t and walkUnionCase (SynUnionCase(Attributes attrs, _, t, _, _, _)) = - List.tryPick walkAttribute attrs |> Option.orElse (walkUnionCaseType t) + List.tryPick walkAttribute attrs |> Option.orElseWith (fun () -> walkUnionCaseType t) and walkTypeDefnSimple = function | SynTypeDefnSimpleRepr.Enum (cases, _) -> List.tryPick walkEnumCase cases @@ -686,10 +682,10 @@ module ParsedInput = and walkComponentInfo isModule (SynComponentInfo(Attributes attrs, TyparsAndConstraints (typars, cs1), cs2, _, _, _, _, r)) = let constraints = cs1 @ cs2 if isModule then None else ifPosInRange r (fun _ -> Some EntityKind.Type) - |> Option.orElse ( + |> Option.orElseWith (fun () -> List.tryPick walkAttribute attrs - |> Option.orElse (List.tryPick walkTyparDecl typars) - |> Option.orElse (List.tryPick walkTypeConstraint constraints)) + |> Option.orElseWith (fun () -> List.tryPick walkTyparDecl typars) + |> Option.orElseWith (fun () -> List.tryPick walkTypeConstraint constraints)) and walkTypeDefnRepr = function | SynTypeDefnRepr.ObjectModel (_, defns, _) -> List.tryPick walkMember defns @@ -703,15 +699,15 @@ module ParsedInput = and walkTypeDefn (SynTypeDefn (info, repr, members, _, _)) = walkComponentInfo false info - |> Option.orElse (walkTypeDefnRepr repr) - |> Option.orElse (List.tryPick walkMember members) + |> Option.orElseWith (fun () -> walkTypeDefnRepr repr) + |> Option.orElseWith (fun () -> List.tryPick walkMember members) and walkSynModuleDecl isTopLevel (decl: SynModuleDecl) = match decl with | SynModuleDecl.NamespaceFragment fragment -> walkSynModuleOrNamespace isTopLevel fragment | SynModuleDecl.NestedModule(info, _, modules, _, range) -> walkComponentInfo true info - |> Option.orElse (ifPosInRange range (fun _ -> List.tryPick (walkSynModuleDecl false) modules)) + |> Option.orElseWith (fun () -> ifPosInRange range (fun _ -> List.tryPick (walkSynModuleDecl false) modules)) | SynModuleDecl.Open _ -> None | SynModuleDecl.Let (_, bindings, _) -> List.tryPick walkBinding bindings | SynModuleDecl.DoExpr (_, expr, _) -> walkExpr expr @@ -825,10 +821,10 @@ module ParsedInput = when ident.idText = name -> Some (lhs, rhs) | _ -> None - // checks if we are in rhs of the range operator - let isInRhsOfRangeOp (p : SyntaxVisitorPath) = + // checks if we are in a range operator + let isAtRangeOp (p : SyntaxVisitorPath) = match p with - | SyntaxNode.SynExpr(Operator "op_Range" _) :: _ -> true + | SyntaxNode.SynExpr(SynExpr.IndexRange _) :: _ -> true | _ -> false let (|Setter|_|) e = @@ -917,7 +913,7 @@ module ParsedInput = new SyntaxVisitorBase<_>() with member _.VisitExpr(path, _, defaultTraverse, expr) = - if isInRhsOfRangeOp path then + if isAtRangeOp path then match defaultTraverse expr with | None -> Some CompletionContext.RangeOperator // nothing was found - report that we were in the context of range operator | x -> x // ok, we found something - return it @@ -1231,10 +1227,6 @@ module ParsedInput = and walkInterfaceImpl (SynInterfaceImpl(_, bindings, _)) = List.iter walkBinding bindings - and walkIndexerArg = function - | SynIndexerArg.One (e, _, _) -> walkExpr e - | SynIndexerArg.Two (e1, _, e2, _, _, _) -> List.iter walkExpr [e1; e2] - and walkType = function | SynType.Array (_, t, _) | SynType.HashConstraint (t, _) @@ -1270,8 +1262,8 @@ module ParsedInput = | SynExpr.AddressOf (_, e, _, _) | SynExpr.DoBang (e, _) | SynExpr.YieldOrReturn (_, e, _) - | SynExpr.ArrayOrListOfSeqExpr (_, e, _) - | SynExpr.CompExpr (_, _, e, _) + | SynExpr.ArrayOrListComputed (_, e, _) + | SynExpr.ComputationExpr (_, e, _) | SynExpr.Do (e, _) | SynExpr.Assert (e, _) | SynExpr.Lazy (e, _) @@ -1333,12 +1325,17 @@ module ParsedInput = | SynExpr.Set (e1, e2, _) -> walkExpr e1 walkExpr e2 + | SynExpr.IndexRange (expr1, _, expr2, _, _, _) -> + match expr1 with Some e -> walkExpr e | None -> () + match expr2 with Some e -> walkExpr e | None -> () + | SynExpr.IndexFromEnd (e, _) -> + walkExpr e | SynExpr.DotIndexedGet (e, args, _, _) -> walkExpr e - List.iter walkIndexerArg args + walkExpr args | SynExpr.DotIndexedSet (e1, args, e2, _, _, _) -> walkExpr e1 - List.iter walkIndexerArg args + walkExpr args walkExpr e2 | SynExpr.NamedIndexedPropertySet (ident, e1, e2, _) -> addLongIdentWithDots ident diff --git a/src/fsharp/service/ServiceStructure.fs b/src/fsharp/service/ServiceStructure.fs index 34bba9662d0..a9567c6c79b 100644 --- a/src/fsharp/service/ServiceStructure.fs +++ b/src/fsharp/service/ServiceStructure.fs @@ -90,7 +90,7 @@ module Structure = | Member | LetOrUse | Val - | CompExpr + | ComputationExpr | IfThenElse | ThenInIfThenElse | ElseInIfThenElse @@ -109,7 +109,6 @@ module Structure = | MatchLambda | MatchClause | Lambda - | CompExprInternal | Quote | Record | SpecialFunc @@ -140,7 +139,7 @@ module Structure = | Member -> "Member" | LetOrUse -> "LetOrUse" | Val -> "Val" - | CompExpr -> "CompExpr" + | ComputationExpr -> "ComputationExpr" | IfThenElse -> "IfThenElse" | ThenInIfThenElse -> "ThenInIfThenElse" | ElseInIfThenElse -> "ElseInIfThenElse" @@ -159,7 +158,6 @@ module Structure = | MatchLambda -> "MatchLambda" | MatchClause -> "MatchClause" | Lambda -> "Lambda" - | CompExprInternal -> "CompExprInternal" | Quote -> "Quote" | Record -> "Record" | SpecialFunc -> "SpecialFunc" @@ -292,24 +290,24 @@ module Structure = // seq exprs, custom operators, etc if ExprAtomicFlag.NonAtomic=atomicFlag && (not isInfix) && (function SynExpr.Ident _ -> true | _ -> false) funcExpr - && (function SynExpr.CompExpr _ -> false | _ -> true ) argExpr then + && (function SynExpr.ComputationExpr _ -> false | _ -> true ) argExpr then // if the argExpr is a computation expression another match will handle the outlining // these cases must be removed to prevent creating unnecessary tags for the same scope let collapse = Range.endToEnd funcExpr.Range r rcheck Scope.SpecialFunc Collapse.Below r collapse elif ExprAtomicFlag.NonAtomic=atomicFlag && (not isInfix) - && (function SynExpr.CompExpr _ -> true | _ -> false) argExpr then + && (function SynExpr.ComputationExpr _ -> true | _ -> false) argExpr then let collapse = Range.startToEnd argExpr.Range r - rcheck Scope.CompExpr Collapse.Same r <| Range.modBoth 1 1 collapse + rcheck Scope.ComputationExpr Collapse.Same r <| Range.modBoth 1 1 collapse parseExpr argExpr parseExpr funcExpr | SynExpr.Sequential (_, _, e1, e2, _) -> parseExpr e1 parseExpr e2 - | SynExpr.ArrayOrListOfSeqExpr (isArray, e, r) -> + | SynExpr.ArrayOrListComputed (isArray, e, r) -> rcheck Scope.ArrayOrList Collapse.Same r <| Range.modBoth (if isArray then 2 else 1) (if isArray then 2 else 1) r parseExpr e - | SynExpr.CompExpr (_arrayOrList, _, e, _r) as _c -> + | SynExpr.ComputationExpr (_, e, _r) as _c -> parseExpr e | SynExpr.ObjExpr (_, argOpt, bindings, extraImpls, newRange, wholeRange) as _objExpr -> match argOpt with diff --git a/src/fsharp/service/ServiceStructure.fsi b/src/fsharp/service/ServiceStructure.fsi index 3ed1eb0dbab..f05df0b6da0 100644 --- a/src/fsharp/service/ServiceStructure.fsi +++ b/src/fsharp/service/ServiceStructure.fsi @@ -25,7 +25,7 @@ module public Structure = | Member | LetOrUse | Val - | CompExpr + | ComputationExpr | IfThenElse | ThenInIfThenElse | ElseInIfThenElse @@ -44,7 +44,6 @@ module public Structure = | MatchLambda | MatchClause | Lambda - | CompExprInternal | Quote | Record | SpecialFunc diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index be470e058e2..1c8628ad31a 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -62,7 +62,12 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str let fileName = m.FileName let s = m.Start let e = m.End - let severity = if severity=FSharpDiagnosticSeverity.Warning then "warning" else "error" + let severity = + match severity with + | FSharpDiagnosticSeverity.Warning -> "warning" + | FSharpDiagnosticSeverity.Error -> "error" + | FSharpDiagnosticSeverity.Info -> "info" + | FSharpDiagnosticSeverity.Hidden -> "hidden" sprintf "%s (%d,%d)-(%d,%d) %s %s %s" fileName s.Line (s.Column + 1) e.Line (e.Column + 1) subcategory severity message /// Decompose a warning or error into parts: position, severity, message, error number @@ -97,7 +102,7 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str /// Use to reset error and warning handlers [] type ErrorScope() = - let mutable errors = [] + let mutable diags = [] let mutable firstError = None let unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck let unwindEL = @@ -105,16 +110,14 @@ type ErrorScope() = { new ErrorLogger("ErrorScope") with member x.DiagnosticSink(exn, severity) = let err = FSharpDiagnostic.CreateFromException(exn, severity, range.Zero, false) - errors <- err :: errors + diags <- err :: diags if severity = FSharpDiagnosticSeverity.Error && firstError.IsNone then firstError <- Some err.Message - member x.ErrorCount = errors.Length }) + member x.ErrorCount = diags.Length }) - member x.Errors = errors |> List.filter (fun error -> error.Severity = FSharpDiagnosticSeverity.Error) + member x.Errors = diags |> List.filter (fun error -> error.Severity = FSharpDiagnosticSeverity.Error) - member x.Warnings = errors |> List.filter (fun error -> error.Severity = FSharpDiagnosticSeverity.Warning) - - member x.Diagnostics = errors + member x.Diagnostics = diags member x.TryGetFirstErrorText() = match x.Errors with @@ -165,13 +168,14 @@ type internal CompilationErrorLogger (debugName: string, options: FSharpDiagnost let mutable errorCount = 0 let diagnostics = ResizeArray<_>() - override x.DiagnosticSink(exn, severity) = - if severity = FSharpDiagnosticSeverity.Error || ReportWarningAsError options exn then - diagnostics.Add(exn, FSharpDiagnosticSeverity.Error) + override x.DiagnosticSink(err, severity) = + if ReportDiagnosticAsError options (err, severity) then + diagnostics.Add(err, FSharpDiagnosticSeverity.Error) errorCount <- errorCount + 1 - elif ReportWarning options exn then - diagnostics.Add(exn, FSharpDiagnosticSeverity.Warning) - + elif ReportDiagnosticAsWarning options (err, severity) then + diagnostics.Add(err, FSharpDiagnosticSeverity.Warning) + elif ReportDiagnosticAsInfo options (err, severity) then + diagnostics.Add(err, severity) override x.ErrorCount = errorCount member x.GetDiagnostics() = diagnostics.ToArray() @@ -180,10 +184,9 @@ module DiagnosticHelpers = let ReportDiagnostic (options: FSharpDiagnosticOptions, allErrors, mainInputFileName, fileInfo, (exn, severity), suggestNames) = [ let severity = - if (severity = FSharpDiagnosticSeverity.Error) then severity - elif ReportWarningAsError options exn then FSharpDiagnosticSeverity.Error + if ReportDiagnosticAsError options (exn, severity) then FSharpDiagnosticSeverity.Error else severity - if (severity = FSharpDiagnosticSeverity.Error || ReportWarning options exn) then + if (severity = FSharpDiagnosticSeverity.Error || ReportDiagnosticAsWarning options (exn, severity) || ReportDiagnosticAsInfo options (exn, severity)) then let oneError exn = [ // We use the first line of the file as a fallbackRange for reporting unexpected errors. // Not ideal, but it's hard to see what else to do. diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 5f21270cfb5..107d5a37dd7 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -338,7 +338,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C default _.Accessibility = FSharpAccessibility(taccessPublic) abstract Attributes: IList - default _.Attributes = makeReadOnlyCollection[] + default _.Attributes = makeReadOnlyCollection [] member sym.HasAttribute<'T> () = sym.Attributes |> Seq.exists (fun attr -> attr.IsAttribute<'T>()) @@ -613,7 +613,7 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = member x.IsNamespace = entity.IsNamespace member x.MembersFunctionsAndValues = - if isUnresolved() then makeReadOnlyCollection[] else + if isUnresolved() then makeReadOnlyCollection [] else protect <| fun () -> ([ let _, entityTy = generalizeTyconRef entity let createMember (minfo: MethInfo) = @@ -684,20 +684,20 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = |> makeReadOnlyCollection member _.NestedEntities = - if isUnresolved() then makeReadOnlyCollection[] else + if isUnresolved() then makeReadOnlyCollection [] else entity.ModuleOrNamespaceType.AllEntities |> QueueList.toList |> List.map (fun x -> FSharpEntity(cenv, entity.NestedTyconRef x)) |> makeReadOnlyCollection member x.UnionCases = - if isUnresolved() then makeReadOnlyCollection[] else + if isUnresolved() then makeReadOnlyCollection [] else entity.UnionCasesAsRefList |> List.map (fun x -> FSharpUnionCase(cenv, x)) |> makeReadOnlyCollection member x.FSharpFields = - if isUnresolved() then makeReadOnlyCollection[] else + if isUnresolved() then makeReadOnlyCollection [] else if entity.IsILEnumTycon then let (TILObjectReprData(_scoref, _enc, tdef)) = entity.ILTyconInfo @@ -723,7 +723,7 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = | Some ty -> FSharpType(cenv, ty) override _.Attributes = - if isUnresolved() then makeReadOnlyCollection[] else + if isUnresolved() then makeReadOnlyCollection [] else GetAttribInfosOfEntity cenv.g cenv.amap range0 entity |> List.map (fun a -> FSharpAttribute(cenv, a)) |> makeReadOnlyCollection diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 0ca3b1456e8..86736b85004 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -17,6 +17,26 @@ Funkce {0} vyžaduje knihovnu F# pro verzi jazyka {1} nebo novější. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Atribut AssemblyKeyNameAttribute je zastaralý. Použijte místo něj AssemblyKeyFileAttribute. @@ -137,6 +157,11 @@ implicitní yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation rozhraní s vícenásobným obecným vytvářením instancí @@ -177,6 +202,11 @@ formátování typu binary pro integery + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation uvolnění prázdných znaků @@ -297,6 +327,16 @@ Hlavička zdroje začínající na posunu {0} má chybný formát. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. Hodnota {0} byla označena jako InlineIfLambda, ale nemá hodnotu lambda. Toto upozornění slouží pouze pro informační účely. @@ -492,11 +532,26 @@ Atributy nejde použít pro rozšíření typů. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Typy Byref nejsou v deklaraci otevřeného typu povolené. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! se nedá kombinovat s and!. + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Deklarace [<Literal>] nemůže používat aktivní vzor jako svůj identifikátor. @@ -557,6 +627,46 @@ K hodnotě označené jako literál se {0} nedá přiřadit. + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods Konstrukt let! ... and! ... se dá použít jen v případě, že tvůrce výpočetních výrazů definuje buď metodu {0}, nebo vhodné metody MergeSource a Bind. @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Neplatný výraz indexeru + Incomplete expression or invalid use of indexer syntax + Neplatný výraz indexeru @@ -7568,12 +7678,12 @@ - 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]'? Tato hodnota není funkcí a nedá se použít. Nechtěli jste místo toho získat k indexeru přístup přes {0}.[index]? - 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]'? Tento výraz není funkcí a nedá se použít. Nechtěli jste místo toho získat k indexeru přístup přes expr.[index]? diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index bbf00dbdba3..888f074f41b 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -17,6 +17,26 @@ Für das Feature "{0}" ist die F#-Bibliothek für die Sprachversion {1} oder höher erforderlich. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" gilt als veraltet. Verwenden Sie stattdessen "AssemblyKeyFileAttribute". @@ -137,6 +157,11 @@ implizite yield-Anweisung + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation Schnittstellen mit mehrfacher generischer Instanziierung @@ -177,6 +202,11 @@ binäre Formatierung für ganze Zahlen + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation Lockerung für Leerraum @@ -297,6 +327,16 @@ Der Ressourcenheader, der am Offset {0} beginnt, ist fehlerhaft formatiert. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. Der Wert "{0}" wurde als "InlineIfLambda" markiert, jedoch nicht als Lambdawert festgelegt. Diese Warnung dient nur zu Informationszwecken. @@ -492,11 +532,26 @@ Attribute können nicht auf Typerweiterungen angewendet werden. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Byref-Typen sind in einer Deklaration für offene Typen nicht zulässig. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Dieser Ausdruck verwendet eine integrierte implizite Konvertierung, um den Typ "{0}" in den Typ "{1}" zu konvertieren. Siehe https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ "use!" darf nicht mit "and!" kombiniert werden. + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Eine [<Literal>]-Deklaration kann kein aktives Muster für ihren Bezeichner verwenden. @@ -557,6 +627,46 @@ "{0}" kann keinem als Literal markierten Wert zugewiesen werden. + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods Das Konstrukt "let! ... and! ..." kann nur verwendet werden, wenn der Berechnungsausdrucks-Generator entweder eine {0}-Methode oder geeignete MergeSource- und Bind-Methoden definiert. @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Ungültiger Indexerausdruck. + Incomplete expression or invalid use of indexer syntax + Ungültiger Indexerausdruck. @@ -7568,12 +7678,12 @@ - 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]'? Dieser Wert ist keine Funktion und kann nicht angewendet werden. Wollten Sie auf den Indexer stattdessen über "{0}.[index]" zugreifen? - 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]'? Dieser Ausdruck ist keine Funktion und kann nicht angewendet werden. Wollten Sie auf den Indexer stattdessen über "expr.[index]" zugreifen? diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index daa2052a77f..25df6eda7fb 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -17,6 +17,26 @@ La característica "{0}" requiere la biblioteca de F# para la versión de lenguaje {1} o superior. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. El elemento "AssemblyKeyNameAttribute" está en desuso. Use "AssemblyKeyFileAttribute" en su lugar. @@ -137,6 +157,11 @@ elemento yield implícito + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation interfaces con creación de instancias genéricas múltiples @@ -177,6 +202,11 @@ formato binario para enteros + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation relajación de espacio en blanco @@ -297,6 +327,16 @@ El encabezado de los recursos que comienza en el desplazamiento {0} está mal formado. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. El valor "{0}" estaba marcado como "InlineIfLambda", pero no se ha determinado que tenga un valor lambda. Esta advertencia solo tiene fines informativos. @@ -492,11 +532,26 @@ Los atributos no se pueden aplicar a las extensiones de tipo. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. No se permiten tipos byref en una declaración de tipo abierto. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Esta expresión usa una conversión implícita integrada para convertir el tipo '{0}' al tipo '{1}'. Vea https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ No se puede combinar use! con and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Una declaración [<Literal>] no puede usar un modelo activo para su identificador @@ -557,6 +627,46 @@ No se puede asignar "{0}" a un valor marcado como literal + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods La construcción "let! ... and! ..." solo se puede usar si el generador de expresiones de cálculo define un método "{0}" o bien los métodos "MergeSource" y "Bind" adecuados. @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Expresión de indizador no válido. + Incomplete expression or invalid use of indexer syntax + Expresión de indizador no válido. @@ -7568,12 +7678,12 @@ - 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]'? Este valor no es una función y no se puede aplicar. ¿Pretendía tener acceso al indexador a través de {0}.[index] en su lugar? - 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]'? Esta expresión no es una función y no se puede aplicar. ¿Pretendía tener acceso al indexador a través de expr.[index] en su lugar? diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 63c70a800f7..fa59f77cb10 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -17,6 +17,26 @@ La fonctionnalité '{0}' nécessite la bibliothèque F# pour le langage version {1} ou ultérieure. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' a été déprécié. Utilisez 'AssemblyKeyFileAttribute' à la place. @@ -137,6 +157,11 @@ yield implicite + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation interfaces avec plusieurs instanciations génériques @@ -177,6 +202,11 @@ mise en forme binaire pour les entiers + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation assouplissement de la mise en retrait avec des espaces blancs @@ -297,6 +327,16 @@ L'en-tête de ressource commençant au décalage {0} est mal formé. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. La valeur «{0} » a été marquée comme « InlineIfLambda », mais elle n’a pas été déterminée comme ayant une valeur lambda. Cet avertissement est à titre d’information uniquement. @@ -492,11 +532,26 @@ Impossible d'appliquer des attributs aux extensions de type. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Les types Byref ne sont pas autorisés dans une déclaration de type ouverte. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! ne peut pas être combiné avec and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Une déclaration [<Literal>] ne peut pas utiliser un modèle actif en tant qu'identificateur @@ -557,6 +627,46 @@ Impossible d'affecter '{0}' à une valeur marquée comme littérale + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods La construction 'let! ... and! ...' peut uniquement être utilisée si le générateur d'expressions de calcul définit une méthode '{0}' ou les méthodes 'MergeSource' et 'Bind' appropriées @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Expression d'indexeur non valide + Incomplete expression or invalid use of indexer syntax + Expression d'indexeur non valide @@ -7568,12 +7678,12 @@ - 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]'? Cette valeur n'est pas une fonction et ne peut pas être appliquée. Souhaitiez-vous accéder à l'indexeur via {0}.[index] ? - 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]'? Cette expression n'est pas une fonction et ne peut pas être appliquée. Souhaitiez-vous accéder à l'indexeur via expr.[index] ? diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 751eb9b0d10..624d21880d4 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -17,6 +17,26 @@ Con la funzionalità '{0}' è richiesta la libreria F# per la versione {1} o successiva del linguaggio. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. L'attributo 'AssemblyKeyNameAttribute' è deprecato. In alternativa, usare 'AssemblyKeyFileAttribute'. @@ -137,6 +157,11 @@ istruzione yield implicita + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation interfacce con più creazioni di istanze generiche @@ -177,6 +202,11 @@ formattazione binaria per interi + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation uso meno restrittivo degli spazi vuoti @@ -297,6 +327,16 @@ L'intestazione di risorsa che inizia a partire dall'offset {0} non è valida. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. Il valore '{0}' è stato contrassegnato come 'InlineIfLambda', ma è stato determinato che non include un valore lambda. Questo avviso viene visualizzato solo a scopo informativo. @@ -492,11 +532,26 @@ Gli attributi non possono essere applicati a estensioni di tipo. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. I tipi byref non sono consentiti in una dichiarazione di tipo aperto. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ Non è possibile combinare use! con and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Una dichiarazione [<Literal>] non può usare un criterio attivo per il relativo identificatore @@ -557,6 +627,46 @@ Non è possibile assegnare '{0}' a un valore contrassegnato come letterale + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods È possibile usare il costrutto 'let! ... and! ...' solo se il generatore di espressioni di calcolo definisce un metodo '{0}' o metodi 'MergeSource' e 'Bind' appropriati @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Espressione di indicizzatore non valida + Incomplete expression or invalid use of indexer syntax + Espressione di indicizzatore non valida @@ -7568,12 +7678,12 @@ - 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]'? Questo valore non è una funzione e non può essere applicato. Si intendeva accedere all'indicizzatore tramite la sintassi {0}.[indice]? - 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]'? Questa espressione non è una funzione e non può essere applicata. Si intendeva accedere all'indicizzatore tramite la sintassi espressione.[indice]? diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 77faabcfa57..bed2a26a4fb 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -17,6 +17,26 @@ 機能 '{0}' を使用するには、言語バージョン {1} 以上の F# ライブラリが必要です。 + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' は非推奨になりました。代わりに 'AssemblyKeyFileAttribute' を使用してください。 @@ -137,6 +157,11 @@ 暗黙的な yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation 複数のジェネリックのインスタンス化を含むインターフェイス @@ -177,6 +202,11 @@ 整数のバイナリ形式 + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation 空白の緩和 @@ -297,6 +327,16 @@ オフセット {0} で始まるリソース ヘッダーの形式に誤りがあります。 + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. 値 '{0}' が ' InlineIfLambda ' とマークされましたが、ラムダ値があると判断されませんでした。この警告は、情報提供のみを目的としています。 @@ -492,11 +532,26 @@ 属性を型拡張に適用することはできません。 + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Byref 型は、オープン型宣言では使用できません。 + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! を and! と組み合わせて使用することはできません + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier [<Literal>] 宣言では、その識別子に対してアクティブ パターンを使用することはできません @@ -557,6 +627,46 @@ リテラルとしてマークされた値に '{0}' を割り当てることはできません + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods 'let! ... and! ...' コンストラクトは、コンピュテーション式ビルダーが '{0}' メソッドまたは適切な 'MergeSource' および 'Bind' メソッドのいずれかを定義している場合にのみ使用できます @@ -3528,8 +3638,8 @@ - Invalid indexer expression - インデクサー式が無効です + Incomplete expression or invalid use of indexer syntax + インデクサー式が無効です @@ -7568,12 +7678,12 @@ - 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]'? この値は関数ではないため、適用できません。そうではなく、{0}.[index] によってインデクサーにアクセスしようとしましたか? - 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]'? この式は関数ではないため、適用できません。そうではなく、expr.[index] によってインデクサーにアクセスしようとしましたか? diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 704ce918ef9..262321ab637 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -17,6 +17,26 @@ 언어 버전 {1} 이상에서 '{0}' 기능을 사용하려면 F# 라이브러리가 필요합니다. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute'는 사용되지 않습니다. 대신 'AssemblyKeyFileAttribute'를 사용하세요. @@ -137,6 +157,11 @@ 암시적 yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation 여러 제네릭 인스턴스화가 포함된 인터페이스 @@ -177,6 +202,11 @@ 정수에 대한 이진 서식 지정 + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation 공백 완화 @@ -297,6 +327,16 @@ 오프셋 {0}에서 시작하는 리소스 헤더의 형식이 잘못되었습니다. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. '{0}' 값이 'InlineIfLambda'로 표시되었지만 람다 값이 없는 것으로 확인되지 않았습니다. 이 경고는 정보 제공용입니다. @@ -492,11 +532,26 @@ 형식 확장에 특성을 적용할 수 없습니다. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Byref 형식은 개방형 형식 선언에서 허용되지 않습니다. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use!는 and!와 함께 사용할 수 없습니다. + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier [<Literal>] 선언은 해당 식별자에 대한 활성 패턴을 사용할 수 없습니다. @@ -557,6 +627,46 @@ 리터럴로 표시된 값에 '{0}'을(를) 할당할 수 없습니다. + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods 'let! ... and! ...' 구문은 계산 식 작성기에서 '{0}' 메서드 또는 적절한 'MergeSource' 및 'Bind' 메서드를 정의한 경우에만 사용할 수 있습니다. @@ -3528,8 +3638,8 @@ - Invalid indexer expression - 인덱서 식이 잘못되었습니다. + Incomplete expression or invalid use of indexer syntax + 인덱서 식이 잘못되었습니다. @@ -7568,12 +7678,12 @@ - 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]'? 이 식은 함수가 아니며 적용할 수 없습니다. 대신 {0}.[index]를 통해 인덱서에 액세스하려고 했나요? - 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]'? 이 식은 함수가 아니며 적용할 수 없습니다. 대신 expr.[index]를 통해 인덱서에 액세스하려고 했나요? diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 47c1dca19da..0d3b01c2a08 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -17,6 +17,26 @@ Funkcja „{0}” wymaga biblioteki języka F# dla wersji językowej {1} lub nowszej. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Element „AssemblyKeyNameAttribute” jest przestarzały. Zamiast niego użyj elementu „AssemblyKeyFileAttribute”. @@ -137,6 +157,11 @@ niejawne słowo kluczowe yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation interfejsy z wieloma ogólnymi wystąpieniami @@ -177,6 +202,11 @@ formatowanie danych binarnych dla liczb całkowitych + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation rozluźnianie reguł dotyczących odstępów @@ -297,6 +327,16 @@ Nagłówek zasobu rozpoczynający się od przesunięcia {0} jest nieprawidłowo sformułowany. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. Wartość "{0}" została oznaczona jako "InlineIfLambda", ale nie została określona jako mająca wartość lambda. To ostrzeżenie jest przeznaczone tylko do celów informacyjnych. @@ -492,11 +532,26 @@ Atrybutów nie można stosować do rozszerzeń typu. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Typy ByRef są niedozwolone w deklaracji typu otwartego. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ Elementu use! nie można łączyć z elementem and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Deklaracja [<Literal>] nie może używać aktywnego wzorca dla swojego identyfikatora @@ -557,6 +627,46 @@ Nie można przypisać elementu „{0}” do wartości oznaczonej jako literał + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods Konstrukcji „let! ... and! ...” można użyć tylko wtedy, gdy konstruktor wyrażeń obliczeniowych definiuje metodę „{0}” lub odpowiednie metody „MergeSource” i „Bind” @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Nieprawidłowe wyrażenie indeksatora + Incomplete expression or invalid use of indexer syntax + Nieprawidłowe wyrażenie indeksatora @@ -7568,12 +7678,12 @@ - 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]'? Ta wartość nie jest funkcją i nie można jej zastosować. Czy zamiast tego zamierzano uzyskać dostęp do indeksatora przy użyciu formatu {0}.[indeks]? - 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]'? To wyrażenie nie jest funkcją i nie można go zastosować. Czy zamiast tego zamierzano uzyskać dostęp do indeksatora przy użyciu formatu wyrażenie.[indeks]? diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index e69e9a8d433..6f5ab59876e 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -17,6 +17,26 @@ O recurso '{0}' exige a biblioteca F# para a versão da linguagem {1} ou posterior. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. O 'AssemblyKeyNameAttribute' foi preterido. Use o 'AssemblyKeyFileAttribute'. @@ -137,6 +157,11 @@ yield implícito + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation interfaces com várias instanciações genéricas @@ -177,6 +202,11 @@ formatação binária para números inteiros + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation atenuação de espaço em branco @@ -297,6 +327,16 @@ O cabeçalho do recurso que começa no deslocamento {0} está malformado. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. O valor '{0}' foi marcado como 'InlineIfLambda' mas não foi determinado como tendo um valor lambda. Este aviso é apenas para fins informativos. @@ -492,11 +532,26 @@ Os atributos não podem ser aplicados às extensões de tipo. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Os tipos Byref não são permitidos em uma declaração de tipo aberto. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! não pode ser combinado com and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Uma declaração [<Literal>] não pode usar um padrão ativo para seu identificador @@ -557,6 +627,46 @@ Não é possível atribuir '{0}' a um valor marcado como literal + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods O constructo 'let! ... and! ...' só pode ser usado se o construtor de expressões de computação definir um método '{0}' ou um método 'MergeSource' ou 'Bind' apropriado @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Expressão de indexador inválida + Incomplete expression or invalid use of indexer syntax + Expressão de indexador inválida @@ -7568,12 +7678,12 @@ - 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]'? Este valor não é uma função e não pode ser aplicado. Você pretendia acessar o indexador por meio do {0}.[index] como alternativa? - 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]'? Esta expressão não é uma função e não pode ser aplicada. Você pretendia acessar o indexador por meio do expr.[index] como alternativa? diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 72f8400963d..f126b1f3d16 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -17,6 +17,26 @@ Компоненту "{0}" требуется библиотека F# для языка версии {1} или более поздней. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Атрибут "AssemblyKeyNameAttribute" является устаревшим. Используйте вместо него атрибут "AssemblyKeyFileAttribute". @@ -137,6 +157,11 @@ неявное использование yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation интерфейсы с множественным универсальным созданием экземпляра @@ -177,6 +202,11 @@ двоичное форматирование для целых чисел + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation уменьшение строгости для пробелов @@ -297,6 +327,16 @@ Заголовок ресурса некорректен начиная со смещения {0}. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. Значение "{0}" было помечено "InlineIfLambda", но не определено как содержащее значение лямбда-выражения. Это предупреждение приводится исключительно для информации. @@ -492,11 +532,26 @@ Атрибуты не могут быть применены к расширениям типа. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Типы ByRef запрещены в объявлении открытого типа. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Это выражение использует встроенное неявное преобразование, чтобы преобразовать тип "{0}" в тип "{1}". См. сведения на странице https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! запрещено сочетать с and! + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier Объявление [<Literal>] не может использовать активный шаблон для своего идентификатора. @@ -557,6 +627,46 @@ Невозможно присвоить "{0}" значению, помеченному как литерал + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods Конструкцию "let! ... and! ..." можно использовать только в том случае, если построитель выражений с вычислениями определяет либо метод "{0}", либо соответствующие методы "MergeSource" и "Bind" @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Недопустимое выражение индексатора + Incomplete expression or invalid use of indexer syntax + Недопустимое выражение индексатора @@ -7568,12 +7678,12 @@ - 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]'? Это значение не является функцией, и применить его невозможно. Вы хотели обратиться к индексатору с помощью {0}.[индекс]? - 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]'? Это выражение не является функцией, и применить его невозможно. Вы хотели обратиться к индексатору с помощью <выражение>.[индекс]? diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 9ceebb3bf56..217effb4457 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -17,6 +17,26 @@ '{0}' özelliği için F# kitaplığının {1} veya üstü dil sürümü gerekir. + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' kullanım dışı bırakıldı. Bunun yerine 'AssemblyKeyFileAttribute' kullanın. @@ -137,6 +157,11 @@ örtük yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation birden çok genel örnek oluşturma içeren arabirimler @@ -177,6 +202,11 @@ tamsayılar için ikili biçim + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation boşluk genişlemesi @@ -297,6 +327,16 @@ {0} uzaklığında başlayan kaynak üst bilgisi hatalı biçimlendirilmiş. + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. '{0}' değeri 'InlineIfLambda' olarak işaretlenmiş ancak bir lambda değerine sahip olmak üzere belirlenmemiş. Bu uyarı yalnızca bilgilendirme amaçlıdır. @@ -492,11 +532,26 @@ Öznitelikler tür uzantılarına uygulanamaz. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. Açık tür bildiriminde Byref türlerine izin verilmez. + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use!, and! ile birleştirilemez + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier [<Literal>] bildirimi, tanımlayıcısı için etkin desen kullanamaz @@ -557,6 +627,46 @@ Sabit değer olarak işaretlenen bir değere '{0}' atanamaz + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods 'let! ... and! ...' yapısı, yalnızca hesaplama ifadesi oluşturucu bir '{0}' metodunu ya da uygun 'MergeSource' ve 'Bind' metotlarını tanımlarsa kullanılabilir @@ -3528,8 +3638,8 @@ - Invalid indexer expression - Geçersiz dizin erişimcisi ifadesi + Incomplete expression or invalid use of indexer syntax + Geçersiz dizin erişimcisi ifadesi @@ -7568,12 +7678,12 @@ - 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]'? Bu değer, bir işlev değil ve uygulanamaz. Dizin oluşturucuya bunun yerine {0}.[index] üzerinden erişmeye mi çalışıyordunuz? - 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]'? Bu ifade, bir işlev değil ve uygulanamaz. Dizin oluşturucuya bunun yerine expr.[index] üzerinden erişmeye mi çalışıyordunuz? diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 6ddc4043c96..8bab6733669 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -17,6 +17,26 @@ 功能“{0}”需要 {1} 或更高语言版本的 F# 库。 + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" 已被弃用。请改为使用 "AssemblyKeyFileAttribute"。 @@ -137,6 +157,11 @@ 隐式 yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation 具有多个泛型实例化的接口 @@ -177,6 +202,11 @@ 整数的二进制格式设置 + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation 空格松弛法 @@ -297,6 +327,16 @@ 以偏移量 {0} 开始的资源标头格式不正确。 + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. 值 "{0}" 标记为 "InlineIfLambda",但未确定其具有 lambda 值。此警告仅供参考。 @@ -492,11 +532,26 @@ 属性不可应用于类型扩展。 + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. 在开放类型声明中不允许使用 Byref 类型。 + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! 不得与 and! 结合使用 + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier [<Literal>] 声明不能对其标识符使用活动模式 @@ -557,6 +627,46 @@ 无法将“{0}”分配给标记为文本的值 + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods 仅当计算表达式生成器定义了 "{0}" 方法或适当的 "MergeSource" 和 "Bind" 方法时,才可以使用 "let! ... and! ..." 构造 @@ -3528,8 +3638,8 @@ - Invalid indexer expression - 索引器表达式无效 + Incomplete expression or invalid use of indexer syntax + 索引器表达式无效 @@ -7568,12 +7678,12 @@ - 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]'? 此值不是一个函数,无法应用。是否曾打算改为通过 {0}.[index] 访问索引器? - 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]'? 此值不是一个函数,无法应用。是否曾打算改为通过 expr.[index] 访问索引器? diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index b429e87050d..5efee5e1059 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -17,6 +17,26 @@ 功能 '{0}' 需要語言版本 {1} 或更高的 F# 程式庫。 + + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + + + + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + + + + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + + + + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' 已淘汰。請改用 'AssemblyKeyFileAttribute'。 @@ -137,6 +157,11 @@ 隱含 yield + + expr[idx] notation for indexing and slicing + expr[idx] notation for indexing and slicing + + interfaces with multiple generic instantiation 具有多個泛型具現化的介面 @@ -177,6 +202,11 @@ 整數的二進位格式化 + + informational messages related to reference cells + informational messages related to reference cells + + whitespace relexation 空白字元放寬 @@ -297,6 +327,16 @@ 從位移 {0} 開始的資源標頭格式錯誤。 + + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + + + + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + This value is not a function and cannot be applied. Did you intend to access the indexer via '{0}[index]'? + + The value '{0}' was marked 'InlineIfLambda' but was not determined to have a lambda value. This warning is for informational purposes only. 值 '{0}' 已標示為 'InlineIfLambda',但並未判定為 Lambda 值。此警告僅供參考。 @@ -492,11 +532,26 @@ 屬性無法套用到類型延伸模組。 + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + + Byref types are not allowed in an open type declaration. 開放式類型宣告中不允許 Byref 類型。 + + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + The syntax 'arr.[idx]' is now revised to 'arr[idx]'. Please update your code. + + This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. This expression uses a built-in implicit conversion to convert type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. @@ -542,6 +597,21 @@ use! 不可與 and! 合併 + + Invalid use of reverse index in list expression. + Invalid use of reverse index in list expression. + + + + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + + + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + + A [<Literal>] declaration cannot use an active pattern for its identifier [<Literal>] 宣告不能對其識別碼使用現用模式 @@ -557,6 +627,46 @@ 無法將 '{0}' 指派給標記為常值的值 + + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + This value supports indexing, e.g. '{0}.[index]'. The syntax '{1}[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation. + + + + This expression is not a function and does not support index notation. + This expression is not a function and does not support index notation. + + + + The value '{0}' is not a function and does not support index notation. + The value '{0}' is not a function and does not support index notation. + + + + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use 'expr1.[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + The syntax 'expr1[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction expr1 [expr2]'. + + + + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + + + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + + The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods 只有在計算運算式產生器定義 '{0}' 方法或正確的 'MergeSource' 和 'Bind' 方法時,才可使用 'let! ... and! ...' 建構 @@ -3528,8 +3638,8 @@ - Invalid indexer expression - 無效的索引子運算式 + Incomplete expression or invalid use of indexer syntax + 無效的索引子運算式 @@ -7568,12 +7678,12 @@ - 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]'? 此值並非函式,因而無法套用。您要改用 {0}.[index] 來存取索引子嗎? - 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]'? 此運算式並非函式,因而無法套用。您要改用 expr.[index] 來存取索引子嗎? diff --git a/src/fsharp/xlf/FSStrings.cs.xlf b/src/fsharp/xlf/FSStrings.cs.xlf index e037aa4e939..94ebc0c2090 100644 --- a/src/fsharp/xlf/FSStrings.cs.xlf +++ b/src/fsharp/xlf/FSStrings.cs.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' symbol ..^ diff --git a/src/fsharp/xlf/FSStrings.de.xlf b/src/fsharp/xlf/FSStrings.de.xlf index 7d294c02120..ad17944ba04 100644 --- a/src/fsharp/xlf/FSStrings.de.xlf +++ b/src/fsharp/xlf/FSStrings.de.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' Symbol "..^" diff --git a/src/fsharp/xlf/FSStrings.es.xlf b/src/fsharp/xlf/FSStrings.es.xlf index e6b066ca7b7..7933797188e 100644 --- a/src/fsharp/xlf/FSStrings.es.xlf +++ b/src/fsharp/xlf/FSStrings.es.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' símbolo "..^" diff --git a/src/fsharp/xlf/FSStrings.fr.xlf b/src/fsharp/xlf/FSStrings.fr.xlf index 1ab6695127c..a46ca15ebb0 100644 --- a/src/fsharp/xlf/FSStrings.fr.xlf +++ b/src/fsharp/xlf/FSStrings.fr.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' symbole '..^' diff --git a/src/fsharp/xlf/FSStrings.it.xlf b/src/fsharp/xlf/FSStrings.it.xlf index bb3b19df630..a88f00392de 100644 --- a/src/fsharp/xlf/FSStrings.it.xlf +++ b/src/fsharp/xlf/FSStrings.it.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' simbolo '..^' diff --git a/src/fsharp/xlf/FSStrings.ja.xlf b/src/fsharp/xlf/FSStrings.ja.xlf index a4c18ff3a40..5856cdaaae5 100644 --- a/src/fsharp/xlf/FSStrings.ja.xlf +++ b/src/fsharp/xlf/FSStrings.ja.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' シンボル '..^' diff --git a/src/fsharp/xlf/FSStrings.ko.xlf b/src/fsharp/xlf/FSStrings.ko.xlf index 6990bd92495..3b8d4ebaff9 100644 --- a/src/fsharp/xlf/FSStrings.ko.xlf +++ b/src/fsharp/xlf/FSStrings.ko.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' 기호 '..^' diff --git a/src/fsharp/xlf/FSStrings.pl.xlf b/src/fsharp/xlf/FSStrings.pl.xlf index 5c982a8eea1..adabf20682f 100644 --- a/src/fsharp/xlf/FSStrings.pl.xlf +++ b/src/fsharp/xlf/FSStrings.pl.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' symbol „..^” diff --git a/src/fsharp/xlf/FSStrings.pt-BR.xlf b/src/fsharp/xlf/FSStrings.pt-BR.xlf index 3872b793e67..69632a69081 100644 --- a/src/fsharp/xlf/FSStrings.pt-BR.xlf +++ b/src/fsharp/xlf/FSStrings.pt-BR.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' símbolo '..^' diff --git a/src/fsharp/xlf/FSStrings.ru.xlf b/src/fsharp/xlf/FSStrings.ru.xlf index c6c5f4c7424..5d6cfabdcb4 100644 --- a/src/fsharp/xlf/FSStrings.ru.xlf +++ b/src/fsharp/xlf/FSStrings.ru.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' символ "..^" diff --git a/src/fsharp/xlf/FSStrings.tr.xlf b/src/fsharp/xlf/FSStrings.tr.xlf index 4c85830388a..cac01e588b3 100644 --- a/src/fsharp/xlf/FSStrings.tr.xlf +++ b/src/fsharp/xlf/FSStrings.tr.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' '..^' sembolü diff --git a/src/fsharp/xlf/FSStrings.zh-Hans.xlf b/src/fsharp/xlf/FSStrings.zh-Hans.xlf index d41bd6d0c5a..0c7719b65c6 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hans.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hans.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' 符号 "..^" diff --git a/src/fsharp/xlf/FSStrings.zh-Hant.xlf b/src/fsharp/xlf/FSStrings.zh-Hant.xlf index 6a61a91c542..e812e78c9f5 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hant.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hant.xlf @@ -2,6 +2,11 @@ + + One or more informational messages in loaded file.\n + One or more informational messages in loaded file.\n + + symbol '..^' 符號 '..^' diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/Comments.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/Comments.fs index 0410f5cc3e4..e378a70aaeb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/Comments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/Comments.fs @@ -20,7 +20,7 @@ module Comments = |> ignore // This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/Comments) - //Unexpected symbol '\*' in implementation file$ + [] let ``Comments - E_star02.fs - --test:ErrorRanges`` compilation = compilation @@ -29,7 +29,7 @@ module Comments = |> compile |> shouldFail |> withErrorCode 0010 - |> withDiagnosticMessageMatches "Unexpected symbol '\*' in implementation file$" + |> withDiagnosticMessageMatches @"Unexpected symbol '\)' in implementation file$" |> ignore // This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/Comments) diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/SuggestionsTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/SuggestionsTests.fs index 85a5dbf6dbb..924704c49ae 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/SuggestionsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/SuggestionsTests.fs @@ -175,25 +175,6 @@ let r = { Field1 = "hallo"; Field2 = 1 } |> withSingleDiagnostic (Error 39, Line 8, Col 11, Line 8, Col 17, ("The record label 'Field1' is not defined. Maybe you want one of the following:" + System.Environment.NewLine + " MyRecord.Field1")) - [] - let ``Suggest To Use Indexer`` () = - FSharp """ -let d = [1,1] |> dict -let y = d[1] - -let z = d[|1|] - -let f() = d -let a = (f())[1] - """ - |> typecheck - |> shouldFail - |> withDiagnostics [ - (Error 3217, Line 3, Col 9, Line 3, Col 10, "This value is not a function and cannot be applied. Did you intend to access the indexer via d.[index] instead?") - (Error 3, Line 5, Col 9, Line 5, Col 10, "This value is not a function and cannot be applied.") - (Error 3217, Line 8, Col 10, Line 8, Col 13, "This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead?")] - - [] let ``Suggest Type Parameters`` () = FSharp """ diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WrongSyntaxInForLoop.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WrongSyntaxInForLoop.fs index 037624160a1..774ac1fda65 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WrongSyntaxInForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WrongSyntaxInForLoop.fs @@ -8,7 +8,7 @@ open FSharp.Test.Compiler module ``Wrong syntax in for loop`` = - [] + [] let ``Equals instead of in``() = FSharp """ module X diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index f0a2ce45afe..15cf4603032 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -3604,8 +3604,7 @@ FSharp.Compiler.EditorServices.Structure+Collapse: System.String ToString() FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 ArrayOrList FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 Attribute FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 Comment -FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 CompExpr -FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 CompExprInternal +FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 ComputationExpr FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 Do FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 ElseInIfThenElse FSharp.Compiler.EditorServices.Structure+Scope+Tags: Int32 EnumCase @@ -3654,8 +3653,7 @@ FSharp.Compiler.EditorServices.Structure+Scope: Boolean Equals(System.Object, Sy FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsArrayOrList FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsAttribute FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsComment -FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsCompExpr -FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsCompExprInternal +FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsComputationExpr FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsDo FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsElseInIfThenElse FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsEnumCase @@ -3701,8 +3699,7 @@ FSharp.Compiler.EditorServices.Structure+Scope: Boolean IsYieldOrReturnBang FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsArrayOrList() FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsAttribute() FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsComment() -FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsCompExpr() -FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsCompExprInternal() +FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsComputationExpr() FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsDo() FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsElseInIfThenElse() FSharp.Compiler.EditorServices.Structure+Scope: Boolean get_IsEnumCase() @@ -3756,8 +3753,7 @@ FSharp.Compiler.EditorServices.Structure+Scope: Int32 get_Tag() FSharp.Compiler.EditorServices.Structure+Scope: Scope ArrayOrList FSharp.Compiler.EditorServices.Structure+Scope: Scope Attribute FSharp.Compiler.EditorServices.Structure+Scope: Scope Comment -FSharp.Compiler.EditorServices.Structure+Scope: Scope CompExpr -FSharp.Compiler.EditorServices.Structure+Scope: Scope CompExprInternal +FSharp.Compiler.EditorServices.Structure+Scope: Scope ComputationExpr FSharp.Compiler.EditorServices.Structure+Scope: Scope Do FSharp.Compiler.EditorServices.Structure+Scope: Scope ElseInIfThenElse FSharp.Compiler.EditorServices.Structure+Scope: Scope EnumCase @@ -3803,8 +3799,7 @@ FSharp.Compiler.EditorServices.Structure+Scope: Scope YieldOrReturnBang FSharp.Compiler.EditorServices.Structure+Scope: Scope get_ArrayOrList() FSharp.Compiler.EditorServices.Structure+Scope: Scope get_Attribute() FSharp.Compiler.EditorServices.Structure+Scope: Scope get_Comment() -FSharp.Compiler.EditorServices.Structure+Scope: Scope get_CompExpr() -FSharp.Compiler.EditorServices.Structure+Scope: Scope get_CompExprInternal() +FSharp.Compiler.EditorServices.Structure+Scope: Scope get_ComputationExpr() FSharp.Compiler.EditorServices.Structure+Scope: Scope get_Do() FSharp.Compiler.EditorServices.Structure+Scope: Scope get_ElseInIfThenElse() FSharp.Compiler.EditorServices.Structure+Scope: Scope get_EnumCase() @@ -6149,24 +6144,22 @@ FSharp.Compiler.Syntax.SynExpr+ArrayOrList: FSharp.Compiler.Text.Range get_range FSharp.Compiler.Syntax.SynExpr+ArrayOrList: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExpr+ArrayOrList: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr] exprs FSharp.Compiler.Syntax.SynExpr+ArrayOrList: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr] get_exprs() -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: Boolean get_isArray() -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: Boolean isArray -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: FSharp.Compiler.Syntax.SynExpr expr -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: FSharp.Compiler.Syntax.SynExpr get_expr() -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: Boolean get_isArray() +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: Boolean isArray +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: FSharp.Compiler.Syntax.SynExpr expr +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: FSharp.Compiler.Syntax.SynExpr get_expr() +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExpr+Assert: FSharp.Compiler.Syntax.SynExpr expr FSharp.Compiler.Syntax.SynExpr+Assert: FSharp.Compiler.Syntax.SynExpr get_expr() FSharp.Compiler.Syntax.SynExpr+Assert: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+Assert: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+CompExpr: Boolean get_isArrayOrList() -FSharp.Compiler.Syntax.SynExpr+CompExpr: Boolean isArrayOrList -FSharp.Compiler.Syntax.SynExpr+CompExpr: FSharp.Compiler.Syntax.SynExpr expr -FSharp.Compiler.Syntax.SynExpr+CompExpr: FSharp.Compiler.Syntax.SynExpr get_expr() -FSharp.Compiler.Syntax.SynExpr+CompExpr: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynExpr+CompExpr: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+CompExpr: Microsoft.FSharp.Core.FSharpRef`1[System.Boolean] get_isNotNakedRefCell() -FSharp.Compiler.Syntax.SynExpr+CompExpr: Microsoft.FSharp.Core.FSharpRef`1[System.Boolean] isNotNakedRefCell +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: Boolean get_hasSeqBuilder() +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: Boolean hasSeqBuilder +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: FSharp.Compiler.Syntax.SynExpr expr +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: FSharp.Compiler.Syntax.SynExpr get_expr() +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExpr+ComputationExpr: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExpr+Const: FSharp.Compiler.Syntax.SynConst constant FSharp.Compiler.Syntax.SynExpr+Const: FSharp.Compiler.Syntax.SynConst get_constant() FSharp.Compiler.Syntax.SynExpr+Const: FSharp.Compiler.Text.Range get_range() @@ -6191,16 +6184,18 @@ FSharp.Compiler.Syntax.SynExpr+DotGet: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+DotGet: FSharp.Compiler.Text.Range get_rangeOfDot() FSharp.Compiler.Syntax.SynExpr+DotGet: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExpr+DotGet: FSharp.Compiler.Text.Range rangeOfDot +FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Syntax.SynExpr get_indexArgs() FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Syntax.SynExpr get_objectExpr() +FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Syntax.SynExpr indexArgs FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Syntax.SynExpr objectExpr FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Text.Range dotRange FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Text.Range get_dotRange() FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg] get_indexExprs() -FSharp.Compiler.Syntax.SynExpr+DotIndexedGet: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg] indexExprs +FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr get_indexArgs() FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr get_objectExpr() FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr get_valueExpr() +FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr indexArgs FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr objectExpr FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Syntax.SynExpr valueExpr FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Text.Range dotRange @@ -6209,8 +6204,6 @@ FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Text.Range get_lef FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Text.Range leftOfSetRange FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg] get_indexExprs() -FSharp.Compiler.Syntax.SynExpr+DotIndexedSet: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg] indexExprs FSharp.Compiler.Syntax.SynExpr+DotNamedIndexedPropertySet: FSharp.Compiler.Syntax.LongIdentWithDots get_longDotId() FSharp.Compiler.Syntax.SynExpr+DotNamedIndexedPropertySet: FSharp.Compiler.Syntax.LongIdentWithDots longDotId FSharp.Compiler.Syntax.SynExpr+DotNamedIndexedPropertySet: FSharp.Compiler.Syntax.SynExpr argExpr @@ -6297,6 +6290,22 @@ FSharp.Compiler.Syntax.SynExpr+IfThenElse: Microsoft.FSharp.Core.FSharpOption`1[ FSharp.Compiler.Syntax.SynExpr+IfThenElse: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_elseKeyword() FSharp.Compiler.Syntax.SynExpr+ImplicitZero: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+ImplicitZero: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynExpr+IndexFromEnd: FSharp.Compiler.Syntax.SynExpr expr +FSharp.Compiler.Syntax.SynExpr+IndexFromEnd: FSharp.Compiler.Syntax.SynExpr get_expr() +FSharp.Compiler.Syntax.SynExpr+IndexFromEnd: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExpr+IndexFromEnd: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range get_opm() +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range get_range1() +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range get_range2() +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range opm +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range range1 +FSharp.Compiler.Syntax.SynExpr+IndexRange: FSharp.Compiler.Text.Range range2 +FSharp.Compiler.Syntax.SynExpr+IndexRange: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] expr1 +FSharp.Compiler.Syntax.SynExpr+IndexRange: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] expr2 +FSharp.Compiler.Syntax.SynExpr+IndexRange: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] get_expr1() +FSharp.Compiler.Syntax.SynExpr+IndexRange: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] get_expr2() FSharp.Compiler.Syntax.SynExpr+InferredDowncast: FSharp.Compiler.Syntax.SynExpr expr FSharp.Compiler.Syntax.SynExpr+InferredDowncast: FSharp.Compiler.Syntax.SynExpr get_expr() FSharp.Compiler.Syntax.SynExpr+InferredDowncast: FSharp.Compiler.Text.Range get_range() @@ -6526,9 +6535,9 @@ FSharp.Compiler.Syntax.SynExpr+Tags: Int32 AnonRecd FSharp.Compiler.Syntax.SynExpr+Tags: Int32 App FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ArbitraryAfterError FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ArrayOrList -FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ArrayOrListOfSeqExpr +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ArrayOrListComputed FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Assert -FSharp.Compiler.Syntax.SynExpr+Tags: Int32 CompExpr +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ComputationExpr FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Const FSharp.Compiler.Syntax.SynExpr+Tags: Int32 DiscardAfterMissingQualificationAfterDot FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Do @@ -6546,6 +6555,8 @@ FSharp.Compiler.Syntax.SynExpr+Tags: Int32 FromParseError FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Ident FSharp.Compiler.Syntax.SynExpr+Tags: Int32 IfThenElse FSharp.Compiler.Syntax.SynExpr+Tags: Int32 ImplicitZero +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 IndexFromEnd +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 IndexRange FSharp.Compiler.Syntax.SynExpr+Tags: Int32 InferredDowncast FSharp.Compiler.Syntax.SynExpr+Tags: Int32 InferredUpcast FSharp.Compiler.Syntax.SynExpr+Tags: Int32 InterpolatedString @@ -6682,9 +6693,9 @@ FSharp.Compiler.Syntax.SynExpr: Boolean IsApp FSharp.Compiler.Syntax.SynExpr: Boolean IsArbExprAndThusAlreadyReportedError FSharp.Compiler.Syntax.SynExpr: Boolean IsArbitraryAfterError FSharp.Compiler.Syntax.SynExpr: Boolean IsArrayOrList -FSharp.Compiler.Syntax.SynExpr: Boolean IsArrayOrListOfSeqExpr +FSharp.Compiler.Syntax.SynExpr: Boolean IsArrayOrListComputed FSharp.Compiler.Syntax.SynExpr: Boolean IsAssert -FSharp.Compiler.Syntax.SynExpr: Boolean IsCompExpr +FSharp.Compiler.Syntax.SynExpr: Boolean IsComputationExpr FSharp.Compiler.Syntax.SynExpr: Boolean IsConst FSharp.Compiler.Syntax.SynExpr: Boolean IsDiscardAfterMissingQualificationAfterDot FSharp.Compiler.Syntax.SynExpr: Boolean IsDo @@ -6702,6 +6713,8 @@ FSharp.Compiler.Syntax.SynExpr: Boolean IsFromParseError FSharp.Compiler.Syntax.SynExpr: Boolean IsIdent FSharp.Compiler.Syntax.SynExpr: Boolean IsIfThenElse FSharp.Compiler.Syntax.SynExpr: Boolean IsImplicitZero +FSharp.Compiler.Syntax.SynExpr: Boolean IsIndexFromEnd +FSharp.Compiler.Syntax.SynExpr: Boolean IsIndexRange FSharp.Compiler.Syntax.SynExpr: Boolean IsInferredDowncast FSharp.Compiler.Syntax.SynExpr: Boolean IsInferredUpcast FSharp.Compiler.Syntax.SynExpr: Boolean IsInterpolatedString @@ -6746,9 +6759,9 @@ FSharp.Compiler.Syntax.SynExpr: Boolean get_IsApp() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsArbExprAndThusAlreadyReportedError() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsArbitraryAfterError() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsArrayOrList() -FSharp.Compiler.Syntax.SynExpr: Boolean get_IsArrayOrListOfSeqExpr() +FSharp.Compiler.Syntax.SynExpr: Boolean get_IsArrayOrListComputed() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsAssert() -FSharp.Compiler.Syntax.SynExpr: Boolean get_IsCompExpr() +FSharp.Compiler.Syntax.SynExpr: Boolean get_IsComputationExpr() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsConst() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsDiscardAfterMissingQualificationAfterDot() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsDo() @@ -6766,6 +6779,8 @@ FSharp.Compiler.Syntax.SynExpr: Boolean get_IsFromParseError() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsIdent() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsIfThenElse() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsImplicitZero() +FSharp.Compiler.Syntax.SynExpr: Boolean get_IsIndexFromEnd() +FSharp.Compiler.Syntax.SynExpr: Boolean get_IsIndexRange() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsInferredDowncast() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsInferredUpcast() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsInterpolatedString() @@ -6809,16 +6824,16 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAnonRecd(Boole FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewApp(FSharp.Compiler.Syntax.ExprAtomicFlag, Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArbitraryAfterError(System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArrayOrList(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArrayOrListOfSeqExpr(Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewArrayOrListComputed(Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewAssert(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewCompExpr(Boolean, Microsoft.FSharp.Core.FSharpRef`1[System.Boolean], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewComputationExpr(Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewConst(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDiscardAfterMissingQualificationAfterDot(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDo(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDoBang(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotGet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.LongIdentWithDots, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotIndexedGet(FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg], FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotIndexedSet(FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynIndexerArg], FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotIndexedGet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotIndexedSet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotNamedIndexedPropertySet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.LongIdentWithDots, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDotSet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.LongIdentWithDots, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewDowncast(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) @@ -6829,6 +6844,8 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewFromParseError FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewIdent(FSharp.Compiler.Syntax.Ident) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewIfThenElse(FSharp.Compiler.Text.Range, Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Syntax.DebugPointAtBinding, Boolean, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewImplicitZero(FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewIndexFromEnd(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewIndexRange(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewInferredDowncast(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewInferredUpcast(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewInterpolatedString(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynInterpolatedStringPart], FSharp.Compiler.Syntax.SynStringKind, FSharp.Compiler.Text.Range) @@ -6872,9 +6889,9 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+AnonRecd FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+App FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ArbitraryAfterError FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ArrayOrList -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ArrayOrListOfSeqExpr +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ArrayOrListComputed FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Assert -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+CompExpr +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ComputationExpr FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Const FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+DiscardAfterMissingQualificationAfterDot FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Do @@ -6892,6 +6909,8 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+FromParseError FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Ident FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+IfThenElse FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+ImplicitZero +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+IndexFromEnd +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+IndexRange FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+InferredDowncast FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+InferredUpcast FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+InterpolatedString @@ -6961,43 +6980,6 @@ FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Com FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynField: System.String ToString() -FSharp.Compiler.Syntax.SynIndexerArg -FSharp.Compiler.Syntax.SynIndexerArg+One: Boolean fromEnd -FSharp.Compiler.Syntax.SynIndexerArg+One: Boolean get_fromEnd() -FSharp.Compiler.Syntax.SynIndexerArg+One: FSharp.Compiler.Syntax.SynExpr expr -FSharp.Compiler.Syntax.SynIndexerArg+One: FSharp.Compiler.Syntax.SynExpr get_expr() -FSharp.Compiler.Syntax.SynIndexerArg+One: FSharp.Compiler.Text.Range Item3 -FSharp.Compiler.Syntax.SynIndexerArg+One: FSharp.Compiler.Text.Range get_Item3() -FSharp.Compiler.Syntax.SynIndexerArg+Tags: Int32 One -FSharp.Compiler.Syntax.SynIndexerArg+Tags: Int32 Two -FSharp.Compiler.Syntax.SynIndexerArg+Two: Boolean fromEnd1 -FSharp.Compiler.Syntax.SynIndexerArg+Two: Boolean fromEnd2 -FSharp.Compiler.Syntax.SynIndexerArg+Two: Boolean get_fromEnd1() -FSharp.Compiler.Syntax.SynIndexerArg+Two: Boolean get_fromEnd2() -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Syntax.SynExpr expr1 -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Syntax.SynExpr expr2 -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Syntax.SynExpr get_expr1() -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Syntax.SynExpr get_expr2() -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Text.Range get_range1() -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Text.Range get_range2() -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Text.Range range1 -FSharp.Compiler.Syntax.SynIndexerArg+Two: FSharp.Compiler.Text.Range range2 -FSharp.Compiler.Syntax.SynIndexerArg: Boolean IsOne -FSharp.Compiler.Syntax.SynIndexerArg: Boolean IsTwo -FSharp.Compiler.Syntax.SynIndexerArg: Boolean get_IsOne() -FSharp.Compiler.Syntax.SynIndexerArg: Boolean get_IsTwo() -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Syntax.SynIndexerArg NewOne(FSharp.Compiler.Syntax.SynExpr, Boolean, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Syntax.SynIndexerArg NewTwo(FSharp.Compiler.Syntax.SynExpr, Boolean, FSharp.Compiler.Syntax.SynExpr, Boolean, FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Syntax.SynIndexerArg+One -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Syntax.SynIndexerArg+Tags -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Syntax.SynIndexerArg+Two -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Text.Range Range -FSharp.Compiler.Syntax.SynIndexerArg: FSharp.Compiler.Text.Range get_Range() -FSharp.Compiler.Syntax.SynIndexerArg: Int32 Tag -FSharp.Compiler.Syntax.SynIndexerArg: Int32 get_Tag() -FSharp.Compiler.Syntax.SynIndexerArg: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr] Exprs -FSharp.Compiler.Syntax.SynIndexerArg: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr] get_Exprs() -FSharp.Compiler.Syntax.SynIndexerArg: System.String ToString() FSharp.Compiler.Syntax.SynInterfaceImpl FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynInterfaceImpl NewSynInterfaceImpl(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynType get_interfaceTy() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs index eec1adbc567..328574bdac0 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs @@ -1091,7 +1091,7 @@ type ListModule02() = Assert.AreEqual([(1,2,3); (2,4,6); (3,6,9)], resultInt) // string List - let resultStr = List.zip3[2;3;4;5] ["b";"c";"d";"e"] ["II"; "III"; "IV"; "V"] + let resultStr = List.zip3 [2;3;4;5] ["b";"c";"d";"e"] ["II"; "III"; "IV"; "V"] Assert.AreEqual([(2,"b","II");(3,"c","III");(4,"d","IV");(5,"e","V")], resultStr) // empty List diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs index 1e63a7f26d7..b6ea2986447 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs @@ -270,7 +270,7 @@ type SeqModule() = let stringArray = [|"a";"b"|] let stringSeq = Seq.cast stringArray - let expectedStringSeq = seq["a";"b"] + let expectedStringSeq = seq ["a";"b"] VerifySeqsEqual expectedStringSeq stringSeq @@ -467,7 +467,7 @@ type SeqModule() = VerifySeqsEqual expectedStrSeq conStrSeq // Empty Seq - let emptySeqs = seq [seq[ Seq.empty;Seq.empty];seq[ Seq.empty;Seq.empty]] + let emptySeqs = seq [seq [ Seq.empty;Seq.empty];seq [ Seq.empty;Seq.empty]] let conEmptySeq = Seq.concat emptySeqs let expectedEmptySeq =seq { for i in 1..4 do yield Seq.empty} diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs index 1178cd57488..5b993364c13 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs @@ -331,7 +331,7 @@ type SeqModule2() = Assert.False(is_emptyInt) //seq str - let seqStr = seq["first";"second"] + let seqStr = seq ["first";"second"] let is_emptyStr = Seq.isEmpty seqStr Assert.False(is_emptyInt) @@ -541,7 +541,7 @@ type SeqModule2() = // string Seq let funcStr (x:int) (y:string) = x+y.Length - let resultStr = Seq.map2 funcStr (seq[3;6;9;11]) (seq ["Lists"; "Are"; "Commonly" ; "List" ]) + let resultStr = Seq.map2 funcStr (seq [3;6;9;11]) (seq ["Lists"; "Are"; "Commonly" ; "List" ]) let expectedSeq = seq [8;9;17;15] VerifySeqsEqual expectedSeq resultStr @@ -881,7 +881,7 @@ type SeqModule2() = // string Seq let funcStr (x:int) (y:int) (z:string) = x+y+z.Length - let resultStr = Seq.mapi2 funcStr (seq[3;6;9;11]) (seq ["Lists"; "Are"; "Commonly" ; "List" ]) + let resultStr = Seq.mapi2 funcStr (seq [3;6;9;11]) (seq ["Lists"; "Are"; "Commonly" ; "List" ]) let expectedSeq = seq [8;10;19;18] VerifySeqsEqual expectedSeq resultStr @@ -1167,11 +1167,11 @@ type SeqModule2() = member this.Rev() = // integer Seq let resultInt = Seq.rev (seq [5;4;3;2;1]) - VerifySeqsEqual (seq[1;2;3;4;5]) resultInt + VerifySeqsEqual (seq [1;2;3;4;5]) resultInt // string Seq let resultStr = Seq.rev (seq ["A"; "B"; "C" ; "D" ]) - VerifySeqsEqual (seq["D";"C";"B";"A"]) resultStr + VerifySeqsEqual (seq ["D";"C";"B";"A"]) resultStr // empty Seq VerifySeqsEqual Seq.empty (Seq.rev Seq.empty) @@ -1380,9 +1380,9 @@ type SeqModule2() = VerifySeqsEqual resultEpt Seq.empty // tuple Seq - let tupSeq = (seq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]) + let tupSeq = (seq [(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]) let resultTup = Seq.sortDescending tupSeq - let expectedTup = (seq[(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")]) + let expectedTup = (seq [(2,"x");(2,"b");(2,"a");(1,"x");(1,"d");(1,"b");(1,"a")]) VerifySeqsEqual expectedTup resultTup // float Seq @@ -1417,9 +1417,9 @@ type SeqModule2() = VerifySeqsEqual resultEpt Seq.empty // tuple Seq - let tupSeq = (seq[(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]) + let tupSeq = (seq [(2,"a");(1,"d");(1,"b");(1,"a");(2,"x");(2,"b");(1,"x")]) let resultTup = Seq.sortByDescending snd tupSeq - let expectedTup = (seq[(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")]) + let expectedTup = (seq [(2,"x");(1,"x");(1,"d");(1,"b");(2,"b");(2,"a");(1,"a")]) VerifySeqsEqual expectedTup resultTup // float Seq diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index e796ffa627b..511b0db5a1e 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -725,7 +725,7 @@ module rec Compiler = match result with | Success r | Failure r -> if not <| diagnosticMatches pattern r.Diagnostics then - failwith "Expected diagnostic message pattern was not found in compilation diagnostics." + failwithf "Expected diagnostic message pattern was not found in compilation diagnostics.\nDiagnostics:\n%A" r.Diagnostics result let withDiagnosticMessageDoesntMatch (pattern: string) (result: TestResult) : TestResult = diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 42418bd4d70..53fc3060bca 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -682,6 +682,7 @@ type CompilerAssert private () = parseResults.Diagnostics |> Array.distinctBy (fun e -> e.Severity, e.ErrorNumber, e.StartLine, e.StartColumn, e.EndLine, e.EndColumn, e.Message) + printfn $"diagnostics: %A{[| for e in errors -> e.Severity, e.ErrorNumber, e.StartLine, e.StartColumn, e.EndLine, e.EndColumn, e.Message |]}" Assert.AreEqual(Array.length expectedParseErrors, errors.Length, sprintf "Parse errors: %A" parseResults.Diagnostics) Array.zip errors expectedParseErrors diff --git a/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs b/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs index 5c1c8796862..bda70e564be 100644 --- a/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs +++ b/tests/fsharp/Compiler/Conformance/DataExpressions/ComputationExpressions.fs @@ -720,7 +720,7 @@ type ContentBuilder() = member this.Run(c: Content) = let crlf = "\r\n"B [|for part in List.rev c do - yield! part.Array.[part.Offset..(part.Count+part.Offset-1)] + yield! part.Array[part.Offset..(part.Count+part.Offset-1)] yield! crlf |] member this.Yield(_) = [] diff --git a/tests/fsharp/Compiler/Language/CustomCollectionTests.fs b/tests/fsharp/Compiler/Language/CustomCollectionTests.fs index e5106029ef8..fa6da06aeb8 100644 --- a/tests/fsharp/Compiler/Language/CustomCollectionTests.fs +++ b/tests/fsharp/Compiler/Language/CustomCollectionTests.fs @@ -17,9 +17,9 @@ type foo() = member _.Item with get (_x: string) = i and set idx value = i <- idx + value let a = foo() -a.[^"2"] <- "-1" +a[^"2"] <- "-1" -if a.["2"] <> "2 -1" then failwithf "expected 2 -1 but got %A" a.["2"] +if a["2"] <> "2 -1" then failwithf "expected 2 -1 but got %A" a["2"] """ [] @@ -34,9 +34,9 @@ type foo() = member this.GetSlice(_: string option, _: string option) = i let a = foo() -a.[^"2"..^"1"] <- "-1" +a[^"2"..^"1"] <- "-1" -if a.["2".."1"] <> "2 1 -1" then failwithf "expected 2 1 -1 but got %A" a.["2".."1"] +if a["2".."1"] <> "2 1 -1" then failwithf "expected 2 1 -1 but got %A" a["2".."1"] """ [] @@ -51,7 +51,7 @@ type foo() = let a = foo() -if a.[^2] <> 12 then failwith "expected 12" +if a[^2] <> 12 then failwith "expected 12" """ [] @@ -66,9 +66,9 @@ type foo() = member _.Item with get (_x: string) = i and set (idx1, idx2) value = i <- idx1 + " " + idx2 + " " + value let a = foo() -a.[^"1",^"2"] <- "3" +a[^"1",^"2"] <- "3" -if a.[""] <> "0 1 1 2 3" then failwithf "expected 0 1 1 2 3 but got %A" a.[""] +if a[""] <> "0 1 1 2 3" then failwithf "expected 0 1 1 2 3 but got %A" a[""] """ [] @@ -83,7 +83,7 @@ type foo() = let a = foo() -if a.[^2,^1] <> 24 then failwithf "expected 23 but got %A" a.[^2,^1] +if a[^2,^1] <> 24 then failwithf "expected 23 but got %A" a[^2,^1] """ [] @@ -120,7 +120,7 @@ type foo() = let a = foo() -if a.[^2..1] <> 13 then failwith "expected 13" +if a[^2..1] <> 13 then failwith "expected 13" """ [] @@ -137,9 +137,9 @@ type foo() = let a = foo() -if a.[^2..1] <> 13 then failwith "expected 13" +if a[^2..1] <> 13 then failwith "expected 13" """ FSharpDiagnosticSeverity.Error 39 - (12,7,12,9) + (12,6,12,8) "The type 'foo' does not define the field, constructor or member 'GetReverseIndex'." diff --git a/tests/fsharp/Compiler/Language/HatDesugaringTests.fs b/tests/fsharp/Compiler/Language/HatDesugaringTests.fs index d9f47a9b4b9..3613ea1d362 100644 --- a/tests/fsharp/Compiler/Language/HatDesugaringTests.fs +++ b/tests/fsharp/Compiler/Language/HatDesugaringTests.fs @@ -28,7 +28,7 @@ module X open System let (^) (x: int) (y: int) = x + y -let result = [1;2].[^1..] +let result = [1;2][^1..] if result <> [1;2] then failwithf "expected result to be [1;2] but got %A" result Console.WriteLine() """ @@ -42,24 +42,20 @@ module X let x = @1 """ [| - FSharpDiagnosticSeverity.Error, 10, (4,9,4,10), "Unexpected infix operator in binding" + FSharpDiagnosticSeverity.Error, 1208, (4,9,4,10), "Invalid prefix operator" |] [] - let ``Hat operator should not be overloadable in prefix context``() = + let ``Hat operator should not be overloadable as prefix operator``() = CompilerAssert.ParseWithErrors """ module X open System let (~^) (x: int) (y:int) = x + y - -Console.WriteLine(^1) """ [| FSharpDiagnosticSeverity.Error, 1208, (5,6,5,8), "Invalid operator definition. Prefix operator definitions must use a valid prefix operator name."; - FSharpDiagnosticSeverity.Error, 10, (7,20,7,21), "Unexpected integer literal in expression. Expected ')' or other token."; - FSharpDiagnosticSeverity.Error, 583, (7,18,7,19), "Unmatched '('"; |] [] @@ -70,10 +66,10 @@ module X open System let list = [1;2;3] -Console.WriteLine(list.[@1..]) +Console.WriteLine(list[@1..]) """ [| - FSharpDiagnosticSeverity.Error, 1208, (6,25,6,26), "Invalid prefix operator" + FSharpDiagnosticSeverity.Error, 1208, (6,24,6,25), "Invalid prefix operator" |] [] @@ -84,10 +80,10 @@ module X open System let list = [1;2;3] -Console.WriteLine(list.[..@1]) +Console.WriteLine(list[..@1]) """ [| - FSharpDiagnosticSeverity.Error, 1208, (6,25,6,28), "Invalid prefix operator" + FSharpDiagnosticSeverity.Error, 1208, (6,24,6,27), "Invalid prefix operator" |] [] @@ -98,11 +94,11 @@ module X open System let list = [1;2;3] -Console.WriteLine(list.[@1..@1]) +Console.WriteLine(list[@1..@1]) """ [| - FSharpDiagnosticSeverity.Error, 1208, (6,25,6,26), "Invalid prefix operator"; - FSharpDiagnosticSeverity.Error, 1208, (6,29,6,30), "Invalid prefix operator" + FSharpDiagnosticSeverity.Error, 1208, (6,24,6,25), "Invalid prefix operator"; + FSharpDiagnosticSeverity.Error, 1208, (6,28,6,29), "Invalid prefix operator" |] [] @@ -113,8 +109,8 @@ module X open System let list = [1;2;3] -Console.WriteLine(list.[@11]) +Console.WriteLine(list[@11]) """ [| - FSharpDiagnosticSeverity.Error, 1208, (6,25,6,26), "Invalid prefix operator" + FSharpDiagnosticSeverity.Error, 1208, (6,24,6,25), "Invalid prefix operator" |] diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.bsl b/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.bsl new file mode 100644 index 00000000000..8513a2590bc --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.bsl @@ -0,0 +1,4 @@ + +test-langversion-5.0.fsx(9,18,9,21): typecheck error FS0001: The type 'float' does not match the type 'int' + +test-langversion-5.0.fsx(9,16,9,17): typecheck error FS0043: The type 'float' does not match the type 'int' diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.fsx b/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.fsx new file mode 100644 index 00000000000..7f44d714162 --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-5.0.fsx @@ -0,0 +1,19 @@ +let f1 a = () +let f2 a b = () + +let v1 = f1[1] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v2 = f2[1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v3 = f2 [1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v4 = f2 (id [1])[2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview + +let _error = 1 + 1.0 + +let xs = [1] +let v5 = xs@[1] //should not give warning + +let arr2 = [| 1 .. 5 |] +arr2.[1..] <- [| 9;8;7;6 |] //should not give warning + +let expectedLists = Array2D.zeroCreate 6 6 +expectedLists.[1,1] <- [ [1] ] //should not give warning + diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.bsl b/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.bsl new file mode 100644 index 00000000000..a2ae7d91887 --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.bsl @@ -0,0 +1,12 @@ + +test-langversion-default.fsx(4,10,4,15): typecheck info FS3367: The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + +test-langversion-default.fsx(5,10,5,15): typecheck info FS3367: The syntax 'expr1[expr2]' is now reserved for indexing. See https://aka.ms/fsharp-index-notation. If calling a function, add a space between the function and argument, e.g. 'someFunction [expr]'. + +test-langversion-default.fsx(6,13,6,19): typecheck info FS3368: The syntax '[expr1][expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + +test-langversion-default.fsx(7,13,7,24): typecheck info FS3368: The syntax '(expr1)[expr2]' is now reserved for indexing and is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + +test-langversion-default.fsx(9,18,9,21): typecheck error FS0001: The type 'float' does not match the type 'int' + +test-langversion-default.fsx(9,16,9,17): typecheck error FS0043: The type 'float' does not match the type 'int' diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.fsx b/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.fsx new file mode 100644 index 00000000000..7f44d714162 --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-default.fsx @@ -0,0 +1,19 @@ +let f1 a = () +let f2 a b = () + +let v1 = f1[1] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v2 = f2[1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v3 = f2 [1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v4 = f2 (id [1])[2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview + +let _error = 1 + 1.0 + +let xs = [1] +let v5 = xs@[1] //should not give warning + +let arr2 = [| 1 .. 5 |] +arr2.[1..] <- [| 9;8;7;6 |] //should not give warning + +let expectedLists = Array2D.zeroCreate 6 6 +expectedLists.[1,1] <- [ [1] ] //should not give warning + diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.bsl b/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.bsl new file mode 100644 index 00000000000..3cc3850adfe --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.bsl @@ -0,0 +1,12 @@ + +test-langversion-preview.fsx(4,10,4,15): typecheck info FS3365: The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + +test-langversion-preview.fsx(5,10,5,15): typecheck info FS3365: The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. + +test-langversion-preview.fsx(6,13,6,19): typecheck error FS3369: The syntax '[expr1][expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction [expr1] [expr2]'. + +test-langversion-preview.fsx(7,13,7,24): typecheck error FS3369: The syntax '(expr1)[expr2]' is ambiguous when used as an argument. See https://aka.ms/fsharp-index-notation. If you intend indexing or slicing then you must use '(expr1).[expr2]' in argument position. If calling a function with multiple curried arguments, add a space between them, e.g. 'someFunction (expr1) [expr2]'. + +test-langversion-preview.fsx(9,18,9,21): typecheck error FS0001: The type 'float' does not match the type 'int' + +test-langversion-preview.fsx(9,16,9,17): typecheck error FS0043: The type 'float' does not match the type 'int' diff --git a/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.fsx b/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.fsx new file mode 100644 index 00000000000..25159f89ff3 --- /dev/null +++ b/tests/fsharp/core/array-no-dot-warnings/test-langversion-preview.fsx @@ -0,0 +1,18 @@ +let f1 a = () +let f2 a b = () + +let v1 = f1[1] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v2 = f2[1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v3 = f2 [1][2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview +let v4 = f2 (id [1])[2] // with langversion 'default' or 'latest' enabled this should give a warning saying to add a space or enable preview + +let _error = 1 + 1.0 + +let xs = [1] +let v5 = xs@[1] //should not give warning + +let arr2 = [| 1 .. 5 |] +arr2.[1..] <- [| 9;8;7;6 |] //should not give warning + +let expectedLists = Array2D.zeroCreate 6 6 +expectedLists.[1,1] <- [ [1] ] //should not give warning diff --git a/tests/fsharp/core/array-no-dot/test.fsx b/tests/fsharp/core/array-no-dot/test.fsx new file mode 100644 index 00000000000..4cba7c3268b --- /dev/null +++ b/tests/fsharp/core/array-no-dot/test.fsx @@ -0,0 +1,444 @@ +// #Conformance #Arrays #Stress #Structs #Mutable #ControlFlow #LetBindings +#if TESTS_AS_APP +module Core_array +#endif + +let mutable failures = [] +let report_failure (s) = + stderr.WriteLine " NO"; failures <- s :: failures +let test s b = if not b then (stderr.Write(s:string); report_failure(s) ) +let check s b1 b2 = test s (b1 = b2) + + +(* TEST SUITE FOR Array *) + +module Array2Tests = + + let test_make_get_set_length () = + let arr = Array2D.create 3 4 0 in + test "fewoih1" (Array2D.get arr 0 0 = 0); + test "fewoih2" (Array2D.get arr 0 1 = 0); + test "vvrew03" (Array2D.get arr 2 2 = 0); + test "vvrew04" (Array2D.get arr 2 3 = 0); + ignore (Array2D.set arr 0 2 4); + test "vsdiuvs5" (Array2D.get arr 0 2 = 4); + arr[0,2] <- 2; + test "vsdiuvs6" (arr[0,2] = 2); + test "vropivrwe7" (Array2D.length1 arr = 3); + test "vropivrwe8" (Array2D.length2 arr = 4) + + let a = Array2D.init 10 10 (fun i j -> i,j) + let b = Array2D.init 2 2 (fun i j -> i+1,j+1) + //test "a2_sub" + // (Array2D.sub a 1 1 2 2 = b) + + + Array2D.blit b 0 0 a 0 0 2 2 + //test "a2_blit" + // (Array2D.sub a 0 0 2 2 = b) + + let _ = test_make_get_set_length () + +module ArrayNonZeroBasedTestsSlice = + let runTest () = + let arr = (Array2D.initBased 5 4 3 2 (fun i j -> (i,j))) + test "fewoih1" (arr[6,*] = [|(6, 4); (6, 5)|]) + test "fewoih2" (arr[*,*][1,*] = [|(6, 4); (6, 5)|]) + test "fewoih3" (arr[*,5] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih4" (arr[*,*][*,1] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih5" (arr.GetLowerBound(0) = 5) + test "fewoih6" (arr.GetLowerBound(1) = 4) + test "fewoih7" (arr[*,*].GetLowerBound(0) = 0) + test "fewoih8" (arr[*,*].GetLowerBound(1) = 0) + test "fewoih9" (arr[*,*][0..,1] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih10" (arr[*,*][1..,1] = [|(6, 5); (7, 5)|]) + let arr2d = + let arr = Array2D.zeroCreateBased 5 4 3 2 + for i in 5..7 do for j in 4..5 do arr[i,j] <- (i,j) + arr + let arr2d2 = + let arr = Array2D.zeroCreate 3 2 + for i in 0..2 do for j in 0..1 do arr[i,j] <- (j,i) + arr + test "fewoih11" (arr2d[6..6,5] = [|(6, 5)|]) + test "fewoih11" (arr2d[..6,5] = [|(5, 5); (6, 5)|]) + test "fewoih11" (arr2d[6..,5] = [|(6, 5); (7, 5)|]) + test "fewoih12" (arr2d[*,*][1..,1] = [|(6, 5); (7, 5)|]) + arr2d[*,*] <- arr2d2 + test "fewoih13" (arr2d[*,*][0..0,1] = [|(1, 0)|]) + test "fewoih13" (arr2d[*,*][1..,1] = [|(1, 1); (1, 2)|]) + test "fewoih13" (arr2d[*,*][1,1..] = [|(1, 1)|]) + test "fewoih13" (arr2d[*,*][1,0..0] = [|(0, 1)|]) + let arr3d = + let arr = System.Array.CreateInstance(typeof, [| 3;2;1 |], [|5;4;3|]) :?> (int*int*int)[,,] + for i in 5..7 do for j in 4..5 do for k in 3..3 do arr[i,j,k] <- (i,j,k) + arr + let arr3d2 = + let arr = System.Array.CreateInstance(typeof, [| 3;2;1 |]) :?> (int*int*int)[,,] + for i in 0..2 do for j in 0..1 do for k in 0..0 do arr[i,j,k] <- (k,j,i) + arr + + test "fewoih14" (arr3d[5,4,3] = (5,4,3)) + test "fewoih15" (arr3d[*,*,*][0,0,0] = (5,4,3)) + arr3d[*,*,*] <- arr3d2 + test "fewoih16" (arr3d[5,4,3] = (0,0,0)) + test "fewoih16" (arr3d[5,5,3] = (0,1,0)) + test "fewoih16" (arr3d[6,5,3] = (0,1,1)) + let _ = runTest() + +module Array3Tests = + + let test_make_get_set_length () = + let arr = Array3D.create 3 4 5 0 in + test "fewoih1" (Array3D.get arr 0 0 0 = 0); + test "fewoih2" (Array3D.get arr 0 1 0 = 0); + test "vvrew03" (Array3D.get arr 2 2 2 = 0); + test "vvrew04" (Array3D.get arr 2 3 4 = 0); + ignore (Array3D.set arr 0 2 3 4); + test "vsdiuvs5" (Array3D.get arr 0 2 3 = 4); + arr[0,2,3] <- 2; + test "vsdiuvs6" (arr[0,2,3] = 2); + arr[0,2,3] <- 3; + test "vsdiuvs" (arr[0,2,3] = 3); + test "vropivrwe7" (Array3D.length1 arr = 3); + test "vropivrwe8" (Array3D.length2 arr = 4); + test "vropivrwe9" (Array3D.length3 arr = 5) + + let _ = test_make_get_set_length () + +module Array4Tests = + + let test_make_get_set_length () = + let arr = Array4D.create 3 4 5 6 0 in + arr[0,2,3,4] <- 2; + test "vsdiuvsq" (arr[0,2,3,4] = 2); + arr[0,2,3,4] <- 3; + test "vsdiuvsw" (arr[0,2,3,4] = 3); + test "vsdiuvsw" (Array4D.get arr 0 2 3 4 = 3); + Array4D.set arr 0 2 3 4 5; + test "vsdiuvsw" (Array4D.get arr 0 2 3 4 = 5); + test "vropivrwee" (Array4D.length1 arr = 3); + test "vropivrwer" (Array4D.length2 arr = 4); + test "vropivrwet" (Array4D.length3 arr = 5) + test "vropivrwey" (Array4D.length4 arr = 6) + + let test_init () = + let arr = Array4D.init 3 4 5 6 (fun i j k m -> i+j+k+m) in + test "vsdiuvs1" (arr[0,2,3,4] = 9); + test "vsdiuvs2" (arr[0,2,3,3] = 8); + test "vsdiuvs3" (arr[0,0,0,0] = 0); + arr[0,2,3,4] <- 2; + test "vsdiuvs4" (arr[0,2,3,4] = 2); + arr[0,2,3,4] <- 3; + test "vsdiuvs5" (arr[0,2,3,4] = 3); + test "vropivrwe1" (Array4D.length1 arr = 3); + test "vropivrwe2" (Array4D.length2 arr = 4); + test "vropivrwe3" (Array4D.length3 arr = 5) + test "vropivrwe4" (Array4D.length4 arr = 6) + + let _ = test_make_get_set_length () + let _ = test_init () + +module Array2TestsNoDot = + + let test_make_get_set_length () = + let arr = Array2D.create 3 4 0 in + test "fewoih1" (Array2D.get arr 0 0 = 0); + test "fewoih2" (Array2D.get arr 0 1 = 0); + test "vvrew03" (Array2D.get arr 2 2 = 0); + test "vvrew04" (Array2D.get arr 2 3 = 0); + ignore (Array2D.set arr 0 2 4); + test "vsdiuvs5" (Array2D.get arr 0 2 = 4); + arr[0,2] <- 2; + test "vsdiuvs6" (arr[0,2] = 2); + test "vropivrwe7" (Array2D.length1 arr = 3); + test "vropivrwe8" (Array2D.length2 arr = 4) + + let a = Array2D.init 10 10 (fun i j -> i,j) + let b = Array2D.init 2 2 (fun i j -> i+1,j+1) + //test "a2_sub" + // (Array2D.sub a 1 1 2 2 = b) + + + Array2D.blit b 0 0 a 0 0 2 2 + //test "a2_blit" + // (Array2D.sub a 0 0 2 2 = b) + + let _ = test_make_get_set_length () + + +module ArrayNonZeroBasedTestsSliceNoDot = + let runTest () = + let arr = (Array2D.initBased 5 4 3 2 (fun i j -> (i,j))) + test "fewoih1" (arr[6,*] = [|(6, 4); (6, 5)|]) + test "fewoih2" (arr[*,*][1,*] = [|(6, 4); (6, 5)|]) + test "fewoih3" (arr[*,5] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih4" (arr[*,*][*,1] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih5" (arr.GetLowerBound(0) = 5) + test "fewoih6" (arr.GetLowerBound(1) = 4) + test "fewoih7" (arr[*,*].GetLowerBound(0) = 0) + test "fewoih8" (arr[*,*].GetLowerBound(1) = 0) + test "fewoih9" (arr[*,*][0..,1] = [|(5, 5); (6, 5); (7, 5)|]) + test "fewoih10" (arr[*,*][1..,1] = [|(6, 5); (7, 5)|]) + let arr2d = + let arr = Array2D.zeroCreateBased 5 4 3 2 + for i in 5..7 do for j in 4..5 do arr[i,j] <- (i,j) + arr + let arr2d2 = + let arr = Array2D.zeroCreate 3 2 + for i in 0..2 do for j in 0..1 do arr[i,j] <- (j,i) + arr + test "fewoih11" (arr2d[6..6,5] = [|(6, 5)|]) + test "fewoih11" (arr2d[..6,5] = [|(5, 5); (6, 5)|]) + test "fewoih11" (arr2d[6..,5] = [|(6, 5); (7, 5)|]) + test "fewoih12" (arr2d[*,*][1..,1] = [|(6, 5); (7, 5)|]) + arr2d[*,*] <- arr2d2 + test "fewoih13" (arr2d[*,*][0..0,1] = [|(1, 0)|]) + test "fewoih13" (arr2d[*,*][1..,1] = [|(1, 1); (1, 2)|]) + test "fewoih13" (arr2d[*,*][1,1..] = [|(1, 1)|]) + test "fewoih13" (arr2d[*,*][1,0..0] = [|(0, 1)|]) + let arr3d = + let arr = System.Array.CreateInstance(typeof, [| 3;2;1 |], [|5;4;3|]) :?> (int*int*int)[,,] + for i in 5..7 do for j in 4..5 do for k in 3..3 do arr[i,j,k] <- (i,j,k) + arr + let arr3d2 = + let arr = System.Array.CreateInstance(typeof, [| 3;2;1 |]) :?> (int*int*int)[,,] + for i in 0..2 do for j in 0..1 do for k in 0..0 do arr[i,j,k] <- (k,j,i) + arr + + test "fewoih14" (arr3d[5,4,3] = (5,4,3)) + test "fewoih15" (arr3d[*,*,*][0,0,0] = (5,4,3)) + arr3d[*,*,*] <- arr3d2 + test "fewoih16" (arr3d[5,4,3] = (0,0,0)) + test "fewoih16" (arr3d[5,5,3] = (0,1,0)) + test "fewoih16" (arr3d[6,5,3] = (0,1,1)) + let _ = runTest() + +module Array3TestsNoDot = + + let test_make_get_set_length () = + let arr = Array3D.create 3 4 5 0 in + test "fewoih1" (Array3D.get arr 0 0 0 = 0); + test "fewoih2" (Array3D.get arr 0 1 0 = 0); + test "vvrew03" (Array3D.get arr 2 2 2 = 0); + test "vvrew04" (Array3D.get arr 2 3 4 = 0); + ignore (Array3D.set arr 0 2 3 4); + test "vsdiuvs5" (Array3D.get arr 0 2 3 = 4); + arr[0,2,3] <- 2; + test "vsdiuvs6" (arr[0,2,3] = 2); + arr[0,2,3] <- 3; + test "vsdiuvs" (arr[0,2,3] = 3); + test "vropivrwe7" (Array3D.length1 arr = 3); + test "vropivrwe8" (Array3D.length2 arr = 4); + test "vropivrwe9" (Array3D.length3 arr = 5) + + let _ = test_make_get_set_length () + +module Array4TestsNoDot = + + let test_make_get_set_length () = + let arr = Array4D.create 3 4 5 6 0 in + arr[0,2,3,4] <- 2; + test "vsdiuvsq" (arr[0,2,3,4] = 2); + arr[0,2,3,4] <- 3; + test "vsdiuvsw" (arr[0,2,3,4] = 3); + test "vsdiuvsw" (Array4D.get arr 0 2 3 4 = 3); + Array4D.set arr 0 2 3 4 5; + test "vsdiuvsw" (Array4D.get arr 0 2 3 4 = 5); + test "vropivrwee" (Array4D.length1 arr = 3); + test "vropivrwer" (Array4D.length2 arr = 4); + test "vropivrwet" (Array4D.length3 arr = 5) + test "vropivrwey" (Array4D.length4 arr = 6) + + let test_init () = + let arr = Array4D.init 3 4 5 6 (fun i j k m -> i+j+k+m) in + test "vsdiuvs1" (arr[0,2,3,4] = 9); + test "vsdiuvs2" (arr[0,2,3,3] = 8); + test "vsdiuvs3" (arr[0,0,0,0] = 0); + arr[0,2,3,4] <- 2; + test "vsdiuvs4" (arr[0,2,3,4] = 2); + arr[0,2,3,4] <- 3; + test "vsdiuvs5" (arr[0,2,3,4] = 3); + test "vropivrwe1" (Array4D.length1 arr = 3); + test "vropivrwe2" (Array4D.length2 arr = 4); + test "vropivrwe3" (Array4D.length3 arr = 5) + test "vropivrwe4" (Array4D.length4 arr = 6) + + let _ = test_make_get_set_length () + let _ = test_init () + +module MiscIndexNotationTests = + [] + type foo + let m, n = 1, 10 + let vs1 = seq { 1 .. 2 .. 3 } + let vs2 = [ 1 .. 2 .. 4 ] + let vs3 = [m .. 1 .. n] + let vs4 = [| 1 .. 2 .. 4 |] + let vs5 = [| m .. 1 .. n |] + + let arr = [| 1;2;3;4;5 |] + let arr2 : int[,] = Array2D.zeroCreate 5 5 + + let v1 = arr[1] + let v2 = arr2[1,1] + let v3 = arr[1..3] + + let v4 = arr[..3] + let v5 = arr[1..] + let v6 = arr[*] + + let v7 = arr2[1..3,1..3] + let v8 = arr2[..3,1..3] + let v9 = arr2[1..,1..3] + let v10 = arr2[*,1..3] + let v11 = arr2[1..3,1..] + let v12 = arr2[..3,1..] + let v13 = arr2[1..,1..] + let v14 = arr2[*,1..] + let v15 = arr2[1..3,..3] + let v16 = arr2[..3,..3] + let v17 = arr2[1..,..3] + let v18 = arr2[*,..3] + let v19 = arr2[1..3,*] + let v20 = arr2[..3,*] + let v21 = arr2[1..,*] + let v22 = arr2[*,*] + + module Apps = + let arrf () = arr + let arrf2 () = arr2 + let v1 = arrf()[1] + let v2 = arrf2()[1,1] + let v3 = arrf()[1..3] + + let v4 = arrf()[..3] + let v5 = arrf()[1..] + let v6 = arrf()[*] + + let v7 = arrf2()[1..3,1..3] + let v8 = arrf2()[..3,1..3] + let v9 = arrf2()[1..,1..3] + let v10 = arrf2()[*,1..3] + let v11 = arrf2()[1..3,1..] + let v12 = arrf2()[..3,1..] + let v13 = arrf2()[1..,1..] + let v14 = arrf2()[*,1..] + let v15 = arrf2()[1..3,..3] + let v16 = arrf2()[..3,..3] + let v17 = arrf2()[1..,..3] + let v18 = arrf2()[*,..3] + let v19 = arrf2()[1..3,*] + let v20 = arrf2()[..3,*] + let v21 = arrf2()[1..,*] + let v22 = arrf2()[*,*] + +module ArrayStructMutation = + module Array1D = + module Test1 = + [] + type T = + val mutable i : int + let a = Array.create 10 Unchecked.defaultof + a[0].i <- 27 + check "wekvw0301" 27 a[0].i + + + module Test2 = + + [] + type T = + val mutable public i : int + member public this.Set i = this.i <- i + let a = Array.create 10 Unchecked.defaultof + a[0].Set 27 + a[2].Set 27 + check "wekvw0302" 27 a[0].i + check "wekvw0303" 27 a[2].i + + module Array2D = + module Test1 = + [] + type T = + val mutable i : int + let a = Array2D.create 10 10 Unchecked.defaultof + a[0,0].i <- 27 + check "wekvw0304" 27 a[0,0].i + + + module Test2 = + + [] + type T = + val mutable public i : int + member public this.Set i = this.i <- i + let a = Array2D.create 10 10 Unchecked.defaultof + a[0,0].Set 27 + a[0,2].Set 27 + check "wekvw0305" 27 a[0,0].i + check "wekvw0306" 27 a[0,2].i + + + module Array3D = + module Test1 = + [] + type T = + val mutable i : int + let a = Array3D.create 10 10 10 Unchecked.defaultof + a[0,0,0].i <- 27 + a[0,2,3].i <- 27 + check "wekvw0307" 27 a[0,0,0].i + check "wekvw0308" 27 a[0,2,3].i + + + module Test2 = + + [] + type T = + val mutable public i : int + member public this.Set i = this.i <- i + let a = Array3D.create 10 10 10 Unchecked.defaultof + a[0,0,0].Set 27 + a[0,2,3].Set 27 + check "wekvw0309" 27 a[0,0,0].i + check "wekvw030q" 27 a[0,2,3].i + + module Array4D = + module Test1 = + [] + type T = + val mutable i : int + let a = Array4D.create 10 10 10 10 Unchecked.defaultof + a[0,0,0,0].i <- 27 + a[0,2,3,4].i <- 27 + check "wekvw030w" 27 a[0,0,0,0].i + check "wekvw030e" 27 a[0,2,3,4].i + + + module Test2 = + + [] + type T = + val mutable public i : int + member public this.Set i = this.i <- i + let a = Array4D.create 10 10 10 10 Unchecked.defaultof + a[0,0,0,0].Set 27 + a[0,2,3,4].Set 27 + check "wekvw030r" 27 a[0,0,0,0].i + check "wekvw030t" 27 a[0,2,3,4].i + + +#if TESTS_AS_APP +let RUN() = failures +#else +let aa = + match failures with + | [] -> + stdout.WriteLine "Test Passed" + System.IO.File.WriteAllText("test.ok","ok") + exit 0 + | _ -> + stdout.WriteLine "Test Failed" + exit 1 +#endif + diff --git a/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.bsl b/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.bsl new file mode 100644 index 00000000000..e3b148ff622 --- /dev/null +++ b/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.bsl @@ -0,0 +1,12 @@ + +test-langversion-preview.fsx(2,3,2,5): typecheck info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. + +test-langversion-preview.fsx(3,10,3,11): typecheck info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + +test-langversion-preview.fsx(4,1,4,5): typecheck info FS3370: The use of 'incr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'incr cell' to 'cell.Value <- cell.Value + 1'. + +test-langversion-preview.fsx(5,1,5,5): typecheck info FS3370: The use of 'decr' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'decr cell' to 'cell.Value <- cell.Value - 1'. + +test-langversion-preview.fsx(9,14,9,15): typecheck error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'X'. + +test-langversion-preview.fsx(8,14,8,15): typecheck error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'X'. diff --git a/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.fsx b/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.fsx new file mode 100644 index 00000000000..34bb29ad8e1 --- /dev/null +++ b/tests/fsharp/core/ref-ops-deprecation/test-langversion-preview.fsx @@ -0,0 +1,9 @@ +let r = ref 3 +r := 4 // generates an informational in preview +let rv = !r // generates an informational in preview +incr r // generates an informational in preview +decr r // generates an informational in preview + +type X() = + member x.M(a:int) = a + member x.M(b:int) = b \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index e722e2c5f2d..3be5dba44ae 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -59,16 +59,45 @@ module CoreTests = let ``apporder-FSI_BASIC`` () = singleTestBuildAndRun "core/apporder" FSI_BASIC [] - let ``array-FSC_BASIC_OPT_MINUS`` () = singleTestBuildAndRun "core/array" FSC_BASIC_OPT_MINUS + let ``array-FSC_BASIC_OPT_MINUS-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_BASIC_OPT_MINUS "5.0" [] - let ``array-FSC_BASIC`` () = singleTestBuildAndRun "core/array" FSC_BASIC + let ``array-FSC_BASIC-5.0`` () = singleTestBuildAndRunVersion "core/array" FSC_BASIC "5.0" - // TODO: We need to migrate to .NET 6, but Array2D.set is broken there yet, until https://github.com/dotnet/runtime/pull/54656 gets into the release. - // It should land into preview7, which is set to be released August 10th 2021. - // These tests should be reenabled then. [] - let ``array-FSI_BASIC`` () = singleTestBuildAndRun "core/array" FSI_BASIC + let ``array-FSI_BASIC-5.0`` () = singleTestBuildAndRunVersion "core/array" FSI_BASIC "5.0" + + [] + let ``array-FSC_BASIC-preview`` () = singleTestBuildAndRunVersion "core/array" FSC_BASIC "preview" + + [] + let ``array-no-dot-FSC_BASIC_OPT_MINUS`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_BASIC_OPT_MINUS "preview" + + [] + let ``array-no-dot-FSC_BASIC`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSC_BASIC "preview" + + [] + let ``array-no-dot-FSI_BASIC`` () = singleTestBuildAndRunVersion "core/array-no-dot" FSI_BASIC "preview" + + [] + let ``array-no-dot-warnings-langversion-default`` () = + let cfg = testConfig "core/array-no-dot-warnings" + singleVersionedNegTest cfg "default" "test-langversion-default" + + [] + let ``array-no-dot-warnings-langversion-5_0`` () = + let cfg = testConfig "core/array-no-dot-warnings" + singleVersionedNegTest cfg "5.0" "test-langversion-5.0" + + [] + let ``array-no-dot-warnings-langversion-preview`` () = + let cfg = testConfig "core/array-no-dot-warnings" + singleVersionedNegTest cfg "preview" "test-langversion-preview" + + [] + let ``ref-ops-deprecation-langversion-preview`` () = + let cfg = testConfig "core/ref-ops-deprecation" + singleVersionedNegTest cfg "preview" "test-langversion-preview" [] let ``auto-widen-version-5_0``() = @@ -2023,19 +2052,19 @@ module CoreTests = [] module VersionTests = [] - let ``member-selfidentifier-version4.6``() = singleTestBuildAndRunVersion "core/members/self-identifier/version46" FSC_BUILDONLY "4.6" + let ``member-selfidentifier-version4_6``() = singleTestBuildAndRunVersion "core/members/self-identifier/version46" FSC_BUILDONLY "4.6" [] - let ``member-selfidentifier-version4.7``() = singleTestBuildAndRun "core/members/self-identifier/version47" FSC_BUILDONLY + let ``member-selfidentifier-version4_7``() = singleTestBuildAndRun "core/members/self-identifier/version47" FSC_BUILDONLY [] - let ``indent-version4.6``() = singleTestBuildAndRunVersion "core/indent/version46" FSC_BUILDONLY "4.6" + let ``indent-version4_6``() = singleTestBuildAndRunVersion "core/indent/version46" FSC_BUILDONLY "4.6" [] - let ``indent-version4.7``() = singleTestBuildAndRun "core/indent/version47" FSC_BUILDONLY + let ``indent-version4_7``() = singleTestBuildAndRun "core/indent/version47" FSC_BUILDONLY [] - let ``nameof-version4.6``() = singleTestBuildAndRunVersion "core/nameof/version46" FSC_BUILDONLY "4.6" + let ``nameof-version4_6``() = singleTestBuildAndRunVersion "core/nameof/version46" FSC_BUILDONLY "4.6" [] let ``nameof-versionpreview``() = singleTestBuildAndRunVersion "core/nameof/preview" FSC_BUILDONLY "preview" @@ -2654,14 +2683,14 @@ module TypecheckTests = let ``type check neg23`` () = singleNegTest (testConfig "typecheck/sigs") "neg23" [] - let ``type check neg24 version 4.6`` () = + let ``type check neg24 version 4_6`` () = let cfg = testConfig "typecheck/sigs/version46" // For some reason this warning is off by default in the test framework but in this case we are testing for it let cfg = { cfg with fsc_flags = cfg.fsc_flags.Replace("--nowarn:20", "") } singleVersionedNegTest cfg "4.6" "neg24" [] - let ``type check neg24 version 4.7`` () = + let ``type check neg24 version 4_7`` () = let cfg = testConfig "typecheck/sigs/version47" // For some reason this warning is off by default in the test framework but in this case we are testing for it let cfg = { cfg with fsc_flags = cfg.fsc_flags.Replace("--nowarn:20", "") } diff --git a/tests/fsharp/typecheck/sigs/neg24.bsl b/tests/fsharp/typecheck/sigs/neg24.bsl index 03d8ce84002..0f622260786 100644 --- a/tests/fsharp/typecheck/sigs/neg24.bsl +++ b/tests/fsharp/typecheck/sigs/neg24.bsl @@ -21,7 +21,7 @@ neg24.fs(302,33,302,34): typecheck error FS0001: All elements of a list must be neg24.fs(302,36,302,37): typecheck error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 'unit'. This element has type 'int'. -neg24.fs(304,11,305,32): typecheck error FS0193: Type constraint mismatch. The type +neg24.fs(304,9,305,34): typecheck error FS0193: Type constraint mismatch. The type 'int' is not compatible with type 'unit' diff --git a/tests/fsharp/typecheck/sigs/neg78.bsl b/tests/fsharp/typecheck/sigs/neg78.bsl index 38d7beca531..202792198ce 100644 --- a/tests/fsharp/typecheck/sigs/neg78.bsl +++ b/tests/fsharp/typecheck/sigs/neg78.bsl @@ -1,2 +1,2 @@ -neg78.fsx(3,15,3,17): parse error FS0010: Unexpected symbol '..' in binding. Expected incomplete structured construct at or before this point or other token. +neg78.fsx(3,9,3,17): typecheck error FS0751: Incomplete expression or invalid use of indexer syntax diff --git a/tests/fsharp/typecheck/sigs/neg78.vsbsl b/tests/fsharp/typecheck/sigs/neg78.vsbsl index 5857bfb98d5..202792198ce 100644 --- a/tests/fsharp/typecheck/sigs/neg78.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg78.vsbsl @@ -1,4 +1,2 @@ -neg78.fsx(3,15,3,17): parse error FS0010: Unexpected symbol '..' in binding. Expected incomplete structured construct at or before this point or other token. - -neg78.fsx(3,15,3,17): parse error FS0010: Unexpected symbol '..' in binding. Expected incomplete structured construct at or before this point or other token. +neg78.fsx(3,9,3,17): typecheck error FS0751: Incomplete expression or invalid use of indexer syntax diff --git a/tests/fsharp/typecheck/sigs/version47/neg24.bsl b/tests/fsharp/typecheck/sigs/version47/neg24.bsl index e2471fb7b86..92b7eacaa73 100644 --- a/tests/fsharp/typecheck/sigs/version47/neg24.bsl +++ b/tests/fsharp/typecheck/sigs/version47/neg24.bsl @@ -21,7 +21,7 @@ neg24.fs(302,33,302,34): typecheck error FS0001: All elements of a list must be neg24.fs(302,36,302,37): typecheck error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 'unit'. This element has type 'int'. -neg24.fs(304,11,305,32): typecheck error FS0193: Type constraint mismatch. The type +neg24.fs(304,9,305,34): typecheck error FS0193: Type constraint mismatch. The type 'int' is not compatible with type 'unit' diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/CodeGenRenamings01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/CodeGenRenamings01.il.bsl index 603890dce4e..63fa4df14a2 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/CodeGenRenamings01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/CodeGenRenamings01.il.bsl @@ -475,7 +475,6 @@ IL_0038: dup IL_0039: stsfld int32[] ''.$CodeGenRenamings01::array@6 IL_003e: stloc.1 - .line 7,7 : 1,27 '' IL_003f: ldc.i4.1 IL_0040: ldc.i4.1 IL_0041: ldc.i4.s 10 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs index b2c362464ac..fcb5e10f2ae 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs @@ -1,6 +1,6 @@ // #Regression #NoMT #CompilerOptions #RequiresENU // Test that without [--flaterrors] flag multi-line errors are emitted in a regular way, i.e. spanned to more that one line -//This expression was expected to have type +//This expression was expected to have type // ''a list' //but here has type // 'seq<'b>' diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs index 8bcc6e508ac..511987567fc 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs @@ -1,5 +1,5 @@ // #Regression #NoMT #CompilerOptions // Test that using [--flaterrors] flag multi-line errors are flattened, i.e. concatenated into one-line error message. -//This expression was expected to have type. ''a list' .but here has type. 'seq<'b>' +//This expression was expected to have type. ''a list' .but here has type. 'seq<'b>' List.rev {1..10} |> ignore diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_ThisValueIsNotAFunctionAndCannotBeApplied01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_ThisValueIsNotAFunctionAndCannotBeApplied01.fs deleted file mode 100644 index cf15f433544..00000000000 --- a/tests/fsharpqa/Source/Diagnostics/General/E_ThisValueIsNotAFunctionAndCannotBeApplied01.fs +++ /dev/null @@ -1,7 +0,0 @@ -// #Regression #Diagnostics -// Regression test for FSHARP1.0:1406 -// - - - -let foo (arr : int[,]) = arr[1,2] diff --git a/tests/fsharpqa/Source/Diagnostics/General/env.lst b/tests/fsharpqa/Source/Diagnostics/General/env.lst index a249196a5b0..d77d0099a55 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/env.lst +++ b/tests/fsharpqa/Source/Diagnostics/General/env.lst @@ -88,8 +88,6 @@ NoMT SOURCE=E_MissingSourceFile04.fs SCFLAGS="--exec doesnotexist.fs" FSIMODE=PI SOURCE=E_IncompleteConstruct01.fs # E_IncompleteConstruct01.fs SOURCE=E_IncompleteConstruct01b.fs # E_IncompleteConstruct01b.fs - SOURCE=E_ThisValueIsNotAFunctionAndCannotBeApplied01.fs SCFLAGS="--test:ErrorRanges" # E_ThisValueIsNotAFunctionAndCannotBeApplied01.fs - SOURCE=E_UnexpectedKeyworkWith01.fs SCFLAGS="--test:ErrorRanges" # E_UnexpectedKeyworkWith01.fs SOURCE=E_MemberObjectctorTakeGiven.fs # E_MemberObjectctorTakeGiven.fs SOURCE=E_StructMustHaveAtLeastOneField.fs SCFLAGS="--test:ErrorRanges" # E_StructMustHaveAtLeastOneField.fs diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx index 004ef985471..8f3bdfa834e 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx @@ -3,7 +3,7 @@ //fsbug //nonTerminalId\.GetTag -//Unexpected symbol '\.\.' in interaction\. Expected incomplete structured construct at or before this point, ';', ';;' or other token\.$ +//Incomplete expression or invalid use of indexer syntax aaaa..;; diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index 6a303c7290b..b68ede569d7 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -630,18 +630,8 @@ let _ = arr.[..number2] ("val number2", (3, 13, 3, 20)) ("val number1", (3, 4, 3, 11)) ("val arr", (4, 8, 4, 11)) - ("Microsoft", (4, 11, 4, 12)) - ("OperatorIntrinsics", (4, 11, 4, 12)) - ("Operators", (4, 11, 4, 12)) - ("Core", (4, 11, 4, 12)) - ("FSharp", (4, 11, 4, 12)) ("val number1", (4, 16, 4, 23)) ("val arr", (5, 8, 5, 11)) - ("Microsoft", (5, 11, 5, 12)) - ("OperatorIntrinsics", (5, 11, 5, 12)) - ("Operators", (5, 11, 5, 12)) - ("Core", (5, 11, 5, 12)) - ("FSharp", (5, 11, 5, 12)) ("val number2", (5, 15, 5, 22)) ("Test", (1, 0, 1, 0))|] diff --git a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs index 8211b8f4bc2..431a6307f9f 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -23,7 +23,7 @@ module internal BlockStructure = | Scope.Interface | Scope.TypeExtension | Scope.RecordDefn - | Scope.CompExpr + | Scope.ComputationExpr | Scope.ObjExpr | Scope.UnionDefn | Scope.Attribute @@ -49,7 +49,6 @@ module internal BlockStructure = | Scope.IfThenElse-> FSharpBlockTypes.Conditional | Scope.Tuple | Scope.ArrayOrList - | Scope.CompExprInternal | Scope.Quote | Scope.SpecialFunc | Scope.Lambda @@ -84,7 +83,7 @@ module internal BlockStructure = | Scope.Interface | Scope.TypeExtension | Scope.RecordDefn - | Scope.CompExpr + | Scope.ComputationExpr | Scope.ObjExpr | Scope.UnionDefn | Scope.Type @@ -104,7 +103,6 @@ module internal BlockStructure = | Scope.IfThenElse | Scope.Tuple | Scope.ArrayOrList - | Scope.CompExprInternal | Scope.Quote | Scope.Lambda | Scope.LetOrUseBang diff --git a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs index a96b20ed8ed..c8e0e43edb9 100644 --- a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs +++ b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs @@ -251,7 +251,6 @@ type internal FSharpLanguageServiceBackgroundRequests_DEPRECATED | FSharpDiagnosticSeverity.Warning -> Microsoft.VisualStudio.FSharp.LanguageService.Severity.Warning | FSharpDiagnosticSeverity.Error -> Microsoft.VisualStudio.FSharp.LanguageService.Severity.Error req.ResultSink.AddError(req.FileName, error.Subcategory, error.Message, span, sev) - let provideMethodList = (req.Reason = BackgroundRequestReason.MethodTip || req.Reason = BackgroundRequestReason.MatchBracesAndMethodTip) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index 118339a2d82..82bdd085587 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -1472,25 +1472,6 @@ let x = new MyClass2(0) [ "BackgroundColor" ] // should contain (from prior System.Console) [ "abs" ] // should not contain (top-level autocomplete on empty identifier) - [] - member public this.``PopupsVersusCtrlSpaceOnDotDot.SecondDot.Popup``() = - // Salsa is no yet capable of determining whether there would be a popup, it can only test what would appear if there were. - // So can't do test below. -// AssertAutoCompleteContainsNoCoffeeBreak -// [ "System.Console..BackgroundColor" ] -// "System.Console.." -// [ ] // should be empty - in fact, there is no popup here -// [ "abs"; "BackgroundColor" ] // should not contain anything - () - - [] - member public this.``PopupsVersusCtrlSpaceOnDotDot.SecondDot.CtrlSpace``() = - AssertCtrlSpaceCompleteContainsNoCoffeeBreak - [ "System.Console..BackgroundColor" ] - "System.Console.." - [ ] // should contain nothing - .. is not properly used range operator - [ "abs" ] // should not contain (from prior System.Console) - [] member public this.``DotCompletionInPatternsPartOfLambda``() = let content = ["let _ = fun x . -> x + 1"] @@ -3131,6 +3112,38 @@ let x = query { for bbbb in abbbbc(*D0*) do [ "abs" ] // should contain (top level) [ "CompareTo" ] // should not contain (from Int32) + [] + member public this.``Array.AfterOperator...Bug65732_B2``() = + AssertCtrlSpaceCompleteContains + [ "let r = [System.Int32.MaxValue.. 42]" ] + ".." // marker + [ "abs" ] // should contain (top level) + [ "CompareTo" ] // should not contain (from Int32) + + [] + member public this.``Array.AfterOperator...Bug65732_B3``() = + AssertCtrlSpaceCompleteContains + [ "let r = [System.Int32.MaxValue .. 42]" ] + ".." // marker + [ "abs" ] // should contain (top level) + [ "CompareTo" ] // should not contain (from Int32) + + [] + member public this.``Array.AfterOperator...Bug65732_C``() = + AssertCtrlSpaceCompleteContains + [ "let r = [System.Int32.MaxValue..]" ] + ".." // marker + [ "abs" ] // should contain (top level) + [ "CompareTo" ] // should not contain (from Int32) + + [] + member public this.``Array.AfterOperator...Bug65732_D``() = + AssertCtrlSpaceCompleteContains + [ "let r = [System.Int32.MaxValue .. ]" ] + ".." // marker + [ "abs" ] // should contain (top level) + [ "CompareTo" ] // should not contain (from Int32) + // Verify the auto completion after the close-parentheses, // there should be auto completion []