Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track CheckDeclarations.CheckModuleSignature activity. #16534

Merged
merged 2 commits into from
Jan 16, 2024
Merged
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
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
Loading