@@ -5960,7 +5960,7 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
5960
5960
5961
5961
| SynExpr.FromParseError (expr1, m) ->
5962
5962
//SolveTypeAsError cenv env.DisplayEnv m overallTy
5963
- let _, tpenv = suppressErrorReporting (fun () -> TcExpr cenv overallTy env tpenv expr1)
5963
+ let _, tpenv = TcExpr cenv overallTy env tpenv expr1
5964
5964
mkDefault(m, overallTy.Commit), tpenv
5965
5965
5966
5966
| SynExpr.Sequential (sp, dir, synExpr1, synExpr2, m, _) ->
@@ -6489,9 +6489,7 @@ and TcIteratedLambdas (cenv: cenv) isFirst (env: TcEnv) overallTy takenNames tpe
6489
6489
6490
6490
| e ->
6491
6491
let env = { env with eIsControlFlow = true }
6492
- // Dive into the expression to check for syntax errors and suppress them if they show.
6493
- conditionallySuppressErrorReporting (not isFirst && synExprContainsError e) (fun () ->
6494
- TcExpr cenv overallTy env tpenv e)
6492
+ TcExpr cenv overallTy env tpenv e
6495
6493
6496
6494
and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed =
6497
6495
match delayed with
@@ -11103,39 +11101,33 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt
11103
11101
// At each module binding, dive into the expression to check for syntax errors and suppress them if they show.
11104
11102
// Don't do this for lambdas, because we always check for suppression for all lambda bodies in TcIteratedLambdas
11105
11103
let rhsExprChecked, tpenv =
11106
- let atTopNonLambdaDefn =
11107
- declKind.IsModuleOrMemberOrExtensionBinding &&
11108
- (match rhsExpr with SynExpr.Lambda _ -> false | _ -> true) &&
11109
- synExprContainsError rhsExpr
11110
-
11111
- conditionallySuppressErrorReporting atTopNonLambdaDefn (fun () ->
11112
-
11113
- // Save the arginfos away to match them up in the lambda
11114
- let (PrelimValReprInfo(argInfos, _)) = prelimValReprInfo
11115
-
11116
- // The right-hand-side is control flow (has an implicit debug point) in any situation where we
11117
- // haven't extended the debug point to include the 'let', that is, there is a debug point noted
11118
- // at the binding.
11119
- //
11120
- // This includes
11121
- // let _ = expr
11122
- // let () = expr
11123
- // which are transformed to sequential expressions in TcLetBinding
11124
- //
11125
- let rhsIsControlFlow =
11126
- match pat with
11127
- | SynPat.Wild _
11128
- | SynPat.Const (SynConst.Unit, _)
11129
- | SynPat.Paren (SynPat.Const (SynConst.Unit, _), _) -> true
11130
- | _ ->
11131
- match debugPoint with
11132
- | DebugPointAtBinding.Yes _ -> false
11133
- | _ -> true
11104
+ // Save the arginfos away to match them up in the lambda
11105
+ let (PrelimValReprInfo(argInfos, _)) = prelimValReprInfo
11106
+
11107
+ // The right-hand-side is control flow (has an implicit debug point) in any situation where we
11108
+ // haven't extended the debug point to include the 'let', that is, there is a debug point noted
11109
+ // at the binding.
11110
+ //
11111
+ // This includes
11112
+ // let _ = expr
11113
+ // let () = expr
11114
+ // which are transformed to sequential expressions in TcLetBinding
11115
+ //
11116
+ let rhsIsControlFlow =
11117
+ match pat with
11118
+ | SynPat.Wild _
11119
+ | SynPat.Const (SynConst.Unit, _)
11120
+ | SynPat.Paren (SynPat.Const (SynConst.Unit, _), _) -> true
11121
+ | _ ->
11122
+
11123
+ match debugPoint with
11124
+ | DebugPointAtBinding.Yes _ -> false
11125
+ | _ -> true
11134
11126
11135
- let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow }
11127
+ let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow }
11136
11128
11137
- if isCtor then TcExprThatIsCtorBody (safeThisValOpt, safeInitInfo) cenv (MustEqual overallExprTy) envinner tpenv rhsExpr
11138
- else TcExprThatCantBeCtorBody cenv (MustConvertTo (false, overallExprTy)) envinner tpenv rhsExpr)
11129
+ if isCtor then TcExprThatIsCtorBody (safeThisValOpt, safeInitInfo) cenv (MustEqual overallExprTy) envinner tpenv rhsExpr
11130
+ else TcExprThatCantBeCtorBody cenv (MustConvertTo (false, overallExprTy)) envinner tpenv rhsExpr
11139
11131
11140
11132
if kind = SynBindingKind.StandaloneExpression && not cenv.isScript then
11141
11133
UnifyUnitType cenv env mBinding overallPatTy rhsExprChecked |> ignore<bool>
0 commit comments