diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 1fa6ba59402..cb7782e5d87 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1553,7 +1553,6 @@ formatDashItem," - %s" featureFromEndSlicing,"from-end slicing" featureNullnessChecking,"nullness checking" featureRuntimeAsync,"runtime async" -featureWitnessPassing,"witness passing for trait constraints in F# quotations" featureCSharpExtensionAttributeNotRequired,"Allow implicit Extension attribute on declaring types, modules" featurePreferExtensionMethodOverPlainProperty,"prefer extension method over plain property" featureWarningIndexedPropertiesGetSetSameType,"Indexed properties getter and setter must have the same type" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 0a34624112e..f894b6a69c1 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -18,7 +18,6 @@ module internal FSharp.Compiler.Features type LanguageFeature = | FromEndSlicing | RuntimeAsync - | WitnessPassing | NullnessChecking | UnionIsPropertiesVisible | CSharpExtensionAttributeNotRequired @@ -107,9 +106,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) static let features = dict [ - // F# 5.0 - LanguageFeature.WitnessPassing, languageVersion50 - // F# 8.0 LanguageFeature.CSharpExtensionAttributeNotRequired, languageVersion80 @@ -265,7 +261,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.FromEndSlicing -> FSComp.SR.featureFromEndSlicing () | LanguageFeature.NullnessChecking -> FSComp.SR.featureNullnessChecking () | LanguageFeature.RuntimeAsync -> FSComp.SR.featureRuntimeAsync () - | LanguageFeature.WitnessPassing -> FSComp.SR.featureWitnessPassing () | LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible () | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () | LanguageFeature.UnmanagedConstraintCsharpInterop -> FSComp.SR.featureUnmanagedConstraintCsharpInterop () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 4afa992cde5..9751bf04263 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -8,7 +8,6 @@ module internal FSharp.Compiler.Features type LanguageFeature = | FromEndSlicing | RuntimeAsync - | WitnessPassing | NullnessChecking | UnionIsPropertiesVisible | CSharpExtensionAttributeNotRequired diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 10436b7eed1..443980eae49 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -508,7 +508,7 @@ module FSharpExprConvert = and GetWitnessArgs cenv (env: ExprTranslationEnv) (vref: ValRef) m tps tyargs : FSharpExpr list = let g = cenv.g - if g.langVersion.SupportsFeature(Features.LanguageFeature.WitnessPassing) && not env.suppressWitnesses then + if not env.suppressWitnesses then /// There are two *conditional* properties a typar can have: equality and comparison. /// A generic type having that constraint may be conditional on whether a specific type parameter to that generic has that /// constraint. diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index ae5c266cff5..234d4e56edc 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2903,7 +2903,6 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | E _ | P _ | M _ | C _ -> [] match witnessInfos with | [] -> None - | _ when not (cenv.g.langVersion.SupportsFeature(Features.LanguageFeature.WitnessPassing)) -> None | _ -> let witnessParams = ((Set.empty, 0), witnessInfos) ||> List.mapFold (fun (used,i) witnessInfo -> diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index a55bc5f5de4..b4b23ee2ff0 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1849,7 +1849,7 @@ type TcGlobals( /// supports witness arguments. member g.generateWitnesses = compilingFSharpCore || - ((ValRefForIntrinsic g.call_with_witnesses_info).TryDeref.IsSome && langVersion.SupportsFeature LanguageFeature.WitnessPassing) + (ValRefForIntrinsic g.call_with_witnesses_info).TryDeref.IsSome /// Indicates if we can use System.Array.Empty when emitting IL for empty array literals member val isArrayEmptyAvailable = v_Array_tcref.ILTyconRawMetadata.Methods.FindByName "Empty" |> List.isEmpty |> not diff --git a/src/Compiler/TypedTree/TypedTreeOps.Transforms.fs b/src/Compiler/TypedTree/TypedTreeOps.Transforms.fs index 7ee5f290b23..59292819942 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.Transforms.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.Transforms.fs @@ -1022,16 +1022,15 @@ module internal Rewriting = remapTyconToNonLocal ctxt tmenv x (* Which constraints actually get compiled to .NET constraints? *) - let isCompiledOrWitnessPassingConstraint (g: TcGlobals) cx = + let isCompiledOrWitnessPassingConstraint cx = match cx with | TyparConstraint.SupportsNull _ // this implies the 'class' constraint | TyparConstraint.IsReferenceType _ // this is the 'class' constraint | TyparConstraint.IsNonNullableStruct _ - | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ | TyparConstraint.IsUnmanaged _ // implies "struct" and also causes a modreq - | TyparConstraint.CoercesTo _ -> true - | TyparConstraint.MayResolveMember _ when g.langVersion.SupportsFeature LanguageFeature.WitnessPassing -> true + | TyparConstraint.CoercesTo _ + | TyparConstraint.MayResolveMember _ -> true | _ -> false // Is a value a first-class polymorphic value with .NET constraints, or witness-passing constraints? @@ -1042,7 +1041,7 @@ module internal Rewriting = && v.Type |> destForallTy g |> fst - |> List.exists (fun tp -> HasConstraint (isCompiledOrWitnessPassingConstraint g) tp) + |> List.exists (HasConstraint isCompiledOrWitnessPassingConstraint) // Does a type support a given interface? type Entity with diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8bd83440050..f74b23eec73 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -537,11 +537,6 @@ Metoda getter a setter indexované vlastnosti musí mít stejný typ. - - witness passing for trait constraints in F# quotations - Předávání kopie clusteru pro omezení vlastností v uvozovkách v jazyce F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Všechny větve výrazu shody vzoru musí vracet hodnoty implicitně převoditelné na typ první větve, což je řazená kolekce členů o délce {0} typu\n {1} \nTato větev vrací řazenou kolekci členů o délce {2} typu\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index ab6af560121..1ca53c24da7 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -537,11 +537,6 @@ Getter und Setter für indizierte Eigenschaften müssen denselben Typ aufweisen. - - witness passing for trait constraints in F# quotations - Zeugenübergabe für Merkmalseinschränkungen in F#-Zitaten - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Alle Verzweigungen eines Musterübereinstimmungsausdrucks müssen Werte zurückgeben, die implizit in den Typ der ersten Verzweigung konvertierbar sind. In diesem Fall handelt es sich dabei um ein Tupel der Länge {0} des Typs.\n {1} \nDiese Verzweigung gibt ein Tupel der Länge {2} des Typs\n {3} \nzurück. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 3f7773686fd..16afad202ee 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -537,11 +537,6 @@ El captador y el establecedor de propiedades indexadas deben tener el mismo tipo. - - witness passing for trait constraints in F# quotations - Paso de testigo para las restricciones de rasgos en las expresiones de código delimitadas de F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Todas las ramas de una expresión de coincidencia de patrón deben devolver valores implícitamente convertibles al tipo de la primera rama, que aquí es una tupla de longitud {0} de tipo\n {1} \nEsta rama devuelve una tupla de longitud {2} de tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 7a3822ab851..26c73177d3a 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -537,11 +537,6 @@ Les propriétés indexées getter et setter doivent avoir le même type - - witness passing for trait constraints in F# quotations - Passage de témoin pour les contraintes de trait dans les quotations F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Toutes les branches d’une expression de correspondance de motifs doivent retourner des valeurs implicitement convertibles au type de la première branche, qui est ici un tuple de longueur {0} de type\n {1} \nCette branche renvoie un tuple de longueur {2} de type\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 21aa6a838be..1b56b3f699b 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -537,11 +537,6 @@ Il getter e il setter delle proprietà indicizzate devono avere lo stesso tipo - - witness passing for trait constraints in F# quotations - Passaggio del testimone per vincoli di tratto in quotation F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Tutti i rami di un'espressione di corrispondenza criterio devono restituire valori convertibili in modo implicito nel tipo del primo ramo, che è una tupla di lunghezza {0} di tipo\n {1} \nQuesto ramo restituisce una tupla di lunghezza {2} di tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index c49b5490212..b684f8d50f9 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -537,11 +537,6 @@ インデックス付きプロパティのゲッターとセッターの型は同じである必要があります - - witness passing for trait constraints in F# quotations - F# 引用での特性制約に対する監視の引き渡し - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n パターン一致のすべての分岐は、最初の分岐の型に暗黙的に変換できる値を返す必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの分岐は、型の長さ {2} のタプルを返します\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 11cebee14be..46265115ee6 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -537,11 +537,6 @@ 인덱싱된 속성 getter와 setter의 형식이 같아야 합니다. - - witness passing for trait constraints in F# quotations - F# 인용의 특성 제약 조건에 대한 감시 전달 - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n 패턴 일치 식의 모든 분기는 첫 번째 분기의 유형으로 암시적으로 변환 가능한 값을 반환해야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 분기는 형식이 \n {3}이고 길이가 {2}인 튜플을 반환합니다. \n diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 9aa0452706b..a19098fad38 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -537,11 +537,6 @@ Metoda pobierająca i metoda ustawiająca właściwości indeksowanych muszą mieć taki sam typ. - - witness passing for trait constraints in F# quotations - monitor, który przekazuje ograniczenia cech języka F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Wszystkie gałęzie wyrażenia dopasowania wzorca muszą zwracać wartości niejawnie konwertowalne na typ pierwszej gałęzi, oto krotka o długości {0} typu\n {1} \nTa Gałąź zwraca krotki o długości {2} typu\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 388d56c9a0c..4d29ae2b3d1 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -537,11 +537,6 @@ As propriedades indexadas getter e setter devem ter o mesmo tipo - - witness passing for trait constraints in F# quotations - Passagem de testemunha para restrições de característica nas citações do F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Todas as ramificações de uma expressão de correspondência de padrão devem retornar valores implicitamente conversíveis ao tipo da primeira ramificação, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEsta ramificação retorna uma tupla de comprimento {2} do tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index ef935e3d593..9fc96c9a345 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -537,11 +537,6 @@ Методы получения и установки индексированных свойств должны иметь один и тот же тип. - - witness passing for trait constraints in F# quotations - Передача свидетеля для ограничений признаков в цитированиях F# - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Все ветви выражения сопоставления с шаблоном должны возвращать значения, поддерживающие неявное преобразование в тип первой ветви, которым здесь является кортеж длиной {0} типа\n {1} \nЭта ветвь возвращает кортеж длиной {2} типа\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 1a917da78aa..8305124673e 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -537,11 +537,6 @@ Dizini oluşturulmuş özelliklerin alıcısı ve ayarlayıcısı aynı türde olmalıdır - - witness passing for trait constraints in F# quotations - F# alıntılarındaki nitelik kısıtlamaları için tanık geçirme - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n Bir desen eşleştirme ifadesinin tüm dalları, örtük olarak ilk dalın türüne dönüştürülebilir değerler döndürmelidir. Burada ilk dal {0} uzunluğunda türü\n {1} olan bir demet \nBu dal {2} uzunluğunda türü\n {3} \nolan bir demet döndürüyor diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index f159ad4ee1b..cfbae5d05fe 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -537,11 +537,6 @@ 索引属性 getter 和 setter 必须具有相同的类型 - - witness passing for trait constraints in F# quotations - F# 引号中特征约束的见证传递 - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n 模式匹配表达式的所有分支必须返回可隐式转换为第一个分支类型的值,这是一个长度为 {0} 的类型的元组\n {1} \n此分支会返回长度为 {2} 的类型的元组\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index abb0041c10d..300ae321afb 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -537,11 +537,6 @@ 索引屬性 getter 和 setter 必須具有相同的類型 - - witness passing for trait constraints in F# quotations - 見證 F# 引號中特徵條件約束的傳遞 - - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n 模式比對運算式的所有分支都傳回可隱含轉換為第一個分支的類型的值,這是類型為\n {1} \n的元組長度 {0}此分支傳回的是類型為\n {3} \n的元組長度 {2}