@@ -1190,7 +1190,7 @@ module MutRecBindingChecking =
11901190 let inheritsExpr , tpenv =
11911191 try
11921192 TcNewExpr cenv envInstance tpenv baseTy ( Some synBaseTy.Range) true arg m
1193- with e ->
1193+ with RecoverableException e ->
11941194 errorRecovery e m
11951195 mkUnit g m, tpenv
11961196 let envInstance = match baseValOpt with Some baseVal -> AddLocalVal g cenv.tcSink scopem baseVal envInstance | None -> envInstance
@@ -1927,7 +1927,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (env
19271927
19281928 MutRecBindingChecking.TcMutRecDefns_ Phase2_ Bindings cenv envInitial tpenv mBinds scopem mutRecNSInfo envMutRec binds
19291929
1930- with exn -> errorRecovery exn scopem; [], envMutRec
1930+ with RecoverableException exn -> errorRecovery exn scopem; [], envMutRec
19311931
19321932//-------------------------------------------------------------------------
19331933// Build augmentation declarations
@@ -3050,7 +3050,7 @@ module EstablishTypeDefinitionCores =
30503050 if not inSig then
30513051 cenv.amap.assemblyLoader.RecordGeneratedTypeRoot ( ProviderGeneratedType( ilOrigRootTypeRef, ilTgtRootTyRef, nested))
30523052
3053- with exn ->
3053+ with RecoverableException exn ->
30543054 errorRecovery exn rhsType.Range
30553055#endif
30563056
@@ -3145,7 +3145,7 @@ module EstablishTypeDefinitionCores =
31453145
31463146 | _ -> ()
31473147
3148- with exn ->
3148+ with RecoverableException exn ->
31493149 errorRecovery exn m
31503150
31513151 // Third phase: check and publish the super types. Run twice, once before constraints are established
@@ -3257,7 +3257,7 @@ module EstablishTypeDefinitionCores =
32573257 // Publish the super type
32583258 tycon.TypeContents.tcaug_ super <- super
32593259
3260- with exn -> errorRecovery exn m))
3260+ with RecoverableException exn -> errorRecovery exn m))
32613261
32623262 /// Establish the fields, dispatch slots and union cases of a type
32633263 let private TcTyconDefnCore_Phase1G_EstablishRepresentation ( cenv : cenv ) envinner tpenv inSig ( MutRecDefnsPhase1DataForTycon ( _ , synTyconRepr , _ , _ , _ , _ )) ( tycon : Tycon ) ( attrs : Attribs ) =
@@ -3643,7 +3643,7 @@ module EstablishTypeDefinitionCores =
36433643 | _ -> ()
36443644
36453645 ( baseValOpt, safeInitInfo)
3646- with exn ->
3646+ with RecoverableException exn ->
36473647 errorRecovery exn m
36483648 None, NoSafeInitInfo
36493649
@@ -3864,7 +3864,7 @@ module EstablishTypeDefinitionCores =
38643864 let envForTycon = MakeInnerEnvForTyconRef envForTycon thisTyconRef false
38653865 try
38663866 TcTyparConstraints cenv NoNewTypars checkConstraints ItemOccurence.UseInType envForTycon tpenv synTyconConstraints |> ignore
3867- with exn ->
3867+ with RecoverableException exn ->
38683868 errorRecovery exn m
38693869 | _ -> ())
38703870
@@ -4818,7 +4818,7 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE
48184818
48194819 return env
48204820
4821- with exn ->
4821+ with RecoverableException exn ->
48224822 errorRecovery exn endm
48234823 return env
48244824 }
@@ -5186,7 +5186,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
51865186 return
51875187 ( defns, [], topAttrs), env, envAtEnd
51885188
5189- with exn ->
5189+ with RecoverableException exn ->
51905190 errorRecovery exn synDecl.Range
51915191 return ([], [], []), env, env
51925192 }
@@ -5408,7 +5408,7 @@ let CreateInitialTcEnv(g, amap, scopem, assemblyName, ccus) =
54085408 ( emptyTcEnv g, ccus) ||> List.collectFold ( fun env ( ccu , autoOpens , internalsVisible ) ->
54095409 try
54105410 AddCcuToTcEnv( g, amap, scopem, env, assemblyName, ccu, autoOpens, internalsVisible)
5411- with exn ->
5411+ with RecoverableException exn ->
54125412 errorRecovery exn scopem
54135413 [], env)
54145414
@@ -5459,7 +5459,7 @@ let ApplyDefaults (cenv: cenv) g denvAtEnd m moduleContents extraAttribs =
54595459 if not tp.IsSolved then
54605460 if ( tp.StaticReq <> TyparStaticReq.None) then
54615461 ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp)
5462- with exn ->
5462+ with RecoverableException exn ->
54635463 errorRecovery exn m
54645464
54655465let CheckValueRestriction denvAtEnd infoReader rootSigOpt implFileTypePriorToSig m =
@@ -5479,7 +5479,7 @@ let CheckValueRestriction denvAtEnd infoReader rootSigOpt implFileTypePriorToSig
54795479 | tp :: _ -> errorR ( ValueRestriction( denvAtEnd, infoReader, false , v, tp, v.Range))
54805480 | _ -> ()
54815481 mty.ModuleAndNamespaceDefinitions |> List.iter ( fun v -> check v.ModuleOrNamespaceType)
5482- try check implFileTypePriorToSig with e -> errorRecovery e m
5482+ try check implFileTypePriorToSig with RecoverableException e -> errorRecovery e m
54835483
54845484
54855485let SolveInternalUnknowns g ( cenv : cenv ) denvAtEnd moduleContents extraAttribs =
@@ -5517,7 +5517,7 @@ let CheckModuleSignature g (cenv: cenv) m denvAtEnd rootSigOpt implFileTypePrior
55175517 if not ( SignatureConformance.Checker( g, cenv.amap, denv, remapInfo, true ) .CheckSignature aenv cenv.infoReader ( mkLocalModuleRef implFileSpecPriorToSig) sigFileType) then
55185518 // We can just raise 'ReportedError' since CheckModuleOrNamespace raises its own error
55195519 raise ( ReportedError None)
5520- with exn ->
5520+ with RecoverableException exn ->
55215521 errorRecovery exn m
55225522
55235523 ( sigFileType, moduleContents)
@@ -5595,7 +5595,7 @@ let CheckOneImplFile
55955595 for check in cenv.css.GetPostInferenceChecksPreDefaults() do
55965596 try
55975597 check()
5598- with exn ->
5598+ with RecoverableException exn ->
55995599 errorRecovery exn m
56005600
56015601 conditionallySuppressErrorReporting ( checkForErrors()) ( fun () ->
@@ -5609,7 +5609,7 @@ let CheckOneImplFile
56095609 implFileTypePriorToSig |> IterTyconsOfModuleOrNamespaceType ( fun tycon ->
56105610 FinalTypeDefinitionChecksAtEndOfInferenceScope ( cenv.infoReader, envAtEnd.NameEnv, cenv.tcSink, true , denvAtEnd, tycon))
56115611
5612- with exn ->
5612+ with RecoverableException exn ->
56135613 errorRecovery exn m)
56145614
56155615 // Check the value restriction. Only checked if there is no signature.
@@ -5630,7 +5630,7 @@ let CheckOneImplFile
56305630 for check in cenv.css.GetPostInferenceChecksFinal() do
56315631 try
56325632 check()
5633- with exn ->
5633+ with RecoverableException exn ->
56345634 errorRecovery exn m)
56355635
56365636 // We ALWAYS run the PostTypeCheckSemanticChecks phase, though we if we have already encountered some
@@ -5649,7 +5649,7 @@ let CheckOneImplFile
56495649 implFileTy, implFileContents, extraAttribs, isLastCompiland,
56505650 isInternalTestSpanStackReferring)
56515651
5652- with exn ->
5652+ with RecoverableException exn ->
56535653 errorRecovery exn m
56545654 false , StampMap.Empty)
56555655
@@ -5711,7 +5711,7 @@ let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSin
57115711 try
57125712 sigFileType |> IterTyconsOfModuleOrNamespaceType ( fun tycon ->
57135713 FinalTypeDefinitionChecksAtEndOfInferenceScope( cenv.infoReader, tcEnv.NameEnv, cenv.tcSink, false , tcEnv.DisplayEnv, tycon))
5714- with exn -> errorRecovery exn sigFile.QualifiedName.Range
5714+ with RecoverableException exn -> errorRecovery exn sigFile.QualifiedName.Range
57155715
57165716 UpdatePrettyTyparNames.updateModuleOrNamespaceType sigFileType
57175717
0 commit comments