3

If I try to compile the following code with scriptCS it fails compilation with a syntax error for the line containing the primary constructor (Error CS 1514 '{' expected to be exact):

public class MyClass(string someName)
{
    public string Name { get; } = someName;
}

I know that the new syntax features have to be enabled on a per-project basis in the first CTP of Visual Studio 2014, but couldn't find a similar setting for scriptCS (or any other information about C# 6 and scriptCS). My understanding is, that scriptCS is using Roslyn, so there should be a way to support those features.

So how do I enable the new C# 6 syntax features in scriptCS? Or isn't that possible (yet)?

Community
  • 1
  • 1
andyp
  • 6,229
  • 3
  • 38
  • 55
  • 2
    I can't see anything on the list of latest commits which would implicate that ScriptCS uses newest Roslyn bits: https://github.com/scriptcs/scriptcs/commits/dev – MarcinJuraszek Jun 06 '14 at 07:17
  • Good point! Although not good news.. ;) – andyp Jun 06 '14 at 07:50
  • 1
    Looks like I found [the reason](http://roslyn.codeplex.com/wikipage?title=FAQ&referringTitle=Home#Scripting,%20REPL,%20and%20Executing%20Code%20Questions) scriptCS hasn't been updated: the scripting API (which is used by scriptCS) has been temporarily removed for re-design in the latest version of Roslyn. – andyp Jun 06 '14 at 09:28

0 Answers0