Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca22bfe

Browse files
isaacabrahamKevinRansom
authored andcommitted
Better expression errors (#5114)
* Initial commit.* Add missing xlf files.* Update messages.* Simplify list and array messages.* Add missing xlf files.* Simply text further.* Update bsl file.* Update neg 80 baseline.* More unit test whack-a-mole.
1 parent245a638 commitca22bfe

26 files changed

+154
-154
lines changed

‎src/buildfromsource/FSharp.Compiler.Private/FSComp.fs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,19 @@ type internal SR private() =
163163
/// Add . for indexer access.
164164
/// (Originally from ..\FSComp.txt:19)
165165
static memberaddIndexerDot()=(GetStringFunc("addIndexerDot",",,,"))
166-
/// All elements of a list constructor expression must have the same type.This expression was expected to havetype '%s', buthere has type '%s'.
166+
/// All elements of a list constructor expression must have the same type.The first element hastype '%s', butthere is also an element of type '%s'.
167167
/// (Originally from ..\FSComp.txt:20)
168168
static memberlistElementHasWrongType(a0:System.String,a1:System.String)=(GetStringFunc("listElementHasWrongType",",,,%s,,,%s,,,") a0 a1)
169-
/// All elements of an array constructor expression must have the same type.This expression was expected to havetype '%s', buthere has type '%s'.
169+
/// All elements of an array constructor expression must have the same type.The first element hastype '%s', butthere is also an element of type '%s'.
170170
/// (Originally from ..\FSComp.txt:21)
171171
static memberarrayElementHasWrongType(a0:System.String,a1:System.String)=(GetStringFunc("arrayElementHasWrongType",",,,%s,,,%s,,,") a0 a1)
172-
/// The 'if' expression is missing an 'else' branch.The 'then' branch has type '%s'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type.
172+
/// The 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type as the first branch ('%s').
173173
/// (Originally from ..\FSComp.txt:22)
174174
static membermissingElseBranch(a0:System.String)=(GetStringFunc("missingElseBranch",",,,%s,,,") a0)
175175
/// The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'.
176176
/// (Originally from ..\FSComp.txt:23)
177177
static memberifExpression(a0:System.String,a1:System.String)=(GetStringFunc("ifExpression",",,,%s,,,%s,,,") a0 a1)
178-
/// All branches of an 'if' expression musthavethe same type.This expression was expected to havetype '%s', buthere has type '%s'.
178+
/// All branches of an 'if' expression mustreturn values ofthe same type.The first branch returned a value oftype '%s', butthis branch returned a value of type '%s'.
179179
/// (Originally from ..\FSComp.txt:24)
180180
static memberelseBranchHasWrongType(a0:System.String,a1:System.String)=(GetStringFunc("elseBranchHasWrongType",",,,%s,,,%s,,,") a0 a1)
181181
/// All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'.

‎src/fsharp/FSComp.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ undefinedNameTypeParameter,"The type parameter %s is not defined."
1717
undefinedNamePatternDiscriminator,"The pattern discriminator '%s' is not defined."
1818
replaceWithSuggestion,"Replace with '%s'"
1919
addIndexerDot,"Add . for indexer access."
20-
listElementHasWrongType,"All elements of a listconstructor expressionmusthavethe same type. This expression was expected to have type '%s', but here has type '%s'."
21-
arrayElementHasWrongType,"All elements of an arrayconstructor expressionmusthavethe same type. This expression was expected to have type '%s', but here has type '%s'."
22-
missingElseBranch,"The 'if' expression is missing an 'else' branch.The 'then' branch has type '%s'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value ofthe sametype."
20+
listElementHasWrongType,"All elements of a list mustbe ofthe same type as the first element, which here is '%s'. This element has type '%s'."
21+
arrayElementHasWrongType,"All elements of an array mustbe ofthe same type as the first element, which here is '%s'. This element has type '%s'."
22+
missingElseBranch,"This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch whichalsoreturns a value of type '%s'."
2323
ifExpression,"The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'."
24-
elseBranchHasWrongType,"All branches of an 'if' expression musthavethe same type. This expression was expected to have type '%s', but here has type '%s'."
25-
followingPatternMatchClauseHasWrongType,"All branches of a pattern match expression must return values of the same type. Thefirst branch returned a value of type'%s', but thisbranchreturned a value of type '%s'."
24+
elseBranchHasWrongType,"All branches of an 'if' expression mustreturn values ofthe same type as the first branch, which here is '%s'. This branch returns a value of type '%s'."
25+
followingPatternMatchClauseHasWrongType,"All branches of a pattern match expression must return values of the same type as thefirst branch, which here is'%s'. Thisbranchreturns a value of type '%s'."
2626
patternMatchGuardIsNotBool,"A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'."
2727
commaInsteadOfSemicolonInRecord,"A ';' is used to separate field values in records. Consider replacing ',' with ';'."
2828
derefInsteadOfNot,"The '!' operator is used to dereference a ref cell. Consider using 'not expr' here."

‎src/fsharp/xlf/FSComp.txt.cs.xlf‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@
8383
<note />
8484
</trans-unit>
8585
<trans-unitid="listElementHasWrongType">
86-
<source>All elements of a listconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
87-
<targetstate="translated">Všechny elementy výrazu konstruktoru seznamu musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
86+
<source>All elements of a list mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
87+
<targetstate="needs-review-translation">Všechny elementy výrazu konstruktoru seznamu musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
8888
<note />
8989
</trans-unit>
9090
<trans-unitid="arrayElementHasWrongType">
91-
<source>All elements of an arrayconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
92-
<targetstate="translated">Všechny elementy výrazu konstruktoru pole musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
91+
<source>All elements of an array mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
92+
<targetstate="needs-review-translation">Všechny elementy výrazu konstruktoru pole musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
9393
<note />
9494
</trans-unit>
9595
<trans-unitid="missingElseBranch">
96-
<source>The 'if' expression is missing an 'else' branch.The 'then' branch has type '{0}'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value ofthe sametype.</source>
97-
<targetstate="translated">Ve výrazu if chybí větev else. Větev then je typu {0}. Protože if je výraz a ne příkaz, přidejte větev else, která vrátí hodnotu stejného typu.</target>
96+
<source>This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch whichalsoreturns a value of type '{0}'.</source>
97+
<targetstate="needs-review-translation">Ve výrazu if chybí větev else. Větev then je typu {0}. Protože if je výraz a ne příkaz, přidejte větev else, která vrátí hodnotu stejného typu.</target>
9898
<note />
9999
</trans-unit>
100100
<trans-unitid="ifExpression">
@@ -103,12 +103,12 @@
103103
<note />
104104
</trans-unit>
105105
<trans-unitid="elseBranchHasWrongType">
106-
<source>All branches of an 'if' expression musthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
107-
<targetstate="translated">Všechny větve výrazu if musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
106+
<source>All branches of an 'if' expression mustreturn values ofthe same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</source>
107+
<targetstate="needs-review-translation">Všechny větve výrazu if musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}.</target>
108108
<note />
109109
</trans-unit>
110110
<trans-unitid="followingPatternMatchClauseHasWrongType">
111-
<source>All branches of a pattern match expression must return values of the same type. Thefirst branch returned a value of type'{0}', but thisbranchreturned a value of type '{1}'.</source>
111+
<source>All branches of a pattern match expression must return values of the same type as thefirst branch, which here is'{0}'. Thisbranchreturns a value of type '{1}'.</source>
112112
<targetstate="translated">Všechny větve výrazu porovnání vzorů musí vracet hodnoty stejného typu. První větev vrátila hodnotu typu {0}, ale tato větev vrátila hodnotu typu {1}.</target>
113113
<note />
114114
</trans-unit>

‎src/fsharp/xlf/FSComp.txt.de.xlf‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@
8383
<note />
8484
</trans-unit>
8585
<trans-unit id="listElementHasWrongType">
86-
<source>All elements of a listconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
87-
<target state="translated">Alle Elemente eines Listenkonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
86+
<source>All elements of a list mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
87+
<target state="needs-review-translation">Alle Elemente eines Listenkonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
8888
<note />
8989
</trans-unit>
9090
<trans-unit id="arrayElementHasWrongType">
91-
<source>All elements of an arrayconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
92-
<target state="translated">Alle Elemente eines Arraykonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
91+
<source>All elements of an array mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
92+
<target state="needs-review-translation">Alle Elemente eines Arraykonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
9393
<note />
9494
</trans-unit>
9595
<trans-unit id="missingElseBranch">
96-
<source>The 'if' expression is missing an 'else' branch.The 'then' branch has type '{0}'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value ofthe sametype.</source>
97-
<target state="translated">Dem if-Ausdruck fehlt ein else-Branch. Der then-Branch weist den Typ "{0}" auf. Da "if" ein Ausdruck und keine Anweisung ist, fügen Sie einen else-Branch hinzu, der einen Wert des gleichen Typs zurückgibt.</target>
96+
<source>This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch whichalsoreturns a value of type '{0}'.</source>
97+
<target state="needs-review-translation">Dem if-Ausdruck fehlt ein else-Branch. Der then-Branch weist den Typ "{0}" auf. Da "if" ein Ausdruck und keine Anweisung ist, fügen Sie einen else-Branch hinzu, der einen Wert des gleichen Typs zurückgibt.</target>
9898
<note />
9999
</trans-unit>
100100
<trans-unit id="ifExpression">
@@ -103,12 +103,12 @@
103103
<note />
104104
</trans-unit>
105105
<trans-unit id="elseBranchHasWrongType">
106-
<source>All branches of an 'if' expression musthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
107-
<target state="translated">Alle Branches eines if-Ausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
106+
<source>All branches of an 'if' expression mustreturn values ofthe same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</source>
107+
<target state="needs-review-translation">Alle Branches eines if-Ausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor.</target>
108108
<note />
109109
</trans-unit>
110110
<trans-unit id="followingPatternMatchClauseHasWrongType">
111-
<source>All branches of a pattern match expression must return values of the same type. Thefirst branch returned a value of type'{0}', but thisbranchreturned a value of type '{1}'.</source>
111+
<source>All branches of a pattern match expression must return values of the same type as thefirst branch, which here is'{0}'. Thisbranchreturns a value of type '{1}'.</source>
112112
<target state="translated">Alle Branches eines Musterübereinstimmungsausdrucks müssen Werte des gleichen Typs zurückgeben. Der erste Branch hat einen Wert vom Typ "{0}" zurückgegeben, aber dieser Branch gab einen Wert vom Typ "{1}" zurück.</target>
113113
<note />
114114
</trans-unit>

‎src/fsharp/xlf/FSComp.txt.en.xlf‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@
8383
<note />
8484
</trans-unit>
8585
<trans-unitid="listElementHasWrongType">
86-
<source>All elements of a listconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
87-
<targetstate="new">All elements of a listconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</target>
86+
<source>All elements of a list mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
87+
<targetstate="new">All elements of a list mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</target>
8888
<note />
8989
</trans-unit>
9090
<trans-unitid="arrayElementHasWrongType">
91-
<source>All elements of an arrayconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
92-
<targetstate="new">All elements of an arrayconstructor expressionmusthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</target>
91+
<source>All elements of an array mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</source>
92+
<targetstate="new">All elements of an array mustbe ofthe same type as the first element, which here is '{0}'. This element has type '{1}'.</target>
9393
<note />
9494
</trans-unit>
9595
<trans-unitid="missingElseBranch">
96-
<source>The 'if' expression is missing an 'else' branch.The 'then' branch has type '{0}'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value ofthe sametype.</source>
97-
<targetstate="new">The 'if' expression is missing an 'else' branch.The 'then' branch has type '{0}'.Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value ofthe sametype.</target>
96+
<source>This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch whichalsoreturns a value of type '{0}'.</source>
97+
<targetstate="new">This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch whichalsoreturns a value of type '{0}'.</target>
9898
<note />
9999
</trans-unit>
100100
<trans-unitid="ifExpression">
@@ -103,13 +103,13 @@
103103
<note />
104104
</trans-unit>
105105
<trans-unitid="elseBranchHasWrongType">
106-
<source>All branches of an 'if' expression musthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</source>
107-
<targetstate="new">All branches of an 'if' expression musthavethe same type. This expression was expected to have type '{0}', but here has type '{1}'.</target>
106+
<source>All branches of an 'if' expression mustreturn values ofthe same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</source>
107+
<targetstate="new">All branches of an 'if' expression mustreturn values ofthe same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</target>
108108
<note />
109109
</trans-unit>
110110
<trans-unitid="followingPatternMatchClauseHasWrongType">
111-
<source>All branches of a pattern match expression must return values of the same type. Thefirst branch returned a value of type'{0}', but thisbranchreturned a value of type '{1}'.</source>
112-
<targetstate="new">All branches of a pattern match expression must return values of the same type. Thefirst branch returned a value of type'{0}', but thisbranchreturned a value of type '{1}'.</target>
111+
<source>All branches of a pattern match expression must return values of the same type as thefirst branch, which here is'{0}'. Thisbranchreturns a value of type '{1}'.</source>
112+
<targetstate="new">All branches of a pattern match expression must return values of the same type as thefirst branch, which here is'{0}'. Thisbranchreturns a value of type '{1}'.</target>
113113
<note />
114114
</trans-unit>
115115
<trans-unitid="patternMatchGuardIsNotBool">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp