From eed877dd73fcaca6261e879f3aed84a2bb7cfcbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Sun, 9 Dec 2018 11:28:40 +0100 Subject: [PATCH] fix #1567 --- CodeCompletion/ExpressionVisitor.cs | 2 +- TestSuite/intellisense_tests/invoke.pas | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 TestSuite/intellisense_tests/invoke.pas diff --git a/CodeCompletion/ExpressionVisitor.cs b/CodeCompletion/ExpressionVisitor.cs index 32bbe9b33..e6e200f4a 100644 --- a/CodeCompletion/ExpressionVisitor.cs +++ b/CodeCompletion/ExpressionVisitor.cs @@ -817,7 +817,7 @@ namespace CodeCompletion returned_scope = new ElementScope(ts); } - else if ((returned_scope != null && returned_scope is ElementScope && (returned_scope as ElementScope).sc is CompiledScope) && _dot_node.left is method_call) + else if ((returned_scope != null && returned_scope is ElementScope && (returned_scope as ElementScope).sc is CompiledScope && ((returned_scope as ElementScope).sc as CompiledScope).IsDelegate) && _dot_node.left is method_call) { ProcScope invoke_meth = ((returned_scope as ElementScope).sc as CompiledScope).FindNameOnlyInThisType("Invoke") as ProcScope; if (invoke_meth != null) diff --git a/TestSuite/intellisense_tests/invoke.pas b/TestSuite/intellisense_tests/invoke.pas new file mode 100644 index 000000000..82ae4571d --- /dev/null +++ b/TestSuite/intellisense_tests/invoke.pas @@ -0,0 +1,4 @@ +begin + var t := typeof(object); + var o := t.GetConstructor(System.Type.EmptyTypes).Invoke{@function ConstructorInfo.Invoke(parameters: array of Object): System.Object;@}(new object[0]); +end. \ No newline at end of file