SmartQuant Discussion
http://www.smartquant.com/forums/

Please support C# 7.0
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14846
Page 1 of 1

Author:  wukan [ Sat Aug 04, 2018 10:45 am ]
Post subject:  Please support C# 7.0

Hi,

I try to use code:

Code:
public (string,string) Output()
{
    return ("Hello","world!");
}

but get error.
Quote:
Type expected
Invalid token '(' in class, struct, or interface member declaration
Invalid token ',' in class, struct, or interface member declaration
Invalid token ')' in class, struct, or interface member declaration
Method must have a return type


I test
Code:
compilerParameters.CompilerOptions = "/langversion:7";

get error too.
Quote:
Invalid option '7' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default


If replace
Code:
using Microsoft.CSharp;

to
Code:
using Microsoft.CodeDom.Providers.DotNetCompilerPlatform;

it will success.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/