diff --git a/src/Compiler/Checking/Expressions/CheckArrayOrListComputedExpressions.fs b/src/Compiler/Checking/Expressions/CheckArrayOrListComputedExpressions.fs
index f8a2abd7d73..2b3d2eaf135 100644
--- a/src/Compiler/Checking/Expressions/CheckArrayOrListComputedExpressions.fs
+++ b/src/Compiler/Checking/Expressions/CheckArrayOrListComputedExpressions.fs
@@ -53,21 +53,8 @@ let TcArrayOrListComputedExpression (cenv: TcFileState) env (overallTy: OverallT
| None ->
- // LanguageFeatures.ImplicitYield do not require this validation
- let implicitYieldEnabled =
- cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield
-
- let validateExpressionWithIfRequiresParenthesis = not implicitYieldEnabled
- let acceptDeprecatedIfThenExpression = not implicitYieldEnabled
-
match comp with
- | SimpleSemicolonSequence cenv acceptDeprecatedIfThenExpression elems ->
- match comp with
- | SimpleSemicolonSequence cenv false _ -> ()
- | _ when validateExpressionWithIfRequiresParenthesis ->
- errorR (Deprecated(FSComp.SR.tcExpressionWithIfRequiresParenthesis (), m))
- | _ -> ()
-
+ | SimpleSemicolonSequence cenv false elems ->
let replacementExpr =
if isArray then
// This are to improve parsing/processing speed for parser tables by converting to an array blob ASAP
diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
index 040b61f9a89..24f648767ed 100644
--- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
+++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
@@ -3037,11 +3037,10 @@ let TcComputationExpression (cenv: TcFileState) env (overallTy: OverallTy) tpenv
// then allow the type-directed rule interpreting non-unit-typed expressions in statement
// positions as 'yield'. 'yield!' may be present in the computation expression.
let enableImplicitYield =
- cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield
- && (hasMethInfo "Yield" cenv env mBuilderVal ad builderTy
- && hasMethInfo "Combine" cenv env mBuilderVal ad builderTy
- && hasMethInfo "Delay" cenv env mBuilderVal ad builderTy
- && YieldFree cenv comp)
+ hasMethInfo "Yield" cenv env mBuilderVal ad builderTy
+ && hasMethInfo "Combine" cenv env mBuilderVal ad builderTy
+ && hasMethInfo "Delay" cenv env mBuilderVal ad builderTy
+ && YieldFree cenv comp
let origComp = comp
diff --git a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs
index 0fe8e296b81..8d4c8259972 100644
--- a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs
+++ b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs
@@ -180,65 +180,31 @@ let RewriteRangeExpr synExpr =
| _ -> None
/// Check if a computation or sequence expression is syntactically free of 'yield' (though not yield!)
-let YieldFree (cenv: TcFileState) expr =
- if cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield then
+let YieldFree (_cenv: TcFileState) expr =
+ let rec YieldFree expr =
+ match expr with
+ | SynExpr.Sequential(expr1 = expr1; expr2 = expr2) -> YieldFree expr1 && YieldFree expr2
- // Implement yield free logic for F# Language including the LanguageFeature.ImplicitYield
- let rec YieldFree expr =
- match expr with
- | SynExpr.Sequential(expr1 = expr1; expr2 = expr2) -> YieldFree expr1 && YieldFree expr2
+ | SynExpr.IfThenElse(thenExpr = thenExpr; elseExpr = elseExprOpt) -> YieldFree thenExpr && Option.forall YieldFree elseExprOpt
- | SynExpr.IfThenElse(thenExpr = thenExpr; elseExpr = elseExprOpt) -> YieldFree thenExpr && Option.forall YieldFree elseExprOpt
+ | SynExpr.TryWith(tryExpr = body; withCases = clauses) ->
+ YieldFree body
+ && clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
- | SynExpr.TryWith(tryExpr = body; withCases = clauses) ->
- YieldFree body
- && clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
+ | SynExpr.Match(clauses = clauses)
+ | SynExpr.MatchBang(clauses = clauses) -> clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
- | SynExpr.Match(clauses = clauses)
- | SynExpr.MatchBang(clauses = clauses) -> clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
+ | SynExpr.For(doBody = body)
+ | SynExpr.TryFinally(tryExpr = body)
+ | SynExpr.LetOrUse({ Body = body })
+ | SynExpr.While(doExpr = body)
+ | SynExpr.WhileBang(doExpr = body)
+ | SynExpr.ForEach(bodyExpr = body) -> YieldFree body
+ | SynExpr.YieldOrReturn(flags = (true, _)) -> false
- | SynExpr.For(doBody = body)
- | SynExpr.TryFinally(tryExpr = body)
- | SynExpr.LetOrUse({ Body = body })
- | SynExpr.While(doExpr = body)
- | SynExpr.WhileBang(doExpr = body)
- | SynExpr.ForEach(bodyExpr = body) -> YieldFree body
- | SynExpr.YieldOrReturn(flags = (true, _)) -> false
+ | _ -> true
- | _ -> true
-
- YieldFree expr
- else
- // Implement yield free logic for F# Language without the LanguageFeature.ImplicitYield
- let rec YieldFree expr =
- match expr with
- | SynExpr.Sequential(expr1 = expr1; expr2 = expr2) -> YieldFree expr1 && YieldFree expr2
-
- | SynExpr.IfThenElse(thenExpr = thenExpr; elseExpr = elseExprOpt) -> YieldFree thenExpr && Option.forall YieldFree elseExprOpt
-
- | SynExpr.TryWith(tryExpr = e1; withCases = clauses) ->
- YieldFree e1
- && clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
-
- | SynExpr.Match(clauses = clauses)
- | SynExpr.MatchBang(clauses = clauses) -> clauses |> List.forall (fun (SynMatchClause(resultExpr = res)) -> YieldFree res)
-
- | SynExpr.For(doBody = body)
- | SynExpr.TryFinally(tryExpr = body)
- | SynExpr.LetOrUse({ Body = body })
- | SynExpr.While(doExpr = body)
- | SynExpr.WhileBang(doExpr = body)
- | SynExpr.ForEach(bodyExpr = body) -> YieldFree body
-
- | LetOrUse(_, true, _)
- | SynExpr.YieldOrReturnFrom _
- | SynExpr.YieldOrReturn _
- | SynExpr.ImplicitZero _
- | SynExpr.Do _ -> false
-
- | _ -> true
-
- YieldFree expr
+ YieldFree expr
let inline IsSimpleSemicolonSequenceElement expr cenv acceptDeprecated =
match expr with
diff --git a/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs b/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs
index c3f740cf458..f97ae454da6 100644
--- a/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs
+++ b/src/Compiler/Checking/Expressions/CheckSequenceExpressions.fs
@@ -35,9 +35,7 @@ let TcSequenceExpression (cenv: TcFileState) env tpenv comp (overallTy: OverallT
// If there are no 'yield' in the computation expression then allow the type-directed rule
// interpreting non-unit-typed expressions in statement positions as 'yield'. 'yield!' may be
// present in the computation expression.
- let enableImplicitYield =
- cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield
- && (YieldFree cenv comp)
+ let enableImplicitYield = YieldFree cenv comp
let mkSeqDelayedExpr m (coreExpr: Expr) =
let overallTy = tyOfExpr cenv.g coreExpr
@@ -162,9 +160,6 @@ let TcSequenceExpression (cenv: TcFileState) env tpenv comp (overallTy: OverallT
Some(mkSeqFinally cenv env mTryToLast genOuterTy innerExpr unwindExpr, tpenv)
- | SynExpr.Paren(range = m) when not (cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield) ->
- error (Error(FSComp.SR.tcConstructIsAmbiguousInSequenceExpression (), m))
-
| SynExpr.ImplicitZero m -> Some(mkSeqEmpty cenv env m genOuterTy, tpenv)
| SynExpr.DoBang(trivia = { DoBangKeyword = m }) -> error (Error(FSComp.SR.tcDoBangIllegalInSequenceExpression (), m))
@@ -469,16 +464,6 @@ let TcSequenceExpressionEntry (cenv: TcFileState) env (overallTy: OverallTy) tpe
match RewriteRangeExpr comp with
| Some replacementExpr -> TcExpr cenv overallTy env tpenv replacementExpr
| None ->
- let implicitYieldEnabled =
- cenv.g.langVersion.SupportsFeature LanguageFeature.ImplicitYield
-
- let validateObjectSequenceOrRecordExpression = not implicitYieldEnabled
-
- match comp with
- | SimpleSemicolonSequence cenv false _ when validateObjectSequenceOrRecordExpression ->
- errorR (Error(FSComp.SR.tcInvalidObjectSequenceOrRecordExpression (), m))
- | _ -> ()
-
if not hasBuilder && not cenv.g.compilingFSharpCore then
error (Error(FSComp.SR.tcInvalidSequenceExpressionSyntaxForm (), m))
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index 764e278979a..8bedfb7d6e5 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -1567,7 +1567,6 @@ featureSingleUnderscorePattern,"single underscore pattern"
featureWildCardInForLoop,"wild card in for loop"
featureRelaxWhitespace,"whitespace relaxation"
featureNameOf,"nameof"
-featureImplicitYield,"implicit yield"
featureDotlessFloat32Literal,"dotless float32 literal"
featurePackageManagement,"package management"
featureFromEndSlicing,"from-end slicing"
diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs
index b95c0aaecf0..86744302a9f 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fs
+++ b/src/Compiler/Facilities/LanguageFeatures.fs
@@ -21,7 +21,6 @@ type LanguageFeature =
| RelaxWhitespace
| RelaxWhitespace2
| NameOf
- | ImplicitYield
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
@@ -153,7 +152,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
LanguageFeature.SingleUnderscorePattern, languageVersion47
LanguageFeature.WildCardInForLoop, languageVersion47
LanguageFeature.RelaxWhitespace, languageVersion47
- LanguageFeature.ImplicitYield, languageVersion47
// F# 5.0
LanguageFeature.FixedIndexSlice3d4d, languageVersion50
@@ -365,7 +363,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
| LanguageFeature.RelaxWhitespace -> FSComp.SR.featureRelaxWhitespace ()
| LanguageFeature.RelaxWhitespace2 -> FSComp.SR.featureRelaxWhitespace2 ()
| LanguageFeature.NameOf -> FSComp.SR.featureNameOf ()
- | LanguageFeature.ImplicitYield -> FSComp.SR.featureImplicitYield ()
| LanguageFeature.DotlessFloat32Literal -> FSComp.SR.featureDotlessFloat32Literal ()
| LanguageFeature.PackageManagement -> FSComp.SR.featurePackageManagement ()
| LanguageFeature.FromEndSlicing -> FSComp.SR.featureFromEndSlicing ()
diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi
index 59bd65470f5..ddff093d78a 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fsi
+++ b/src/Compiler/Facilities/LanguageFeatures.fsi
@@ -11,7 +11,6 @@ type LanguageFeature =
| RelaxWhitespace
| RelaxWhitespace2
| NameOf
- | ImplicitYield
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index d878863c755..2bec2fcf12c 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- implicitní yield
-
-
Improved implied argument names
Vylepšené názvy implikovaných argumentů
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 5ec1084eb12..ac83c1050ac 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- implizite yield-Anweisung
-
-
Improved implied argument names
Verbesserte implizite Argumentnamen
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index 4f80cb251b8..c75d1ccb217 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- elemento yield implícito
-
-
Improved implied argument names
Nombres de argumentos implícitos mejorados
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index 1874188e31f..e2636373375 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- yield implicite
-
-
Improved implied argument names
Noms d’arguments implicites améliorés
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index fc49986b737..85e25e5c7bc 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- istruzione yield implicita
-
-
Improved implied argument names
Nomi di argomenti impliciti migliorati
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 3708ae69285..f87a8dfcdfd 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- 暗黙的な yield
-
-
Improved implied argument names
暗黙的な引数名の改善
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index e178c73b058..c149228fcce 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- 암시적 yield
-
-
Improved implied argument names
향상된 암시적 인수 이름
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index 055a6cf5229..b293264d62b 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- niejawne słowo kluczowe yield
-
-
Improved implied argument names
Ulepszone nazwy dorozumianych argumentów
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 732bd853809..25d820ebea4 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- yield implícito
-
-
Improved implied argument names
Nomes de argumento implícitos aprimorados
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 49f4ee9a7de..8e3296cb399 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- неявное использование yield
-
-
Improved implied argument names
Улучшенные имена подразумеваемых аргументов
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index 973dd758f46..0c36af7d685 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- örtük yield
-
-
Improved implied argument names
Geliştirilmiş örtük bağımsız değişken adları
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 6da1c13c739..19a97396b00 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- 隐式 yield
-
-
Improved implied argument names
改进了默示的参数名称
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index 80881c5dab3..0af31ff3a40 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -457,11 +457,6 @@
Implicit dispatch slot coverage for default interface member implementations
-
- implicit yield
- 隱含 yield
-
-
Improved implied argument names
改良的隱含引數名稱