Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ stages:
- name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
buildArguments: '--source-build'
- name: 'Managed_MonoRuntime'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
buildArguments: '--source-build /p:DotNetBuildUseMonoRuntime=true'
enableTelemetry: true
helixRepo: dotnet/fsharp
jobs:
Expand Down
15 changes: 14 additions & 1 deletion src/Compiler/Driver/GraphChecking/FileContentMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

open FSharp.Compiler.Syntax
open FSharp.Compiler.SyntaxTreeOps
open FSharp.Compiler.DiagnosticsLogger

type Continuations = ((FileContentEntry list -> FileContentEntry list) -> FileContentEntry list) list

Expand Down Expand Up @@ -362,7 +363,16 @@ let (|NameofExpr|_|) (e: SynExpr) : NameofResult voption =
| _ -> ValueNone

let visitSynExpr (e: SynExpr) : FileContentEntry list =
#if BUILD_USING_MONO
let rec visitGuarded
(sg: StackGuard)
(e: SynExpr)
(continuation: FileContentEntry list -> FileContentEntry list)
: FileContentEntry list =
let visit e c = sg.Guard(fun () -> visitGuarded sg e c)
#else
let rec visit (e: SynExpr) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list =
#endif
match e with
| NameofExpr nameofResult -> continuation [ visitNameofResult nameofResult ]
| SynExpr.Const _ -> continuation []
Expand Down Expand Up @@ -559,8 +569,11 @@ let visitSynExpr (e: SynExpr) : FileContentEntry list =
| SynExpr.Dynamic(funcExpr, _, argExpr, _) ->
let continuations = List.map visit [ funcExpr; argExpr ]
Continuation.concatenate continuations continuation

#if BUILD_USING_MONO
visitGuarded (StackGuard(nameof (FileContentMapping))) e id
#else
visit e id
#endif

/// Special case of `| nameof Module ->` type of pattern
[<return: Struct>]
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<AssemblyName>FSharp.Compiler.Service</AssemblyName>
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants Condition="$(DotNetBuildUseMonoRuntime) == 'true'">$(DefineConstants);BUILD_USING_MONO</DefineConstants>
<Nullable>enable</Nullable>
<!-- Nullness checking against ns20 base class libraries is very weak, the APIs were not updated with annotations.
Therefore we want to use the latest BCL APIs from NetCurrent.
Expand Down
Loading