Permalink
Browse files

Update mcs lang version

  • Loading branch information...
1 parent 72e0ce7 commit 7a4152aedf00dfe880f7cff3121d31ed7ae94185 @marek-safar marek-safar committed Sep 16, 2011
Showing with 37 additions and 7 deletions.
  1. +5 −1 man/mcs.1
  2. +1 −1 mcs/errors/cs1617.cs
  3. +2 −2 mcs/errors/cs1644-33.cs
  4. +14 −0 mcs/errors/cs1644-34.cs
  5. +1 −1 mcs/mcs/ikvm.cs
  6. +3 −0 mcs/mcs/report.cs
  7. +11 −2 mcs/mcs/rootcontext.cs
View
@@ -163,7 +163,7 @@ The possible values are:
.TP
.I "Default"
Instruct compiler to use the latest version. Equivalent is to omit the
-switch (this currently defaults to the C# 3.0 language specification).
+switch (this currently defaults to the C# 4.0 language specification).
.TP
.I "ISO-1"
Restrict compiler to use only first ISO standardized features.
@@ -179,6 +179,10 @@ anonymous methods for example.
Restrict the compiler to use only the features available in C# 3.0
(a superset of ISO-1 and ISO-2).
.TP
+.I "4"
+Restrict the compiler to use only the features available in C# 4.0
+specification.
+.TP
.I "future"
Enables unstable features from upcoming versions of the language.
.PP
View
@@ -1,3 +1,3 @@
-// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', `3' or `Default'
+// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', `3', `4', `5', `Default' or `Future'
// Line: 0
// Compiler options: -langversion:ISO
View
@@ -1,6 +1,6 @@
-// CS1644: Feature `asynchronous functions' cannot be used because it is not part of the C# 2.0 language specification
+// CS1644: Feature `asynchronous functions' cannot be used because it is not part of the C# 4.0 language specification
// Line: 9
-// Compiler options: -langversion:ISO-2
+// Compiler options: -langversion:4
using System;
View
@@ -0,0 +1,14 @@
+// CS1644: Feature `asynchronous functions' cannot be used because it is not part of the C# 4.0 language specification
+// Line: 10
+// Compiler options: -langversion:4
+
+using System;
+
+class C
+{
+ public void Foo ()
+ {
+ Action a = async () => { };
+ }
+}
+
View
@@ -356,7 +356,7 @@ protected override string[] GetDefaultReferences ()
default_references.Add ("Microsoft.CSharp.dll");
}
- if (compiler.Settings.Version == LanguageVersion.Future)
+ if (compiler.Settings.Version >= LanguageVersion.V_4)
default_references.Add ("Mono.Async.dll");
return default_references.ToArray ();
View
@@ -107,6 +107,9 @@ public void FeatureIsNotAvailable (CompilerContext compiler, Location loc, strin
case LanguageVersion.V_4:
version = "4.0";
break;
+ case LanguageVersion.V_5:
+ version = "5.0";
+ break;
default:
throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version);
}
View
@@ -10,6 +10,8 @@
//
// Copyright 2001 Ximian, Inc (http://www.ximian.com)
// Copyright 2004-2008 Novell, Inc
+// Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
+//
using System.Collections.Generic;
using System.IO;
@@ -25,6 +27,7 @@ public enum LanguageVersion
ISO_2 = 2,
V_3 = 3,
V_4 = 4,
+ V_5 = 5,
Future = 100,
Default = LanguageVersion.V_4,
@@ -1041,12 +1044,18 @@ ParseResult ParseOption (string option, ref string[] args, CompilerSettings sett
case "3":
settings.Version = LanguageVersion.V_3;
return ParseResult.Success;
+ case "4":
+ settings.Version = LanguageVersion.V_4;
+ return ParseResult.Success;
+ case "5":
+ settings.Version = LanguageVersion.V_5;
+ return ParseResult.Success;
case "future":
settings.Version = LanguageVersion.Future;
return ParseResult.Success;
}
- report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', `3' or `Default'", value);
+ report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', `3', `4', `5', `Default' or `Future'", value);
return ParseResult.Error;
case "/codepage":
@@ -1407,7 +1416,7 @@ void Usage ()
" -help Lists all compiler options (short: -?)\n" +
" -keycontainer:NAME The key pair container used to sign the output assembly\n" +
" -keyfile:FILE The key file used to strongname the ouput assembly\n" +
- " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, Default or Future\n" +
+ " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Future\n" +
" -lib:PATH1[,PATHn] Specifies the location of referenced assemblies\n" +
" -main:CLASS Specifies the class with the Main method (short: -m)\n" +
" -noconfig Disables implicitly referenced assemblies\n" +

0 comments on commit 7a4152a

Please sign in to comment.