Skip to content

Commit ba3700e

Browse files
authored
Merge pull request #18464 from dotnet/merge/main-to-release/dev18.0
[automated] Merge branch 'main' => 'release/dev18.0'
2 parents 0d8fedb + 21ba49d commit ba3700e

File tree

26 files changed

+319
-132
lines changed

26 files changed

+319
-132
lines changed

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<clear />
99
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
1010
<!-- Begin: Package sources from DotNet-msbuild-Trusted -->
11-
<add key="darc-pub-DotNet-msbuild-Trusted-0ca03f8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-0ca03f84/nuget/v3/index.json" />
11+
<add key="darc-pub-DotNet-msbuild-Trusted-8e42d4a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-8e42d4a4/nuget/v3/index.json" />
1212
<!-- End: Package sources from DotNet-msbuild-Trusted -->
1313
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
1414
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />

docs/release-notes/.FSharp.Compiler.Service/9.0.300.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
* Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401))
2525
* Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436))
2626
* Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457))
27+
* Make `[<CallerMemberName; Struct>]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/))
2728

2829
### Added
2930
* Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241))
3031
* The 'use' keyword can be used on IDisposable|null without nullness warnings ([PR #18262](https://github.com/dotnet/fsharp/pull/18262))
3132
* Add support for C# `Experimental` attribute. ([PR #18253](https://github.com/dotnet/fsharp/pull/18253))
3233
* Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186))
3334
* Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290))
35+
* Type checker: don't suppress errors while checking expressions ([PR #18311](https://github.com/dotnet/fsharp/pull/18311))
3436
* Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323))
3537
* Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
3638
* Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394)

eng/Version.Details.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@
77
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
88
</Dependency>
99
<!-- Intermediate is necessary for source build. -->
10-
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.13.22-preview-25174-08">
10+
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.13.23-preview-25208-06">
1111
<Uri>https://github.com/dotnet/msbuild</Uri>
12-
<Sha>0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30</Sha>
12+
<Sha>8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff</Sha>
1313
<SourceBuild RepoName="msbuild" ManagedOnly="true" />
1414
</Dependency>
15-
<Dependency Name="Microsoft.Build" Version="17.13.22">
15+
<Dependency Name="Microsoft.Build" Version="17.13.23">
1616
<Uri>https://github.com/dotnet/msbuild</Uri>
17-
<Sha>0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30</Sha>
17+
<Sha>8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff</Sha>
1818
</Dependency>
19-
<Dependency Name="Microsoft.Build.Framework" Version="17.13.22">
19+
<Dependency Name="Microsoft.Build.Framework" Version="17.13.23">
2020
<Uri>https://github.com/dotnet/msbuild</Uri>
21-
<Sha>0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30</Sha>
21+
<Sha>8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff</Sha>
2222
</Dependency>
23-
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.13.22">
23+
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.13.23">
2424
<Uri>https://github.com/dotnet/msbuild</Uri>
25-
<Sha>0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30</Sha>
25+
<Sha>8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff</Sha>
2626
</Dependency>
27-
<Dependency Name="Microsoft.Build.Utilities.Core" Version="17.13.22">
27+
<Dependency Name="Microsoft.Build.Utilities.Core" Version="17.13.23">
2828
<Uri>https://github.com/dotnet/msbuild</Uri>
29-
<Sha>0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30</Sha>
29+
<Sha>8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff</Sha>
3030
</Dependency>
3131
<Dependency Name="System.Reflection.Metadata" Version="8.0.0">
3232
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -42,14 +42,14 @@
4242
</Dependency>
4343
</ProductDependencies>
4444
<ToolsetDependencies>
45-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25204.5">
45+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25208.6">
4646
<Uri>https://github.com/dotnet/arcade</Uri>
47-
<Sha>97cbc7361ff28b2948c8182720c166a744049f55</Sha>
47+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
4848
</Dependency>
4949
<!-- Intermediate is necessary for source build. -->
50-
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25204.5">
50+
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25208.6">
5151
<Uri>https://github.com/dotnet/arcade</Uri>
52-
<Sha>97cbc7361ff28b2948c8182720c166a744049f55</Sha>
52+
<Sha>aa61e8c20a869bcc994f8b29eb07d927d2bec6f4</Sha>
5353
<SourceBuild RepoName="arcade" ManagedOnly="true" />
5454
</Dependency>
5555
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2">

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<MicrosoftVisualStudioShellPackagesVersion>17.10.40152</MicrosoftVisualStudioShellPackagesVersion>
103103
<VisualStudioProjectSystemPackagesVersion>17.10.526-pre-g1b474069f5</VisualStudioProjectSystemPackagesVersion>
104104
<MicrosoftVisualStudioThreadingPackagesVersion>17.10.41</MicrosoftVisualStudioThreadingPackagesVersion>
105-
<MicrosoftBuildVersion>17.13.22</MicrosoftBuildVersion>
105+
<MicrosoftBuildVersion>17.13.23</MicrosoftBuildVersion>
106106
<!-- Roslyn packages -->
107107
<MicrosoftCodeAnalysisEditorFeaturesVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesVersion>
108108
<MicrosoftCodeAnalysisEditorFeaturesTextVersion>$(RoslynVersion)</MicrosoftCodeAnalysisEditorFeaturesTextVersion>
@@ -138,9 +138,9 @@
138138
<MicrosoftVisualStudioShellImmutable150Version>15.0.25123-Dev15Preview</MicrosoftVisualStudioShellImmutable150Version>
139139
<!-- -->
140140
<!-- Microsoft Build packages -->
141-
<MicrosoftBuildFrameworkVersion>17.13.22</MicrosoftBuildFrameworkVersion>
142-
<MicrosoftBuildTasksCoreVersion>17.13.22</MicrosoftBuildTasksCoreVersion>
143-
<MicrosoftBuildUtilitiesCoreVersion>17.13.22</MicrosoftBuildUtilitiesCoreVersion>
141+
<MicrosoftBuildFrameworkVersion>17.13.23</MicrosoftBuildFrameworkVersion>
142+
<MicrosoftBuildTasksCoreVersion>17.13.23</MicrosoftBuildTasksCoreVersion>
143+
<MicrosoftBuildUtilitiesCoreVersion>17.13.23</MicrosoftBuildUtilitiesCoreVersion>
144144
<!-- -->
145145
<!-- Visual Studio Editor packages -->
146146
<MicrosoftVisualStudioCoreUtilityVersion>$(VisualStudioEditorPackagesVersion)</MicrosoftVisualStudioCoreUtilityVersion>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"perl": "5.38.2.2"
1818
},
1919
"msbuild-sdks": {
20-
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25204.5",
20+
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25208.6",
2121
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2222
}
2323
}

src/Compiler/Checking/Expressions/CheckExpressions.fs

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5960,7 +5960,7 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE
59605960

59615961
| SynExpr.FromParseError (expr1, m) ->
59625962
//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
59645964
mkDefault(m, overallTy.Commit), tpenv
59655965

59665966
| SynExpr.Sequential (sp, dir, synExpr1, synExpr2, m, _) ->
@@ -6489,9 +6489,7 @@ and TcIteratedLambdas (cenv: cenv) isFirst (env: TcEnv) overallTy takenNames tpe
64896489

64906490
| e ->
64916491
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
64956493

64966494
and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed =
64976495
match delayed with
@@ -11103,39 +11101,33 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt
1110311101
// At each module binding, dive into the expression to check for syntax errors and suppress them if they show.
1110411102
// Don't do this for lambdas, because we always check for suppression for all lambda bodies in TcIteratedLambdas
1110511103
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
1113411126

11135-
let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow }
11127+
let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow }
1113611128

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
1113911131

1114011132
if kind = SynBindingKind.StandaloneExpression && not cenv.isScript then
1114111133
UnifyUnitType cenv env mBinding overallPatTy rhsExprChecked |> ignore<bool>

src/Compiler/Checking/MethodCalls.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ let inline mkOptionalNone (g: TcGlobals) ty calledArgTy mMethExpr =
348348
else
349349
mkNone g calledArgTy mMethExpr
350350

351+
let inline mkOptionalSome (g: TcGlobals) outerOptTy innerNonOptionalType expr mMethExpr =
352+
if g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g outerOptTy then
353+
mkValueSome g innerNonOptionalType expr mMethExpr
354+
else
355+
mkSome g innerNonOptionalType expr mMethExpr
356+
351357

352358
/// Adjust the called argument type to take into account whether the caller's argument is CSharpMethod(?arg=Some(3)) or CSharpMethod(arg=1)
353359
let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableOptionalsKnownTypes (calledArg: CalledArg) calledArgTy (callerArg: CallerArg<_>) =
@@ -1502,14 +1508,14 @@ let GetDefaultExpressionForCalleeSideOptionalArg g (calledArg: CalledArg) eCalle
15021508
match calledArg.CallerInfo, eCallerMemberName with
15031509
| CallerLineNumber, _ when typeEquiv g calledNonOptTy g.int_ty ->
15041510
let lineExpr = Expr.Const(Const.Int32 mMethExpr.StartLine, mMethExpr, calledNonOptTy)
1505-
mkSome g calledNonOptTy lineExpr mMethExpr
1511+
mkOptionalSome g calledArgTy calledNonOptTy lineExpr mMethExpr
15061512
| CallerFilePath, _ when typeEquiv g calledNonOptTy g.string_ty ->
15071513
let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply g.pathMap
15081514
let filePathExpr = Expr.Const (Const.String(fileName), mMethExpr, calledNonOptTy)
1509-
mkSome g calledNonOptTy filePathExpr mMethExpr
1515+
mkOptionalSome g calledArgTy calledNonOptTy filePathExpr mMethExpr
15101516
| CallerMemberName, Some(callerName) when typeEquiv g calledNonOptTy g.string_ty ->
15111517
let memberNameExpr = Expr.Const (Const.String callerName, mMethExpr, calledNonOptTy)
1512-
mkSome g calledNonOptTy memberNameExpr mMethExpr
1518+
mkOptionalSome g calledArgTy calledNonOptTy memberNameExpr mMethExpr
15131519
| _ ->
15141520
mkOptionalNone g calledArgTy calledNonOptTy mMethExpr
15151521

src/Compiler/Checking/PostInferenceChecks.fs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,13 +2398,25 @@ let CheckEntityDefn cenv env (tycon: Entity) =
23982398
errorR(Error(FSComp.SR.chkCurriedMethodsCantHaveOutParams(), m))
23992399

24002400
if numCurriedArgSets = 1 then
2401-
let errorIfNotStringTy m ty callerInfo =
2401+
2402+
let inline tryDestOptionalTy g ty =
2403+
if isOptionTy g ty then
2404+
destOptionTy g ty |> ValueSome
2405+
elif g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g ty then
2406+
destValueOptionTy g ty |> ValueSome
2407+
else
2408+
ValueNone
2409+
2410+
let errorIfNotStringTy m ty callerInfo =
24022411
if not (typeEquiv g g.string_ty ty) then
24032412
errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m))
2413+
2414+
let errorIfNotOptional tyToCompare desiredTyName m ty callerInfo =
24042415

2405-
let errorIfNotStringOptionTy m ty callerInfo =
2406-
if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then
2407-
errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m))
2416+
match tryDestOptionalTy g ty with
2417+
| ValueSome t when typeEquiv g tyToCompare t -> ()
2418+
| ValueSome innerTy -> errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, desiredTyName, NicePrint.minimalStringOfType cenv.denv innerTy), m))
2419+
| ValueNone -> errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, desiredTyName, NicePrint.minimalStringOfType cenv.denv ty), m))
24082420

24092421
minfo.GetParamDatas(cenv.amap, m, minfo.FormalMethodInst)
24102422
|> List.iterSquared (fun (ParamData(_, isInArg, _, optArgInfo, callerInfo, nameOpt, _, ty)) ->
@@ -2421,11 +2433,9 @@ let CheckEntityDefn cenv env (tycon: Entity) =
24212433
| CallerSide _, CallerLineNumber ->
24222434
if not (typeEquiv g g.int32_ty ty) then
24232435
errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "int", NicePrint.minimalStringOfType cenv.denv ty), m))
2424-
| CalleeSide, CallerLineNumber ->
2425-
if not ((isOptionTy g ty) && (typeEquiv g g.int32_ty (destOptionTy g ty))) then
2426-
errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "int", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m))
2436+
| CalleeSide, CallerLineNumber -> errorIfNotOptional g.int32_ty "int" m ty callerInfo
24272437
| CallerSide _, (CallerFilePath | CallerMemberName) -> errorIfNotStringTy m ty callerInfo
2428-
| CalleeSide, (CallerFilePath | CallerMemberName) -> errorIfNotStringOptionTy m ty callerInfo
2438+
| CalleeSide, (CallerFilePath | CallerMemberName) -> errorIfNotOptional g.string_ty "string" m ty callerInfo
24292439
)
24302440

24312441
for pinfo in immediateProps do

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,4 +609,41 @@ but here has type
609609
''T option'
610610
but here has type
611611
''a voption' "
612-
]
612+
]
613+
614+
[<Fact>]
615+
let ``Struct optional args can have caller member name`` () =
616+
617+
let source = """module TestLib
618+
open System.Runtime.CompilerServices
619+
620+
let printItOut x =
621+
printf "%s" $"{x};"
622+
623+
type Ab() =
624+
625+
static member aa ([<CallerMemberName; Struct>]?b: string) =
626+
printItOut b
627+
628+
static member bb ([<CallerLineNumber; Struct>]?i: int) =
629+
printItOut i
630+
631+
[<EntryPoint>]
632+
let main _args =
633+
Ab.aa()
634+
Ab.bb()
635+
Ab.aa("hello")
636+
Ab.bb(42)
637+
0
638+
"""
639+
640+
source
641+
|> FSharp
642+
|> withLangVersionPreview
643+
|> withNoWarn 25
644+
|> asExe
645+
|> compile
646+
|> ILVerifierModule.verifyPEFileWithSystemDlls
647+
|> run
648+
|> verifyOutputContains [|"main;18;hello;42;"|]
649+

tests/FSharp.Compiler.Service.Tests/Common.fs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ let mkProjectCommandLineArgsForScript (dllName, fileNames) =
119119
yield "--doc:test.xml"
120120
yield "--warn:3"
121121
yield "--fullpaths"
122-
yield "--flaterrors"
123122
yield "--target:library"
124123
for x in fileNames do
125124
yield x
@@ -370,11 +369,17 @@ let inline dumpDiagnostics (results: FSharpCheckFileResults) =
370369
|> Array.map (fun e ->
371370
let message =
372371
e.Message.Split('\n')
373-
|> Array.map (fun s -> s.Trim())
372+
|> Array.map _.Trim()
373+
|> Array.filter (fun s -> s.Length > 0)
374374
|> String.concat " "
375375
sprintf "%s: %s" (e.Range.ToString()) message)
376376
|> List.ofArray
377377

378+
let inline dumpDiagnosticNumbers (results: FSharpCheckFileResults) =
379+
results.Diagnostics
380+
|> Array.map (fun e -> e.Range.ToString(), e.ErrorNumber)
381+
|> List.ofArray
382+
378383
let getSymbolUses (results: FSharpCheckFileResults) =
379384
results.GetAllUsesOfAllSymbolsInFile()
380385

0 commit comments

Comments
 (0)