Skip to content

Commit

Permalink
Track CheckDeclarations.CheckModuleSignature activity. (#16534)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf authored Jan 16, 2024
1 parent 2352770 commit f6e0313
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5596,15 +5596,21 @@ let SolveInternalUnknowns g (cenv: cenv) denvAtEnd moduleContents extraAttribs =
if (tp.Rigidity <> TyparRigidity.Rigid) && not tp.IsSolved then
ChooseTyparSolutionAndSolve cenv.css denvAtEnd tp

let CheckModuleSignature g (cenv: cenv) m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig moduleContents =
let CheckModuleSignature g (cenv: cenv) m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig moduleContents fileName qualifiedNameOfFile =
match rootSigOpt with
| None ->
// Deep copy the inferred type of the module
let implFileTypePriorToSigCopied = copyModuleOrNamespaceType g CloneAll implFileTypePriorToSig

(implFileTypePriorToSigCopied, moduleContents)

| Some sigFileType ->
| Some sigFileType ->
use _ =
Activity.start "CheckDeclarations.CheckModuleSignature"
[|
Activity.Tags.fileName, fileName
Activity.Tags.qualifiedNameOfFile, qualifiedNameOfFile
|]

// We want to show imperative type variables in any types in error messages at this late point
let denv = { denvAtEnd with showInferenceTyparAnnotations=true }
Expand Down Expand Up @@ -5730,7 +5736,7 @@ let CheckOneImplFile
// Check the module matches the signature
let implFileTy, implFileContents =
conditionallySuppressErrorReporting (checkForErrors()) (fun () ->
CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig moduleContents)
CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig implFileSpecPriorToSig moduleContents fileName qualNameOfFile.Text)

do
conditionallySuppressErrorReporting (checkForErrors()) (fun () ->
Expand Down

0 comments on commit f6e0313

Please sign in to comment.