From 4ad56150efde1882f3b5879ad01840437eb2b334 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Tue, 25 Oct 2022 17:44:56 +0200 Subject: [PATCH] Keeping error context for tuple length mismatch (#14003) --- src/Compiler/Checking/CheckExpressions.fs | 2 +- src/Compiler/Checking/ConstraintSolver.fs | 4 +- src/Compiler/Checking/ConstraintSolver.fsi | 8 +- src/Compiler/Driver/CompilerDiagnostics.fs | 89 +++++++++---------- src/Compiler/FSComp.txt | 5 ++ src/Compiler/xlf/FSComp.txt.cs.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.de.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.es.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.fr.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.it.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.ja.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.ko.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.pl.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.ru.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.tr.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 25 ++++++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 25 ++++++ .../ErrorMessages/TypeMismatchTests.fs | 68 ++++++++++++++ 19 files changed, 452 insertions(+), 49 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index fa31c59164b..fecd9e6c09a 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -5815,7 +5815,7 @@ and CheckTupleIsCorrectLength g (env: TcEnv) m tupleTy (args: 'a list) tcArgs = // We let error recovery handle this exception error (ErrorFromAddingTypeEquation(g, env.DisplayEnv, tupleTy, expectedTy, - (ConstraintSolverTupleDiffLengths(env.DisplayEnv, ptys, argTys, m, m)), m)) + (ConstraintSolverTupleDiffLengths(env.DisplayEnv, env.eContextInfo, ptys, argTys, m, m)), m)) and TcExprTuple (cenv: cenv) overallTy env tpenv (isExplicitStruct, args, m) = let g = cenv.g diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 9f35a8a52aa..751e71bff5c 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -232,7 +232,7 @@ type OverallTy = | MustEqual ty -> ty | MustConvertTo (_, ty) -> ty -exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range +exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range @@ -1228,7 +1228,7 @@ and SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln origl1 origl2 = | h1 :: t1, h2 :: t2 when t1.Length = t2.Length -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln h1 h2 ++ (fun () -> loop t1 t2) | _ -> - ErrorD(ConstraintSolverTupleDiffLengths(csenv.DisplayEnv, origl1, origl2, csenv.m, m2)) + ErrorD(ConstraintSolverTupleDiffLengths(csenv.DisplayEnv, csenv.eContextInfo, origl1, origl2, csenv.m, m2)) loop origl1 origl2 and SolveFunTypeEqn csenv ndeep m2 trace cxsln domainTy1 domainTy2 rangeTy1 rangeTy2 = trackErrors { diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index ca6a0bc4c47..d6cc309c6b5 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -141,7 +141,13 @@ type OverallTy = /// Represents a point where no subsumption/widening is possible member Commit: TType -exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range +exception ConstraintSolverTupleDiffLengths of + displayEnv: DisplayEnv * + contextInfo: ContextInfo * + TType list * + TType list * + range * + range exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index b518ea9338d..4b78aa9b9f9 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -170,7 +170,7 @@ type Exception with | VirtualAugmentationOnNullValuedType m | NonVirtualAugmentationOnNullValuedType m | NonRigidTypar (_, _, _, _, _, m) - | ConstraintSolverTupleDiffLengths (_, _, _, m, _) + | ConstraintSolverTupleDiffLengths (_, _, _, _, m, _) | ConstraintSolverInfiniteTypes (_, _, _, _, m, _) | ConstraintSolverMissingConstraint (_, _, _, m, _) | ConstraintSolverTypesNotInEqualityRelation (_, _, _, m, _, _) @@ -617,12 +617,28 @@ let OutputNameSuggestions (os: StringBuilder) suggestNames suggestionsF idText = os.AppendString " " os.AppendString(ConvertValLogicalNameToDisplayNameCore value) +let OutputTypesNotInEqualityRelationContextInfo contextInfo ty1 ty2 m (os: StringBuilder) fallback = + match contextInfo with + | ContextInfo.IfExpression range when equals range m -> os.AppendString(FSComp.SR.ifExpression (ty1, ty2)) + | ContextInfo.CollectionElement (isArray, range) when equals range m -> + if isArray then + os.AppendString(FSComp.SR.arrayElementHasWrongType (ty1, ty2)) + else + os.AppendString(FSComp.SR.listElementHasWrongType (ty1, ty2)) + | ContextInfo.OmittedElseBranch range when equals range m -> os.AppendString(FSComp.SR.missingElseBranch (ty2)) + | ContextInfo.ElseBranchResult range when equals range m -> os.AppendString(FSComp.SR.elseBranchHasWrongType (ty1, ty2)) + | ContextInfo.FollowingPatternMatchClause range when equals range m -> + os.AppendString(FSComp.SR.followingPatternMatchClauseHasWrongType (ty1, ty2)) + | ContextInfo.PatternMatchGuard range when equals range m -> os.AppendString(FSComp.SR.patternMatchGuardIsNotBool (ty2)) + | contextInfo -> fallback contextInfo + type Exception with member exn.Output(os: StringBuilder, suggestNames) = match exn with - | ConstraintSolverTupleDiffLengths (_, tl1, tl2, m, m2) -> + // TODO: this is now unused...? + | ConstraintSolverTupleDiffLengths (_, _, tl1, tl2, m, m2) -> os.AppendString(ConstraintSolverTupleDiffLengthsE().Format tl1.Length tl2.Length) if m.StartLine <> m2.StartLine then @@ -663,19 +679,8 @@ type Exception with // REVIEW: consider if we need to show _cxs (the type parameter constraints) let ty1, ty2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - match contextInfo with - | ContextInfo.IfExpression range when equals range m -> os.AppendString(FSComp.SR.ifExpression (ty1, ty2)) - | ContextInfo.CollectionElement (isArray, range) when equals range m -> - if isArray then - os.AppendString(FSComp.SR.arrayElementHasWrongType (ty1, ty2)) - else - os.AppendString(FSComp.SR.listElementHasWrongType (ty1, ty2)) - | ContextInfo.OmittedElseBranch range when equals range m -> os.AppendString(FSComp.SR.missingElseBranch (ty2)) - | ContextInfo.ElseBranchResult range when equals range m -> os.AppendString(FSComp.SR.elseBranchHasWrongType (ty1, ty2)) - | ContextInfo.FollowingPatternMatchClause range when equals range m -> - os.AppendString(FSComp.SR.followingPatternMatchClauseHasWrongType (ty1, ty2)) - | ContextInfo.PatternMatchGuard range when equals range m -> os.AppendString(FSComp.SR.patternMatchGuardIsNotBool (ty2)) - | _ -> os.AppendString(ConstraintSolverTypesNotInEqualityRelation2E().Format ty1 ty2) + OutputTypesNotInEqualityRelationContextInfo contextInfo ty1 ty2 m os (fun _ -> + os.AppendString(ConstraintSolverTypesNotInEqualityRelation2E().Format ty1 ty2)) if m.StartLine <> m2.StartLine then os.AppendString(SeeAlsoE().Format(stringOfRange m)) @@ -699,33 +704,15 @@ type Exception with -> let ty1, ty2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - match contextInfo with - | ContextInfo.IfExpression range when equals range m -> os.AppendString(FSComp.SR.ifExpression (ty1, ty2)) - - | ContextInfo.CollectionElement (isArray, range) when equals range m -> - if isArray then - os.AppendString(FSComp.SR.arrayElementHasWrongType (ty1, ty2)) - else - os.AppendString(FSComp.SR.listElementHasWrongType (ty1, ty2)) - - | ContextInfo.OmittedElseBranch range when equals range m -> os.AppendString(FSComp.SR.missingElseBranch (ty2)) - - | ContextInfo.ElseBranchResult range when equals range m -> os.AppendString(FSComp.SR.elseBranchHasWrongType (ty1, ty2)) - - | ContextInfo.FollowingPatternMatchClause range when equals range m -> - os.AppendString(FSComp.SR.followingPatternMatchClauseHasWrongType (ty1, ty2)) - - | ContextInfo.PatternMatchGuard range when equals range m -> os.AppendString(FSComp.SR.patternMatchGuardIsNotBool (ty2)) - - | ContextInfo.TupleInRecordFields -> - os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs) - os.AppendString(Environment.NewLine + FSComp.SR.commaInsteadOfSemicolonInRecord ()) - - | _ when ty2 = "bool" && ty1.EndsWithOrdinal(" ref") -> - os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs) - os.AppendString(Environment.NewLine + FSComp.SR.derefInsteadOfNot ()) - - | _ -> os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs) + OutputTypesNotInEqualityRelationContextInfo contextInfo ty1 ty2 m os (fun contextInfo -> + match contextInfo with + | ContextInfo.TupleInRecordFields -> + os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs) + os.AppendString(Environment.NewLine + FSComp.SR.commaInsteadOfSemicolonInRecord ()) + | _ when ty2 = "bool" && ty1.EndsWithOrdinal(" ref") -> + os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs) + os.AppendString(Environment.NewLine + FSComp.SR.derefInsteadOfNot ()) + | _ -> os.AppendString(ErrorFromAddingTypeEquation1E().Format ty2 ty1 tpcs)) | ErrorFromAddingTypeEquation (_, _, _, _, (ConstraintSolverTypesNotInEqualityRelation (_, _, _, _, _, contextInfo) as e), _) when (match contextInfo with @@ -738,11 +725,23 @@ type Exception with | ErrorFromAddingTypeEquation(error = ConstraintSolverError _ as e) -> e.Output(os, suggestNames) - | ErrorFromAddingTypeEquation (_g, denv, ty1, ty2, ConstraintSolverTupleDiffLengths (_, tl1, tl2, _, _), _) -> + | ErrorFromAddingTypeEquation (_g, denv, ty1, ty2, ConstraintSolverTupleDiffLengths (_, contextInfo, tl1, tl2, _, _), m) -> let ty1, ty2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 + let messageArgs = tl1.Length, ty1, tl2.Length, ty2 if ty1 <> ty2 + tpcs then - os.AppendString(ErrorFromAddingTypeEquationTuplesE().Format tl1.Length ty1 tl2.Length ty2 tpcs) + match contextInfo with + | ContextInfo.IfExpression range when equals range m -> os.AppendString(FSComp.SR.ifExpressionTuple messageArgs) + | ContextInfo.ElseBranchResult range when equals range m -> + os.AppendString(FSComp.SR.elseBranchHasWrongTypeTuple messageArgs) + | ContextInfo.FollowingPatternMatchClause range when equals range m -> + os.AppendString(FSComp.SR.followingPatternMatchClauseHasWrongTypeTuple messageArgs) + | ContextInfo.CollectionElement (isArray, range) when equals range m -> + if isArray then + os.AppendString(FSComp.SR.arrayElementHasWrongTypeTuple messageArgs) + else + os.AppendString(FSComp.SR.listElementHasWrongTypeTuple messageArgs) + | _ -> os.AppendString(ErrorFromAddingTypeEquationTuplesE().Format tl1.Length ty1 tl2.Length ty2 tpcs) | ErrorFromAddingTypeEquation (g, denv, ty1, ty2, e, _) -> if not (typeEquiv g ty1 ty2) then @@ -2107,7 +2106,7 @@ type PhasedDiagnostic with Printf.bprintf buf "\n" match e with - | FormattedDiagnostic.Short (_, txt) -> buf.AppendString txt |> ignore + | FormattedDiagnostic.Short (_, txt) -> buf.AppendString txt | FormattedDiagnostic.Long (_, details) -> match details.Location with | Some l when not l.IsEmpty -> buf.AppendString l.TextRepresentation diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 8e934660a11..7e460abeb92 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -19,11 +19,16 @@ undefinedNamePatternDiscriminator,"The pattern discriminator '%s' is not defined replaceWithSuggestion,"Replace with '%s'" addIndexerDot,"Add . for indexer access." listElementHasWrongType,"All elements of a list must be implicitly convertible to the type of the first element, which here is '%s'. This element has type '%s'." +listElementHasWrongTypeTuple,"All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length %d of type\n %s \nThis element is a tuple of length %d of type\n %s \n" arrayElementHasWrongType,"All elements of an array must be implicitly convertible to the type of the first element, which here is '%s'. This element has type '%s'." +arrayElementHasWrongTypeTuple,"All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length %d of type\n %s \nThis element is a tuple of length %d of type\n %s \n" missingElseBranch,"This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '%s'." ifExpression,"The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'." +ifExpressionTuple,"The 'if' expression needs to return a tuple of length %d of type\n %s \nto satisfy context type requirements. It currently returns a tuple of length %d of type\n %s \n" elseBranchHasWrongType,"All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is '%s'. This branch returns a value of type '%s'." +elseBranchHasWrongTypeTuple,"All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length %d of type\n %s \nThis branch returns a tuple of length %d of type\n %s \n" followingPatternMatchClauseHasWrongType,"All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is '%s'. This branch returns a value of type '%s'." +followingPatternMatchClauseHasWrongTypeTuple,"All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length %d of type\n %s \nThis branch returns a tuple of length %d of type\n %s \n" patternMatchGuardIsNotBool,"A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'." commaInsteadOfSemicolonInRecord,"A ';' is used to separate field values in records. Consider replacing ',' with ';'." derefInsteadOfNot,"The '!' operator is used to dereference a ref cell. Consider using 'not expr' here." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 9f7ced75df2..2d981896ab9 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. Soubor {0} má nerozpoznanou příponu. Zdrojové soubory musí mít příponu .fs, .fsi, .fsx nebo .fsscript. Pokud chcete povolit použití zastaralých přípon .ml nebo .mli, použijte parametry --langversion:5.0 a --mlcompatibility. @@ -107,6 +112,11 @@ Argument {0} neodpovídá + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Navržené sestavení poskytovatele typu {0} nešlo načíst ze složky {1}, protože chyběla závislost nebo ji nešlo načíst. Všechny závislosti tohoto sestavení se musí nacházet ve stejné složce jako toto sestavení. Ohlášená výjimka: {2} – {3} @@ -317,6 +327,11 @@ Předávání kopie clusteru pro omezení vlastností v uvozovkách v jazyce F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Interpolované řetězce nemůžou používat specifikátory formátu %, pokud se každému z nich nezadá nějaký výraz, např. %d{{1+1}}. @@ -357,6 +372,11 @@ Neplatná direktiva #{0} {1} + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Neznámý bod ladění {0}. Dostupné body ladění jsou {1}. @@ -417,6 +437,11 @@ Neplatný interpolovaný řetězec. V interpolovaných výrazech se nedají použít řetězcové literály s trojitými uvozovkami. Zvažte možnost použít pro interpolovaný výraz explicitní vazbu let. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index a799aa69d56..7b2e86ccd81 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. Die Dateierweiterung von „{0}“ wurde nicht erkannt. Quelldateien müssen die Erweiterung .fs, .fsi, .fsx oder .fsscript haben. Um die veraltete Verwendung der Erweiterungen .ml oder .mli zu aktivieren, verwenden Sie „--langversion:5.0“ und „--mlcompatibility“. @@ -107,6 +112,11 @@ Das Argument "{0}" stimmt nicht überein. + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Die Typanbieter-Designerassembly "{0}" konnte aus dem Ordner "{1}" nicht geladen werden, weil eine Abhängigkeit fehlte oder nicht geladen werden konnte. Alle Abhängigkeiten der Typanbieter-Designerassembly müssen sich in demselben Ordner wie die Assembly befinden. Gemeldete Ausnahme: {2} – {3} @@ -317,6 +327,11 @@ Zeugenübergabe für Merkmalseinschränkungen in F#-Zitaten + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Interpolierte Zeichenfolgen dürfen keine Formatbezeichner vom Typ "%" verwenden, es sei denn, jeder erhält einen Ausdruck, z. B. "%d{{1+1}}". @@ -357,6 +372,11 @@ Ungültige Direktive "#{0} {1}" + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Unbekannter Debugpunkt „{0}“. Die verfügbaren Debugpunkte sind „{1}“. @@ -417,6 +437,11 @@ Ungültige interpolierte Zeichenfolge. Zeichenfolgenliterale mit dreifachen Anführungszeichen dürfen in interpolierten Ausdrücken nicht verwendet werden. Erwägen Sie die Verwendung einer expliziten let-Bindung für den Interpolationsausdruck. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index fa31fba0a06..8aad3d6f781 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. No se reconoce la extensión de archivo de '{0}'. Los archivos de código fuente deben tener las extensiones .fs, .fsi, .fsx o .fsscript. Para habilitar el uso en desuso de las extensiones .ml o .mli, use '--langversion:5.0' y '--mlcompatibility'. @@ -107,6 +112,11 @@ El argumento "{0}" no coincide. + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} No se pudo cargar el ensamblado del diseñador de proveedores de tipos "{0}" desde la carpeta "{1}" porque falta una dependencia o no se pudo cargar. Todas las dependencias del ensamblado del diseñador de proveedores de tipos deben encontrarse en la misma carpeta que el ensamblado. Se notificó la excepción: {2} - {3}. @@ -317,6 +327,11 @@ Paso de testigo para las restricciones de rasgos en las expresiones de código delimitadas de F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Las cadenas interpoladas no pueden usar los especificadores de formato "%", a menos que se les proporcione una expresión individualmente; por ejemplo, "%d{{1+1}}". @@ -357,6 +372,11 @@ Directiva '#{0} {1}' no válida. + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Punto de depuración desconocido \"{0}\". Los puntos de depuración disponibles son \"{1}\". @@ -417,6 +437,11 @@ Cadena interpolada no válida. No se pueden usar literales de cadena de comillas triples en las expresiones interpoladas. Puede usar un enlace "let" explícito para la expresión de interpolación. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index d65a883e5de..ffc5e832198 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. L’extension de fichier « {0} » n’est pas reconnue. Les fichiers sources doivent avoir l’extension. FS,. FSI,. FSX ou. fsscript. Pour activer l’utilisation déconseillée des extensions. ml ou. MLI, utilisez'--langversion : 5.0 'et'--mlcompatibility'. @@ -107,6 +112,11 @@ L'argument '{0}' ne correspond pas + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Impossible de charger l'assembly de concepteur de fournisseur de type '{0}' à partir du dossier '{1}', car une dépendance est manquante ou n'a pas pu être chargée. Toutes les dépendances de l'assembly de concepteur de fournisseur de type doivent se trouver dans le même dossier que cet assembly. Exception signalée : {2} - {3} @@ -317,6 +327,11 @@ Passage de témoin pour les contraintes de trait dans les quotations F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Les chaînes interpolées ne peuvent pas utiliser les spécificateurs de format '%' à moins de recevoir une expression, par exemple '%d{{1+1}}'. @@ -357,6 +372,11 @@ Directive non valide '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Point de débogage inconnu « {0} ». Les points de débogage disponibles sont «{1}». @@ -417,6 +437,11 @@ Chaîne interpolée non valide. Les littéraux de chaîne à guillemets triples ne peuvent pas être utilisés dans des expressions interpolées. Utilisez une liaison 'let' explicite pour l'expression d'interpolation. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index b82be281d65..29240e0d98c 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. L'estensione di file di '{0}' non è riconosciuta. I file di origine devono avere estensione fs, fsi, fsx o fsscript. Per abilitare l'uso deprecato delle estensioni ml o mli, usare '--langversion:5.0' e '--mlcompatibility'. @@ -107,6 +112,11 @@ L'argomento '{0}' non corrisponde + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Non è stato possibile caricare l'assembly '{0}' della finestra di progettazione del provider di tipi dalla cartella '{1}' perché una dipendenza non è presente o non è stato possibile caricarla. Tutte le dipendenze dell'assembly della finestra di progettazione del provider di tipi devono trovarsi nella stessa cartella dell'assembly. L'eccezione restituita è {2} - {3} @@ -317,6 +327,11 @@ Passaggio del testimone per vincoli di tratto in quotation F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Nelle stringhe interpolate non è possibile usare gli identificatori di formato '%' a meno che non si indichi un'espressione per ognuno di essi, ad esempio '%d{{1+1}}'. @@ -357,6 +372,11 @@ Direttiva '#{0} {1}' non valida + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Punto di debug '{0}' sconosciuto. I punti di debug disponibili sono '{1}'. @@ -417,6 +437,11 @@ La stringa interpolata non è valida. Non è possibile usare valori letterali stringa tra virgolette triple in espressioni interpolate. Provare a usare un binding 'let' esplicito per l'espressione di interpolazione. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 5971343763f..c509bc1328e 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. '{0}' のファイル拡張子を認識できません。ソース ファイル拡張子は .fs、.fsi、.fsx、または .fsscript にする必要があります。非推奨の拡張子 .ml または .mli の使用を有効にするには、'--langversion:5.0' および '--mlcompatibility' を使用してください。 @@ -107,6 +112,11 @@ 引数 '{0}' が一致しません + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} 依存関係がないか、または読み込めなかったため、型プロバイダーのデザイナー アセンブリ '{0}' をフォルダー '{1}' から読み込めませんでした。型プロバイダーのデザイナー アセンブリのすべての依存関係は、そのアセンブリと同じフォルダーに配置されている必要があります。次の例外が報告されました: {2} - {3} @@ -317,6 +327,11 @@ F# 引用での特性制約に対する監視の引き渡し + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. '%d{{1+1}}' などの式が指定されている場合を除き、補間された文字列では '%' 書式指定子を使用できません。 @@ -357,6 +372,11 @@ 無効なディレクティブ '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. 不明なデバッグ ポイントの `{0}`。使用可能なデバッグ ポイントは `{1}` です。 @@ -417,6 +437,11 @@ 補間された文字列が無効です。三重引用符文字列リテラルは、補間された式では使用できません。補間式に対して明示的な 'let' バインドを使用することをご検討ください。 + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index a05cd1d2c67..9767ff521a6 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. '{0}'의 파일 확장자가 인식되지 않습니다. 원본 파일의 확장자는 .fs, .fsi, .fsx 또는 .fsscript여야 합니다. 더 이상 사용되지 않는 .ml 또는 .mli 확장자를 사용하려면 '--langversion:5.0' 및 '--mlcompatibility'를 사용하세요. @@ -107,6 +112,11 @@ '{0}' 인수가 일치하지 않습니다. + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} 종속성이 없거나 로드되지 않았으므로 '{0}' 형식 공급자 디자이너 어셈블리를 '{1}' 폴더에서 로드할 수 없습니다. 형식 공급자 디자이너 어셈블리의 모든 종속성은 해당 어셈블리와 동일한 폴더에 있어야 합니다. 보고된 예외: {2} - {3} @@ -317,6 +327,11 @@ F# 인용의 특성 제약 조건에 대한 감시 전달 + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. 각 보간 문자열에 식(예: '%d{{1+1}}')이 지정되지 않는 한 '%' 형식 지정자를 사용할 수 없습니다. @@ -357,6 +372,11 @@ 잘못된 지시문 '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. 알 수 없는 디버그 지점 '{0}'. 사용 가능한 디버그 지점은 '{1}'입니다. @@ -417,6 +437,11 @@ 잘못된 보간 문자열. 삼중 따옴표 문자열 리터럴은 보간 식에 사용할 수 없습니다. 보간 식에 명시적 'let' 바인딩을 사용해 보세요. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index b39c389dede..4a565f29eaf 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. Rozszerzenie pliku "{0}" nie zostało rozpoznane. Pliki źródłowe muszą mieć rozszerzenie .fs, .fsi, .fsx lub .fsscript. Aby włączyć przestarzałe używanie rozszerzeń. ml lub .mli, użyj polecenia "--langversion: 5.0" i "--mlcompatibility". @@ -107,6 +112,11 @@ Argument „{0}” nie jest zgodny + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Nie można załadować zestawu projektanta dostawców typów „{0}” z folderu „{1}”, ponieważ brakuje zależności lub nie można jej załadować. Wszystkie zależności zestawu projektanta dostawców typów muszą znajdować się w tym samym folderze co ten zestaw. Zgłoszony wyjątek: {2} — {3} @@ -317,6 +327,11 @@ monitor, który przekazuje ograniczenia cech języka F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. W interpolowanych ciągach nie można używać specyfikatorów formatu „%”, chyba że każdemu z nich odpowiada wyrażenie, na przykład „%d{{1+1}}”. @@ -357,6 +372,11 @@ Nieprawidłowa dyrektywa „#{0} {1}” + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Nieznany punkt debugowania „{0}”. Dostępnymi punktami debugowania są „{1}”. @@ -417,6 +437,11 @@ Nieprawidłowy ciąg interpolowany. Literały ciągów z potrójnymi cudzysłowami nie mogą być używane w wyrażeniach interpolowanych. Rozważ użycie jawnego powiązania „let” dla wyrażenia interpolacji. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 63d09e66795..140f330414d 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. A extensão do arquivo '{0}' não foi reconhecida. Os arquivos de origem devem ter a extensão .fs, .fsi, .fsx ou .fsscript. Para ativar o uso preterido das extensões .ml ou .mli, use '--langversion:5.0' e '--mlcompatibility'. @@ -107,6 +112,11 @@ O argumento '{0}' não corresponde + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Não foi possível carregar o assembly do designer do provedor de tipos '{0}' da pasta '{1}' porque uma dependência estava ausente ou não pôde ser carregada. Todas as dependências do assembly do designer do provedor de tipos precisam estar localizadas na mesma pasta que esse assembly. A exceção relatada foi: {2} – {3} @@ -317,6 +327,11 @@ Passagem de testemunha para restrições de característica nas citações do F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. As cadeias de caracteres interpoladas não podem usar especificadores de formato '%', a menos que cada um receba uma expressão, por exemplo, '%d{{1+1}}'. @@ -357,6 +372,11 @@ Diretriz inválida '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Ponto de depuração desconhecido '{0}'. Os pontos de depuração disponíveis são '{1}'. @@ -417,6 +437,11 @@ Cadeia de caracteres interpolada inválida. Literais de cadeia de caracteres de aspas triplas não podem ser usados em expressões interpoladas. Considere usar uma associação 'let' explícita para a expressão de interpolação. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index f10abb60269..5c8c1ad44e7 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. Расширение файла "{0}" не распознано. Исходные файлы должны иметь расширения FS, FSI, FSX или FSSCRIPT. Чтобы включить использование нерекомендуемых расширений ML или MLI, примените команду "--langversion:5.0" и "--mlcompatibility". @@ -107,6 +112,11 @@ Аргумент "{0}" не соответствует + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} Не удалось загрузить сборку конструктора поставщика типа "{0}" из папки "{1}", так как зависимость отсутствует или не может быть загружена. Все зависимости для сборки конструктора поставщика типа должны находиться в папке сборки. Получено исключение: {2} — {3} @@ -317,6 +327,11 @@ Передача свидетеля для ограничений признаков в цитированиях F# + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. В интерполированных строках запрещено использовать описатели формата "%", если только каждому из них не назначено выражение, например "'%d{{1+1}}". @@ -357,6 +372,11 @@ Недопустимая директива "#{0} {1}" + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Неизвестная точка отладки \"{0}\". Доступные точки отладки: \"{1}\". @@ -417,6 +437,11 @@ Недопустимая интерполированная строка. Строковые литералы с тройными кавычками запрещено использовать в интерполированных выражениях. Рекомендуется использовать явную привязку "let" для выражения интерполяции. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index a76a6b2a4ba..fb8d5406e68 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. '{0}' kaynak dosyasının dosya uzantısı tanınmadı. Kaynak dosyaların uzantısı .fs, .fsi, .fsx veya .fsscript olmalıdır. Kullanım dışı .ml veya .mli uzantılarını etkinleştirmek için '--langversion:5.0' ve '--mlcompatibility' kullanın. @@ -107,6 +112,11 @@ '{0}' bağımsız değişkeni eşleşmiyor + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} '{0}' tür sağlayıcısı tasarımcı bütünleştirilmiş kodu, bir bağımlılık eksik olduğundan veya yüklenemediğinden '{1}' klasöründen yüklenemedi. Tür sağlayıcısı tasarımcısı bütünleştirilmiş kodunun tüm bağımlılıkları, ilgili bütünleştirilmiş kodun bulunduğu klasörde bulunmalıdır. Bildirilen özel durum: {2} - {3} @@ -317,6 +327,11 @@ F# alıntılarındaki nitelik kısıtlamaları için tanık geçirme + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. Düz metin arasına kod eklenmiş dizeler, her birine '%d{{1+1}}' gibi bir ifade verilmedikçe '%' biçim belirticilerini kullanamaz. @@ -357,6 +372,11 @@ Geçersiz yönerge '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. Bilinmeyen hata ayıklama noktası '{0}'. Kullanılabilir hata ayıklama noktaları '{1}'. @@ -417,6 +437,11 @@ Geçersiz düz metin arasına kod eklenmiş dize. Üç tırnaklı dize sabitleri, düz metin arasına kod eklenmiş ifadelerde kullanılamaz. Düz metin arasına kod ekleme ifadesi için açık bir 'let' bağlaması kullanmayı düşünün. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 388f1d2aedd..baf4e53d041 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. 无法识别“{0}”的文件扩展名。源文件必须具有扩展名 .fs、.fsi、.fsx 或 .fsscript。要启用已弃用的 .ml 或 .mli 扩展名,请使用 “--langversion:5.0” 和 “--mlcompatibility”。 @@ -107,6 +112,11 @@ 参数 "{0}" 不匹配 + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} 无法从文件夹“{1}”加载类型提供程序设计器程序集“{0}”,因为依赖项缺失或无法加载。类型提供程序设计器程序集的所有依赖项必须与该程序集位于同一文件夹中。报告的异常是: {2} - {3} @@ -317,6 +327,11 @@ F# 引号中特征约束的见证传递 + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. 内插字符串不会使用 "%" 格式说明符,除非为每个字符串提供诸如 "%d{{1+1}}" 之类的表达式。 @@ -357,6 +372,11 @@ 无效的指令“#{0} {1}” + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. 调试点“{0}”未知。可用的调试点为“{1}”。 @@ -417,6 +437,11 @@ 内插字符串无效。在内插表达式中不能使用三重引号字符串文字。请考虑对内插表达式使用显式的 "let" 绑定。 + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 756c76f9ec2..3711de1d214 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -2,6 +2,11 @@ + + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + The file extension of '{0}' is not recognized. Source files must have extension .fs, .fsi, .fsx or .fsscript. To enable the deprecated use of .ml or .mli extensions, use '--langversion:5.0' and '--mlcompatibility'. 無法辨識 '{0}' 的副檔名。來源檔案的副檔名必須是 fsi、.fsx 或 .fsscript。若要啟用已被取代的 .ml 或 .mli 副檔名,請使用 '--langversion:5.0' and '--mlcompatibility'。 @@ -107,6 +112,11 @@ 引數 '{0}' 不相符 + + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + The type provider designer assembly '{0}' could not be loaded from folder '{1}' because a dependency was missing or could not loaded. All dependencies of the type provider designer assembly must be located in the same folder as that assembly. The exception reported was: {2} - {3} 因為缺少相依性或相依性無法載入,導致無法從資料夾 '{1}' 載入類型提供者設計工具組件 '{0}'。類型提供者設計工具組件的所有相依性都必須位於該組件所在的資料夾內。回報的例外狀況: {2} - {3} @@ -317,6 +327,11 @@ 見證 F# 引號中特徵條件約束的傳遞 + + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + + Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'. 除非每個插補字串都有一個運算式,否則不可使用 '%' 格式指定名稱,例如 '%d{{1+1}}'。 @@ -357,6 +372,11 @@ 無效的指示詞 '#{0} {1}' + + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + + Unknown debug point '{0}'. The available debug points are '{1}'. 未知的偵錯點 '{0}'。可用的偵錯點為 '{1}'。 @@ -417,6 +437,11 @@ 插補字串無效。三引號字串常值不可用於插補運算式。請考慮為內插補點運算式使用明確的 'let' 繫結。 + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + + Pattern discard is not allowed for union case that takes no data. Pattern discard is not allowed for union case that takes no data. diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs index 9447c8821f8..7a64b56dabf 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs @@ -104,6 +104,74 @@ let test x = "Type mismatch. Expecting a tuple of length 3 of type\n int * string * char \nbut given a tuple of length 2 of type\n int * char \n") ] + [] + let ``Else branch context``() = + FSharp """ +let f1(a, b: string, c) = + if true then (1, 2) else (a, b, c) + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 3, Col 31, Line 3, Col 38, + "All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length 2 of type\n int * int \nThis branch returns a tuple of length 3 of type\n 'a * string * 'b \n") + ] + + [] + let ``Match branch context``() = + FSharp """ +let f x = + match x with + | 0 -> 0, 0, 0 + | _ -> "a", "a" + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 5, Col 12, Line 5, Col 20, + "All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length 3 of type\n int * int * int \nThis branch returns a tuple of length 2 of type\n string * string \n") + ] + + [] + let ``If context`` () = + FSharp """ +let y : bool * int * int = + if true then "A", "B" + else "B", "C" + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 3, Col 18, Line 3, Col 26, + "The 'if' expression needs to return a tuple of length 3 of type\n bool * int * int \nto satisfy context type requirements. It currently returns a tuple of length 2 of type\n string * string \n") + (Error 1, Line 4, Col 10, Line 4, Col 18, + "All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length 3 of type\n bool * int * int \nThis branch returns a tuple of length 2 of type\n string * string \n") + ] + + [] + let ``Array context`` () = + FSharp """ +let f x y = [| 1, 2; x, "a", y |] + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 22, Line 2, Col 31, + "All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length 2 of type\n int * int \nThis element is a tuple of length 3 of type\n 'a * string * 'b \n") + ] + + [] + let ``List context`` () = + FSharp """ +let f x y = [ 1, 2; x, "a", y ] + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 21, Line 2, Col 30, + "All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length 2 of type\n int * int \nThis element is a tuple of length 3 of type\n 'a * string * 'b \n") + ] + [] let ``return Instead Of return!``() = FSharp """