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

Provide a unit testing tool that compares the resolved dependency graph with one inferred from a TypedTree. #22

Open
safesparrow opened this issue Nov 15, 2022 · 2 comments

Comments

@safesparrow
Copy link
Owner

safesparrow commented Nov 15, 2022

MVP with an example merged in #18 .

We should productionise/generalise it if it's not already clean/generic enough.

@nojaf
Copy link
Collaborator

nojaf commented Nov 17, 2022

An interesting case I just found is the following:

// A.fs
module A

type A = int

// B.fs
module B 

open A
let b () : A array = [| 0 |]

// C.fs
module C

// The typed tree knows what type A is!
let c = B.b () 

In our current detection we see the following:

A: []
B: [ A ]
C: [ B ]

The typed tree however knows that c is of type A. So it sees this instead:

A: []
B: [ A ]
C: [ A; B ]

This doesn't really affect the outcome of the heuristic. When type-checking A will be known before C is checked. But it does yield incomplete results in the assertion of #18.

I guess to compare both graphs we should include all dependencies as well.

@safesparrow
Copy link
Owner Author

Yes, we should either compare transitive closures of the graphs or trim the graph from the TypedTree and remove duplicates. The former is much easier (eg. Graph transitiveOpt) so probably what we should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants