-
Notifications
You must be signed in to change notification settings - Fork 832
Experiment: force enable graph checking #18990
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
Changes from all commits
c0637d9
32ff473
10876ed
fdeb4a9
8304a2b
4de8615
602c694
39d75eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,6 +206,7 @@ let mkGraph (filePairs: FilePairMap) (files: FileInProject array) : Graph<FileIn | |
| if file.Idx = 0 then | ||
| // First file cannot have any dependencies. | ||
| Array.empty | ||
|
|
||
| else | ||
| let fileContent = fileContents[file.Idx] | ||
|
|
||
|
|
@@ -235,20 +236,41 @@ let mkGraph (filePairs: FilePairMap) (files: FileInProject array) : Graph<FileIn | |
| | None -> Array.empty | ||
| | Some sigIdx -> Array.singleton sigIdx | ||
|
|
||
| let wrongOrderSignature = | ||
| if file.ParsedInput.IsSigFile then | ||
| match filePairs.TryGetWrongOrderSignatureToImplementationIndex file.Idx with | ||
| | Some idx -> Array.singleton idx | ||
| | None -> Array.empty | ||
| else | ||
| Array.empty | ||
|
|
||
| let allDependencies = | ||
| [| | ||
| yield! depsResult.FoundDependencies | ||
| yield! ghostDependencies | ||
| yield! signatureDependency | ||
| yield! wrongOrderSignature | ||
| |] | ||
| |> Array.distinct | ||
|
|
||
| allDependencies | ||
|
|
||
| let graph = | ||
| // If there is a script in the project, we just process sequentially all the files that may have been added as part of the script closure. | ||
| // That means all files up to the last script file. | ||
| let scriptCompilationLength = | ||
| files |> Array.tryFindIndexBack (fun f -> f.IsScript) |> Option.map (fun idx -> idx + 1) |> Option.defaultValue 0 | ||
|
Comment on lines
+258
to
+261
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, we could just drop down to fully sequential checking in such cases. |
||
|
|
||
| let sequentialPartForScriptCompilation = | ||
| files | ||
| |> Array.take scriptCompilationLength | ||
| |> Array.map (fun file -> file.Idx, [| if file.Idx > 0 then file.Idx - 1 |]) | ||
|
|
||
| let normalPart = | ||
| files | ||
| |> Array.skip scriptCompilationLength | ||
| |> Array.Parallel.map (fun file -> file.Idx, findDependencies file) | ||
| |> readOnlyDict | ||
|
|
||
| let graph = Array.append sequentialPartForScriptCompilation normalPart |> readOnlyDict | ||
|
|
||
| let trie = trie |> Array.last |> snd | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2282,9 +2282,6 @@ module TypecheckTests = | |
| [<Fact>] | ||
| let ``type check neg49`` () = singleNegTest (testConfig "typecheck/sigs") "neg49" | ||
|
|
||
| [<Fact>] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same test is enabled in ComponentTests now. |
||
| let ``type check neg56_a`` () = singleNegTest (testConfig "typecheck/sigs") "neg56_a" | ||
|
|
||
| [<Fact>] | ||
| let ``type check neg94`` () = singleNegTest (testConfig "typecheck/sigs") "neg94" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,12 @@ | ||
|
|
||
| neg14a.fs(9,6,9,33): typecheck error FS0343: The type 'missingInterfaceInSignature' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly | ||
|
|
||
| neg14a.fs(2,8,2,11): typecheck error FS0193: Module 'Lib' requires a type 'z' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Graph checking produces more (valid) diagnostics, why? |
||
|
|
||
| neg14a.fs(2,8,2,11): typecheck error FS0193: Module 'Lib' requires a type 'missingTypeVariableInSignature' | ||
|
|
||
| neg14a.fs(2,8,2,11): typecheck error FS0193: Module 'Lib' requires a type 'missingTypeInImplementation' | ||
|
|
||
| neg14a.fs(2,8,2,11): typecheck error FS0193: Module 'Lib' requires a type 'fieldsInWrongOrder' | ||
|
|
||
| neg14b.fs(2,13,2,14): typecheck error FS0039: The value, constructor, namespace or type 'X' is not defined. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
|
|
||
| neg56_a.fs(11,35,11,47): typecheck error FS1125: The instantiation of the generic type 'list1' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. 'list1<_>'. | ||
|
|
||
| neg56_a.fs(15,18,15,33): typecheck error FS3068: The function or member 'toList' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is 'static member private list1.toList: ('a list1 -> 'a list)'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of ugly code to deal with a single edge case, maybe can be made nicer.