From b6aaa005f7b279b4ca6d7dbdfdae352f5b8201ff Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 02:33:29 +0800 Subject: [PATCH 01/20] Improve value restriction error message #1103 --- src/Compiler/Checking/CheckDeclarations.fs | 2 +- src/Compiler/Checking/CheckExpressions.fs | 2 +- src/Compiler/Checking/CheckExpressions.fsi | 2 +- src/Compiler/FSStrings.resx | 17 +++-------- src/Compiler/xlf/FSStrings.cs.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.de.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.es.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.fr.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.it.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.ja.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.ko.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.pl.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.pt-BR.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.ru.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.tr.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 35 +++++++--------------- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 35 +++++++--------------- 17 files changed, 137 insertions(+), 341 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 0a860cef0ec..ef9a56204a0 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -5577,7 +5577,7 @@ let CheckValueRestriction denvAtEnd infoReader rootSigOpt implFileTypePriorToSig // for example FSharp 1.0 3661. (match v.ValReprInfo with None -> true | Some tvi -> tvi.HasNoArgs)) then match ftyvs with - | tp :: _ -> errorR (ValueRestriction(denvAtEnd, infoReader, false, v, tp, v.Range)) + | tp :: _ -> errorR (ValueRestriction(denvAtEnd, infoReader, v, tp, v.Range)) | _ -> () mty.ModuleAndNamespaceDefinitions |> List.iter (fun v -> check v.ModuleOrNamespaceType) try check implFileTypePriorToSig with RecoverableException e -> errorRecovery e m diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 6f169d474a8..98138270658 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -94,7 +94,7 @@ exception UnionPatternsBindDifferentNames of range exception VarBoundTwice of Ident -exception ValueRestriction of DisplayEnv * InfoReader * bool * Val * Typar * range +exception ValueRestriction of DisplayEnv * InfoReader * Val * Typar * range exception ValNotMutable of DisplayEnv * ValRef * range diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 16a759c2e3d..3f1e8d78b97 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -75,7 +75,7 @@ exception UnionPatternsBindDifferentNames of range exception VarBoundTwice of Ident -exception ValueRestriction of DisplayEnv * InfoReader * bool * Val * Typar * range +exception ValueRestriction of DisplayEnv * InfoReader * Val * Typar * range exception ValNotMutable of DisplayEnv * ValRef * range diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 251f626c63e..79e11695761 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1029,20 +1029,11 @@ The following fields require values: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. syntax error diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 318ea1464ff..c8170ce1a85 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -202,6 +202,16 @@ Pole {0} a {1} jsou odlišného typu. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern {0} má v tomto vzoru dvě vazby. @@ -1532,31 +1542,6 @@ Následující pole vyžadují hodnoty: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Omezení hodnoty. Hodnota {0} je obecného typu\n {1}. \nBuď změňte argumenty pro {2} na explicitní, nebo (pokud hodnota nemá být obecná) přidejte poznámku typu. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Omezení hodnoty. Hodnota {0} je obecného typu\n {1}. \nZměňte {2} na funkci s explicitními argumenty nebo (pokud hodnota nemá být obecná) přidejte poznámku typu. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Omezení hodnoty. Tento člen se odvodil jako člen obecného typu\n {0}. \nKonstruktory a metody getter nebo setter vlastnosti nemůžou být obecnější než nadřazený typ. Přidejte poznámku typu, abyste přesně určili, které typy se mají zahrnout. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Omezení hodnoty. Hodnota {0} se odvodila jako hodnota obecného typu\n {1}. \nBuď změňte argumenty pro {2} na explicitní, nebo (pokud hodnota nemá být obecná) přidejte poznámku typu. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Omezení hodnoty. Hodnota {0} se odvodila jako hodnota obecného typu\n {1}. \nDefinujte {2} jako jednoduchý datový výraz, změňte ji na funkci s explicitními argumenty nebo (pokud hodnota nemá být obecná) přidejte poznámku typu. - - syntax error chyba syntaxe diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 430b308631e..740780a7f42 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -202,6 +202,16 @@ Die Felder "{0}" und "{1}" stammen aus unterschiedlichen Typen. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern {0} ist in diesem Muster doppelt gebunden. @@ -1532,31 +1542,6 @@ Für die folgenden Felder sind Werte erforderlich: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Werteinschränkung. Der Wert "{0}" hat den generischen Typ\n {1} \nLegen Sie die Argumente für "{2}" entweder als explizit fest, oder fügen Sie eine Typanmerkung hinzu, wenn der Typ nicht generisch sein soll. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Werteinschränkung. Der Wert "{0}" hat den generischen Typ\n {1} \nDefinieren Sie "{2}" entweder als Funktion mit expliziten Argumenten, oder fügen Sie eine Typanmerkung hinzu, wenn der Typ nicht generisch sein soll. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Werteinschränkung. Dieser Member wurde per Rückschluss abgeleitet als generischer Typ\n {0} \nKonstruktoren und Eigenschaftengetter/-setter dürfen nicht generischer sein als der einschließende Typ. Fügen Sie eine Typanmerkung hinzu, um die genauen Typen anzugeben. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Werteinschränkung. Der Wert "{0}" wurde per Rückschluss abgeleitet als generischer Typ\n {1} \nLegen Sie die Argumente für "{2}" entweder als explizit fest, oder fügen Sie eine Typanmerkung hinzu, wenn der Typ nicht generisch sein soll. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Werteinschränkung. Der Wert "{0}" wurde per Rückschluss abgeleitet als generischer Typ\n {1} \nDefinieren Sie "{2}" entweder als einfachen Ausdruck oder als Funktion mit expliziten Argumenten, oder fügen Sie eine Typanmerkung hinzu, wenn der Typ nicht generisch sein soll. - - syntax error Syntaxfehler diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 9a94fe0bfca..5f5804aaff7 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -202,6 +202,16 @@ Los campos '{0}' y '{1}' son de tipos diferentes. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' está enlazado dos veces en este patrón @@ -1532,31 +1542,6 @@ Los campos siguientes requieren valores: {0}. - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restricción de valor. El valor '{0}' tiene el tipo genérico\n {1} \nConvierta los argumentos de '{2}' en explícitos o, si su intención no es que sea genérico, agregue una anotación de tipo. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restricción de valor. El valor '{0}' tiene el tipo genérico\n {1} \nConvierta '{2}' en una función con argumentos explícitos o, si su intención no es que sea genérico, agregue una anotación de tipo. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Restricción de valor. Se ha inferido que este miembro tiene el tipo genérico\n {0} \nLos constructores y los captadores y establecedores de propiedades no pueden ser más genéricos que el tipo envolvente. Agregue una anotación de tipo para indicar los tipos exactos implicados. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restricción de valor. Se ha inferido que el valor '{0}' tiene el tipo genérico\n {1} \nConvierta los argumentos de '{2}' en explícitos o, si su intención no es que sea genérico, agregue una anotación de tipo. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restricción de valor. Se ha inferido que el valor '{0}' tiene el tipo genérico\n {1} \nDefina '{2}' como un término de datos simple, conviértalo en una función con argumentos explícitos o, si su intención no es que sea genérico, agregue una anotación de tipo. - - syntax error error de sintaxis diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 0d5bfd687ae..2509dfb03e2 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -202,6 +202,16 @@ Les champs '{0}' et '{1}' sont de types différents + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' est lié à deux reprises dans ce modèle @@ -1532,31 +1542,6 @@ Les champs suivants requièrent des valeurs : {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restriction de valeur. La valeur '{0}' a le type générique\n {1} \nRendez les arguments de '{2}' explicites ou, si votre but n'est pas d'utiliser un type générique, ajoutez une annotation de type. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restriction de valeur. La valeur '{0}' a le type générique\n {1} \nChangez '{2}' en fonction avec des arguments explicites ou, si votre but n'est pas d'utiliser un type générique, ajoutez une annotation de type. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Restriction de valeur. Il a été déduit que ce membre avait un type générique\n {0} \nLes constructeurs, ainsi que les méthodes getter/setter d'une propriété ne peuvent pas être plus génériques que le type englobant. Ajoutez une annotation de type pour indiquer les types exacts impliqués. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restriction de valeur. Il a été déduit que la valeur '{0}' avait le type générique\n {1} \nRendez les arguments de '{2}' explicites ou, si votre but n'est pas d'utiliser un type générique, ajoutez une annotation de type. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restriction de valeur. Il a été déduit que la valeur '{0}' avait le type générique\n {1} \nDéfinissez '{2}' en tant que terme de données simple, faites-en une fonction avec des arguments explicites ou, si votre but n'est pas d'utiliser un type générique, ajoutez une annotation de type. - - syntax error erreur de syntaxe diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 465456a085d..f227ff2b6a6 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -202,6 +202,16 @@ I campi '{0}' e '{1}' sono di tipi diversi + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' è associato due volte in questo criterio @@ -1532,31 +1542,6 @@ Immissione valori obbligatoria per i campi seguenti: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Limitazione valore. Il valore '{0}' ha il tipo generico\n {1} \nRendere gli argomenti di '{2}' espliciti oppure, se non si intende renderlo generico, aggiungere un'annotazione di tipo. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Limitazione valore. Il valore '{0}' ha il tipo generico\n {1} \nRendere '{2}' una funzione con argomenti espliciti oppure, se non si intende renderlo generico, aggiungere un'annotazione di tipo. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Restrizione relativa ai valori. È stato dedotto che il membro ha il tipo generico\n {0} \nI getter/setter di proprietà e i costruttori non possono essere più generici del tipo di inclusione. Aggiungere un'annotazione di tipo per indicare i tipi esatti previsti. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Limitazione valore. È stato dedotto che il valore '{0}' ha il tipo generico\n {1} \nRendere gli argomenti di '{2}' espliciti, oppure se non si intende renderlo generico, aggiungere un'annotazione di tipo. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Limitazione valore. È stato dedotto che il valore '{0}' ha il tipo generico\n {1} \nDefinire '{2}' come termine di dati semplice, renderlo una funzione con argomenti espliciti oppure, se non si intende renderlo generico, aggiungere un'annotazione di tipo. - - syntax error errore di sintassi diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index c895e7a6a1e..6b5b477e176 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -202,6 +202,16 @@ フィールド '{0}' と '{1}' は異なる型です + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern このパターンで '{0}' が 2 回バインドされています @@ -1532,31 +1542,6 @@ 次のフィールドには値が必要です: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 値の制限。値 '{0}' は次のジェネリック型です。\n {1} \n明示的に引数を '{2}' にするか、ジェネリックにする意図がない場合は型の注釈を追加してください。 - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 値の制限。値 '{0}' は次のジェネリック型です。\n {1} \n明示的な引数を使用して '{2}' を関数にするか、ジェネリックにする意図がない場合は型の注釈を追加してください。 - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - 値の制限。このメンバーは次のジェネリック型を持つと推論されました。\n {0} \nコンストラクターとプロパティのゲッター/セッターは、それを囲む型よりも総称性を高くすることができません。関係する正確な型を示すために、型の注釈を追加してください。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 値の制限。値 '{0}' は次のジェネリック型を持つと推論されました。\n {1} \n明示的に引数を '{2}' にするか、ジェネリックにする意図がない場合は型の注釈を追加してください。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 値の制限。値 '{0}' は次のジェネリック型を持つと推論されました。\n {1} \n単純なデータ用語として '{2}' を定義するか、明示的な引数を使用して関数にするか、ジェネリックにする意図がない場合は型の注釈を追加してください。 - - syntax error 構文エラーです diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 82dbc42e072..61482db79c7 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -202,6 +202,16 @@ {0}' 필드와 '{1}' 필드의 소스 형식이 서로 다릅니다. + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}'은(는) 이 패턴에서 두 번 바인딩되었습니다. @@ -1532,31 +1542,6 @@ 다음 필드에는 값이 필요합니다. {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 값 제한이 있습니다. 값 '{0}'에 제네릭 형식\n {1}이(가) 있습니다. \n'{2}'에 대한 인수를 명시적으로 만들거나, 제네릭 요소로 만들지 않으려는 경우 형식 주석을 추가하세요. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 값 제한이 있습니다. 값 '{0}'에 제네릭 형식\n {1}이(가) 있습니다. \n'{2}'을(를) 명시적 인수가 포함된 함수로 만들거나, 제네릭 요소로 만들지 않으려는 경우 형식 주석을 추가하세요. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - 값 제한이 있습니다. 이 멤버는 제네릭 형식\n {0}을(를) 가지는 것으로 유추되었습니다. \n생성자 및 속성 getter/setter는 바깥쪽 형식보다 일반적일 수 없습니다. 형식 주석을 추가하여 관련 형식을 정확히 나타내세요. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 값 제한이 있습니다. 값 '{0}'은(는) 제네릭 형식\n {1}을(를) 가지는 것으로 유추되었습니다. \n'{2}'에 대한 인수를 명시적으로 만들거나, 제네릭 요소로 만들지 않으려는 경우 형식 주석을 추가하세요. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 값 제한이 있습니다. 값 '{0}'은(는) 제네릭 형식\n {1}을(를) 가지는 것으로 유추되었습니다. \n'{2}'을(를) 단순 데이터 용어로 정의하거나, 명시적 인수가 포함된 함수로 만들거나, 제네릭 요소로 만들지 않으려는 경우 형식 주석을 추가하세요. - - syntax error 구문 오류입니다. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index e2bc31e3fb9..a1c15d85f1b 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -202,6 +202,16 @@ Pola „{0}” i „{1}” są polami różnego typu + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern Zmienna „{0}” została powiązana dwa razy w tym wzorcu @@ -1532,31 +1542,6 @@ Następujące pola wymagają wartości: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Ograniczenie wartości. Wartość „{0}” jest wartością typu ogólnego\n {1} \nOkreśl argumenty elementu „{2}” jako jawne lub dodaj adnotację typu, jeśli nie chcesz, aby wartość była ogólna. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Ograniczenie wartości. Wartość „{0}” jest wartością typu ogólnego\n {1} \nUstaw element „{2}” jako funkcję z jawnymi argumentami lub dodaj adnotację typu, jeśli nie chcesz, aby wartość była ogólna. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Ograniczenie wartości. Wywnioskowano, że ten element członkowski jest elementem typu ogólnego\n {0} \nKonstruktory i metody pobierające/ustawiające właściwości nie mogą być bardziej ogólne niż typ otaczający. Dodaj adnotację typu, aby dokładnie wskazać uwzględnione typy. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Ograniczenie wartości. Wywnioskowano, że wartość „{0}” jest wartością typu ogólnego\n {1} \nOkreśl argumenty elementu „{2}” jako jawne lub dodaj adnotację typu, jeśli nie chcesz, aby wartość była ogólna. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Ograniczenie wartości. Wywnioskowano, że wartość „{0}” jest wartością typu ogólnego\n {1} \nZdefiniuj element „{2}” jako prosty termin danych, określ go jako funkcję z jawnymi argumentami lub dodaj adnotację typu, jeśli nie chcesz, aby wartość była ogólna. - - syntax error błąd składni diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index b4d1f7ba70d..a8394d317ab 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -202,6 +202,16 @@ Os campos '{0}' e '{1}' são de tipos diferentes + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' é associado duas vezes neste padrão @@ -1532,31 +1542,6 @@ Os campos a seguir requerem valores: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restrição de valor. O valor '{0}' tem um tipo genérico\n {1} \nTorne os argumentos '{2}' explícitos ou, se sua intenção não for deixá-los genéricos, adicione uma anotação de tipo. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restrição de valor. O valor '{0}' tem um tipo genérico\n {1} \nInsira '{2}' em uma função com argumentos explícitos ou, se você não desejar que ele seja genérico, adicione uma anotação de tipo. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Restrição de valor. Este membro foi inferido para ter um tipo genérico\n {0} \nConstrutores e getters/setters de propriedade não podem ser mais genéricos que o tipo de delimitador. Adicione uma anotação de tipo para indicar os tipos exatos envolvidos. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Restrição de valor. O valor '{0}' foi inferido para ter um tipo genérico\n {1} \nTorne os argumentos '{2}' explícitos ou, se sua intenção não for deixá-los genéricos, adicione uma anotação de tipo. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Restrição de valor. O valor '{0}' foi inferido para ter um tipo genérico\n {1} \nDefina '{2}' como um termo de dado simples e torne-o uma função com argumentos explícitos ou, se sua intenção for deixá-los genéricos, adicione uma anotação de tipo. - - syntax error erro de sintaxe diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 5149ef4d9f0..cb43c694637 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -202,6 +202,16 @@ Поля "{0}" и "{1}" принадлежат различным типам + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern {0} в данном шаблоне привязан дважды @@ -1532,31 +1542,6 @@ Для следующих полей требуются значения: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Ограничение значения. Значение "{0}" имеет универсальный тип\n {1} \nЛибо сделайте аргументы для "{2}" явными либо (если универсальный тип не требуется) добавьте аннотацию типа. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Ограничение значения. Значение "{0}" имеет универсальный тип\n {1} \nЛибо сделайте "{2}" функцией с явными аргументами, либо (если универсальный тип не требуется) добавьте аннотацию типа. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Ограничение значения. Данный выведенный элемент должен иметь универсальный тип\n {0} \nМетоды получения или задания свойств и конструкторов не могут быть более универсальными, чем вмещающий тип. Добавьте аннотацию типа, чтобы точно обозначить затрагиваемые типы. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Ограничение значения. Выведенное значение "{0}" должно иметь универсальный тип\n {1} \nЛибо сделайте аргументы для "{2}" явными, либо (если универсальный тип не требуется) добавьте аннотацию типа. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Ограничение значения. Выведенное значение "{0}" должно иметь универсальный тип\n {1} \nЛибо определите "{2}" как простой член данных, либо сделайте его функцией с явными аргументами, либо (если универсальный тип не требуется) добавьте аннотацию типа. - - syntax error синтаксическая ошибка diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index dde4f9ee022..eb58ed02f4a 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -202,6 +202,16 @@ {0}' ve '{1}' alanları farklı türlerde + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' bu desende iki kez bağlandı @@ -1532,31 +1542,6 @@ Aşağıdaki alanlar için değerler gerekiyor: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Değer kısıtlaması. '{0}' değerinin genel türü:\n {1} \nYa '{2}' bağımsız değişkenlerini açık yapın ya da genel olmasını istemiyorsanız bir tür ek açıklaması ekleyin. - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Değer kısıtlaması. '{0}' değerinin genel türü:\n {1} \nYa açık bağımsız değişkenlerle '{2}' için işlev dönüşümü yapın ya da genel olmasını istemiyorsanız bir tür ek açıklaması ekleyin. - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - Değer kısıtlaması. Bu üyenin şu genel türü olduğu çıkarıldı\n {0} \nOluşturucular ve özellik alıcıları/ayarlayıcıları kapsayan türden daha genel olamaz. Söz konusu türleri tam olarak belirtmek için bir tür ek açıklaması ekleyin. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - Değer kısıtlaması. '{0}' değerinin şu genel türü olduğu çıkarıldı:\n {1} \nYa '{2}' bağımsız değişkenlerini açık yapın ya da genel olmasını istemiyorsanız bir tür ek açıklaması ekleyin. - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - Değer kısıtlaması. '{0}' değerinin şu genel türü olduğu çıkarıldı:\n {1} \nYa '{2}' tanımını basit veri terimi olarak yaparak onu açık bağımsız değişkenlerle bir işlev yapın ya da genel olmasını istemiyorsanız bir tür ek açıklaması ekleyin. - - syntax error sözdizimi hatası diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 89e54bb26c5..dcaba934893 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -202,6 +202,16 @@ 字段“{0}”和“{1}”来自不同的类型 + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern “{0}”在此模式中绑定了两次 @@ -1532,31 +1542,6 @@ 以下字段需要值: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 值限制。值“{0}”具有泛型类型\n {1} \n使“{2}”的参数成为显式参数,或添加类型批注(如果您不希望它是泛型的)。 - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 值限制。值“{0}”具有泛型类型\n {1} \n使“{2}”成为具有显式参数的函数,或添加类型批注(如果您不希望它是泛型的)。 - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - 值限制。已推理出此成员具有泛型类型\n {0} \n构造函数和属性 Getter/Setter 不能比封闭类型更通用。 添加类型批注以指示涉及到的确切类型。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 值限制。已推理出值“{0}”具有泛型类型\n {1} \n使“{2}”的参数成为显式参数,或添加类型批注(如果您不希望它是泛型的)。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 值限制。已推理出值“{0}”具有泛型类型\n {1} \n将“{2}”定义为简单的数据条目,使其成为具有显式参数的函数,或添加类型批注(如果您不希望它是泛型的)。 - - syntax error 语法错误 diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 71c045b02fa..998c6380452 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -202,6 +202,16 @@ 欄位 '{0}' 和 '{1}' 來自不同類型 + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + + + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + + '{0}' is bound twice in this pattern '{0}' 在這個模式中繫結兩次 @@ -1532,31 +1542,6 @@ 下列欄位需要值: {0} - - Value restriction. The value '{0}' has generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 值限制。值 '{0}' 具有泛型類型\n {1} \n請將 '{2}' 的引數設為明確的,或者如果不想將它設為泛型,請加入類型註釋。 - - - - Value restriction. The value '{0}' has generic type\n {1} \nEither make '{2}' into a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 值限制。值 '{0}' 具有泛型類型\n {1} \n請將 '{2}' 設為具有明確引數的函式,或者如果不想將它設為泛型,請加入類型註釋。 - - - - Value restriction. This member has been inferred to have generic type\n {0} \nConstructors and property getters/setters cannot be more generic than the enclosing type. Add a type annotation to indicate the exact types involved. - 值限制。這個成員已被推斷為具有泛型類型\n {0} \n建構函式和屬性 getter/setter 不能比封入類型更為泛型。請加入類型註釋,以指示涉及的確切類型。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither make the arguments to '{2}' explicit or, if you do not intend for it to be generic, add a type annotation. - 值限制。值 '{0}' 已被推斷為具有泛型類型\n {1} \n請將 '{2}' 的引數設為明確的,或者如果不想將它設為泛型,請加入類型註釋。 - - - - Value restriction. The value '{0}' has been inferred to have generic type\n {1} \nEither define '{2}' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. - 值限制。值 '{0}' 已被推斷為具有泛型類型\n {1} \n請將 '{2}' 定義為簡單資料項、將它設為具有明確引數的函式,或者如果不想將它設為泛型,請加入類型註釋。 - - syntax error 語法錯誤 From b7d7f8c1ba3ae465d9f3499c0a02646b6a64240e Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 03:18:21 +0800 Subject: [PATCH 02/20] Update the error message --- src/Compiler/FSStrings.resx | 4 ++-- src/Compiler/xlf/FSStrings.cs.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.de.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.es.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.fr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.it.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ja.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ko.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pl.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pt-BR.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ru.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.tr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 8 ++++---- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 79e11695761..cd42591fb2a 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1030,10 +1030,10 @@ The following fields require values: {0} - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." syntax error diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index c8170ce1a85..be03c40c94b 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 740780a7f42..1ae552f68cb 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 5f5804aaff7..e9d43f2551f 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 2509dfb03e2..c4332cff210 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index f227ff2b6a6..2c0dc9090a7 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 6b5b477e176..457ebe5b353 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 61482db79c7..2d2c2257830 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index a1c15d85f1b..ac99d37784f 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index a8394d317ab..02cae79f135 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index cb43c694637..7a0ccf6a082 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index eb58ed02f4a..d7c30005169 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index dcaba934893..4e498453256 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 998c6380452..884f9f8d1b4 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -203,13 +203,13 @@ - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic type\n {1} \nYou can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: Values cannot have generic type parameters like '_a. However, the value '{0}' has an inferred generic function type\n {1} \nYou should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using partial application\n- Add a unit parameter\n- Write explicit type parameters,\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. From 6d1ad7de4444095dc10b26626978fe764ee1e1b0 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 16:09:34 +0800 Subject: [PATCH 03/20] Update message --- src/Compiler/FSStrings.resx | 4 ++-- src/Compiler/xlf/FSStrings.cs.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.de.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.es.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.fr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.it.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ja.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ko.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pl.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pt-BR.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ru.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.tr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 8 ++++---- .../Language/SequenceExpressionTests.fs | 3 ++- 15 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index cd42591fb2a..25045cd3cc4 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1030,10 +1030,10 @@ The following fields require values: {0} - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. syntax error diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index be03c40c94b..78436dde171 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 1ae552f68cb..5b9edc33c9b 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index e9d43f2551f..21c75e3c48b 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index c4332cff210..3d1aef22a29 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 2c0dc9090a7..1d0c9de3d4e 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 457ebe5b353..0ed6ea3e3f4 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 2d2c2257830..de1141a65cf 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index ac99d37784f..3a11de7325d 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 02cae79f135..bdab26c6288 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 7a0ccf6a082..fccd0207e27 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index d7c30005169..b4734b9be6e 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 4e498453256..30c21c1adfb 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 884f9f8d1b4..8b1027811e8 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -203,13 +203,13 @@ - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." - "Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results." + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in \"let x: '_a\". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like \"let x<'a>\",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs index 2f90f8963c6..982ae0c820b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressionTests.fs @@ -440,5 +440,6 @@ let typedSeq = |> typecheck |> shouldFail |> withErrorCode 30 - |> withDiagnosticMessageMatches "Value restriction. The value 'typedSeq' has been inferred to have generic type" + |> withDiagnosticMessageMatches "Value restriction: The value 'typedSeq' has an inferred generic type" + |> withDiagnosticMessageMatches "val typedSeq: '_a seq" \ No newline at end of file From 9897879f3531ab11967287c700a48173e31e1f1f Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 17:34:02 +0800 Subject: [PATCH 04/20] Update tests --- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- tests/fsharp/typecheck/sigs/neg119b.bsl | 13 ++++++++++--- .../ExpressionQuotations/Baselines/E_Cast.fs | 3 +-- .../ConstraintSolving/E_ValueRestriction01.fs | 7 +------ .../E_GenInterfaceWGenMethods01.fs | 2 +- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../W_NonGenVarInValueRestrictionWarning.fs | 4 ++-- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 182fb04be48..836ff316350 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction\. The value 'x1' has been inferred to have generic type. val x1: \('_a -> unit\) .Either make the arguments to 'x1' explicit or, if you do not intend for it to be generic, add a type annotation\.$ +//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharp/typecheck/sigs/neg119b.bsl b/tests/fsharp/typecheck/sigs/neg119b.bsl index e5edc502670..8b9529cb307 100644 --- a/tests/fsharp/typecheck/sigs/neg119b.bsl +++ b/tests/fsharp/typecheck/sigs/neg119b.bsl @@ -1,4 +1,11 @@ -neg119b.fs(40,9,40,17): typecheck error FS0030: Value restriction. The value 'res2n3n4' has been inferred to have generic type - val res2n3n4: ^_a when (^_b or Applicatives.ZipList or ^_a) : (static member (<*>) : ^_b * Applicatives.ZipList -> ^_a) and (^_c or obj or ^_b) : (static member (<*>) : ^_c * obj -> ^_b) and (Applicatives.Ap or ^_c) : (static member Return: ^_c * Applicatives.Ap -> ((int -> int -> int) -> ^_c)) -Either define 'res2n3n4' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. +neg119b.fs(40,9,40,17): typecheck error FS0030: Value restriction: The value 'res2n3n4' has an inferred generic type + val res2n3n4: ^_a when (^_b or Applicatives.ZipList or ^_a) : (static member (<*>) : ^_b * Applicatives.ZipList -> ^_a) and (^_c or obj or ^_b) : (static member (<*>) : ^_c * obj -> ^_b) and (Applicatives.Ap or ^_c) : (static member Return: ^_c * Applicatives.Ap -> ((int -> int -> int) -> ^_c)) +However, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following: +- Define it as a simple data term (e.g. a string literal or a union case) +- Add an explicit type annotation +- Use the value as a non-generic type in later code for type inference, +or if you still want type-dependent results, you can define 'res2n3n4' as a function instead by doing either: +- Add a unit parameter +- Write explicit type parameters like "let x<'a>". +This error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index fdfeed0171e..7cd7e7d6de6 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,8 +1,7 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction\. The value 'tq' has been inferred to have generic type. val tq: Expr<'_a> .Either define 'tq' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation\.$ +//Value restriction: The value 'tq' has an inferred generic type\n val tq: Expr<'_a>\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'tq' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // - open Microsoft.FSharp.Quotations let uq = <@@ let x = 1 in x @@> diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index d66cc047dc4..f705cf17671 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,12 +3,7 @@ // Verify error associated with open type variable -(* -error FS0030: Value restriction. The value 'x' has been inferred to have generic type - val x : '_a list ref -Either define 'x' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type constraint. -*) -//Value restriction. The value +//Value restriction: The value 'x' has an inferred generic type\n val x : '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs index 5d87e71957e..094d8585ef1 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypeInference // FSHARP1.0:1445. See also FSHARP1.0:4721 // Failure when generating code for generic interface with generic method -//Value restriction\. The value 'result' has been inferred to have generic type. val result: '_a array when '_a: equality and '_a: null .Either define 'result' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation\.$ +//Value restriction: The value 'result' has an inferred generic type\n val result: '_a array when '_a: equality and '_a: null\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'result' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ type 'a IFoo = interface abstract DoStuff<'b> : 'a -> 'b array end diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 182fb04be48..836ff316350 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction\. The value 'x1' has been inferred to have generic type. val x1: \('_a -> unit\) .Either make the arguments to 'x1' explicit or, if you do not intend for it to be generic, add a type annotation\.$ +//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs index 12ca2be2ce8..c2120dfd773 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:4969 // Non-generalized unit-of-measure variables should display with "_" in value restriction warning -//.+val x: float<'_u> list ref -//.+val y: '_a list ref +//Value restriction: The value 'x' has an inferred generic type\n val x: float<'_u> list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'y' has an inferred generic type\n val y: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'y' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref ([] : float<_> list) let y = ref ([] : _ list) From dbec2ddbb0d2bf3a6251aaa509476ec54c7eb86e Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 18:35:16 +0800 Subject: [PATCH 05/20] Update error message --- src/Compiler/FSStrings.resx | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 4 ++-- src/Compiler/xlf/FSStrings.de.xlf | 4 ++-- src/Compiler/xlf/FSStrings.es.xlf | 4 ++-- src/Compiler/xlf/FSStrings.fr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.it.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ja.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ko.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pl.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ru.xlf | 4 ++-- src/Compiler/xlf/FSStrings.tr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 4 ++-- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- tests/fsharp/typecheck/sigs/neg119b.bsl | 2 +- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 2 +- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- .../DispatchSlotInference/E_GenInterfaceWGenMethods01.fs | 2 +- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Diagnostics/W_NonGenVarInValueRestrictionWarning.fs | 4 ++-- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 25045cd3cc4..c77b19b93e5 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1033,7 +1033,7 @@ Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. syntax error diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 78436dde171..6437a09039a 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 5b9edc33c9b..0764686e5e3 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 21c75e3c48b..e309a0daab8 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 3d1aef22a29..f85dec66483 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 1d0c9de3d4e..fee81b4a756 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 0ed6ea3e3f4..ccc5b1185c8 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index de1141a65cf..317c4da33fa 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 3a11de7325d..7c910af8749 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index bdab26c6288..d096d4b92ed 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index fccd0207e27..91e2c1f570f 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index b4734b9be6e..26c6570b3e1 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 30c21c1adfb..2860ade2151 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 8b1027811e8..ad4ef161dc6 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -203,8 +203,8 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term (e.g. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 836ff316350..e5a45080984 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharp/typecheck/sigs/neg119b.bsl b/tests/fsharp/typecheck/sigs/neg119b.bsl index 8b9529cb307..6e76a9a85e4 100644 --- a/tests/fsharp/typecheck/sigs/neg119b.bsl +++ b/tests/fsharp/typecheck/sigs/neg119b.bsl @@ -2,7 +2,7 @@ neg119b.fs(40,9,40,17): typecheck error FS0030: Value restriction: The value 'res2n3n4' has an inferred generic type val res2n3n4: ^_a when (^_b or Applicatives.ZipList or ^_a) : (static member (<*>) : ^_b * Applicatives.ZipList -> ^_a) and (^_c or obj or ^_b) : (static member (<*>) : ^_c * obj -> ^_b) and (Applicatives.Ap or ^_c) : (static member Return: ^_c * Applicatives.Ap -> ((int -> int -> int) -> ^_c)) However, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following: -- Define it as a simple data term (e.g. a string literal or a union case) +- Define it as a simple data term like a string literal or a union case - Add an explicit type annotation - Use the value as a non-generic type in later code for type inference, or if you still want type-dependent results, you can define 'res2n3n4' as a function instead by doing either: diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 7cd7e7d6de6..56f5dca05d4 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type\n val tq: Expr<'_a>\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'tq' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'tq' has an inferred generic type\n val tq: Expr<'_a>\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'tq' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index f705cf17671..2df1c863196 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\n val x : '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type\n val x : '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs index 094d8585ef1..332f43a0e1a 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypeInference // FSHARP1.0:1445. See also FSHARP1.0:4721 // Failure when generating code for generic interface with generic method -//Value restriction: The value 'result' has an inferred generic type\n val result: '_a array when '_a: equality and '_a: null\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'result' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'result' has an inferred generic type\n val result: '_a array when '_a: equality and '_a: null\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'result' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ type 'a IFoo = interface abstract DoStuff<'b> : 'a -> 'b array end diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 836ff316350..e5a45080984 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs index c2120dfd773..df63039a3f4 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:4969 // Non-generalized unit-of-measure variables should display with "_" in value restriction warning -//Value restriction: The value 'x' has an inferred generic type\n val x: float<'_u> list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ -//Value restriction: The value 'y' has an inferred generic type\n val y: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term (e\.g\. a string literal or a union case)\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'y' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type\n val x: float<'_u> list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'y' has an inferred generic type\n val y: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'y' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref ([] : float<_> list) let y = ref ([] : _ list) From 1aef604a90d54f4fc5afdf3b8fafc69b765f3840 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Mon, 28 Aug 2023 18:40:19 +0800 Subject: [PATCH 06/20] Update messages --- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index e5a45080984..671d05f3b8b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index e5a45080984..671d05f3b8b 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x1' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) From 6a293e71c3fa64b464ab2cd299efff910f2d9302 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Tue, 29 Aug 2023 21:48:17 +0800 Subject: [PATCH 07/20] Add line back --- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 56f5dca05d4..4c43218fcb5 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -2,6 +2,7 @@ // Verify type annotation is required for casting quotes //Value restriction: The value 'tq' has an inferred generic type\n val tq: Expr<'_a>\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'tq' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // + open Microsoft.FSharp.Quotations let uq = <@@ let x = 1 in x @@> From 0470610b1ddbd217b6e5d86690fbd98fdff9cae7 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 03:13:37 +0800 Subject: [PATCH 08/20] Update error messages --- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 2 +- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- .../DispatchSlotInference/E_GenInterfaceWGenMethods01.fs | 2 +- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Diagnostics/W_NonGenVarInValueRestrictionWarning.fs | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 671d05f3b8b..83e73bfcba9 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 4c43218fcb5..fbaf7d4f505 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type\n val tq: Expr<'_a>\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'tq' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 2df1c863196..51e1d7f0730 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\n val x : '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type val x: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs index 332f43a0e1a..c16f4d75bd0 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypeInference // FSHARP1.0:1445. See also FSHARP1.0:4721 // Failure when generating code for generic interface with generic method -//Value restriction: The value 'result' has an inferred generic type\n val result: '_a array when '_a: equality and '_a: null\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'result' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'result' has an inferred generic type val result: '_a array when '_a: equality and '_a: nullHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'result' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ type 'a IFoo = interface abstract DoStuff<'b> : 'a -> 'b array end diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 671d05f3b8b..83e73bfcba9 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type\n val x1: \('_a -> unit\)\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs index df63039a3f4..c90fe2630bd 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:4969 // Non-generalized unit-of-measure variables should display with "_" in value restriction warning -//Value restriction: The value 'x' has an inferred generic type\n val x: float<'_u> list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ -//Value restriction: The value 'y' has an inferred generic type\n val y: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'y' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type val x: float<'_u> list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'y' has an inferred generic type val y: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'y' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref ([] : float<_> list) let y = ref ([] : _ list) From 7761d3d5d502a620297705488c5fc19202e28920 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 03:14:51 +0800 Subject: [PATCH 09/20] Update E_ValueRestriction01.fs --- .../ConstraintSolving/E_ValueRestriction01.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 51e1d7f0730..35ec9ce94ef 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,8 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type val x: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ - +//Value restriction: The value 'x' has an inferred generic type\n val x: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 From 80e559602693b7ce9f0e55a0654bb7bfa549d94c Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 16:42:53 +0800 Subject: [PATCH 10/20] Update messages --- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 2 +- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- .../DispatchSlotInference/E_GenInterfaceWGenMethods01.fs | 2 +- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Diagnostics/W_NonGenVarInValueRestrictionWarning.fs | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 83e73bfcba9..314ed4e83ad 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index fbaf7d4f505..85dc5d94e47 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 35ec9ce94ef..7aeab70e43b 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\n val x: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type\r\n val x: '_a list ref\r\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\r\n- Define it as a simple data term like a string literal or a union case\r\n- Add an explicit type annotation\r\n- Use the value as a non-generic type in later code for type inference,\r\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\r\n- Add a unit parameter\r\n- Write explicit type parameters like "let x<'a>"\.\r\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs index c16f4d75bd0..46fc3d1a43f 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypeInference // FSHARP1.0:1445. See also FSHARP1.0:4721 // Failure when generating code for generic interface with generic method -//Value restriction: The value 'result' has an inferred generic type val result: '_a array when '_a: equality and '_a: nullHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'result' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'result' has an inferred generic type val result: '_a array when '_a: equality and '_a: nullHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'result' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ type 'a IFoo = interface abstract DoStuff<'b> : 'a -> 'b array end diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 83e73bfcba9..314ed4e83ad 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs index c90fe2630bd..7df83554b72 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:4969 // Non-generalized unit-of-measure variables should display with "_" in value restriction warning -//Value restriction: The value 'x' has an inferred generic type val x: float<'_u> list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ -//Value restriction: The value 'y' has an inferred generic type val y: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'y' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type val x: float<'_u> list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\. +//Value restriction: The value 'y' has an inferred generic type val y: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'y' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref ([] : float<_> list) let y = ref ([] : _ list) From 4129be32d963bfd2d76418446e330ea4a0697a8c Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 17:46:16 +0800 Subject: [PATCH 11/20] Update messages --- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 3 +-- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 85dc5d94e47..5ce14214104 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,7 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ -// +//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 7aeab70e43b..ecd68ea8eff 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\r\n val x: '_a list ref\r\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\r\n- Define it as a simple data term like a string literal or a union case\r\n- Add an explicit type annotation\r\n- Use the value as a non-generic type in later code for type inference,\r\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\r\n- Add a unit parameter\r\n- Write explicit type parameters like "let x<'a>"\.\r\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type\n val x: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 From e3ad7f8e0f7c096051311fee384c894126b92997 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 18:36:24 +0800 Subject: [PATCH 12/20] Update messages --- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 2 +- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 5ce14214104..9b2aa97cf88 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index ecd68ea8eff..7aeab70e43b 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\n val x: '_a list ref\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>"\.\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type\r\n val x: '_a list ref\r\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\r\n- Define it as a simple data term like a string literal or a union case\r\n- Add an explicit type annotation\r\n- Use the value as a non-generic type in later code for type inference,\r\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\r\n- Add a unit parameter\r\n- Write explicit type parameters like "let x<'a>"\.\r\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 From 3094dee39d116d634b628cf7c7292f7da4cde1e9 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 20:05:19 +0800 Subject: [PATCH 13/20] Does this work? --- .../ConstraintSolving/E_ValueRestriction01.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 7aeab70e43b..2f18b9c9c05 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,7 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type\r\n val x: '_a list ref\r\nHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:\r\n- Define it as a simple data term like a string literal or a union case\r\n- Add an explicit type annotation\r\n- Use the value as a non-generic type in later code for type inference,\r\nor if you still want type-dependent results, you can define 'x' as a function instead by doing either:\r\n- Add a unit parameter\r\n- Write explicit type parameters like "let x<'a>"\.\r\nThis error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type val x: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 From 15ac5c115bde6317de749bf2740e64da3ff8efb0 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 22:26:02 +0800 Subject: [PATCH 14/20] hmm --- .../ConstraintSolving/E_ValueRestriction01.fs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index 2f18b9c9c05..c6adf70d032 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -3,7 +3,16 @@ // Verify error associated with open type variable -//Value restriction: The value 'x' has an inferred generic type val x: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type +// val x: '_a list ref +//However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following: +//- Define it as a simple data term like a string literal or a union case +//- Add an explicit type annotation +//- Use the value as a non-generic type in later code for type inference, +//or if you still want type-dependent results, you can define 'x' as a function instead by doing either: +//- Add a unit parameter +//- Write explicit type parameters like "let x<'a>"\. +//This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] exit 1 From 2b73c935edbd597e91395c58767cb8d698391e6b Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Wed, 30 Aug 2023 23:59:24 +0800 Subject: [PATCH 15/20] Update function message --- src/Compiler/FSStrings.resx | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 2 +- src/Compiler/xlf/FSStrings.de.xlf | 2 +- src/Compiler/xlf/FSStrings.es.xlf | 2 +- src/Compiler/xlf/FSStrings.fr.xlf | 2 +- src/Compiler/xlf/FSStrings.it.xlf | 2 +- src/Compiler/xlf/FSStrings.ja.xlf | 2 +- src/Compiler/xlf/FSStrings.ko.xlf | 2 +- src/Compiler/xlf/FSStrings.pl.xlf | 2 +- src/Compiler/xlf/FSStrings.pt-BR.xlf | 2 +- src/Compiler/xlf/FSStrings.ru.xlf | 2 +- src/Compiler/xlf/FSStrings.tr.xlf | 2 +- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 2 +- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index c77b19b93e5..63b7a529765 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1030,7 +1030,7 @@ The following fields require values: {0} - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 6437a09039a..ac9966245b4 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 0764686e5e3..2e3d1a60082 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index e309a0daab8..12e51400f7b 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index f85dec66483..7257af73d8c 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index fee81b4a756..14d6c9c7f94 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index ccc5b1185c8..3a04b819b14 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 317c4da33fa..c65f6829668 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 7c910af8749..ebcf6b1e503 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index d096d4b92ed..dcef900b92d 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 91e2c1f570f..e44edab4286 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 26c6570b3e1..5251aea01f9 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 2860ade2151..ee608590938 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index ad4ef161dc6..97da3d60e9d 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -208,7 +208,7 @@ - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 314ed4e83ad..6632fc259aa 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f()"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f()"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 314ed4e83ad..6632fc259aa 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let x: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application- Add a unit parameter- Write explicit type parameters like "let x<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation- Apply arguments of non-generic types to the function value in later code for type inference\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f()"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f()"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) From 1de9d862ed55c1cd6691bef58c225c146b3221c4 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Thu, 31 Aug 2023 00:43:33 +0800 Subject: [PATCH 16/20] Escape () --- .../ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 6632fc259aa..1680d8fcf4b 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f()"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f()"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f\(\)"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f\(\)"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) @@ -8,4 +8,4 @@ // variable could have feasibly be genrealized at 'x1' (c.f. the case above, where it // was generalized). let f1 (x:obj) = () -let x1 = ((); f1) \ No newline at end of file +let x1 = ((); f1) From 22406f5aee9c9599b8be08ade84b37425789f811 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Fri, 1 Sep 2023 16:31:46 +0800 Subject: [PATCH 17/20] Update tests --- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- tests/fsharp/typecheck/sigs/neg119b.bsl | 8 ++++---- .../Expressions/ExpressionQuotations/Baselines/E_Cast.fs | 2 +- .../ConstraintSolving/E_ValueRestriction01.fs | 8 ++++---- .../DispatchSlotInference/E_GenInterfaceWGenMethods01.fs | 2 +- .../ValueRestriction/E_NotMemberOrFunction01.fsx | 2 +- .../Diagnostics/W_NonGenVarInValueRestrictionWarning.fs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx index 6632fc259aa..5cb7755a083 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f()"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f()"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f\(\)"- Write explicit type parameters like "let f<'a>"or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f\(\)"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharp/typecheck/sigs/neg119b.bsl b/tests/fsharp/typecheck/sigs/neg119b.bsl index 6e76a9a85e4..7a445f3ea7f 100644 --- a/tests/fsharp/typecheck/sigs/neg119b.bsl +++ b/tests/fsharp/typecheck/sigs/neg119b.bsl @@ -2,10 +2,10 @@ neg119b.fs(40,9,40,17): typecheck error FS0030: Value restriction: The value 'res2n3n4' has an inferred generic type val res2n3n4: ^_a when (^_b or Applicatives.ZipList or ^_a) : (static member (<*>) : ^_b * Applicatives.ZipList -> ^_a) and (^_c or obj or ^_b) : (static member (<*>) : ^_c * obj -> ^_b) and (Applicatives.Ap or ^_c) : (static member Return: ^_c * Applicatives.Ap -> ((int -> int -> int) -> ^_c)) However, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following: -- Define it as a simple data term like a string literal or a union case -- Add an explicit type annotation -- Use the value as a non-generic type in later code for type inference, +- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1" +- Add an explicit type annotation like "let x : int" +- Use the value as a non-generic type in later code for type inference like "do x" or if you still want type-dependent results, you can define 'res2n3n4' as a function instead by doing either: -- Add a unit parameter +- Add a unit parameter like "let x()" - Write explicit type parameters like "let x<'a>". This error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs index 9b2aa97cf88..bd3772bf30c 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ExpressionQuotations/Baselines/E_Cast.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #Quotations // Verify type annotation is required for casting quotes -//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'tq' has an inferred generic type val tq: Expr<'_a>However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"- Add an explicit type annotation like "let x : int"- Use the value as a non-generic type in later code for type inference like "do x"or if you still want type-dependent results, you can define 'tq' as a function instead by doing either:- Add a unit parameter like "let x\(\)"- Write explicit type parameters like "let x<'a>".This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ open Microsoft.FSharp.Quotations diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs index c6adf70d032..cf485b37d8c 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ConstraintSolving/E_ValueRestriction01.fs @@ -6,11 +6,11 @@ //Value restriction: The value 'x' has an inferred generic type // val x: '_a list ref //However, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following: -//- Define it as a simple data term like a string literal or a union case -//- Add an explicit type annotation -//- Use the value as a non-generic type in later code for type inference, +//- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1" +//- Add an explicit type annotation like "let x : int" +//- Use the value as a non-generic type in later code for type inference like "do x" //or if you still want type-dependent results, you can define 'x' as a function instead by doing either: -//- Add a unit parameter +//- Add a unit parameter like "let x()" //- Write explicit type parameters like "let x<'a>"\. //This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref [] diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs index 46fc3d1a43f..8a65831546e 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/DispatchSlotInference/E_GenInterfaceWGenMethods01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypeInference // FSHARP1.0:1445. See also FSHARP1.0:4721 // Failure when generating code for generic interface with generic method -//Value restriction: The value 'result' has an inferred generic type val result: '_a array when '_a: equality and '_a: nullHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'result' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'result' has an inferred generic type val result: '_a array when '_a: equality and '_a: nullHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"- Add an explicit type annotation like "let x : int"- Use the value as a non-generic type in later code for type inference like "do x"or if you still want type-dependent results, you can define 'result' as a function instead by doing either:- Add a unit parameter like "let x\(\)"- Write explicit type parameters like "let x<'a>".This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ type 'a IFoo = interface abstract DoStuff<'b> : 'a -> 'b array end diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx index 1680d8fcf4b..a33da54e3f9 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/ValueRestriction/E_NotMemberOrFunction01.fsx @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #TypeInference #ValueRestriction -//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f\(\)"- Write explicit type parameters like "let f<'a>",or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f\(\)"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x1' has an inferred generic function type val x1: \('_a -> unit\)However, values cannot have generic type variables like '_a in "let f: '_a". You should define 'x1' as a function instead by doing one of the following:- Add an explicit parameter that is applied instead of using a partial application "let f param"- Add a unit parameter like "let f\(\)"- Write explicit type parameters like "let f<'a>"or if you do not intend for it to be generic, either:- Add an explicit type annotation like "let f : obj -> obj"- Apply arguments of non-generic types to the function value in later code for type inference like "do f\(\)"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ // We expect a value restriction here. The inferred signature is: // val x1: (?1 -> unit) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs index 7df83554b72..6552aa57379 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:4969 // Non-generalized unit-of-measure variables should display with "_" in value restriction warning -//Value restriction: The value 'x' has an inferred generic type val x: float<'_u> list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\. -//Value restriction: The value 'y' has an inferred generic type val y: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like a string literal or a union case- Add an explicit type annotation- Use the value as a non-generic type in later code for type inference,or if you still want type-dependent results, you can define 'y' as a function instead by doing either:- Add a unit parameter- Write explicit type parameters like "let x<'a>"\.This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ +//Value restriction: The value 'x' has an inferred generic type val x: float<'_u> list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"- Add an explicit type annotation like "let x : int"- Use the value as a non-generic type in later code for type inference like "do x"or if you still want type-dependent results, you can define 'x' as a function instead by doing either:- Add a unit parameter like "let x\(\)"- Write explicit type parameters like "let x<'a>".This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\. +//Value restriction: The value 'y' has an inferred generic type val y: '_a list refHowever, values cannot have generic type variables like '_a in "let x: '_a"\. You can do one of the following:- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"- Add an explicit type annotation like "let x : int"- Use the value as a non-generic type in later code for type inference like "do x"or if you still want type-dependent results, you can define 'y' as a function instead by doing either:- Add a unit parameter like "let x\(\)"- Write explicit type parameters like "let x<'a>".This error is because a let binding without parameters defines a value, not a function\. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results\.$ let x = ref ([] : float<_> list) let y = ref ([] : _ list) From ad3d2b15e1efb22cdd94ba2e07fafabaa075a31c Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Fri, 1 Sep 2023 17:41:45 +0800 Subject: [PATCH 18/20] Update messages --- src/Compiler/FSStrings.resx | 4 ++-- src/Compiler/xlf/FSStrings.cs.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.de.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.es.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.fr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.it.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ja.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ko.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pl.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.pt-BR.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.ru.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.tr.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 8 ++++---- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 8 ++++---- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 63b7a529765..e24b4737742 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1030,10 +1030,10 @@ The following fields require values: {0} - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. syntax error diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index ac9966245b4..c2142422521 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 2e3d1a60082..9e138b1f06a 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 12e51400f7b..21ce23e4a4c 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7257af73d8c..b60d006b516 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 14d6c9c7f94..11a10d7e283 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 3a04b819b14..8bd7b3bf676 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index c65f6829668..809f65182e8 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index ebcf6b1e503..7f0fd4fe660 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index dcef900b92d..68884d303f8 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index e44edab4286..e4183664a10 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 5251aea01f9..fd472f37780 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index ee608590938..fa324741415 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 97da3d60e9d..db72d0a3ee7 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -203,13 +203,13 @@ - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like a string literal or a union case\n- Add an explicit type annotation\n- Use the value as a non-generic type in later code for type inference,\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following:\n- Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1"\n- Add an explicit type annotation like "let x : int"\n- Use the value as a non-generic type in later code for type inference like "do x"\nor if you still want type-dependent results, you can define '{2}' as a function instead by doing either:\n- Add a unit parameter like "let x()"\n- Write explicit type parameters like "let x<'a>".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. - Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let x: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application\n- Add a unit parameter\n- Write explicit type parameters like "let x<'a>",\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation\n- Apply arguments of non-generic types to the function value in later code for type inference.\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. + Value restriction: The value '{0}' has an inferred generic function type\n {1}\nHowever, values cannot have generic type variables like '_a in "let f: '_a". You should define '{2}' as a function instead by doing one of the following:\n- Add an explicit parameter that is applied instead of using a partial application "let f param"\n- Add a unit parameter like "let f()"\n- Write explicit type parameters like "let f<'a>"\nor if you do not intend for it to be generic, either:\n- Add an explicit type annotation like "let f : obj -> obj"\n- Apply arguments of non-generic types to the function value in later code for type inference like "do f()".\nThis error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results. From ff83b24939ebce14de958f92617a0f884bb3722c Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 15 Dec 2023 14:47:38 +0100 Subject: [PATCH 19/20] Update CompilerDiagnostics.fs --- src/Compiler/Driver/CompilerDiagnostics.fs | 90 +++++++++------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 71d24223e14..79308a1bf18 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -145,7 +145,7 @@ type Exception with | IntfImplInIntrinsicAugmentation m | OverrideInExtrinsicAugmentation m | IntfImplInExtrinsicAugmentation m - | ValueRestriction(_, _, _, _, _, m) + | ValueRestriction(_, _, _, _, m) | LetRecUnsound(_, _, m) | ObsoleteError(_, m) | ObsoleteWarning(_, m) @@ -579,11 +579,8 @@ module OldStyleMessages = let DeprecatedE () = Message("Deprecated", "%s") let LibraryUseOnlyE () = Message("LibraryUseOnly", "") let MissingFieldsE () = Message("MissingFields", "%s") - let ValueRestriction1E () = Message("ValueRestriction1", "%s%s%s") - let ValueRestriction2E () = Message("ValueRestriction2", "%s%s%s") - let ValueRestriction3E () = Message("ValueRestriction3", "%s") - let ValueRestriction4E () = Message("ValueRestriction4", "%s%s%s") - let ValueRestriction5E () = Message("ValueRestriction5", "%s%s%s") + let ValueRestrictionFunctionE () = Message("ValueRestrictionFunction", "%s%s%s") + let ValueRestrictionE () = Message("ValueRestriction", "%s%s%s") let RecoverableParseErrorE () = Message("RecoverableParseError", "") let ReservedKeywordE () = Message("ReservedKeyword", "%s") let IndentationProblemE () = Message("IndentationProblem", "%s") @@ -1760,7 +1757,7 @@ type Exception with | MissingFields(sl, _) -> os.AppendString(MissingFieldsE().Format(String.concat "," sl + ".")) - | ValueRestriction(denv, infoReader, hasSig, v, _, _) -> + | ValueRestriction(denv, infoReader, v, _, _) -> let denv = { denv with showInferenceTyparAnnotations = true @@ -1768,55 +1765,44 @@ type Exception with let tau = v.TauType - if hasSig then - if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then - let msg = - ValueRestriction1E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) - v.DisplayName + match v.MemberInfo with + | Some membInfo -> + // We should not reach here since obj would be inferred instead of retaining a generic type variable + (* + let a = [] @ [] // ERROR: Value restriction + module b = + let c = [] @ [] // ERROR: Value restriction + type d() = + let e = [] @ [] // inferred as 'obj list' + new(_) = + let f = [] @ [] // inferred as 'obj list' + d() + member _.g = [] @ [] // inferred as 'obj list' + member _.h with set () = + let i = [] @ [] // inferred as 'obj list' + () + *) + assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.PropertyGet) + assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.PropertySet) + assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.Constructor) + | _ -> () - os.AppendString msg - else - let msg = - ValueRestriction2E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) - v.DisplayName + if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then + let msg = + ValueRestrictionFunctionE().Format + v.DisplayName + (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) + v.DisplayName - os.AppendString msg + os.AppendString msg else - match v.MemberInfo with - | Some membInfo when - (match membInfo.MemberFlags.MemberKind with - | SynMemberKind.PropertyGet - | SynMemberKind.PropertySet - | SynMemberKind.Constructor -> true // can't infer extra polymorphism - // can infer extra polymorphism - | _ -> false) - -> - let msg = - ValueRestriction3E() - .Format(NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) - - os.AppendString msg - | _ -> - if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then - let msg = - ValueRestriction4E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) - v.DisplayName - - os.AppendString msg - else - let msg = - ValueRestriction5E().Format - v.DisplayName - (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) - v.DisplayName + let msg = + ValueRestrictionE().Format + v.DisplayName + (NicePrint.stringOfQualifiedValOrMember denv infoReader (mkLocalValRef v)) + v.DisplayName - os.AppendString msg + os.AppendString msg | Parsing.RecoverableParseError -> os.AppendString(RecoverableParseErrorE().Format) From d6b10f3e6fe2aec04683592e278b942ef1e5968c Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 15 Dec 2023 14:49:04 +0100 Subject: [PATCH 20/20] Update CompilerDiagnostics.fs --- src/Compiler/Driver/CompilerDiagnostics.fs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 79308a1bf18..3327aa0a635 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1765,28 +1765,6 @@ type Exception with let tau = v.TauType - match v.MemberInfo with - | Some membInfo -> - // We should not reach here since obj would be inferred instead of retaining a generic type variable - (* - let a = [] @ [] // ERROR: Value restriction - module b = - let c = [] @ [] // ERROR: Value restriction - type d() = - let e = [] @ [] // inferred as 'obj list' - new(_) = - let f = [] @ [] // inferred as 'obj list' - d() - member _.g = [] @ [] // inferred as 'obj list' - member _.h with set () = - let i = [] @ [] // inferred as 'obj list' - () - *) - assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.PropertyGet) - assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.PropertySet) - assert (membInfo.MemberFlags.MemberKind <> SynMemberKind.Constructor) - | _ -> () - if isFunTy denv.g tau && (arityOfVal v).HasNoArgs then let msg = ValueRestrictionFunctionE().Format