Tuples are highlighted as incorrect syntax

SyntaxEditor for Windows Forms Forum

Posted 1 year ago by Alex Sche
Version: 20.1.0402
Platform: .NET 4.6
Environment: Windows 10 (64-bit)
Avatar

Hello ActiPro team,

We have encountered an issue with tuples - they are highlighted  by red line as incorrect statement:

var a = (A: 10, B: 20);

Are tuples supported by SyntaxEditor? 

Comments (5)

Answer - Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Alex,

C# 7.x syntax (including this tuple syntax) should be supported as of v2020.1.  I suspect you are on an earlier version that what you indicated in the original post?


Actipro Software Support

Posted 1 year ago by Alex Sche
Avatar

Oh, sorry, indeed.

I'm just confused about the versions of my program - what have old SyntaxEditor and what uses the new one.

Posted 5 months ago by Jon Tackabury
Avatar

Hello, I am having a syntax highlighting issue with tuples as well with the latest 2021 version. This code works:

(int A, int B) things = null;

But this code says it's invalid syntax:

System.Collections.Generic.List<(int A, int B)> things = null;

I can compile and run the code fine, it's just reported as a syntax error. Is there planned support for this syntax? Thanks!

Posted 5 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jon,

Thanks for reporting this.  We fixed the problem in the parser for the next build.


Actipro Software Support

Posted 5 months ago by Jon Tackabury
Avatar

Thanks for the quick help! :)

The latest build of this product (v21.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.