Skip to content

Commit

Permalink
add generics10.pas in test suite (for pascalabcnet#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibond84 committed Mar 2, 2017
1 parent 22e529d commit 7b31f58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CodeCompletion/DomSyntaxTreeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ public override void visit(program_module _program_module)
#endif
}
}
if (_program_module.program_block.program_code != null)
if (cur_scope != null && _program_module.program_block.program_code != null)
{
cur_scope.body_loc = new location(_program_module.program_block.program_code.left_logical_bracket.source_context.end_position.line_num,
_program_module.program_block.program_code.left_logical_bracket.source_context.end_position.column_num,
Expand Down
5 changes: 5 additions & 0 deletions TestSuite/generics10.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
begin
var arr := Range(1,5).Select(i->i.ToString).ToArray;
assert(arr[0] = '1');
assert(arr[4] = '5');
end.

0 comments on commit 7b31f58

Please sign in to comment.