C# 7.3 support?
Does linqpad have c# 7.3 support?
c# 7.3 added equality support for tuples (== and !=) and while the following code works in Visual Studio 15.7 Preview, its causes a compilation error in linqpad 5.31
`(1,1) == (1,2)`
`CS0019 Operator '==' cannot be applied to operands of type '(int, int)' and '(int, int)'`
c# 7.3 added equality support for tuples (== and !=) and while the following code works in Visual Studio 15.7 Preview, its causes a compilation error in linqpad 5.31
`(1,1) == (1,2)`
`CS0019 Operator '==' cannot be applied to operands of type '(int, int)' and '(int, int)'`
Comments
Download the new beta:
http://www.linqpad.net/download.aspx#beta
This sample statement does not appear to work although LinqPad states 7.3 support:
results in:
CS1002 ; expected
CS1003 Syntax error, '(' expected
CS1525 Invalid expression term '{'
CS1026 ) expected
I am sorry to be out of it, but these really simple examples should work, yes? Or do I need to set an option somewhere?
What I really want to do is this:
Replace all these if statements :
with :
}
and then invoke the action...
Hopeless?
Thank you.
Works ok with LinqPad 6 beta, so I'm guessing you are using LinqPad 5.
Switch expressions were introduced in C# 8, which requires .NET Core (and hence LINQPad 6).
This is a few years old, but I am copying code directly from my .NetFrameWork (3.7.2) code into LinqPad 5, but I get an error for Invalid Expression Term in a Switch Statement. however, I get no error in VS and the code works. Am I missing a setting change in LinqPad5?
The feature you are using (relational patterns) is part of C# 9. LINQPad 5 only supports up to C# 7.3 or 8 with experimental Roslyn features enabled. Are you using C# 9 but targeting .Net Framework 3.7.2?
We are running a .Net 4.7.2, and we can not set the target language version, it is disabled and automatically set by the framework.
Again, this has been in our code for a while. (FYI, I mean 4.7.2 (type-o on my part..sorry)
so, our projects are setup to use "LangVersion" of 9.