Skip to content

Commit

Permalink
Merge pull request #66 from jindraivanek/static-let
Browse files Browse the repository at this point in the history
Support "static let" definition.
  • Loading branch information
forki authored Jan 28, 2018
2 parents c134753 + bd89216 commit b02f92f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Mechanic.Tests/FileOrderTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ 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" {
Expand Down
2 changes: 2 additions & 0 deletions src/Mechanic/AstSymbolCollector.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b02f92f

Please sign in to comment.