Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions src/fsharp/ConstraintSolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,35 @@ and SolveAnonInfoEqualsAnonInfo (csenv: ConstraintSolverEnv) m2 (anonInfo1: Anon
(match anonInfo1.Assembly, anonInfo2.Assembly with
| ccu1, ccu2 -> if not (ccuEq ccu1 ccu2) then ErrorD (ConstraintSolverError(FSComp.SR.tcAnonRecdCcuMismatch(ccu1.AssemblyName, ccu2.AssemblyName), csenv.m,m2)) else ResultD ()
) ++ (fun () ->

if not (anonInfo1.SortedNames = anonInfo2.SortedNames) then
let namesText1 = sprintf "%A" (Array.toList anonInfo1.SortedNames)
let namesText2 = sprintf "%A" (Array.toList anonInfo2.SortedNames)
ErrorD (ConstraintSolverError(FSComp.SR.tcAnonRecdFieldNameMismatch(namesText1, namesText2), csenv.m,m2))
let (|Subset|Superset|Overlap|CompletelyDifferent|) (first, second) =
let first = Set first
let second = Set second
let secondOnly = Set.toList (second - first)
let firstOnly = Set.toList (first - second)

if second.IsSubsetOf first then
Subset firstOnly
elif second.IsSupersetOf first then
Superset secondOnly
elif Set.intersect first second <> Set.empty then
Overlap(firstOnly, secondOnly)
else
CompletelyDifferent(Seq.toList first)

let message =
match anonInfo1.SortedNames, anonInfo2.SortedNames with
| Subset missingFields ->
FSComp.SR.tcAnonRecdFieldNameSubset(string missingFields)
| Superset extraFields ->
FSComp.SR.tcAnonRecdFieldNameSuperset(string extraFields)
| Overlap (missingFields, extraFields) ->
FSComp.SR.tcAnonRecdFieldNameMismatch(string missingFields, string extraFields)
| CompletelyDifferent missingFields ->
FSComp.SR.tcAnonRecdFieldNameDifferent(string missingFields)

ErrorD (ConstraintSolverError(message, csenv.m,m2))
else
ResultD ())

Expand Down
5 changes: 4 additions & 1 deletion src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,10 @@ tcGlobalsSystemTypeNotFound,"The system type '%s' was required but no referenced
3214,methodIsNotStatic,"Method or object constructor '%s' is not static"
3215,parsUnexpectedSymbolEqualsInsteadOfIn,"Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead?"
tcAnonRecdCcuMismatch,"Two anonymous record types are from different assemblies '%s' and '%s'"
tcAnonRecdFieldNameMismatch,"Two anonymous record types have mismatched sets of field names '%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."
tcAnonRecdFieldNameSubset,"This anonymous record does not have enough fields. Add the missing fields %s."
tcAnonRecdFieldNameSuperset,"This anonymous record has too many fields. Remove the extra fields %s."
tcAnonRecdFieldNameDifferent,"This is the wrong anonymous record. It should have the 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."
keyworkDescriptionAnd,"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."
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">Algoritmus {0} není podporovaný.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">Atributy nejde použít pro rozšíření typů.</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">Dva typy anonymních záznamů mají odlišné sady názvů polí: {0} a {1}</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">Dva typy anonymních záznamů mají odlišné sady názvů polí: {0} a {1}</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">Algorithmus "{0}" wird nicht unterstützt</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">Attribute können nicht auf Typerweiterungen angewendet werden.</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">Zwei anonyme Datensatztypen weisen die nicht übereinstimmenden Feldnamen "{0}" und "{1}" auf.</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">Zwei anonyme Datensatztypen weisen die nicht übereinstimmenden Feldnamen "{0}" und "{1}" auf.</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
21 changes: 18 additions & 3 deletions src/fsharp/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">No se admite el algoritmo '{0}'</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">Los atributos no se pueden aplicar a las extensiones de tipo.</target>
Expand Down Expand Up @@ -159,7 +174,7 @@
</trans-unit>
<trans-unit id="followingPatternMatchClauseHasWrongType">
<source>All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</source>
<target state="translated">Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}".</target>
<target state="new">All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'.</target>
<note />
</trans-unit>
<trans-unit id="patternMatchGuardIsNotBool">
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">Dos tipos de registros anónimos tienen conjuntos de nombres de campo que no coinciden "{0}" y "{1}"</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">Dos tipos de registros anónimos tienen conjuntos de nombres de campo que no coinciden "{0}" y "{1}"</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">Algorithme '{0}' non pris en charge</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">Impossible d'appliquer des attributs aux extensions de type.</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">Deux types d'enregistrement anonyme ont des ensembles de noms de champ incompatibles '{0}' et '{1}'</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">Deux types d'enregistrement anonyme ont des ensembles de noms de champ incompatibles '{0}' et '{1}'</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">L'algoritmo '{0}' non è supportato</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">Gli attributi non possono essere applicati a estensioni di tipo.</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">Due tipi di record anonimo contengono set di nomi di campo '{0}' e '{1}' non corrispondenti</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">Due tipi di record anonimo contengono set di nomi di campo '{0}' e '{1}' non corrispondenti</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">アルゴリズム '{0}' はサポートされていません</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">属性を型拡張に適用することはできません。</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">2 種類の匿名レコードのフィールド名 '{0}' と '{1}' が一致しません</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">2 種類の匿名レコードのフィールド名 '{0}' と '{1}' が一致しません</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
19 changes: 17 additions & 2 deletions src/fsharp/xlf/FSComp.txt.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@
<target state="translated">{0}' 알고리즘은 지원되지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameDifferent">
<source>This is the wrong anonymous record. It should have the fields {0}.</source>
<target state="new">This is the wrong anonymous record. It should have the fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSubset">
<source>This anonymous record does not have enough fields. Add the missing fields {0}.</source>
<target state="new">This anonymous record does not have enough fields. Add the missing fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameSuperset">
<source>This anonymous record has too many fields. Remove the extra fields {0}.</source>
<target state="new">This anonymous record has too many fields. Remove the extra fields {0}.</target>
<note />
</trans-unit>
<trans-unit id="tcAugmentationsCannotHaveAttributes">
<source>Attributes cannot be applied to type extensions.</source>
<target state="translated">형식 확장에 특성을 적용할 수 없습니다.</target>
Expand Down Expand Up @@ -7128,8 +7143,8 @@
<note />
</trans-unit>
<trans-unit id="tcAnonRecdFieldNameMismatch">
<source>Two anonymous record types have mismatched sets of field names '{0}' and '{1}'</source>
<target state="translated">두 무명 레코드 형식의 필드 이름 '{0}' 및 '{1}' 집합이 일치하지 않습니다.</target>
<source>This anonymous record does not exactly match the expected shape. Add the missing fields {0} and remove the extra fields {1}.</source>
<target state="needs-review-translation">두 무명 레코드 형식의 필드 이름 '{0}' 및 '{1}' 집합이 일치하지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="tcCannotCallExtensionMethodInrefToByref">
Expand Down
Loading