This commit is contained in:
Бондарев Иван 2019-04-10 21:00:08 +02:00
parent b4ee219266
commit ca3eb6f3c1
2 changed files with 22 additions and 1 deletions

View file

@ -196,6 +196,13 @@ namespace CodeCompletion
public override void visit(assign _assign)
{
visit_is_patterns(_assign.from);
if (pending_is_pattern_vars.Count > 0)
{
foreach (var_def_statement vds in pending_is_pattern_vars)
vds.visit(this);
pending_is_pattern_vars.Clear();
}
if (_assign.from is function_lambda_definition)
{
_assign.to.visit(this);
@ -847,7 +854,14 @@ namespace CodeCompletion
public override void visit(PascalABCCompiler.SyntaxTree.if_node _if_node)
{
visit_is_patterns(_if_node.condition);
statement then_stmt = merge_with_is_variables(_if_node.then_body);
statement then_stmt = _if_node.then_body;
if (pending_is_pattern_vars.Count > 0 && then_stmt != null)
{
statement_list slist = new statement_list();
slist.source_context = _if_node.source_context;
slist.Add(then_stmt);
then_stmt = merge_with_is_variables(slist);
}
if (then_stmt != null)
then_stmt.visit(this);
if (_if_node.else_body != null)

View file

@ -0,0 +1,7 @@
function f1(o: object) :=
(o is byte(var b)) and (b{@var b: byte;@}=5);
begin
var o: object := byte(5);
if (o is byte(var b)) and (b{@var b: byte;@}=5) then
end.