diff --git a/src/Mechanic.Tests/FileOrderTests.fs b/src/Mechanic.Tests/FileOrderTests.fs index 388b131..e1d1a9a 100644 --- a/src/Mechanic.Tests/FileOrderTests.fs +++ b/src/Mechanic.Tests/FileOrderTests.fs @@ -146,8 +146,21 @@ let expectDependency sources expectedDeps = let y = M.x """ expectDependency [source1; source2] [1,2] + } + + test "file order test let static" { + let source1 = """namespace Test + type T() = + static let x = 42 + """ + let source2 = """namespace Test + module M2 = + let y = T.x + """ + expectDependency [source1; source2] [1,2] } + test "file order test cycle" { let source1 = """module Test1 let x = Test2.y diff --git a/src/Mechanic/AstSymbolCollector.fs b/src/Mechanic/AstSymbolCollector.fs index 9353309..4ee2054 100644 --- a/src/Mechanic/AstSymbolCollector.fs +++ b/src/Mechanic/AstSymbolCollector.fs @@ -32,6 +32,8 @@ let getDefSymbols (tree: ParsedInput) = Some (visitLongIdent lId) | TraverseStep.Module(SynModuleDecl.NestedModule(ComponentInfo(_,_,_,lId,_,_,_,_),_,_,_,_)) -> Some (visitLongIdent lId) + | TraverseStep.TypeDefn(SynTypeDefn.TypeDefn(ComponentInfo(_,_,_,lId,_,_,_,_),_,_,_)) -> + Some (visitLongIdent lId) | _ -> None ) |> List.rev |> String.concat "." let visitor = { new AstVisitorBase<_>() with