All files

src/compiler/module_resolution.panack

Green: covered; red: known zero; amber: unavailable. Blank lines are outside the executable-start-line denominator.

    1 import "module_bindings.panack"
    2 
    3 // Edges retain import order; paths are resolved by the loader, not guessed by
    4 // the semantic resolver. Aliases and re-exports never mint declaration IDs.
    5 record ModuleImportEdge {
    6   owner: ModuleIdentity,
    7   index: Nat,
    8   target: ModuleIdentity
    9 }
   10 
   11 record ModuleBindingGraph {
   12   modules: [ModuleBindings],
   13   edges: [ModuleImportEdge]
   14 }
   15 
   16 enum ResolvedModuleTarget {
   17   DeclarationTarget(ModuleDeclarationBinding),
   18   NamespaceTarget(ModuleIdentity)
   19 }
   20 
   21 record ResolvedModuleReference {
   22   spelling: Str,
   23   target: ResolvedModuleTarget,
   24   span: SourceSpan
   25 }
   26 
   27 pure binding_graph_module(graph: ModuleBindingGraph, identity: ModuleIdentity): Result[ModuleBindings,Str] {
   28   mut found: Option[ModuleBindings] = None()
   29   mut count: Nat = 0
   30   for module in graph.modules {
   31     if module.identity == identity { found = Some(module); count = count + 1 }
   32   }
   33   if count > 1 { Error("duplicate module identity " + identity.path) }
   34   else { match found {
   35     None() => Error("missing module " + identity.path),
   36     Some(module) => Ok(module)
   37   } }
   38 }
   39 
   40 pure binding_graph_target(graph: ModuleBindingGraph, identity: ModuleIdentity, index: Nat): Result[ModuleIdentity,Str] {
   41   mut found: Option[ModuleIdentity] = None()
   42   mut count: Nat = 0
   43   for edge in graph.edges {
   44     if edge.owner == identity && edge.index == index { found = Some(edge.target); count = count + 1 }
   45   }
   46   if count > 1 { Error("ambiguous import target in " + identity.path) }
   47   else { match found {
   48     None() => Error("missing import target in " + identity.path),
   49     Some(target) => Ok(target)
   50   } }
   51 }
   52 
   53 pure module_identity_in(identities: [ModuleIdentity], identity: ModuleIdentity): Bool {
   54   mut found: Bool = false
   55   for candidate in identities { found = found || candidate == identity }
   56   found
   57 }
   58 
   59 pure module_cycle_text(stack: [ModuleIdentity], identity: ModuleIdentity): Str {
   60   mut text: Str = ""
   61   for item in stack { text = text + item.path + " -> " }
   62   "module import cycle: " + text + identity.path
   63 }
   64 
   65 record ModuleGraphWalk {
   66   completed: [ModuleIdentity],
   67   error: Option[Str]
   68 }
   69 
   70 pure binding_graph_visit(graph: ModuleBindingGraph, identity: ModuleIdentity, stack: [ModuleIdentity], state: ModuleGraphWalk): ModuleGraphWalk {
   71   if module_identity_in(state.completed, identity) { state }
   72   else { if module_identity_in(stack, identity) { ModuleGraphWalk(state.completed, Some(module_cycle_text(stack, identity))) }
   73   else {
   74     match binding_graph_module(graph, identity) {
   75       Error(message) => ModuleGraphWalk(state.completed, Some(message)),
   76       Ok(module) => {
   77         mut current: ModuleGraphWalk = state
   78         mut index: Nat = 0
   79         for imported in module.imports {
   80           match current.error {
   81             Some(message) => {},
   82             None() => match binding_graph_target(graph, identity, index) {
   83               Error(message) => { current = ModuleGraphWalk(current.completed, Some(message)) },
   84               Ok(target) => { current = binding_graph_visit(graph, target, append(stack, identity), current) }
   85             }
   86           }
   87           index = index + 1
   88         }
   89         match current.error {
   90           Some(message) => current,
   91           None() => ModuleGraphWalk(append(current.completed, identity), None())
   92         }
   93       }
   94     }
   95   } }
   96 }
   97 
   98 pure walk_module_graph(graph: ModuleBindingGraph): ModuleGraphWalk {
   99   mut state: ModuleGraphWalk = ModuleGraphWalk([], None())
  100   for module in graph.modules {
  101     match state.error {
  102       Some(message) => {},
  103       None() => { state = binding_graph_visit(graph, module.identity, [], state) }
  104     }
  105   }
  106   state
  107 }
  108 
  109 pure resolve_enum_member(graph: ModuleBindingGraph, declaration: ModuleDeclarationBinding, member: Str): Result[ResolvedModuleTarget,Str] {
  110   match declaration.kind {
  111     ModuleEnum() => match binding_graph_module(graph, declaration.identity.module) {
  112       Error(message) => Error(message),
  113       Ok(module) => {
  114         mut found: Option[ModuleDeclarationBinding] = None()
  115         for candidate in module.declarations {
  116           if candidate.kind == ModuleVariant(declaration.identity.name) && candidate.identity.name == member { found = Some(candidate) }
  117         }
  118         match found {
  119           None() => Error("enum " + declaration.identity.name + " has no variant " + member),
  120           Some(variant) => Ok(DeclarationTarget(variant))
  121         }
  122       }
  123     },
  124     ModuleFunction() => Error("function is not a namespace: " + declaration.identity.name),
  125     ModuleGuardedType() => Error("guarded type is not a namespace: " + declaration.identity.name),
  126     ModuleRecord() => Error("record is not a namespace: " + declaration.identity.name),
  127     ModuleVariant(parent) => Error("variant is not a namespace: " + declaration.identity.name)
  128   }
  129 }
  130 
  131 pure resolve_target_member(graph: ModuleBindingGraph, target: ResolvedModuleTarget, tail: Str, stack: [ModuleIdentity]): Result[ResolvedModuleTarget,Str] {
  132   if tail == "" { Ok(target) }
  133   else { match target {
  134     NamespaceTarget(identity) => resolve_module_path_inner(graph, identity, tail, true, stack),
  135     DeclarationTarget(declaration) => resolve_enum_member(graph, declaration, tail)
  136   } }
  137 }
  138 
  139 pure resolve_module_path_inner(graph: ModuleBindingGraph, identity: ModuleIdentity, spelling: Str, exported: Bool, stack: [ModuleIdentity]): Result[ResolvedModuleTarget,Str] {
  140   if module_identity_in(stack, identity) { Error(module_cycle_text(stack, identity)) }
  141   else { match binding_graph_module(graph, identity) {
  142     Error(message) => Error(message),
  143     Ok(module) => {
  144       conflicts: [Diagnostic] = module_binding_diagnostics(module)
  145       if len(conflicts) > 0 { Error(conflicts[0].message) }
  146       else {
  147         head: Str = reference_head(spelling)
  148         tail: Str = reference_tail(spelling)
  149         next_stack: [ModuleIdentity] = append(stack, identity)
  150         mut found: Bool = false
  151         mut result: Result[ResolvedModuleTarget,Str] = Error("module " + identity.path + " has no binding " + spelling)
  152         for declaration in module.declarations {
  153           if declaration.identity.name == head {
  154             // A variant has a bare name only inside its declaring module.
  155             selectable: Bool = match declaration.kind {
  156               ModuleVariant(parent) => !exported,
  157               ModuleFunction() => true, ModuleGuardedType() => true,
  158               ModuleRecord() => true, ModuleEnum() => true
  159             }
  160             if selectable {
  161               found = true
  162               if exported && !declaration.is_public {
  163                 result = Error("module declaration " + head + " is private in " + identity.path)
  164               } else { result = resolve_target_member(graph, DeclarationTarget(declaration), tail, next_stack) }
  165             }
  166           }
  167         }
  168         mut index: Nat = 0
  169         for imported in module.imports {
  170           for selector in module_import_names(imported) {
  171             if !found && selector.alias == head {
  172               found = true
  173               if exported && !imported.is_public {
  174                 result = Error("import binding " + head + " is private in " + identity.path)
  175               } else {
  176                 match binding_graph_target(graph, identity, index) {
  177                   Error(message) => { result = Error(message) },
  178                   Ok(target) => {
  179                     selected: Result[ResolvedModuleTarget,Str] = if selector.name == "" {
  180                       Ok(NamespaceTarget(target))
  181                     } else { resolve_module_path_inner(graph, target, selector.name, true, next_stack) }
  182                     result = match selected {
  183                       Error(message) => Error(message),
  184                       Ok(binding) => resolve_target_member(graph, binding, tail, next_stack)
  185                     }
  186                   }
  187                 }
  188               }
  189             }
  190           }
  191           index = index + 1
  192         }
  193         result
  194       }
  195     }
  196   } }
  197 }
  198 
  199 pure resolve_module_path(graph: ModuleBindingGraph, identity: ModuleIdentity, spelling: Str): Result[ResolvedModuleTarget,Str] {
  200   resolve_module_path_inner(graph, identity, spelling, false, [])
  201 }
  202 
  203 // Validate imports even when no use refers to them. No transitive opening or
  204 // load-order fallback is permitted; every selective binding checks visibility.
  205 pure module_graph_diagnostics(graph: ModuleBindingGraph): [Diagnostic] {
  206   mut diagnostics: [Diagnostic] = []
  207   walked: ModuleGraphWalk = walk_module_graph(graph)
  208   match walked.error {
  209     None() => {},
  210     Some(message) => { diagnostics = append(diagnostics, Diagnostic(message, SourcePos("", 0, 1, 1))) }
  211   }
  212   for module in graph.modules {
  213     diagnostics = concat(diagnostics, module_binding_diagnostics(module))
  214     mut index: Nat = 0
  215     for imported in module.imports {
  216       match binding_graph_target(graph, module.identity, index) {
  217         Error(message) => { diagnostics = append(diagnostics, Diagnostic(message, imported.span.start)) },
  218         Ok(target) => {
  219           match binding_graph_module(graph, target) {
  220             Error(message) => { diagnostics = append(diagnostics, Diagnostic(message, imported.span.start)) },
  221             Ok(target_module) => {
  222               for selector in module_import_names(imported) {
  223                 if selector.name != "" {
  224                   match resolve_module_path_inner(graph, target, selector.name, true, []) {
  225                     Error(message) => { diagnostics = append(diagnostics, Diagnostic(message, selector.span.start)) },
  226                     Ok(binding) => {}
  227                   }
  228                 }
  229               }
  230             }
  231           }
  232         }
  233       }
  234       index = index + 1
  235     }
  236   }
  237   diagnostics
  238 }
  239 
  240 // Namespace/value disambiguation is explicit and precedes reserved core method
  241 // lowering. Value receivers stay raw until checked-identity integration.
  242 enum ResolvedDotCall {
  243   NamespaceCall(ModuleDeclarationBinding, [Expr], [Str]),
  244   ValueMethodCall(Expr, Str, [Expr], [Str])
  245 }
  246 
  247 pure resolve_module_dot_call_scoped(graph: ModuleBindingGraph, identity: ModuleIdentity, target: Expr, name: Str, arguments: [Expr], types: [Str], locals: Set[Str]): Result[ResolvedDotCall,Str] {
  248   path: Str = expression_reference_path(target)
  249   if path == "" || locals.has(reference_head(path)) { Ok(ValueMethodCall(target, name, arguments, types)) }
  250   else {
  251     match resolve_module_path(graph, identity, reference_head(path)) {
  252       Error(message) => Ok(ValueMethodCall(target, name, arguments, types)),
  253       Ok(binding) => {
  254         namespace_receiver: Bool = match binding {
  255           NamespaceTarget(owner) => true,
  256           DeclarationTarget(declaration) => declaration.kind == ModuleEnum()
  257         }
  258         if !namespace_receiver { Ok(ValueMethodCall(target, name, arguments, types)) }
  259         else {
  260           match resolve_module_path(graph, identity, path + "." + name) {
  261             Error(message) => Error(message),
  262             Ok(resolved) => match resolved {
  263               NamespaceTarget(owner) => Error("namespace cannot be called: " + path + "." + name),
  264               DeclarationTarget(declaration) => match declaration.kind {
  265                 ModuleEnum() => Error("enum type cannot be called: " + path + "." + name),
  266                 ModuleFunction() => Ok(NamespaceCall(declaration, arguments, types)),
  267                 ModuleGuardedType() => Ok(NamespaceCall(declaration, arguments, types)),
  268                 ModuleRecord() => Ok(NamespaceCall(declaration, arguments, types)),
  269                 ModuleVariant(parent) => Ok(NamespaceCall(declaration, arguments, types))
  270               }
  271             }
  272           }
  273         }
  274       }
  275     }
  276   }
  277 }
  278 
  279 pure resolve_module_type(graph: ModuleBindingGraph, identity: ModuleIdentity, name: Str): Result[ModuleDeclarationBinding,Str] {
  280   match resolve_module_path(graph, identity, name) {
  281     Error(message) => Error(message),
  282     Ok(target) => match target {
  283       NamespaceTarget(owner) => Error("namespace is not a type: " + name),
  284       DeclarationTarget(declaration) => match declaration.kind {
  285         ModuleRecord() => Ok(declaration), ModuleEnum() => Ok(declaration), ModuleGuardedType() => Ok(declaration),
  286         ModuleFunction() => Error("function is not a type: " + name),
  287         ModuleVariant(parent) => Error("variant is not a type: " + name)
  288       }
  289     }
  290   }
  291 }
  292 
  293 pure resolve_module_function(graph: ModuleBindingGraph, identity: ModuleIdentity, name: Str): Result[ModuleDeclarationBinding,Str] {
  294   match resolve_module_path(graph, identity, name) {
  295     Error(message) => Error(message),
  296     Ok(target) => match target {
  297       NamespaceTarget(owner) => Error("namespace is not a function: " + name),
  298       DeclarationTarget(declaration) => {
  299         if declaration.kind == ModuleFunction() { Ok(declaration) }
  300         else { Error("declaration is not a function: " + name) }
  301       }
  302     }
  303   }
  304 }
  305 
  306 record ResolvedModuleUses {
  307   references: [ResolvedModuleReference],
  308   diagnostics: [Diagnostic]
  309 }
  310 
  311 pure combine_module_uses(left: ResolvedModuleUses, right: ResolvedModuleUses): ResolvedModuleUses {
  312   ResolvedModuleUses(concat(left.references, right.references), concat(left.diagnostics, right.diagnostics))
  313 }
  314 
  315 pure module_use_result(spelling: Str, span: SourceSpan, resolved: Result[ResolvedModuleTarget,Str]): ResolvedModuleUses {
  316   match resolved {
  317     Error(message) => ResolvedModuleUses([], [Diagnostic(message, span.start)]),
  318     Ok(target) => ResolvedModuleUses([ResolvedModuleReference(spelling, target, span)], [])
  319   }
  320 }
  321 
  322 // Retain each qualified nominal leaf, including nested arrays/generic arguments.
  323 // Arity, core/type-parameter validation and substitutions belong to the checker.
  324 pure resolve_qualified_type_uses(graph: ModuleBindingGraph, identity: ModuleIdentity, type_name: Str, span: SourceSpan): ResolvedModuleUses {
  325   mut result: ResolvedModuleUses = ResolvedModuleUses([], [])
  326   match lex(type_name) {
  327     Error(errors) => { result = ResolvedModuleUses([], errors) },
  328     Ok(tokens) => {
  329       mut index: Nat = 0
  330       while index < len(tokens) {
  331         if tokens[index].kind == Identifier() {
  332           match parse_reference_path(tokens, index) {
  333             Error(error) => { index = len(tokens); result = combine_module_uses(result, ResolvedModuleUses([], [error])) },
  334             Ok(path) => {
  335               if type_has_qualification(path.text) {
  336                 resolved: Result[ResolvedModuleTarget,Str] = match resolve_module_type(graph, identity, path.text) {
  337                   Error(message) => Error(message), Ok(binding) => Ok(DeclarationTarget(binding))
  338                 }
  339                 result = combine_module_uses(result, module_use_result(path.text, span, resolved))
  340               }
  341               index = path.next
  342             }
  343           }
  344         } else { index = index + 1 }
  345       }
  346     }
  347   }
  348   result
  349 }
  350 
  351 pure module_head_is_namespace(graph: ModuleBindingGraph, identity: ModuleIdentity, path: Str): Bool {
  352   match resolve_module_path(graph, identity, reference_head(path)) {
  353     Error(message) => false,
  354     Ok(target) => match target {
  355       NamespaceTarget(owner) => true,
  356       DeclarationTarget(declaration) => declaration.kind == ModuleEnum()
  357     }
  358   }
  359 }
  360 
  361 pure resolve_module_expression_uses(graph: ModuleBindingGraph, identity: ModuleIdentity, expression: Expr, origin: SourceSpan, locals: Set[Str]): ResolvedModuleUses {
  362   mut result: ResolvedModuleUses = ResolvedModuleUses([], [])
  363   match expression {
  364     LocatedExpr(span, value) => { result = resolve_module_expression_uses(graph, identity, value, span, locals) },
  365     DotCallExpr(target, name, arguments, types) => {
  366       match resolve_module_dot_call_scoped(graph, identity, target, name, arguments, types, locals) {
  367         Error(message) => { result = ResolvedModuleUses([], [Diagnostic(message, origin.start)]) },
  368         Ok(call) => match call {
  369           NamespaceCall(declaration, values, type_arguments) => {
  370             result = module_use_result(expression_reference_path(target) + "." + name, origin, Ok(DeclarationTarget(declaration)))
  371           },
  372           ValueMethodCall(receiver, method, values, type_arguments) => {
  373             result = resolve_module_expression_uses(graph, identity, receiver, origin, locals)
  374             if !module_reserved_binding(method) && lowered_method_name(method) == method {
  375               method_target: Result[ResolvedModuleTarget,Str] = match resolve_module_function(graph, identity, method) {
  376                 Error(message) => Error(message), Ok(binding) => Ok(DeclarationTarget(binding))
  377               }
  378               result = combine_module_uses(result, module_use_result(method, origin, method_target))
  379             }
  380           }
  381         }
  382       }
  383       for argument in arguments { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, argument, origin, locals)) }
  384       for type_name in types { result = combine_module_uses(result, resolve_qualified_type_uses(graph, identity, type_name, origin)) }
  385     },
  386     FunctionExpr(name) => {
  387       resolved: Result[ResolvedModuleTarget,Str] = match resolve_module_function(graph, identity, name) {
  388         Error(message) => Error(message), Ok(binding) => Ok(DeclarationTarget(binding))
  389       }
  390       result = module_use_result(name, origin, resolved)
  391     },
  392     FieldExpr(target, field) => {
  393       path: Str = expression_reference_path(expression)
  394       if path != "" && !locals.has(reference_head(path)) && module_head_is_namespace(graph, identity, path) {
  395         resolved: Result[ResolvedModuleTarget,Str] = match resolve_module_path(graph, identity, path) {
  396           Error(message) => Error(message),
  397           Ok(binding) => Error("qualified binding is not a value: " + path)
  398         }
  399         result = module_use_result(path, origin, resolved)
  400       } else { result = resolve_module_expression_uses(graph, identity, target, origin, locals) }
  401     },
  402     NameExpr(name) => {
  403       if !locals.has(name) && module_head_is_namespace(graph, identity, name) {
  404         result = ResolvedModuleUses([], [Diagnostic("namespace or enum type is not a value: " + name, origin.start)])
  405       }
  406     },
  407     CallExpr(name, arguments, types) => {
  408       if !module_reserved_binding(name) {
  409         resolved: Result[ResolvedModuleTarget,Str] = match resolve_module_path(graph, identity, name) {
  410           Error(message) => Error(message),
  411           Ok(binding) => match binding {
  412             NamespaceTarget(owner) => Error("namespace cannot be called: " + name),
  413             DeclarationTarget(declaration) => {
  414               if declaration.kind == ModuleEnum() { Error("enum type cannot be called: " + name) }
  415               else { Ok(binding) }
  416             }
  417           }
  418         }
  419         result = module_use_result(name, origin, resolved)
  420       }
  421       for argument in arguments { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, argument, origin, locals)) }
  422       for type_name in types { result = combine_module_uses(result, resolve_qualified_type_uses(graph, identity, type_name, origin)) }
  423     },
  424     ArrayExpr(items) => { for item in items { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, item, origin, locals)) } },
  425     UnaryExpr(operator, operand) => { result = resolve_module_expression_uses(graph, identity, operand, origin, locals) },
  426     BinaryExpr(operator, left, right) => { result = combine_module_uses(resolve_module_expression_uses(graph, identity, left, origin, locals), resolve_module_expression_uses(graph, identity, right, origin, locals)) },
  427     IndexExpr(target, index) => { result = combine_module_uses(resolve_module_expression_uses(graph, identity, target, origin, locals), resolve_module_expression_uses(graph, identity, index, origin, locals)) },
  428     IfExpr(condition, yes, no, has_else) => {
  429       result = resolve_module_expression_uses(graph, identity, condition, origin, locals)
  430       result = combine_module_uses(result, resolve_module_block_uses(graph, identity, yes, origin, locals))
  431       result = combine_module_uses(result, resolve_module_block_uses(graph, identity, no, origin, locals))
  432     },
  433     BlockExpr(block) => { result = resolve_module_block_uses(graph, identity, block, origin, locals) },
  434     MatchExpr(subject, arms) => {
  435       result = resolve_module_expression_uses(graph, identity, subject, origin, locals)
  436       for arm in arms {
  437         name: Str = arm.pattern.variant
  438         if type_has_qualification(name) {
  439           resolved: Result[ResolvedModuleTarget,Str] = match resolve_module_path(graph, identity, name) {
  440             Error(message) => Error(message),
  441             Ok(binding) => match binding {
  442               NamespaceTarget(owner) => Error("namespace is not a variant: " + name),
  443               DeclarationTarget(declaration) => match declaration.kind {
  444                 ModuleVariant(parent) => Ok(binding),
  445                 ModuleFunction() => Error("declaration is not a variant: " + name),
  446                 ModuleRecord() => Error("declaration is not a variant: " + name),
  447                 ModuleEnum() => Error("declaration is not a variant: " + name),
  448                 ModuleGuardedType() => Error("declaration is not a variant: " + name)
  449               }
  450             }
  451           }
  452           result = combine_module_uses(result, module_use_result(name, origin, resolved))
  453         }
  454         mut arm_locals: Set[Str] = locals
  455         for binding in arm.pattern.bindings { arm_locals = arm_locals.add(binding) }
  456         result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, arm.body, origin, arm_locals))
  457       }
  458     },
  459     NatExpr(value) => {}, DecimalExpr(text) => {}, StringExpr(text) => {}, BoolExpr(value) => {}
  460   }
  461   result
  462 }
  463 
  464 pure resolve_module_block_uses(graph: ModuleBindingGraph, identity: ModuleIdentity, block: Block, origin: SourceSpan, locals: Set[Str]): ResolvedModuleUses {
  465   mut result: ResolvedModuleUses = ResolvedModuleUses([], [])
  466   mut visible: Set[Str] = locals
  467   for statement in block.statements {
  468     match statement {
  469       BindingStatement(name, type_name, mutable, value) => {
  470         result = combine_module_uses(result, resolve_qualified_type_uses(graph, identity, type_name, origin))
  471         result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, value, origin, visible))
  472         visible = visible.add(name)
  473       },
  474       AssignmentStatement(name, value) => { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, value, origin, visible)); visible = visible.add(name) },
  475       ExpressionStatement(value) => { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, value, origin, visible)) },
  476       WhileStatement(condition, body) => {
  477         result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, condition, origin, visible))
  478         result = combine_module_uses(result, resolve_module_block_uses(graph, identity, body, origin, visible))
  479       },
  480       ForStatement(name, values, body) => {
  481         result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, values, origin, visible))
  482         result = combine_module_uses(result, resolve_module_block_uses(graph, identity, body, origin, visible.add(name)))
  483       }
  484     }
  485   }
  486   match block.value {
  487     NoBlockValue() => {},
  488     TailBlockValue(value) => { result = combine_module_uses(result, resolve_module_expression_uses(graph, identity, value, origin, visible)) }
  489   }
  490   result
  491 }
  492 
  493 pure imported_binding_names(module: ModuleBindings): Set[Str] {
  494   mut names: Set[Str] = set()
  495   for imported in module.imports {
  496     for selector in module_import_names(imported) { names = names.add(selector.alias) }
  497   }
  498   names
  499 }
  500 
  501 pure import_shadow_diagnostic(names: Set[Str], name: Str, origin: SourceSpan): [Diagnostic] {
  502   if names.has(name) { [Diagnostic("local binding " + name + " conflicts with an import binding", origin.start)] }
  503   else { [] }
  504 }
  505 
  506 pure expression_import_shadows(expression: Expr, names: Set[Str], origin: SourceSpan): [Diagnostic] {
  507   mut diagnostics: [Diagnostic] = []
  508   match expression {
  509     LocatedExpr(span, value) => { diagnostics = expression_import_shadows(value, names, span) },
  510     DotCallExpr(target, name, arguments, types) => {
  511       diagnostics = expression_import_shadows(target, names, origin)
  512       for argument in arguments { diagnostics = concat(diagnostics, expression_import_shadows(argument, names, origin)) }
  513     },
  514     CallExpr(name, arguments, types) => { for argument in arguments { diagnostics = concat(diagnostics, expression_import_shadows(argument, names, origin)) } },
  515     ArrayExpr(items) => { for item in items { diagnostics = concat(diagnostics, expression_import_shadows(item, names, origin)) } },
  516     UnaryExpr(operator, operand) => { diagnostics = expression_import_shadows(operand, names, origin) },
  517     BinaryExpr(operator, left, right) => { diagnostics = concat(expression_import_shadows(left, names, origin), expression_import_shadows(right, names, origin)) },
  518     FieldExpr(target, field) => { diagnostics = expression_import_shadows(target, names, origin) },
  519     IndexExpr(target, index) => { diagnostics = concat(expression_import_shadows(target, names, origin), expression_import_shadows(index, names, origin)) },
  520     IfExpr(condition, yes, no, has_else) => {
  521       diagnostics = expression_import_shadows(condition, names, origin)
  522       diagnostics = concat(diagnostics, block_import_shadows(yes, names, origin))
  523       diagnostics = concat(diagnostics, block_import_shadows(no, names, origin))
  524     },
  525     BlockExpr(block) => { diagnostics = block_import_shadows(block, names, origin) },
  526     MatchExpr(subject, arms) => {
  527       diagnostics = expression_import_shadows(subject, names, origin)
  528       for arm in arms {
  529         for name in arm.pattern.bindings { diagnostics = concat(diagnostics, import_shadow_diagnostic(names, name, origin)) }
  530         diagnostics = concat(diagnostics, expression_import_shadows(arm.body, names, origin))
  531       }
  532     },
  533     NatExpr(value) => {}, DecimalExpr(text) => {}, StringExpr(text) => {},
  534     BoolExpr(value) => {}, NameExpr(name) => {}, FunctionExpr(name) => {}
  535   }
  536   diagnostics
  537 }
  538 
  539 pure block_import_shadows(block: Block, names: Set[Str], origin: SourceSpan): [Diagnostic] {
  540   mut diagnostics: [Diagnostic] = []
  541   for statement in block.statements {
  542     match statement {
  543       BindingStatement(name, type_name, mutable, value) => {
  544         diagnostics = concat(diagnostics, import_shadow_diagnostic(names, name, origin))
  545         diagnostics = concat(diagnostics, expression_import_shadows(value, names, origin))
  546       },
  547       AssignmentStatement(name, value) => {
  548         diagnostics = concat(diagnostics, import_shadow_diagnostic(names, name, origin))
  549         diagnostics = concat(diagnostics, expression_import_shadows(value, names, origin))
  550       },
  551       ExpressionStatement(value) => { diagnostics = concat(diagnostics, expression_import_shadows(value, names, origin)) },
  552       WhileStatement(condition, body) => {
  553         diagnostics = concat(diagnostics, expression_import_shadows(condition, names, origin))
  554         diagnostics = concat(diagnostics, block_import_shadows(body, names, origin))
  555       },
  556       ForStatement(name, values, body) => {
  557         diagnostics = concat(diagnostics, import_shadow_diagnostic(names, name, origin))
  558         diagnostics = concat(diagnostics, expression_import_shadows(values, names, origin))
  559         diagnostics = concat(diagnostics, block_import_shadows(body, names, origin))
  560       }
  561     }
  562   }
  563   match block.value {
  564     NoBlockValue() => {},
  565     TailBlockValue(value) => { diagnostics = concat(diagnostics, expression_import_shadows(value, names, origin)) }
  566   }
  567   diagnostics
  568 }
  569 
  570 pure module_import_shadow_diagnostics(module: ModuleBindings, parsed: ParsedModule): [Diagnostic] {
  571   names: Set[Str] = imported_binding_names(module)
  572   mut diagnostics: [Diagnostic] = []
  573   mut index: Nat = 0
  574   for declaration in parsed.program.declarations {
  575     origin: SourceSpan = parsed.syntax[index].span
  576     match declaration {
  577       ImportDeclaration(path) => {},
  578       TypeDeclaration(name, base, guard) => {
  579         diagnostics = concat(diagnostics, import_shadow_diagnostic(names, "value", origin))
  580         diagnostics = concat(diagnostics, expression_import_shadows(guard, names, origin))
  581       },
  582       RecordDeclaration(name, parameters, fields) => {
  583         for parameter in parameters { diagnostics = concat(diagnostics, import_shadow_diagnostic(names, parameter, origin)) }
  584       },
  585       EnumDeclaration(name, parameters, variants) => {
  586         for parameter in parameters { diagnostics = concat(diagnostics, import_shadow_diagnostic(names, parameter, origin)) }
  587       },
  588       FunctionDeclaration(name, parameters, return_type, is_pure, is_async, body, type_parameters) => {
  589         for parameter in parameters { diagnostics = concat(diagnostics, import_shadow_diagnostic(names, parameter.name, origin)) }
  590         for parameter in type_parameters { diagnostics = concat(diagnostics, import_shadow_diagnostic(names, parameter, origin)) }
  591         diagnostics = concat(diagnostics, block_import_shadows(body, names, origin))
  592       }
  593     }
  594     index = index + 1
  595   }
  596   diagnostics
  597 }
  598 
  599 pure resolve_module_dot_call(graph: ModuleBindingGraph, identity: ModuleIdentity, target: Expr, name: Str, arguments: [Expr], types: [Str]): Result[ResolvedDotCall,Str] {
  600   resolve_module_dot_call_scoped(graph, identity, target, name, arguments, types, set())
  601 }
  602 

Functions

[
  {
    "id": "declaration/5",
    "name": "binding_graph_module",
    "line": 27,
    "state": "covered",
    "entries": "719"
  },
  {
    "id": "declaration/6",
    "name": "binding_graph_target",
    "line": 40,
    "state": "covered",
    "entries": "338"
  },
  {
    "id": "declaration/7",
    "name": "module_identity_in",
    "line": 53,
    "state": "covered",
    "entries": "710"
  },
  {
    "id": "declaration/8",
    "name": "module_cycle_text",
    "line": 59,
    "state": "covered",
    "entries": "1"
  },
  {
    "id": "declaration/10",
    "name": "binding_graph_visit",
    "line": 70,
    "state": "covered",
    "entries": "138"
  },
  {
    "id": "declaration/11",
    "name": "walk_module_graph",
    "line": 98,
    "state": "covered",
    "entries": "8"
  },
  {
    "id": "declaration/12",
    "name": "resolve_enum_member",
    "line": 109,
    "state": "covered",
    "entries": "33"
  },
  {
    "id": "declaration/13",
    "name": "resolve_target_member",
    "line": 131,
    "state": "covered",
    "entries": "440"
  },
  {
    "id": "declaration/14",
    "name": "resolve_module_path_inner",
    "line": 139,
    "state": "covered",
    "entries": "453"
  },
  {
    "id": "declaration/15",
    "name": "resolve_module_path",
    "line": 199,
    "state": "covered",
    "entries": "284"
  },
  {
    "id": "declaration/16",
    "name": "module_graph_diagnostics",
    "line": 205,
    "state": "covered",
    "entries": "6"
  },
  {
    "id": "declaration/18",
    "name": "resolve_module_dot_call_scoped",
    "line": 247,
    "state": "covered",
    "entries": "65"
  },
  {
    "id": "declaration/19",
    "name": "resolve_module_type",
    "line": 279,
    "state": "covered",
    "entries": "91"
  },
  {
    "id": "declaration/20",
    "name": "resolve_module_function",
    "line": 293,
    "state": "covered",
    "entries": "11"
  },
  {
    "id": "declaration/22",
    "name": "combine_module_uses",
    "line": 311,
    "state": "covered",
    "entries": "150"
  },
  {
    "id": "declaration/23",
    "name": "module_use_result",
    "line": 315,
    "state": "covered",
    "entries": "25"
  },
  {
    "id": "declaration/24",
    "name": "resolve_qualified_type_uses",
    "line": 324,
    "state": "covered",
    "entries": "55"
  },
  {
    "id": "declaration/25",
    "name": "module_head_is_namespace",
    "line": 351,
    "state": "covered",
    "entries": "2"
  },
  {
    "id": "declaration/26",
    "name": "resolve_module_expression_uses",
    "line": 361,
    "state": "covered",
    "entries": "176"
  },
  {
    "id": "declaration/27",
    "name": "resolve_module_block_uses",
    "line": 464,
    "state": "covered",
    "entries": "32"
  },
  {
    "id": "declaration/28",
    "name": "imported_binding_names",
    "line": 493,
    "state": "covered",
    "entries": "257"
  },
  {
    "id": "declaration/29",
    "name": "import_shadow_diagnostic",
    "line": 501,
    "state": "covered",
    "entries": "323"
  },
  {
    "id": "declaration/30",
    "name": "expression_import_shadows",
    "line": 506,
    "state": "covered",
    "entries": "1848"
  },
  {
    "id": "declaration/31",
    "name": "block_import_shadows",
    "line": 539,
    "state": "covered",
    "entries": "380"
  },
  {
    "id": "declaration/32",
    "name": "module_import_shadow_diagnostics",
    "line": 570,
    "state": "covered",
    "entries": "257"
  },
  {
    "id": "declaration/33",
    "name": "resolve_module_dot_call",
    "line": 599,
    "state": "covered",
    "entries": "4"
  }
]

Source branch outcomes

[
  {
    "id": "declaration/5/statement/2/decision/body",
    "outcome": "body",
    "line": 30,
    "state": "covered",
    "hits": "2868"
  },
  {
    "id": "declaration/5/statement/2/decision/exit",
    "outcome": "exit",
    "line": 30,
    "state": "covered",
    "hits": "719"
  },
  {
    "id": "declaration/5/statement/2/body/tail/decision/true",
    "outcome": "true",
    "line": 31,
    "state": "covered",
    "hits": "720"
  },
  {
    "id": "declaration/5/statement/2/body/tail/decision/false",
    "outcome": "false",
    "line": 31,
    "state": "covered",
    "hits": "2148"
  },
  {
    "id": "declaration/5/tail/decision/true",
    "outcome": "true",
    "line": 33,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/5/tail/decision/false",
    "outcome": "false",
    "line": 33,
    "state": "covered",
    "hits": "718"
  },
  {
    "id": "declaration/5/tail/false/tail/arm/0",
    "outcome": "None",
    "line": 35,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/5/tail/false/tail/arm/1",
    "outcome": "Some",
    "line": 36,
    "state": "covered",
    "hits": "718"
  },
  {
    "id": "declaration/6/statement/2/decision/body",
    "outcome": "body",
    "line": 43,
    "state": "covered",
    "hits": "4218"
  },
  {
    "id": "declaration/6/statement/2/decision/exit",
    "outcome": "exit",
    "line": 43,
    "state": "covered",
    "hits": "338"
  },
  {
    "id": "declaration/6/statement/2/body/tail/decision/true",
    "outcome": "true",
    "line": 44,
    "state": "covered",
    "hits": "330"
  },
  {
    "id": "declaration/6/statement/2/body/tail/decision/false",
    "outcome": "false",
    "line": 44,
    "state": "covered",
    "hits": "3888"
  },
  {
    "id": "declaration/6/statement/2/body/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 44,
    "state": "covered",
    "hits": "905"
  },
  {
    "id": "declaration/6/statement/2/body/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 44,
    "state": "covered",
    "hits": "3313"
  },
  {
    "id": "declaration/6/tail/decision/true",
    "outcome": "true",
    "line": 46,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/6/tail/decision/false",
    "outcome": "false",
    "line": 46,
    "state": "covered",
    "hits": "338"
  },
  {
    "id": "declaration/6/tail/false/tail/arm/0",
    "outcome": "None",
    "line": 48,
    "state": "covered",
    "hits": "8"
  },
  {
    "id": "declaration/6/tail/false/tail/arm/1",
    "outcome": "Some",
    "line": 49,
    "state": "covered",
    "hits": "330"
  },
  {
    "id": "declaration/7/statement/1/decision/body",
    "outcome": "body",
    "line": 55,
    "state": "covered",
    "hits": "1047"
  },
  {
    "id": "declaration/7/statement/1/decision/exit",
    "outcome": "exit",
    "line": 55,
    "state": "covered",
    "hits": "710"
  },
  {
    "id": "declaration/7/statement/1/body/statement/0/value/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 55,
    "state": "covered",
    "hits": "1022"
  },
  {
    "id": "declaration/7/statement/1/body/statement/0/value/decision/skip-right",
    "outcome": "skip-right",
    "line": 55,
    "state": "covered",
    "hits": "25"
  },
  {
    "id": "declaration/8/statement/1/decision/body",
    "outcome": "body",
    "line": 61,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/8/statement/1/decision/exit",
    "outcome": "exit",
    "line": 61,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/10/tail/decision/true",
    "outcome": "true",
    "line": 71,
    "state": "covered",
    "hits": "86"
  },
  {
    "id": "declaration/10/tail/decision/false",
    "outcome": "false",
    "line": 71,
    "state": "covered",
    "hits": "52"
  },
  {
    "id": "declaration/10/tail/false/tail/decision/true",
    "outcome": "true",
    "line": 72,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/10/tail/false/tail/decision/false",
    "outcome": "false",
    "line": 72,
    "state": "covered",
    "hits": "51"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/0",
    "outcome": "Error",
    "line": 75,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1",
    "outcome": "Ok",
    "line": 76,
    "state": "covered",
    "hits": "50"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/decision/body",
    "outcome": "body",
    "line": 79,
    "state": "covered",
    "hits": "92"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/decision/exit",
    "outcome": "exit",
    "line": 79,
    "state": "covered",
    "hits": "50"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/body/statement/0/value/arm/0",
    "outcome": "Some",
    "line": 81,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/body/statement/0/value/arm/1",
    "outcome": "None",
    "line": 82,
    "state": "covered",
    "hits": "89"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/body/statement/0/value/arm/1/body/arm/0",
    "outcome": "Error",
    "line": 83,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/statement/2/body/statement/0/value/arm/1/body/arm/1",
    "outcome": "Ok",
    "line": 84,
    "state": "covered",
    "hits": "88"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/tail/arm/0",
    "outcome": "Some",
    "line": 90,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/10/tail/false/tail/false/tail/arm/1/body/block/tail/arm/1",
    "outcome": "None",
    "line": 91,
    "state": "covered",
    "hits": "47"
  },
  {
    "id": "declaration/11/statement/1/decision/body",
    "outcome": "body",
    "line": 100,
    "state": "covered",
    "hits": "58"
  },
  {
    "id": "declaration/11/statement/1/decision/exit",
    "outcome": "exit",
    "line": 100,
    "state": "covered",
    "hits": "8"
  },
  {
    "id": "declaration/11/statement/1/body/tail/arm/0",
    "outcome": "Some",
    "line": 102,
    "state": "covered",
    "hits": "8"
  },
  {
    "id": "declaration/11/statement/1/body/tail/arm/1",
    "outcome": "None",
    "line": 103,
    "state": "covered",
    "hits": "50"
  },
  {
    "id": "declaration/12/tail/arm/0",
    "outcome": "ModuleEnum",
    "line": 111,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/0",
    "outcome": "Error",
    "line": 112,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1",
    "outcome": "Ok",
    "line": 113,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 115,
    "state": "covered",
    "hits": "244"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 115,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/body/tail/decision/true",
    "outcome": "true",
    "line": 116,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/body/tail/decision/false",
    "outcome": "false",
    "line": 116,
    "state": "covered",
    "hits": "211"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/body/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 116,
    "state": "covered",
    "hits": "58"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/statement/1/body/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 116,
    "state": "covered",
    "hits": "186"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/tail/arm/0",
    "outcome": "None",
    "line": 119,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/12/tail/arm/0/body/arm/1/body/block/tail/arm/1",
    "outcome": "Some",
    "line": 120,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/12/tail/arm/1",
    "outcome": "ModuleFunction",
    "line": 124,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/12/tail/arm/2",
    "outcome": "ModuleGuardedType",
    "line": 125,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/12/tail/arm/3",
    "outcome": "ModuleRecord",
    "line": 126,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/12/tail/arm/4",
    "outcome": "ModuleVariant",
    "line": 127,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/13/tail/decision/true",
    "outcome": "true",
    "line": 132,
    "state": "covered",
    "hits": "307"
  },
  {
    "id": "declaration/13/tail/decision/false",
    "outcome": "false",
    "line": 132,
    "state": "covered",
    "hits": "133"
  },
  {
    "id": "declaration/13/tail/false/tail/arm/0",
    "outcome": "NamespaceTarget",
    "line": 134,
    "state": "covered",
    "hits": "100"
  },
  {
    "id": "declaration/13/tail/false/tail/arm/1",
    "outcome": "DeclarationTarget",
    "line": 135,
    "state": "covered",
    "hits": "33"
  },
  {
    "id": "declaration/14/tail/decision/true",
    "outcome": "true",
    "line": 140,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/14/tail/decision/false",
    "outcome": "false",
    "line": 140,
    "state": "covered",
    "hits": "453"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/0",
    "outcome": "Error",
    "line": 142,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1",
    "outcome": "Ok",
    "line": 143,
    "state": "covered",
    "hits": "453"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/decision/true",
    "outcome": "true",
    "line": 145,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/decision/false",
    "outcome": "false",
    "line": 145,
    "state": "covered",
    "hits": "453"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/decision/body",
    "outcome": "body",
    "line": 152,
    "state": "covered",
    "hits": "1527"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/decision/exit",
    "outcome": "exit",
    "line": 152,
    "state": "covered",
    "hits": "453"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/decision/true",
    "outcome": "true",
    "line": 153,
    "state": "covered",
    "hits": "282"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/decision/false",
    "outcome": "false",
    "line": 153,
    "state": "covered",
    "hits": "1245"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/statement/0/value/arm/0",
    "outcome": "ModuleVariant",
    "line": 156,
    "state": "covered",
    "hits": "13"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/statement/0/value/arm/1",
    "outcome": "ModuleFunction",
    "line": 157,
    "state": "covered",
    "hits": "80"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/statement/0/value/arm/2",
    "outcome": "ModuleGuardedType",
    "line": 157,
    "state": "covered",
    "hits": "5"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/statement/0/value/arm/3",
    "outcome": "ModuleRecord",
    "line": 158,
    "state": "covered",
    "hits": "115"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/statement/0/value/arm/4",
    "outcome": "ModuleEnum",
    "line": 158,
    "state": "covered",
    "hits": "69"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/decision/true",
    "outcome": "true",
    "line": 160,
    "state": "covered",
    "hits": "281"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/decision/false",
    "outcome": "false",
    "line": 160,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/true/tail/decision/true",
    "outcome": "true",
    "line": 162,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/true/tail/decision/false",
    "outcome": "false",
    "line": 162,
    "state": "covered",
    "hits": "277"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/true/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 162,
    "state": "covered",
    "hits": "141"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/5/body/tail/true/tail/true/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 162,
    "state": "covered",
    "hits": "140"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/decision/body",
    "outcome": "body",
    "line": 169,
    "state": "covered",
    "hits": "523"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/decision/exit",
    "outcome": "exit",
    "line": 169,
    "state": "covered",
    "hits": "453"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/decision/body",
    "outcome": "body",
    "line": 170,
    "state": "covered",
    "hits": "706"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/decision/exit",
    "outcome": "exit",
    "line": 170,
    "state": "covered",
    "hits": "523"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/decision/true",
    "outcome": "true",
    "line": 171,
    "state": "covered",
    "hits": "165"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/decision/false",
    "outcome": "false",
    "line": 171,
    "state": "covered",
    "hits": "541"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 171,
    "state": "covered",
    "hits": "321"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 171,
    "state": "covered",
    "hits": "385"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/decision/true",
    "outcome": "true",
    "line": 173,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/decision/false",
    "outcome": "false",
    "line": 173,
    "state": "covered",
    "hits": "163"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 173,
    "state": "covered",
    "hits": "25"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 173,
    "state": "covered",
    "hits": "140"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/0",
    "outcome": "Error",
    "line": 177,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/1",
    "outcome": "Ok",
    "line": 178,
    "state": "covered",
    "hits": "163"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/1/body/block/statement/0/value/decision/true",
    "outcome": "true",
    "line": 179,
    "state": "covered",
    "hits": "128"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/1/body/block/statement/0/value/decision/false",
    "outcome": "false",
    "line": 179,
    "state": "covered",
    "hits": "35"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/1/body/block/statement/1/value/arm/0",
    "outcome": "Error",
    "line": 183,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/14/tail/false/tail/arm/1/body/block/tail/false/statement/7/body/statement/0/body/tail/true/tail/false/tail/arm/1/body/block/statement/1/value/arm/1",
    "outcome": "Ok",
    "line": 184,
    "state": "covered",
    "hits": "163"
  },
  {
    "id": "declaration/16/statement/2/value/arm/0",
    "outcome": "None",
    "line": 209,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/16/statement/2/value/arm/1",
    "outcome": "Some",
    "line": 210,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/16/statement/3/decision/body",
    "outcome": "body",
    "line": 212,
    "state": "covered",
    "hits": "37"
  },
  {
    "id": "declaration/16/statement/3/decision/exit",
    "outcome": "exit",
    "line": 212,
    "state": "covered",
    "hits": "6"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/decision/body",
    "outcome": "body",
    "line": 215,
    "state": "covered",
    "hits": "67"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/decision/exit",
    "outcome": "exit",
    "line": 215,
    "state": "covered",
    "hits": "37"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 217,
    "state": "covered",
    "hits": "7"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 218,
    "state": "covered",
    "hits": "60"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/0",
    "outcome": "Error",
    "line": 220,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1",
    "outcome": "Ok",
    "line": 221,
    "state": "covered",
    "hits": "60"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 222,
    "state": "covered",
    "hits": "77"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 222,
    "state": "covered",
    "hits": "60"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/body/tail/decision/true",
    "outcome": "true",
    "line": 223,
    "state": "covered",
    "hits": "25"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/body/tail/decision/false",
    "outcome": "false",
    "line": 223,
    "state": "covered",
    "hits": "52"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/body/tail/true/tail/arm/0",
    "outcome": "Error",
    "line": 225,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/16/statement/3/body/statement/2/body/statement/0/value/arm/1/body/block/tail/arm/1/body/block/statement/0/body/tail/true/tail/arm/1",
    "outcome": "Ok",
    "line": 226,
    "state": "covered",
    "hits": "24"
  },
  {
    "id": "declaration/18/tail/decision/true",
    "outcome": "true",
    "line": 249,
    "state": "covered",
    "hits": "29"
  },
  {
    "id": "declaration/18/tail/decision/false",
    "outcome": "false",
    "line": 249,
    "state": "covered",
    "hits": "36"
  },
  {
    "id": "declaration/18/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 249,
    "state": "covered",
    "hits": "55"
  },
  {
    "id": "declaration/18/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 249,
    "state": "covered",
    "hits": "10"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/0",
    "outcome": "Error",
    "line": 252,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1",
    "outcome": "Ok",
    "line": 253,
    "state": "covered",
    "hits": "34"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/statement/0/value/arm/0",
    "outcome": "NamespaceTarget",
    "line": 255,
    "state": "covered",
    "hits": "25"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/statement/0/value/arm/1",
    "outcome": "DeclarationTarget",
    "line": 256,
    "state": "covered",
    "hits": "9"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/decision/true",
    "outcome": "true",
    "line": 258,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/decision/false",
    "outcome": "false",
    "line": 258,
    "state": "covered",
    "hits": "34"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/0",
    "outcome": "Error",
    "line": 261,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1",
    "outcome": "Ok",
    "line": 262,
    "state": "covered",
    "hits": "31"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 263,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 264,
    "state": "covered",
    "hits": "31"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1/body/arm/0",
    "outcome": "ModuleEnum",
    "line": 265,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1/body/arm/1",
    "outcome": "ModuleFunction",
    "line": 266,
    "state": "covered",
    "hits": "8"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1/body/arm/2",
    "outcome": "ModuleGuardedType",
    "line": 267,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1/body/arm/3",
    "outcome": "ModuleRecord",
    "line": 268,
    "state": "covered",
    "hits": "13"
  },
  {
    "id": "declaration/18/tail/false/tail/arm/1/body/block/tail/false/tail/arm/1/body/arm/1/body/arm/4",
    "outcome": "ModuleVariant",
    "line": 269,
    "state": "covered",
    "hits": "10"
  },
  {
    "id": "declaration/19/tail/arm/0",
    "outcome": "Error",
    "line": 281,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/19/tail/arm/1",
    "outcome": "Ok",
    "line": 282,
    "state": "covered",
    "hits": "91"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 283,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 284,
    "state": "covered",
    "hits": "91"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1/body/arm/0",
    "outcome": "ModuleRecord",
    "line": 285,
    "state": "covered",
    "hits": "67"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1/body/arm/1",
    "outcome": "ModuleEnum",
    "line": 285,
    "state": "covered",
    "hits": "18"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1/body/arm/2",
    "outcome": "ModuleGuardedType",
    "line": 285,
    "state": "covered",
    "hits": "5"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1/body/arm/3",
    "outcome": "ModuleFunction",
    "line": 286,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/19/tail/arm/1/body/arm/1/body/arm/4",
    "outcome": "ModuleVariant",
    "line": 287,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/20/tail/arm/0",
    "outcome": "Error",
    "line": 295,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/20/tail/arm/1",
    "outcome": "Ok",
    "line": 296,
    "state": "covered",
    "hits": "11"
  },
  {
    "id": "declaration/20/tail/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 297,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/20/tail/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 298,
    "state": "covered",
    "hits": "11"
  },
  {
    "id": "declaration/20/tail/arm/1/body/arm/1/body/block/tail/decision/true",
    "outcome": "true",
    "line": 299,
    "state": "covered",
    "hits": "9"
  },
  {
    "id": "declaration/20/tail/arm/1/body/arm/1/body/block/tail/decision/false",
    "outcome": "false",
    "line": 299,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/23/tail/arm/0",
    "outcome": "Error",
    "line": 317,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/23/tail/arm/1",
    "outcome": "Ok",
    "line": 318,
    "state": "covered",
    "hits": "22"
  },
  {
    "id": "declaration/24/statement/1/value/arm/0",
    "outcome": "Error",
    "line": 327,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1",
    "outcome": "Ok",
    "line": 328,
    "state": "covered",
    "hits": "55"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 330,
    "state": "covered",
    "hits": "76"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 330,
    "state": "covered",
    "hits": "55"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/decision/true",
    "outcome": "true",
    "line": 331,
    "state": "covered",
    "hits": "58"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/decision/false",
    "outcome": "false",
    "line": 331,
    "state": "covered",
    "hits": "18"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/0",
    "outcome": "Error",
    "line": 333,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/1",
    "outcome": "Ok",
    "line": 334,
    "state": "covered",
    "hits": "58"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/1/body/block/statement/0/value/decision/true",
    "outcome": "true",
    "line": 335,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/1/body/block/statement/0/value/decision/false",
    "outcome": "false",
    "line": 335,
    "state": "covered",
    "hits": "54"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/1/body/block/statement/0/value/true/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 337,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/24/statement/1/value/arm/1/body/block/statement/1/body/tail/true/tail/arm/1/body/block/statement/0/value/true/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 337,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/25/tail/arm/0",
    "outcome": "Error",
    "line": 353,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/25/tail/arm/1",
    "outcome": "Ok",
    "line": 354,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/25/tail/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 355,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/25/tail/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 356,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/0",
    "outcome": "LocatedExpr",
    "line": 364,
    "state": "covered",
    "hits": "88"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1",
    "outcome": "DotCallExpr",
    "line": 365,
    "state": "covered",
    "hits": "31"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 367,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 368,
    "state": "covered",
    "hits": "28"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/0",
    "outcome": "NamespaceCall",
    "line": 369,
    "state": "covered",
    "hits": "11"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1",
    "outcome": "ValueMethodCall",
    "line": 372,
    "state": "covered",
    "hits": "17"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/decision/true",
    "outcome": "true",
    "line": 374,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/decision/false",
    "outcome": "false",
    "line": 374,
    "state": "covered",
    "hits": "16"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 374,
    "state": "covered",
    "hits": "12"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 374,
    "state": "covered",
    "hits": "5"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/true/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 376,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/0/value/arm/1/body/arm/1/body/block/tail/true/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 376,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 383,
    "state": "covered",
    "hits": "9"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 383,
    "state": "covered",
    "hits": "31"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/2/decision/body",
    "outcome": "body",
    "line": 384,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/1/body/block/statement/2/decision/exit",
    "outcome": "exit",
    "line": 384,
    "state": "covered",
    "hits": "31"
  },
  {
    "id": "declaration/26/statement/1/value/arm/2",
    "outcome": "FunctionExpr",
    "line": 386,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/2/body/block/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 388,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/2/body/block/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 388,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3",
    "outcome": "FieldExpr",
    "line": 392,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/decision/true",
    "outcome": "true",
    "line": 394,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/decision/false",
    "outcome": "false",
    "line": 394,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 394,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 394,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/condition/left/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 394,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/condition/left/decision/skip-right",
    "outcome": "skip-right",
    "line": 394,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/true/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 396,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/3/body/block/tail/true/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 397,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/4",
    "outcome": "NameExpr",
    "line": 402,
    "state": "covered",
    "hits": "28"
  },
  {
    "id": "declaration/26/statement/1/value/arm/4/body/block/tail/decision/true",
    "outcome": "true",
    "line": 403,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/4/body/block/tail/decision/false",
    "outcome": "false",
    "line": 403,
    "state": "covered",
    "hits": "27"
  },
  {
    "id": "declaration/26/statement/1/value/arm/4/body/block/tail/condition/decision/evaluate-right",
    "outcome": "evaluate-right",
    "line": 403,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/4/body/block/tail/condition/decision/skip-right",
    "outcome": "skip-right",
    "line": 403,
    "state": "covered",
    "hits": "27"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5",
    "outcome": "CallExpr",
    "line": 407,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/decision/true",
    "outcome": "true",
    "line": 408,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/decision/false",
    "outcome": "false",
    "line": 408,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 410,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 411,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 412,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 413,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/1/body/arm/1/body/block/tail/decision/true",
    "outcome": "true",
    "line": 414,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/0/value/true/statement/0/value/arm/1/body/arm/1/body/block/tail/decision/false",
    "outcome": "false",
    "line": 414,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 421,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 421,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/2/decision/body",
    "outcome": "body",
    "line": 422,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/5/body/block/statement/2/decision/exit",
    "outcome": "exit",
    "line": 422,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/6",
    "outcome": "ArrayExpr",
    "line": 424,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/6/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 424,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/6/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 424,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/7",
    "outcome": "UnaryExpr",
    "line": 425,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/8",
    "outcome": "BinaryExpr",
    "line": 426,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/26/statement/1/value/arm/9",
    "outcome": "IndexExpr",
    "line": 427,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/10",
    "outcome": "IfExpr",
    "line": 428,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/11",
    "outcome": "BlockExpr",
    "line": 433,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12",
    "outcome": "MatchExpr",
    "line": 434,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 436,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 436,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/decision/true",
    "outcome": "true",
    "line": 438,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/decision/false",
    "outcome": "false",
    "line": 438,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/0",
    "outcome": "Error",
    "line": 440,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1",
    "outcome": "Ok",
    "line": 441,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/0",
    "outcome": "NamespaceTarget",
    "line": 442,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1",
    "outcome": "DeclarationTarget",
    "line": 443,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1/body/arm/0",
    "outcome": "ModuleVariant",
    "line": 444,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1/body/arm/1",
    "outcome": "ModuleFunction",
    "line": 445,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1/body/arm/2",
    "outcome": "ModuleRecord",
    "line": 446,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1/body/arm/3",
    "outcome": "ModuleEnum",
    "line": 447,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/1/value/true/statement/0/value/arm/1/body/arm/1/body/arm/4",
    "outcome": "ModuleGuardedType",
    "line": 448,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/3/decision/body",
    "outcome": "body",
    "line": 455,
    "state": "covered",
    "hits": "2"
  },
  {
    "id": "declaration/26/statement/1/value/arm/12/body/block/statement/1/body/statement/3/decision/exit",
    "outcome": "exit",
    "line": 455,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/26/statement/1/value/arm/13",
    "outcome": "NatExpr",
    "line": 459,
    "state": "covered",
    "hits": "12"
  },
  {
    "id": "declaration/26/statement/1/value/arm/14",
    "outcome": "DecimalExpr",
    "line": 459,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/26/statement/1/value/arm/15",
    "outcome": "StringExpr",
    "line": 459,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/26/statement/1/value/arm/16",
    "outcome": "BoolExpr",
    "line": 459,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/27/statement/2/decision/body",
    "outcome": "body",
    "line": 467,
    "state": "covered",
    "hits": "5"
  },
  {
    "id": "declaration/27/statement/2/decision/exit",
    "outcome": "exit",
    "line": 467,
    "state": "covered",
    "hits": "32"
  },
  {
    "id": "declaration/27/statement/2/body/tail/arm/0",
    "outcome": "BindingStatement",
    "line": 469,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/27/statement/2/body/tail/arm/1",
    "outcome": "AssignmentStatement",
    "line": 474,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/27/statement/2/body/tail/arm/2",
    "outcome": "ExpressionStatement",
    "line": 475,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/27/statement/2/body/tail/arm/3",
    "outcome": "WhileStatement",
    "line": 476,
    "state": "zero",
    "hits": "0"
  },
  {
    "id": "declaration/27/statement/2/body/tail/arm/4",
    "outcome": "ForStatement",
    "line": 480,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/27/statement/3/value/arm/0",
    "outcome": "NoBlockValue",
    "line": 487,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/27/statement/3/value/arm/1",
    "outcome": "TailBlockValue",
    "line": 488,
    "state": "covered",
    "hits": "28"
  },
  {
    "id": "declaration/28/statement/1/decision/body",
    "outcome": "body",
    "line": 495,
    "state": "covered",
    "hits": "96"
  },
  {
    "id": "declaration/28/statement/1/decision/exit",
    "outcome": "exit",
    "line": 495,
    "state": "covered",
    "hits": "257"
  },
  {
    "id": "declaration/28/statement/1/body/statement/0/decision/body",
    "outcome": "body",
    "line": 496,
    "state": "covered",
    "hits": "124"
  },
  {
    "id": "declaration/28/statement/1/body/statement/0/decision/exit",
    "outcome": "exit",
    "line": 496,
    "state": "covered",
    "hits": "96"
  },
  {
    "id": "declaration/29/tail/decision/true",
    "outcome": "true",
    "line": 502,
    "state": "covered",
    "hits": "7"
  },
  {
    "id": "declaration/29/tail/decision/false",
    "outcome": "false",
    "line": 502,
    "state": "covered",
    "hits": "316"
  },
  {
    "id": "declaration/30/statement/1/value/arm/0",
    "outcome": "LocatedExpr",
    "line": 509,
    "state": "covered",
    "hits": "924"
  },
  {
    "id": "declaration/30/statement/1/value/arm/1",
    "outcome": "DotCallExpr",
    "line": 510,
    "state": "covered",
    "hits": "63"
  },
  {
    "id": "declaration/30/statement/1/value/arm/1/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 512,
    "state": "covered",
    "hits": "27"
  },
  {
    "id": "declaration/30/statement/1/value/arm/1/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 512,
    "state": "covered",
    "hits": "63"
  },
  {
    "id": "declaration/30/statement/1/value/arm/2",
    "outcome": "CallExpr",
    "line": 514,
    "state": "covered",
    "hits": "112"
  },
  {
    "id": "declaration/30/statement/1/value/arm/2/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 514,
    "state": "covered",
    "hits": "87"
  },
  {
    "id": "declaration/30/statement/1/value/arm/2/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 514,
    "state": "covered",
    "hits": "112"
  },
  {
    "id": "declaration/30/statement/1/value/arm/3",
    "outcome": "ArrayExpr",
    "line": 515,
    "state": "covered",
    "hits": "54"
  },
  {
    "id": "declaration/30/statement/1/value/arm/3/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 515,
    "state": "covered",
    "hits": "46"
  },
  {
    "id": "declaration/30/statement/1/value/arm/3/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 515,
    "state": "covered",
    "hits": "54"
  },
  {
    "id": "declaration/30/statement/1/value/arm/4",
    "outcome": "UnaryExpr",
    "line": 516,
    "state": "covered",
    "hits": "13"
  },
  {
    "id": "declaration/30/statement/1/value/arm/5",
    "outcome": "BinaryExpr",
    "line": 517,
    "state": "covered",
    "hits": "51"
  },
  {
    "id": "declaration/30/statement/1/value/arm/6",
    "outcome": "FieldExpr",
    "line": 518,
    "state": "covered",
    "hits": "13"
  },
  {
    "id": "declaration/30/statement/1/value/arm/7",
    "outcome": "IndexExpr",
    "line": 519,
    "state": "covered",
    "hits": "7"
  },
  {
    "id": "declaration/30/statement/1/value/arm/8",
    "outcome": "IfExpr",
    "line": 520,
    "state": "covered",
    "hits": "23"
  },
  {
    "id": "declaration/30/statement/1/value/arm/9",
    "outcome": "BlockExpr",
    "line": 525,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/30/statement/1/value/arm/10",
    "outcome": "MatchExpr",
    "line": 526,
    "state": "covered",
    "hits": "38"
  },
  {
    "id": "declaration/30/statement/1/value/arm/10/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 528,
    "state": "covered",
    "hits": "70"
  },
  {
    "id": "declaration/30/statement/1/value/arm/10/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 528,
    "state": "covered",
    "hits": "38"
  },
  {
    "id": "declaration/30/statement/1/value/arm/10/body/block/statement/1/body/statement/0/decision/body",
    "outcome": "body",
    "line": 529,
    "state": "covered",
    "hits": "37"
  },
  {
    "id": "declaration/30/statement/1/value/arm/10/body/block/statement/1/body/statement/0/decision/exit",
    "outcome": "exit",
    "line": 529,
    "state": "covered",
    "hits": "70"
  },
  {
    "id": "declaration/30/statement/1/value/arm/11",
    "outcome": "NatExpr",
    "line": 533,
    "state": "covered",
    "hits": "228"
  },
  {
    "id": "declaration/30/statement/1/value/arm/12",
    "outcome": "DecimalExpr",
    "line": 533,
    "state": "covered",
    "hits": "1"
  },
  {
    "id": "declaration/30/statement/1/value/arm/13",
    "outcome": "StringExpr",
    "line": 533,
    "state": "covered",
    "hits": "28"
  },
  {
    "id": "declaration/30/statement/1/value/arm/14",
    "outcome": "BoolExpr",
    "line": 534,
    "state": "covered",
    "hits": "18"
  },
  {
    "id": "declaration/30/statement/1/value/arm/15",
    "outcome": "NameExpr",
    "line": 534,
    "state": "covered",
    "hits": "264"
  },
  {
    "id": "declaration/30/statement/1/value/arm/16",
    "outcome": "FunctionExpr",
    "line": 534,
    "state": "covered",
    "hits": "8"
  },
  {
    "id": "declaration/31/statement/1/decision/body",
    "outcome": "body",
    "line": 541,
    "state": "covered",
    "hits": "88"
  },
  {
    "id": "declaration/31/statement/1/decision/exit",
    "outcome": "exit",
    "line": 541,
    "state": "covered",
    "hits": "380"
  },
  {
    "id": "declaration/31/statement/1/body/tail/arm/0",
    "outcome": "BindingStatement",
    "line": 543,
    "state": "covered",
    "hits": "20"
  },
  {
    "id": "declaration/31/statement/1/body/tail/arm/1",
    "outcome": "AssignmentStatement",
    "line": 547,
    "state": "covered",
    "hits": "42"
  },
  {
    "id": "declaration/31/statement/1/body/tail/arm/2",
    "outcome": "ExpressionStatement",
    "line": 551,
    "state": "covered",
    "hits": "10"
  },
  {
    "id": "declaration/31/statement/1/body/tail/arm/3",
    "outcome": "WhileStatement",
    "line": 552,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/31/statement/1/body/tail/arm/4",
    "outcome": "ForStatement",
    "line": 556,
    "state": "covered",
    "hits": "12"
  },
  {
    "id": "declaration/31/statement/2/value/arm/0",
    "outcome": "NoBlockValue",
    "line": 564,
    "state": "covered",
    "hits": "43"
  },
  {
    "id": "declaration/31/statement/2/value/arm/1",
    "outcome": "TailBlockValue",
    "line": 565,
    "state": "covered",
    "hits": "337"
  },
  {
    "id": "declaration/32/statement/3/decision/body",
    "outcome": "body",
    "line": 574,
    "state": "covered",
    "hits": "414"
  },
  {
    "id": "declaration/32/statement/3/decision/exit",
    "outcome": "exit",
    "line": 574,
    "state": "covered",
    "hits": "257"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/0",
    "outcome": "ImportDeclaration",
    "line": 577,
    "state": "covered",
    "hits": "53"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/1",
    "outcome": "TypeDeclaration",
    "line": 578,
    "state": "covered",
    "hits": "3"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/2",
    "outcome": "RecordDeclaration",
    "line": 582,
    "state": "covered",
    "hits": "23"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/2/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 583,
    "state": "covered",
    "hits": "19"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/2/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 583,
    "state": "covered",
    "hits": "23"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/3",
    "outcome": "EnumDeclaration",
    "line": 585,
    "state": "covered",
    "hits": "20"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/3/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 586,
    "state": "covered",
    "hits": "4"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/3/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 586,
    "state": "covered",
    "hits": "20"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/4",
    "outcome": "FunctionDeclaration",
    "line": 588,
    "state": "covered",
    "hits": "315"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/4/body/block/statement/0/decision/body",
    "outcome": "body",
    "line": 589,
    "state": "covered",
    "hits": "154"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/4/body/block/statement/0/decision/exit",
    "outcome": "exit",
    "line": 589,
    "state": "covered",
    "hits": "315"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/4/body/block/statement/1/decision/body",
    "outcome": "body",
    "line": 590,
    "state": "covered",
    "hits": "32"
  },
  {
    "id": "declaration/32/statement/3/body/statement/1/value/arm/4/body/block/statement/1/decision/exit",
    "outcome": "exit",
    "line": 590,
    "state": "covered",
    "hits": "315"
  }
]

Reviewed declaration exclusions

[
  {
    "id": "declaration/0",
    "reason": "import",
    "line": 1
  },
  {
    "id": "declaration/1",
    "reason": "record-declaration",
    "line": 5
  },
  {
    "id": "declaration/2",
    "reason": "record-declaration",
    "line": 11
  },
  {
    "id": "declaration/3",
    "reason": "enum-declaration",
    "line": 16
  },
  {
    "id": "declaration/4",
    "reason": "record-declaration",
    "line": 21
  },
  {
    "id": "declaration/9",
    "reason": "record-declaration",
    "line": 65
  },
  {
    "id": "declaration/17",
    "reason": "enum-declaration",
    "line": 242
  },
  {
    "id": "declaration/21",
    "reason": "record-declaration",
    "line": 306
  }
]