diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index f74e7509df9..fa20b108362 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -1078,7 +1078,9 @@ and SolveAnonInfoEqualsAnonInfo (csenv: ConstraintSolverEnv) m2 (anonInfo1: Anon elif Set.intersect first second <> Set.empty then Overlap(firstOnly, secondOnly) else - CompletelyDifferent(Seq.toList first) + let first = Set.toList first + let second = Set.toList second + CompletelyDifferent(first, second) let message = match anonInfo1.SortedNames, anonInfo2.SortedNames with @@ -1087,6 +1089,7 @@ and SolveAnonInfoEqualsAnonInfo (csenv: ConstraintSolverEnv) m2 (anonInfo1: Anon | [missingField] -> FSComp.SR.tcAnonRecdSingleFieldNameSubset(string missingField) | _ -> + let missingFields = missingFields |> List.map(sprintf "'%s'") let missingFields = String.concat ", " missingFields FSComp.SR.tcAnonRecdMultipleFieldsNameSubset(string missingFields) | Superset extraFields -> @@ -1094,12 +1097,31 @@ and SolveAnonInfoEqualsAnonInfo (csenv: ConstraintSolverEnv) m2 (anonInfo1: Anon | [extraField] -> FSComp.SR.tcAnonRecdSingleFieldNameSuperset(string extraField) | _ -> + let extraFields = extraFields |> List.map(sprintf "'%s'") let extraFields = String.concat ", " extraFields FSComp.SR.tcAnonRecdMultipleFieldsNameSuperset(string extraFields) | Overlap (missingFields, extraFields) -> FSComp.SR.tcAnonRecdFieldNameMismatch(string missingFields, string extraFields) | CompletelyDifferent missingFields -> - FSComp.SR.tcAnonRecdFieldNameDifferent(string missingFields) + let missingFields, usedFields = missingFields + match missingFields, usedFields with + | [ missingField ], [ usedField ] -> + FSComp.SR.tcAnonRecdSingleFieldNameSingleDifferent(missingField, usedField) + | [ missingField ], usedFields -> + let usedFields = usedFields |> List.map(sprintf "'%s'") + let usedFields = String.concat ", " usedFields + FSComp.SR.tcAnonRecdSingleFieldNameMultipleDifferent(missingField, usedFields) + | missingFields, [ usedField ] -> + let missingFields = missingFields |> List.map(sprintf "'%s'") + let missingFields = String.concat ", " missingFields + FSComp.SR.tcAnonRecdMultipleFieldNameSingleDifferent(missingFields, usedField) + + | missingFields, usedFields -> + let missingFields = missingFields |> List.map(sprintf "'%s'") + let missingFields = String.concat ", " missingFields + let usedFields = usedFields |> List.map(sprintf "'%s'") + let usedFields = String.concat ", " usedFields + FSComp.SR.tcAnonRecdMultipleFieldNameMultipleDifferent(missingFields, usedFields) ErrorD (ConstraintSolverError(message, csenv.m,m2)) else diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 4c205650dbf..dfbda7e7b67 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1396,10 +1396,13 @@ tcAnonRecdInvalid,"Invalid Anonymous Record type declaration." tcAnonRecdCcuMismatch,"Two anonymous record types are from different assemblies '%s' and '%s'" tcAnonRecdFieldNameMismatch,"This anonymous record does not exactly match the expected shape. Add the missing fields %s and remove the extra fields %s." tcAnonRecdSingleFieldNameSubset,"This anonymous record is missing field '%s'." -tcAnonRecdMultipleFieldsNameSubset,"This anonymous record is missing fields '%s'." +tcAnonRecdMultipleFieldsNameSubset,"This anonymous record is missing fields %s." tcAnonRecdSingleFieldNameSuperset,"This anonymous record has an extra field. Remove field '%s'." -tcAnonRecdMultipleFieldsNameSuperset,"This anonymous record has extra fields. Remove fields '%s'." -tcAnonRecdFieldNameDifferent,"This is the wrong anonymous record. It should have the fields %s." +tcAnonRecdMultipleFieldsNameSuperset,"This anonymous record has extra fields. Remove fields %s." +tcAnonRecdSingleFieldNameSingleDifferent,"This anonymous record should have field '%s' but here has field '%s'." +tcAnonRecdSingleFieldNameMultipleDifferent,"This anonymous record should have field '%s' but here has fields %s." +tcAnonRecdMultipleFieldNameSingleDifferent,"This anonymous record should have fields %s; but here has field '%s'." +tcAnonRecdMultipleFieldNameMultipleDifferent,"This anonymous record should have fields %s; but here has fields %s." keywordDescriptionAbstract,"Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation." keywordDescriptionAnd,"Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters." keywordDescriptionAs,"Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index bd2593763cb..2ff15cd7a6b 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1032,9 +1032,9 @@ Pole {0} se v tomto výrazu záznamu vyskytuje vícekrát. - - This is the wrong anonymous record. It should have the fields {0}. - Toto je nesprávný anonymní záznam. Měl by mít pole {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Neplatná deklarace typu anonymního záznamu + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Dva typy anonymních záznamů jsou z různých sestavení: {0} a {1}. - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Tento anonymní záznam neodpovídá přesně očekávanému tvaru. Přidejte chybějící pole {0} a odeberte nadbytečná pole {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Nejde volat metodu rozšíření byref {0}. První parametr vyžaduje, aby hodnota byla měnitelná nebo typu byref, která není jen pro čtení. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 4110ca32276..08236b18246 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1032,9 +1032,9 @@ Das Feld "{0}" ist in diesem Datensatzausdruck mehrmals vorhanden. - - This is the wrong anonymous record. It should have the fields {0}. - Dies ist der falsche anonyme Datensatz. Er muss folgende Felder umfassen: {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Ungültige Deklaration für anonymen Datensatztyp. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Zwei anonyme Datensatztypen stammen aus verschiedenen Assemblys: "{0}" und "{1}". - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Dieser anonyme Datensatz stimmt nicht genau mit der erwarteten Form überein. Fügen Sie die fehlenden Felder ({0}) hinzu, und entfernen Sie die zusätzlichen Felder ({1}). - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Die ByRef-Erweiterungsmethode "{0}" kann nicht aufgerufen werden. Für den ersten Parameter muss der Wert änderbar sein oder einem nicht schreibgeschützten ByRef-Typ entsprechen. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index ed8fb113da1..fd837db386c 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1032,9 +1032,9 @@ El campo "{0}" aparece varias veces en esta expresión de registro. - - This is the wrong anonymous record. It should have the fields {0}. - Este es un registro anónimo incorrecto. Debe tener los campos {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Declaración de tipo de registro anónimo no válido. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Dos tipos de registro anónimos provienen de diferentes ensamblados "{0}" y "{1}" - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Este registro anónimo no coincide exactamente con la forma esperada. Agregue los campos que faltan {0} y quite los campos adicionales {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. No se puede llamar al método de extensión de byref "{0}". El primer parámetro requiere que el valor sea mutable o un tipo de byref que no sea de solo lectura. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index bfc9572c277..1587b7f10e0 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1032,9 +1032,9 @@ Le champ «{0}» apparaît plusieurs fois dans cette expression d’enregistrement. - - This is the wrong anonymous record. It should have the fields {0}. - Il s'agit de l'enregistrement anonyme incorrect. Il doit contenir les champs {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Déclaration de type d'enregistrement anonyme non valide. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Deux types d'enregistrement anonyme proviennent d'assemblys différents '{0}' et '{1}' - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Cet enregistrement anonyme ne correspond pas exactement à la forme attendue. Ajoutez les champs manquants {0} et supprimez les champs supplémentaires {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Impossible d’appeler la méthode d’extension byref « {0} ». Le premier paramètre nécessite que la valeur soit mutable ou un type byref autre qu'en lecture seule. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index d4e7b1fc917..bb92fad9b00 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1032,9 +1032,9 @@ Il campo '{0}' viene visualizzato più volte in questa espressione di record. - - This is the wrong anonymous record. It should have the fields {0}. - Si tratta del record anonimo errato. Deve includere i campi {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ La dichiarazione di tipo Record anonimo non è valida. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Due tipi di record anonimo provengono da assembly diversi, '{0}' e '{1}' - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Questo record anonimo non corrisponde esattamente alla forma prevista. Aggiungere i campi mancanti {0} e rimuovere i campi aggiuntivi {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Non è possibile chiamare il metodo di estensione byref '{0}. Il valore del primo parametro deve essere modificabile oppure un tipo byref non di sola lettura. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 37e47f6da0a..c59b5a2abf4 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1032,9 +1032,9 @@ このレコード式に、フィールド '{0}' が複数回出現します。 - - This is the wrong anonymous record. It should have the fields {0}. - この匿名レコードは正しくありません。フィールド {0} を含んでいる必要があります。 + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ 匿名レコードの型宣言が無効です。 + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ 2 つの匿名レコードの種類は、'{0}' と '{1}' の異なるアセンブリからのものです - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - この匿名レコードは、予期された形状と完全には一致していません。不足しているフィールド {0} を追加し、不要なフィールド {1} を削除してください。 - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. byref 拡張メソッド '{0} を呼び出すことはできません。最初のパラメーターでは、値を変更可能な byref 型または読み取り専用以外の byref 型にする必要があります。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 40751d29f73..782b1fe4b22 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1032,9 +1032,9 @@ '{0}' 필드가 이 레코드 식에 여러 번 나타납니다. - - This is the wrong anonymous record. It should have the fields {0}. - 잘못된 익명 레코드입니다. {0} 필드가 있어야 합니다. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ 익명 레코드 형식 선언이 잘못되었습니다. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ 두 무명 레코드 형식은 서로 다른 어셈블리 '{0}' 및 '{1}'에서 가져왔습니다. - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - 이 익명 레코드는 필요한 도형과 정확하게 일치하지 않습니다. 누락된 필드 {0}을(를) 추가하고 추가 필드 {1}을(를) 제거하세요. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. byref 확장 메서드 '{0}'을(를) 호출할 수 없습니다. 첫 번째 매개 변수는 변경할 수 있거나 읽기 전용이 아닌 byref 형식인 값이 필요합니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index c64f7c479b8..26e1c6498bc 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1032,9 +1032,9 @@ Pole „{0}” występuje wielokrotnie w tym wyrażeniu rekordu. - - This is the wrong anonymous record. It should have the fields {0}. - To jest nieprawidłowy rekord anonimowy. Powinien zawierać pola {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Nieprawidłowa deklaracja typu rekordu anonimowego. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Dwa typy rekordów anonimowych pochodzą z różnych zestawów: „{0}” i „{1}” - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Ten rekord anonimowy nie jest dokładnie zgodny z oczekiwanym kształtem. Dodaj brakujące pola {0} i usuń dodatkowe pola {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Nie można wywołać metody rozszerzenia byref „{0}”. Pierwszy parametr wymaga, aby wartość była typem byref zmiennym lub innym niż tylko do odczytu. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1f2828362ef..afe6de384ca 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1032,9 +1032,9 @@ O campo '{0}' aparece várias vezes nesta expressão de registro. - - This is the wrong anonymous record. It should have the fields {0}. - Este é o registro anônimo errado. Ele deve ter os campos {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Declaração inválida de tipo de Registro Anônimo. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Dois tipos de registro anônimos são de diferentes assemblies '{0}' e '{1}' - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Este registro anônimo não corresponde exatamente à forma esperada. Adicione os campos ausentes {0} e remova os campos extras {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Não é possível chamar o método de extensão de byref '{0}. O primeiro parâmetro requer que o valor seja mutável ou não seja byref somente leitura. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index b648cf9f655..a6b7ccdcfd6 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1032,9 +1032,9 @@ Поле "{0}" появляется несколько раз в данном выражении записи. - - This is the wrong anonymous record. It should have the fields {0}. - Неправильная анонимная запись. Она должна содержать поля {0}. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Недопустимое объявление типа анонимной записи. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ Два типа анонимных записей принадлежат различным сборкам '{0}' и '{1}' - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Эта анонимная запись не соответствует ожидаемой форме. Добавьте недостающие поля {0} и удалите лишние поля {1}. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. Не удается вызвать метод расширения byref "{0}". В качестве первого параметра необходимо указать изменяемое значение или значение типа byref, доступное не только для чтения. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 6ca7fdeee95..f2b50c00ba5 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1032,9 +1032,9 @@ '{0}' alanı bu kayıt ifadesinde birden fazla yerde görünüyor. - - This is the wrong anonymous record. It should have the fields {0}. - Bu anonim kayıt yanlış. Kayıt, {0} alanlarını içermelidir. + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ Anonim Kayıt türü bildirimi geçersiz. + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ İki anonim kayıt türü, birbirinden farklı olan '{0}' ve '{1}' derlemelerinden - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - Bu anonim kayıt, beklenen şekille tam olarak eşleşmiyor. Eksik {0} alanlarını ekleyin ve ek {1} alanlarını kaldırın. - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. '{0}' byref genişletme metodu çağrılamıyor. İlk parametre, değerin değişebilir olmasını veya salt okunur olmayan bir byref türünde olmasını gerektiriyor. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 859302398f9..1f63fdbae98 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1032,9 +1032,9 @@ 字段“{0}”在此记录表达式中多次出现。 - - This is the wrong anonymous record. It should have the fields {0}. - 此匿名记录不正确。它应具有字段 {0}。 + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ 匿名记录类型声明无效。 + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ 两个匿名记录类型来自不同的程序集“{0}”和“{1}” - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - 此匿名记录与预期的形状不完全匹配。请添加缺少的字段 {0} 并删除额外的字段 {1}。 - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. 无法调用 byref 扩展方法 "{0}"。第一个参数要求该值是可变的或非只读的 byref 类型。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 5f0596a3035..5771d206cfd 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1032,9 +1032,9 @@ 欄位 '{0}' 在這個記錄運算式中出現多次。 - - This is the wrong anonymous record. It should have the fields {0}. - 此為錯誤的匿名記錄。其應有欄位 {0}。 + + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. + This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. @@ -1042,14 +1042,34 @@ 匿名記錄型別宣告無效。 + + This anonymous record should have fields {0}; but here has fields {1}. + This anonymous record should have fields {0}; but here has fields {1}. + + + + This anonymous record should have fields {0}; but here has field '{1}'. + This anonymous record should have fields {0}; but here has field '{1}'. + + - This anonymous record is missing fields '{0}'. - This anonymous record is missing fields '{0}'. + This anonymous record is missing fields {0}. + This anonymous record is missing fields {0}. - This anonymous record has extra fields. Remove fields '{0}'. - This anonymous record has extra fields. Remove fields '{0}'. + This anonymous record has extra fields. Remove fields {0}. + This anonymous record has extra fields. Remove fields {0}. + + + + This anonymous record should have field '{0}' but here has fields {1}. + This anonymous record should have field '{0}' but here has fields {1}. + + + + This anonymous record should have field '{0}' but here has field '{1}'. + This anonymous record should have field '{0}' but here has field '{1}'. @@ -8397,11 +8417,6 @@ 有兩個匿名的記錄類型來自不同的組件 '{0}' 和 '{1}' - - This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}. - 此匿名記錄與預期的圖形未完全相符。請新增缺少的欄位 {0},並移除額外的欄位 {1}。 - - Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. 無法呼叫 byref 擴充方法 '{0}。第一個參數需要值可變動,或為非唯讀 byref 類型。 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index faa24a3e17a..b5074a29007 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -39,7 +39,7 @@ let x () : {| A: int; B: string; C: int |} = {| A = 123 |} |> compile |> shouldFail |> withDiagnostics [ - (Error 1, Line 2, Col 48, Line 2, Col 61, "This anonymous record is missing fields 'B, C'.") + (Error 1, Line 2, Col 48, Line 2, Col 61, "This anonymous record is missing fields 'B', 'C'.") ] [] @@ -61,8 +61,60 @@ let x () : {| A: int |} = {| A = 123 ; B = ""; C = 1 |} |> compile |> shouldFail |> withDiagnostics [ - (Error 1, Line 2, Col 29, Line 2, Col 58, "This anonymous record has extra fields. Remove fields 'B, C'.") + (Error 1, Line 2, Col 29, Line 2, Col 58, "This anonymous record has extra fields. Remove fields 'B', 'C'.") ] + + [] + let ``Using the wrong anon record with single field`` () = + Fsx """ +let x() = ({| b = 2 |} = {| a = 2 |} ) +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 26, Line 2, Col 37, "This anonymous record should have field 'b' but here has field 'a'.") + ] + + [] + let ``Using the wrong anon record with single field 2`` () = + Fsx """ +let x() = ({| b = 2 |} = {| a = 2; c = "" |} ) +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 26, Line 2, Col 45, "This anonymous record should have field 'b' but here has fields 'a', 'c'.") + ] + + [] + let ``Using the wrong anon record with multiple fields`` () = + Fsx """ +let x() = ({| b = 2; c = 3 |} = {| a = 2 |} ) +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 33, Line 2, Col 44, "This anonymous record should have fields 'b', 'c'; but here has field 'a'.") + ] + + [] + let ``Using the wrong anon record with multiple fields 2`` () = + Fsx """ +let x() = ({| b = 2; c = 3 |} = {| a = 2; d = "" |} ) +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 2, Col 33, Line 2, Col 52, "This anonymous record should have fields 'b', 'c'; but here has fields 'a', 'd'.") + ] + + [] + let ``Two anon records with no fields`` () = + Fsx """ +let x() = ({||} = {||}) +""" + |> compile + |> shouldSucceed [] let ``Anonymous Records with duplicate labels - Copy and update expression`` () = diff --git a/tests/fsharp/typecheck/sigs/neg113.bsl b/tests/fsharp/typecheck/sigs/neg113.bsl index c61b8907b47..c9e74bcc6ec 100644 --- a/tests/fsharp/typecheck/sigs/neg113.bsl +++ b/tests/fsharp/typecheck/sigs/neg113.bsl @@ -1,7 +1,7 @@ neg113.fs(5,50,5,61): typecheck error FS0001: This anonymous record is missing field 'b'. -neg113.fs(7,41,7,52): typecheck error FS0001: This is the wrong anonymous record. It should have the fields [b]. +neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have field 'b' but here has field 'a'. neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion diff --git a/tests/fsharp/typecheck/sigs/neg113.vsbsl b/tests/fsharp/typecheck/sigs/neg113.vsbsl index c61b8907b47..c9e74bcc6ec 100644 --- a/tests/fsharp/typecheck/sigs/neg113.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg113.vsbsl @@ -1,7 +1,7 @@ neg113.fs(5,50,5,61): typecheck error FS0001: This anonymous record is missing field 'b'. -neg113.fs(7,41,7,52): typecheck error FS0001: This is the wrong anonymous record. It should have the fields [b]. +neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have field 'b' but here has field 'a'. neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion diff --git a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl index 5f4522e7c1d..1edbabacd8c 100644 --- a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl +++ b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl @@ -1,7 +1,7 @@ neg_anon_1.fs(5,50,5,61): typecheck error FS0001: This anonymous record is missing field 'b'. -neg_anon_1.fs(7,41,7,52): typecheck error FS0001: This is the wrong anonymous record. It should have the fields [b]. +neg_anon_1.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have field 'b' but here has field 'a'. neg_anon_1.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion