未验证 提交 d91b6c5c 编写于 作者: D Don Syme 提交者: GitHub

Improve debugging within the compiler (#13339)

* improve debugging

* fix build

* fix build

* fix build

* remove !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE and some other cruft
Co-authored-by: NKevin Ransom <codecutter@hotmail.com>
上级 4be3bb57
......@@ -1211,7 +1211,7 @@ let CheckOneInput
let typeCheckOne =
if skipImplIfSigExists && hadSig then
(EmptyTopAttrs, CreateEmptyDummyImplFile qualNameOfFile rootSigOpt.Value, Unchecked.defaultof<_>, tcImplEnv, false)
|> Cancellable.ret
|> cancellable.Return
else
CheckOneImplFile(
tcGlobals,
......
......@@ -8,6 +8,7 @@ open FSharp.Compiler.Text.Range
open FSharp.Compiler.Text
open System
open System.Diagnostics
open System.Reflection
open System.Threading
open Internal.Utilities.Library
open Internal.Utilities.Library.Extras
......@@ -365,7 +366,6 @@ type internal DiagnosticsThreadStatics =
[<AutoOpen>]
module DiagnosticsLoggerExtensions =
open System.Reflection
// Dev15.0 shipped with a bug in diasymreader in the portable pdb symbol reader which causes an AV
// This uses a simple heuristic to detect it (the vsversion is < 16.0)
......@@ -557,8 +557,6 @@ let stopProcessingRecovery exn m =
let errorRecoveryNoRange exn =
DiagnosticsThreadStatics.DiagnosticsLogger.ErrorRecoveryNoRange exn
let report f = f ()
let deprecatedWithError s m = errorR (Deprecated(s, m))
let libraryOnlyError m = errorR (LibraryUseOnly m)
......@@ -574,6 +572,7 @@ let mlCompatWarning s m =
let mlCompatError s m =
errorR (UserCompilerMessage(FSComp.SR.mlCompatError s, 62, m))
[<DebuggerStepThrough>]
let suppressErrorReporting f =
let diagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger
......@@ -589,6 +588,7 @@ let suppressErrorReporting f =
finally
SetThreadDiagnosticsLoggerNoUnwind diagnosticsLogger
[<DebuggerStepThrough>]
let conditionallySuppressErrorReporting cond f =
if cond then suppressErrorReporting f else f ()
......@@ -633,6 +633,7 @@ let CheckNoErrorsAndGetWarnings res =
| ErrorResult _ -> None
/// The bind in the monad. Stop on first error. Accumulate warnings and continue.
[<DebuggerHidden; DebuggerStepThrough>]
let (++) res f =
match res with
| OkResult ([], res) -> (* tailcall *) f res
......@@ -643,24 +644,27 @@ let (++) res f =
| ErrorResult (warns, err) -> ErrorResult(warns, err)
/// Stop on first error. Accumulate warnings and continue.
[<DebuggerHidden; DebuggerStepThrough>]
let rec IterateD f xs =
match xs with
| [] -> CompleteD
| h :: t -> f h ++ (fun () -> IterateD f t)
[<DebuggerHidden; DebuggerStepThrough>]
let rec WhileD gd body =
if gd () then
body () ++ (fun () -> WhileD gd body)
else
CompleteD
let MapD f xs =
let rec loop acc xs =
match xs with
| [] -> ResultD(List.rev acc)
| h :: t -> f h ++ (fun x -> loop (x :: acc) t)
[<DebuggerHidden; DebuggerStepThrough>]
let rec MapD_loop f acc xs =
match xs with
| [] -> ResultD(List.rev acc)
| h :: t -> f h ++ (fun x -> MapD_loop f (x :: acc) t)
loop [] xs
[<DebuggerHidden; DebuggerStepThrough>]
let MapD f xs = MapD_loop f [] xs
type TrackErrorsBuilder() =
member x.Bind(res, k) = res ++ k
......@@ -676,12 +680,14 @@ type TrackErrorsBuilder() =
let trackErrors = TrackErrorsBuilder()
/// Stop on first error. Accumulate warnings and continue.
[<DebuggerHidden; DebuggerStepThrough>]
let OptionD f xs =
match xs with
| None -> CompleteD
| Some h -> f h
/// Stop on first error. Report index
[<DebuggerHidden; DebuggerStepThrough>]
let IterateIdxD f xs =
let rec loop xs i =
match xs with
......@@ -691,6 +697,7 @@ let IterateIdxD f xs =
loop xs 0
/// Stop on first error. Accumulate warnings and continue.
[<DebuggerHidden; DebuggerStepThrough>]
let rec Iterate2D f xs ys =
match xs, ys with
| [], [] -> CompleteD
......@@ -698,6 +705,7 @@ let rec Iterate2D f xs ys =
| _ -> failwith "Iterate2D"
/// Keep the warnings, propagate the error to the exception continuation.
[<DebuggerHidden; DebuggerStepThrough>]
let TryD f g =
match f () with
| ErrorResult (warns, err) ->
......@@ -707,15 +715,19 @@ let TryD f g =
}
| res -> res
[<DebuggerHidden; DebuggerStepThrough>]
let rec RepeatWhileD nDeep body =
body nDeep ++ (fun x -> if x then RepeatWhileD (nDeep + 1) body else CompleteD)
[<DebuggerHidden; DebuggerStepThrough>]
let inline AtLeastOneD f l =
MapD f l ++ (fun res -> ResultD(List.exists id res))
[<DebuggerHidden; DebuggerStepThrough>]
let inline AtLeastOne2D f xs ys =
List.zip xs ys |> AtLeastOneD(fun (x, y) -> f x y)
[<DebuggerHidden; DebuggerStepThrough>]
let inline MapReduceD mapper zero reducer l =
MapD mapper l
++ (fun res ->
......@@ -725,6 +737,7 @@ let inline MapReduceD mapper zero reducer l =
| _ -> List.reduce reducer res
))
[<DebuggerHidden; DebuggerStepThrough>]
let inline MapReduce2D mapper zero reducer xs ys =
List.zip xs ys |> MapReduceD (fun (x, y) -> mapper x y) zero reducer
......@@ -804,6 +817,7 @@ type StackGuard(maxDepth: int) =
let mutable depth = 1
[<DebuggerHidden; DebuggerStepThrough>]
member _.Guard(f) =
depth <- depth + 1
......
......@@ -267,8 +267,6 @@ val stopProcessingRecovery: exn: exn -> m: range -> unit
val errorRecoveryNoRange: exn: exn -> unit
val report: f: (unit -> 'T) -> 'T
val deprecatedWithError: s: string -> m: range -> unit
val libraryOnlyError: m: range -> unit
......
......@@ -110,7 +110,7 @@ type internal DelayedILModuleReader =
None
| _ -> Some this.result)
}
| _ -> Cancellable.ret (Some this.result)
| _ -> cancellable.Return(Some this.result)
[<RequireQualifiedAccess; NoComparison; CustomEquality>]
type FSharpReferencedProject =
......
......@@ -10,6 +10,9 @@ open System.IO
open System.Threading
open System.Threading.Tasks
open System.Runtime.CompilerServices
#if !USE_SHIPPED_FSCORE
open FSharp.Core.CompilerServices.StateMachineHelpers
#endif
[<AutoOpen>]
module internal PervasiveAutoOpens =
......@@ -885,51 +888,27 @@ type ValueOrCancelled<'TResult> =
/// A cancellable computation is passed may be cancelled via a CancellationToken, which is propagated implicitly.
/// If cancellation occurs, it is propagated as data rather than by raising an OperationCanceledException.
[<Struct>]
type Cancellable<'TResult> = Cancellable of (CancellationToken -> ValueOrCancelled<'TResult>)
type Cancellable<'T> = Cancellable of (CancellationToken -> ValueOrCancelled<'T>)
module Cancellable =
/// Run a cancellable computation using the given cancellation token
let run (ct: CancellationToken) (Cancellable oper) =
let inline run (ct: CancellationToken) (Cancellable oper) =
if ct.IsCancellationRequested then
ValueOrCancelled.Cancelled(OperationCanceledException ct)
else
oper ct
/// Bind the result of a cancellable computation
let inline bind f comp1 =
Cancellable(fun ct ->
match run ct comp1 with
| ValueOrCancelled.Value v1 -> run ct (f v1)
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
/// Map the result of a cancellable computation
let inline map f oper =
Cancellable(fun ct ->
match run ct oper with
| ValueOrCancelled.Value res -> ValueOrCancelled.Value(f res)
| ValueOrCancelled.Cancelled err -> ValueOrCancelled.Cancelled err)
/// Return a simple value as the result of a cancellable computation
let inline ret x =
Cancellable(fun _ -> ValueOrCancelled.Value x)
/// Fold a cancellable computation along a sequence of inputs
let fold f acc seq =
Cancellable(fun ct ->
(ValueOrCancelled.Value acc, seq)
||> Seq.fold (fun acc x ->
match acc with
| ValueOrCancelled.Value accv -> run ct (f accv x)
| res -> res))
let mutable acc = ValueOrCancelled.Value acc
/// Iterate a cancellable computation over a collection
let inline each f seq =
fold (fun acc x -> f x |> map (fun y -> (y :: acc))) [] seq |> map List.rev
for x in seq do
match acc with
| ValueOrCancelled.Value accv -> acc <- run ct (f accv x)
| ValueOrCancelled.Cancelled _ -> ()
/// Delay a cancellable computation
let inline delay (f: unit -> Cancellable<'T>) =
Cancellable(fun ct -> let (Cancellable g) = f () in g ct)
acc)
/// Run the computation in a mode where it may not be cancelled. The computation never results in a
/// ValueOrCancelled.Cancelled.
......@@ -960,61 +939,118 @@ module Cancellable =
let canceled () =
Cancellable(fun ct -> ValueOrCancelled.Cancelled(OperationCanceledException ct))
/// Catch exceptions in a computation
let inline catch comp =
let (Cancellable f) = comp
type CancellableBuilder() =
member inline _.Delay([<InlineIfLambda>] f) =
Cancellable(fun ct ->
try
match f ct with
| ValueOrCancelled.Value res -> ValueOrCancelled.Value(Choice1Of2 res)
| ValueOrCancelled.Cancelled exn -> ValueOrCancelled.Cancelled exn
with err ->
ValueOrCancelled.Value(Choice2Of2 err))
/// Implement try/finally for a cancellable computation
let inline tryFinally comp compensation =
catch comp
|> bind (fun res ->
compensation ()
match res with
| Choice1Of2 r -> ret r
| Choice2Of2 err -> raise err)
/// Implement try/with for a cancellable computation
let inline tryWith comp handler =
catch comp
|> bind (fun res ->
match res with
| Choice1Of2 r -> ret r
| Choice2Of2 err -> handler err)
let (Cancellable g) = f ()
g ct)
type CancellableBuilder() =
member inline _.Bind(comp, [<InlineIfLambda>] k) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
member inline _.BindReturn(comp, k) = Cancellable.map k comp
match Cancellable.run ct comp with
| ValueOrCancelled.Value v1 -> Cancellable.run ct (k v1)
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.Bind(comp, k) = Cancellable.bind k comp
member inline _.BindReturn(comp, [<InlineIfLambda>] k) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
member inline _.Return v = Cancellable.ret v
match Cancellable.run ct comp with
| ValueOrCancelled.Value v1 -> ValueOrCancelled.Value(k v1)
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.ReturnFrom(v: Cancellable<'T>) = v
member inline _.Combine(comp1, comp2) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
member inline _.Combine(e1, e2) = e1 |> Cancellable.bind (fun () -> e2)
match Cancellable.run ct comp1 with
| ValueOrCancelled.Value () -> Cancellable.run ct comp2
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.For(es, f) = es |> Cancellable.each f
member inline _.TryWith(comp, [<InlineIfLambda>] handler) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
member inline _.TryWith(comp, handler) = Cancellable.tryWith comp handler
let compRes =
try
match Cancellable.run ct comp with
| ValueOrCancelled.Value res -> ValueOrCancelled.Value(Choice1Of2 res)
| ValueOrCancelled.Cancelled exn -> ValueOrCancelled.Cancelled exn
with err ->
ValueOrCancelled.Value(Choice2Of2 err)
match compRes with
| ValueOrCancelled.Value res ->
match res with
| Choice1Of2 r -> ValueOrCancelled.Value r
| Choice2Of2 err -> Cancellable.run ct (handler err)
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.Using(resource, comp) =
Cancellable.tryFinally (comp resource) (fun () -> (resource :> IDisposable).Dispose())
member inline _.Using(resource, [<InlineIfLambda>] comp) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
let body = comp resource
member inline _.TryFinally(comp, compensation) =
Cancellable.tryFinally comp compensation
let compRes =
try
match Cancellable.run ct body with
| ValueOrCancelled.Value res -> ValueOrCancelled.Value(Choice1Of2 res)
| ValueOrCancelled.Cancelled exn -> ValueOrCancelled.Cancelled exn
with err ->
ValueOrCancelled.Value(Choice2Of2 err)
match compRes with
| ValueOrCancelled.Value res ->
(resource :> IDisposable).Dispose()
match res with
| Choice1Of2 r -> ValueOrCancelled.Value r
| Choice2Of2 err -> raise err
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.Delay f = Cancellable.delay f
member inline _.TryFinally(comp, [<InlineIfLambda>] compensation) =
Cancellable(fun ct ->
#if !USE_SHIPPED_FSCORE
__debugPoint ""
#endif
let compRes =
try
match Cancellable.run ct comp with
| ValueOrCancelled.Value res -> ValueOrCancelled.Value(Choice1Of2 res)
| ValueOrCancelled.Cancelled exn -> ValueOrCancelled.Cancelled exn
with err ->
ValueOrCancelled.Value(Choice2Of2 err)
match compRes with
| ValueOrCancelled.Value res ->
compensation ()
match res with
| Choice1Of2 r -> ValueOrCancelled.Value r
| Choice2Of2 err -> raise err
| ValueOrCancelled.Cancelled err1 -> ValueOrCancelled.Cancelled err1)
member inline _.Return v =
Cancellable(fun _ -> ValueOrCancelled.Value v)
member inline _.ReturnFrom(v: Cancellable<'T>) = v
member inline _.Zero() = Cancellable.ret ()
member inline _.Zero() =
Cancellable(fun _ -> ValueOrCancelled.Value())
[<AutoOpen>]
module CancellableAutoOpens =
......
......@@ -369,80 +369,53 @@ type internal ValueOrCancelled<'TResult> =
| Value of result: 'TResult
| Cancelled of ``exception``: OperationCanceledException
/// Represents a synchronous cancellable computation with explicit representation of a cancelled result.
/// Represents a synchronous, cold-start, cancellable computation with explicit representation of a cancelled result.
///
/// A cancellable computation is passed may be cancelled via a CancellationToken, which is propagated implicitly.
/// A cancellable computation may be cancelled via a CancellationToken, which is propagated implicitly.
/// If cancellation occurs, it is propagated as data rather than by raising an OperationCanceledException.
[<Struct>]
type internal Cancellable<'TResult> = Cancellable of (CancellationToken -> ValueOrCancelled<'TResult>)
type internal Cancellable<'T> = Cancellable of (CancellationToken -> ValueOrCancelled<'T>)
module internal Cancellable =
/// Run a cancellable computation using the given cancellation token
val run: ct: CancellationToken -> Cancellable<'a> -> ValueOrCancelled<'a>
val inline run: ct: CancellationToken -> Cancellable<'T> -> ValueOrCancelled<'T>
/// Bind the result of a cancellable computation
val inline bind: f: ('a -> Cancellable<'b>) -> comp1: Cancellable<'a> -> Cancellable<'b>
/// Map the result of a cancellable computation
val inline map: f: ('a -> 'b) -> oper: Cancellable<'a> -> Cancellable<'b>
/// Return a simple value as the result of a cancellable computation
val inline ret: x: 'a -> Cancellable<'a>
/// Fold a cancellable computation along a sequence of inputs
val fold: f: ('a -> 'b -> Cancellable<'a>) -> acc: 'a -> seq: seq<'b> -> Cancellable<'a>
/// Iterate a cancellable computation over a collection
val inline each: f: ('a -> Cancellable<'b>) -> seq: seq<'a> -> Cancellable<'b list>
/// Delay a cancellable computation
val inline delay: f: (unit -> Cancellable<'T>) -> Cancellable<'T>
val fold: f: ('State -> 'T -> Cancellable<'State>) -> acc: 'State -> seq: seq<'T> -> Cancellable<'State>
/// Run the computation in a mode where it may not be cancelled. The computation never results in a
/// ValueOrCancelled.Cancelled.
val runWithoutCancellation: comp: Cancellable<'a> -> 'a
val runWithoutCancellation: comp: Cancellable<'T> -> 'T
/// Bind the cancellation token associated with the computation
val token: unit -> Cancellable<CancellationToken>
/// Represents a canceled computation
val canceled: unit -> Cancellable<'a>
/// Implement try/finally for a cancellable computation
val inline catch: comp: Cancellable<'a> -> Cancellable<Choice<'a, Exception>>
/// Implement try/finally for a cancellable computation
val inline tryFinally: comp: Cancellable<'a> -> compensation: (unit -> unit) -> Cancellable<'a>
/// Implement try/with for a cancellable computation
val inline tryWith: comp: Cancellable<'a> -> handler: (exn -> Cancellable<'a>) -> Cancellable<'a>
val toAsync: Cancellable<'a> -> Async<'a>
val toAsync: Cancellable<'T> -> Async<'T>
type internal CancellableBuilder =
new: unit -> CancellableBuilder
member inline BindReturn: comp: Cancellable<'T> * k: ('T -> 'U) -> Cancellable<'U>
member inline Bind: comp: Cancellable<'T> * k: ('T -> Cancellable<'U>) -> Cancellable<'U>
member inline BindReturn: comp: Cancellable<'T> * [<InlineIfLambda>] k: ('T -> 'U) -> Cancellable<'U>
member inline Combine: e1: Cancellable<unit> * e2: Cancellable<'T> -> Cancellable<'T>
member inline Bind: comp: Cancellable<'T> * [<InlineIfLambda>] k: ('T -> Cancellable<'U>) -> Cancellable<'U>
member inline Delay: f: (unit -> Cancellable<'T>) -> Cancellable<'T>
member inline Combine: comp1: Cancellable<unit> * comp2: Cancellable<'T> -> Cancellable<'T>
member inline For: es: seq<'T> * f: ('T -> Cancellable<'U>) -> Cancellable<'U list>
member inline Delay: [<InlineIfLambda>] f: (unit -> Cancellable<'T>) -> Cancellable<'T>
member inline Return: v: 'T -> Cancellable<'T>
member inline ReturnFrom: v: Cancellable<'T> -> Cancellable<'T>
member inline TryFinally: comp: Cancellable<'T> * compensation: (unit -> unit) -> Cancellable<'T>
member inline TryFinally: comp: Cancellable<'T> * [<InlineIfLambda>] compensation: (unit -> unit) -> Cancellable<'T>
member inline TryWith: comp: Cancellable<'T> * handler: (exn -> Cancellable<'T>) -> Cancellable<'T>
member inline TryWith:
comp: Cancellable<'T> * [<InlineIfLambda>] handler: (exn -> Cancellable<'T>) -> Cancellable<'T>
member inline Using: resource: 'c * comp: ('c -> Cancellable<'T>) -> Cancellable<'T> when 'c :> IDisposable
member inline Using:
resource: 'Resource * [<InlineIfLambda>] comp: ('Resource -> Cancellable<'T>) -> Cancellable<'T>
when 'Resource :> IDisposable
member inline Zero: unit -> Cancellable<unit>
......
......@@ -11,7 +11,7 @@
<DefineConstants>$(DefineConstants);LOCALIZATION_FSBUILD</DefineConstants>
<NoWarn>NU1701;FS0075</NoWarn>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<LangVersion>5.0</LangVersion> <!-- FSharp.Build may run in Visual Studio with older FSharp.Cores so don't use unshipped features -->
<LangVersion>6.0</LangVersion> <!-- FSharp.Build may run in Visual Studio with older FSharp.Cores so don't use unshipped features -->
</PropertyGroup>
<ItemGroup>
......@@ -57,7 +57,7 @@
The FSharp.Build built here may be loaded directly into a shipped Visual Studio, to that end, we cannot
rely on new API's just being added to FSharp.Core.
-->
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersionValue)"/>
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersionValue)" IncludeAssets="compile" ExcludeAssets="all" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Proto'">
......
......@@ -10,7 +10,6 @@
<NoWarn>$(NoWarn);1204</NoWarn> <!-- This construct is for use in the FSharp.Core library and should not be used directly -->
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);FSHARP_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Proto'">BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
<!-- 3218: ArgumentsInSigAndImplMismatch -->
<OtherFlags>$(OtherFlags) --warnon:3218</OtherFlags>
<!-- 1182: Unused variables -->
......@@ -26,8 +25,6 @@
<!-- Turn off 3513: resumable code invocation' - expected for resumable code combinators -->
<OtherFlags>$(OtherFlags) --nowarn:3513</OtherFlags>
<OtherFlags>$(OtherFlags) --compiling-fslib --compiling-fslib-40 --maxerrors:100 --extraoptimizationloops:1</OtherFlags>
<!-- preview needed for use of state machines for tasks -->
<LangVersion>preview</LangVersion>
<!-- .tail annotations always emitted for this binary, even in debug mode -->
<Tailcalls>true</Tailcalls>
<NGenBinary>true</NGenBinary>
......
......@@ -373,11 +373,9 @@ module ExtraTopLevelOperators =
[<assembly: AutoOpen("Microsoft.FSharp.Core")>]
[<assembly: AutoOpen("Microsoft.FSharp.Collections")>]
[<assembly: AutoOpen("Microsoft.FSharp.Control")>]
#if !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE
[<assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority")>]
[<assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority")>]
[<assembly: AutoOpen("Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority")>]
#endif
[<assembly: AutoOpen("Microsoft.FSharp.Linq.QueryRunExtensions.LowPriority")>]
[<assembly: AutoOpen("Microsoft.FSharp.Linq.QueryRunExtensions.HighPriority")>]
do ()
......
......@@ -4856,8 +4856,7 @@ namespace Microsoft.FSharp.Core
[<assembly: System.Runtime.InteropServices.ComVisible(false)>]
[<assembly: System.CLSCompliant(true)>]
[<assembly: System.Security.SecurityTransparent>] // assembly is fully transparent
#if CROSS_PLATFORM_COMPILER
#else
#if !CROSS_PLATFORM_COMPILER
[<assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level2)>] // v4 transparency; soon to be the default, but not yet
#endif
do ()
......
......@@ -9,7 +9,6 @@
#nowarn "51"
namespace Microsoft.FSharp.Core.CompilerServices
#if !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE
open System
open System.Runtime.CompilerServices
open Microsoft.FSharp.Core
......@@ -444,5 +443,3 @@ module ResumableCode =
//-- RESUMABLE CODE END
else
YieldDynamic(&sm))
#endif
......@@ -2,7 +2,6 @@
namespace Microsoft.FSharp.Core.CompilerServices
#if !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE
open Microsoft.FSharp.Collections
open Microsoft.FSharp.Core
open System
......@@ -66,7 +65,6 @@ and ResumptionFunc<'Data> = delegate of byref<ResumableStateMachine<'Data>> -> b
type ResumableCode<'Data, 'T> = delegate of byref<ResumableStateMachine<'Data>> -> bool
/// Contains functions for composing resumable code blocks
[<Microsoft.FSharp.Core.Experimental("Experimental library feature, requires '--langversion:preview'")>]
[<Microsoft.FSharp.Core.RequireQualifiedAccess>]
module ResumableCode =
......@@ -125,7 +123,6 @@ type SetStateMachineMethodImpl<'Data> = delegate of byref<ResumableStateMachine<
type AfterCode<'Data, 'Result> = delegate of byref<ResumableStateMachine<'Data>> -> 'Result
/// Contains compiler intrinsics related to the definition of state machines.
[<Microsoft.FSharp.Core.Experimental("Experimental library feature, requires '--langversion:preview'")>]
module StateMachineHelpers =
/// <summary>
......@@ -231,5 +228,3 @@ type NoEagerConstraintApplicationAttribute =
/// <summary>Creates an instance of the attribute</summary>
/// <returns>NoEagerConstraintApplicationAttribute</returns>
new : unit -> NoEagerConstraintApplicationAttribute
#endif
......@@ -13,7 +13,6 @@
namespace Microsoft.FSharp.Control
#if !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE
open System
open System.Runtime.CompilerServices
open System.Threading
......@@ -464,5 +463,3 @@ module MediumPriority =
member inline this.ReturnFrom(computation: Async<'T>) : TaskCode<'T, 'T> =
this.ReturnFrom(Async.StartAsTask computation)
#endif
......@@ -4,7 +4,6 @@
namespace Microsoft.FSharp.Control
#if !BUILDING_WITH_LKG && !BUILD_FROM_SOURCE
open System
open System.Runtime.CompilerServices
open System.Threading.Tasks
......@@ -286,4 +285,3 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
task: Task<'TResult1> *
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> bool
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册