This commit is contained in:
parent
b4ee219266
commit
ca3eb6f3c1
|
|
@ -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)
|
||||
|
|
|
|||
7
TestSuite/intellisense_tests/ispattern4.pas
Normal file
7
TestSuite/intellisense_tests/ispattern4.pas
Normal 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.
|
||||
Loading…
Reference in a new issue