[mcs] C#7 throw expression
authorMarek Safar <marek.safar@gmail.com>
Mon, 5 Jun 2017 10:19:08 +0000 (12:19 +0200)
committerMarek Safar <marek.safar@gmail.com>
Mon, 5 Jun 2017 10:23:06 +0000 (12:23 +0200)
27 files changed:
mcs/errors/cs0019-72.cs [new file with mode: 0644]
mcs/errors/cs0155-5.cs [new file with mode: 0644]
mcs/errors/cs0162-21.cs [new file with mode: 0644]
mcs/errors/cs0173-6.cs [new file with mode: 0644]
mcs/errors/cs0411-25.cs [new file with mode: 0644]
mcs/errors/cs1061-18.cs [new file with mode: 0644]
mcs/errors/cs1617.cs
mcs/errors/cs1644-51.cs [new file with mode: 0644]
mcs/errors/cs4001-3.cs [new file with mode: 0644]
mcs/errors/cs8188.cs [new file with mode: 0644]
mcs/mcs/anonymous.cs
mcs/mcs/assign.cs
mcs/mcs/async.cs
mcs/mcs/convert.cs
mcs/mcs/cs-parser.jay
mcs/mcs/cs-tokenizer.cs
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/generic.cs
mcs/mcs/nullable.cs
mcs/mcs/report.cs
mcs/mcs/settings.cs
mcs/mcs/statement.cs
mcs/mcs/typespec.cs
mcs/tests/test-throw-expr-01.cs [new file with mode: 0644]
mcs/tests/test-throw-expr-02.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml

diff --git a/mcs/errors/cs0019-72.cs b/mcs/errors/cs0019-72.cs
new file mode 100644 (file)
index 0000000..90cbae7
--- /dev/null
@@ -0,0 +1,10 @@
+// CS0019: Operator `??' cannot be applied to operands of type `void' and `throw expression'
+// Line: 20
+
+class C
+{
+       public static void Main ()
+       {
+               var s = Main () ?? throw null;
+       }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0155-5.cs b/mcs/errors/cs0155-5.cs
new file mode 100644 (file)
index 0000000..774700a
--- /dev/null
@@ -0,0 +1,7 @@
+// CS0155: The type caught or thrown must be derived from System.Exception
+// Line: 9
+
+class X
+{
+    public int Test () => throw "";
+}
diff --git a/mcs/errors/cs0162-21.cs b/mcs/errors/cs0162-21.cs
new file mode 100644 (file)
index 0000000..e8bd4b2
--- /dev/null
@@ -0,0 +1,19 @@
+// CS0162: Unreachable code detected
+// Line: 12
+// Compiler options: -warnaserror -warn:2
+
+using System;
+
+class X
+{
+    void Test ()
+    {
+        var x = true ? throw new NullReferenceException () : 1;
+        x = 2;
+        return;
+    }
+
+       static void Main () 
+       {
+       }
+}
diff --git a/mcs/errors/cs0173-6.cs b/mcs/errors/cs0173-6.cs
new file mode 100644 (file)
index 0000000..6c2dab2
--- /dev/null
@@ -0,0 +1,10 @@
+// CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between `throw expression' and `throw expression'
+// Line: 8
+
+class C
+{
+       public static void Test (bool b)
+       {
+               var s = b ? throw null : throw null;
+       }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0411-25.cs b/mcs/errors/cs0411-25.cs
new file mode 100644 (file)
index 0000000..c7f92fb
--- /dev/null
@@ -0,0 +1,16 @@
+// CS0411: The type arguments for method `C.Foo<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 10
+
+using System;
+
+public class C
+{
+    public static void Main ()
+    {
+        Foo (() => throw null);
+    }
+
+    static void Foo<T> (Func<T> arg)
+    {
+    }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs1061-18.cs b/mcs/errors/cs1061-18.cs
new file mode 100644 (file)
index 0000000..1f201d5
--- /dev/null
@@ -0,0 +1,18 @@
+// CS1061: No overload for method `Call' takes `0' arguments
+// Line: 11
+
+using System;
+class Program
+{
+       static void Main ()
+       {
+               Action<dynamic, object> action = delegate { };
+               Foo (action).NoDynamicBinding ();
+       }
+       static T Foo<T>(Action<T, T> x)
+       {
+               throw new NotImplementedException ();
+       }
+}
\ No newline at end of file
index 88f9c12deca51b8d214bd2e87c42b18b4efa6746..cfa63a7d8355e7be6928a4cfa58b370cb57d8743 100644 (file)
@@ -1,3 +1,3 @@
-// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6
+// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 7
 // Line: 0
 // Compiler options: -langversion:ISO
diff --git a/mcs/errors/cs1644-51.cs b/mcs/errors/cs1644-51.cs
new file mode 100644 (file)
index 0000000..0cc6150
--- /dev/null
@@ -0,0 +1,8 @@
+// CS1644: Feature `throw expression' cannot be used because it is not part of the C# 6.0 language specification
+// Line: 5
+// Compiler options: -langversion:6
+
+static class Class
+{
+       int Prop => throw null;
+}
diff --git a/mcs/errors/cs4001-3.cs b/mcs/errors/cs4001-3.cs
new file mode 100644 (file)
index 0000000..9f4d82c
--- /dev/null
@@ -0,0 +1,12 @@
+// CS4001: Cannot await `void' expression
+// Line: 10
+
+using System;
+
+class A
+{
+       static async void Test ()
+       {
+               await Console.WriteLine;
+       }
+}
diff --git a/mcs/errors/cs8188.cs b/mcs/errors/cs8188.cs
new file mode 100644 (file)
index 0000000..d2f225f
--- /dev/null
@@ -0,0 +1,13 @@
+// CS8188: An expression tree cannot not contain a throw expression
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+       public static void Main ()
+       {
+               Expression<Func<object>> l = () => throw null;
+       }
+}
\ No newline at end of file
index d27fe806048797af33538b202c262e0e040dff4e..6cec0e1da6dc57513c0af368e3ec08a8f5ac6848 100644 (file)
@@ -1652,9 +1652,10 @@ namespace Mono.CSharp {
                        fc.TryFinally = prev_tf;
                }
 
-               public override void MarkReachable (Reachability rc)
+               public override Reachability MarkReachable (Reachability rc)
                {
                        block.MarkReachable (rc);
+                       return rc;
                }
 
                public void SetHasThisAccess ()
index 7200501984e2230825ba7f8dfdaf06f3cec5fba6..43399ffc3ae105be93bdbe212052714c7f7cde95 100644 (file)
@@ -503,11 +503,9 @@ namespace Mono.CSharp {
                        }
                }
 
-               public override void MarkReachable (Reachability rc)
+               public override Reachability MarkReachable (Reachability rc)
                {
-                       var es = source as ExpressionStatement;
-                       if (es != null)
-                               es.MarkReachable (rc);
+                       return source.MarkReachable (rc);
                }
        }
 
index 39d114fd451cb516dca4d5a8e9679e07ecf6a2ff..fd6499346e88b08abfc56ff85071cc9997c83af1 100644 (file)
@@ -127,10 +127,9 @@ namespace Mono.CSharp
                        stmt.EmitStatement (ec);
                }
 
-               public override void MarkReachable (Reachability rc)
+               public override Reachability MarkReachable (Reachability rc)
                {
-                       base.MarkReachable (rc);
-                       stmt.MarkReachable (rc);
+                       return stmt.MarkReachable (rc);
                }
 
                public override object Accept (StructuralVisitor visitor)
@@ -514,11 +513,12 @@ namespace Mono.CSharp
                        ec.Emit (OpCodes.Ret);
                }
 
-               public override void MarkReachable (Reachability rc)
+               public override Reachability MarkReachable (Reachability rc)
                {
                        //
                        // Reachability has been done in AsyncInitializerStatement
                        //
+                       return rc;
                }
        }
 
index 36c5626bcc32dd190a10ff102953fb65f56ea8e3..3adb909e6f5afc782964f929c325165b6694813d 100644 (file)
@@ -744,6 +744,9 @@ namespace Mono.CSharp {
                        if (expr_type == target_type)
                                return true;
 
+                       if (expr_type == InternalType.ThrowExpr)
+                               return target_type.Kind != MemberKind.InternalCompilerType;
+
                        if (target_type.IsNullableType)
                                return ImplicitNulableConversion (null, expr, target_type) != null;
 
@@ -1370,7 +1373,7 @@ namespace Mono.CSharp {
                        Expression e;
 
                        if (expr_type == target_type) {
-                               if (expr_type != InternalType.NullLiteral && expr_type != InternalType.AnonymousMethod)
+                               if (expr_type != InternalType.NullLiteral && expr_type != InternalType.AnonymousMethod && expr_type != InternalType.ThrowExpr)
                                        return expr;
                                return null;
                        }
@@ -1396,6 +1399,10 @@ namespace Mono.CSharp {
                                return null;
                        }
 
+                       if (expr_type == InternalType.ThrowExpr) {
+                               return target_type.Kind == MemberKind.InternalCompilerType ? null : EmptyCast.Create (expr, target_type);
+                       }
+
                        if (target_type.IsNullableType)
                                return ImplicitNulableConversion (ec, expr, target_type);
 
index 91e6a23b1406f17bcc0ff188c1161ba949f1a98d..153a6bc7bdba4d8cc56dca48f8c9396ed3e00df3 100644 (file)
@@ -219,7 +219,7 @@ namespace Mono.CSharp
 %token STRUCT  
 %token SWITCH  
 %token THIS    
-%token THROW   
+%token THROW
 %token TRUE    
 %token TRY     
 %token TYPEOF  
@@ -261,6 +261,7 @@ namespace Mono.CSharp
 %token WHEN
 %token INTERPOLATED_STRING
 %token INTERPOLATED_STRING_END
+%token THROW_EXPR
 
 /* C# keywords which are not really keywords */
 %token GET
@@ -4310,6 +4311,13 @@ unary_expression
                
                $$ = new Await ((Expression) $2, GetLocation ($1));
          }
+       | THROW_EXPR prefixed_unary_expression
+         {
+               if (lang_version < LanguageVersion.V_7)
+                       FeatureIsNotAvailable (lexer.Location, "throw expression");
+
+               $$ = new ThrowExpression ((Expression) $2, GetLocation ($1));
+         }
        | BANG error
          {
                Error_SyntaxError (yyToken);
@@ -6366,11 +6374,16 @@ return_statement
        ;
 
 throw_statement
-       : THROW opt_expression SEMICOLON
+       : THROW expression SEMICOLON
          {
                $$ = new Throw ((Expression) $2, GetLocation ($1));
                lbag.AddStatement ($$, GetLocation ($3));
          }
+       | THROW SEMICOLON
+         {
+               $$ = new Throw (null, GetLocation ($1));
+               lbag.AddStatement ($$, GetLocation ($2));
+         }
        | THROW expression error
          {
                Error_SyntaxError (yyToken);
@@ -8081,6 +8094,7 @@ static string GetTokenName (int token)
        case Token.THIS:
                return "this";
        case Token.THROW:
+       case Token.THROW_EXPR:
                return "throw";
        case Token.TRUE:
                return "true";
index d6314ff005a3222079d9eb1eb746b258780da2f8..afa69c86a4bc307d083b9c8b0b9373a178ff2aa8 100644 (file)
@@ -893,6 +893,17 @@ namespace Mono.CSharp
                                if (parsing_block == 0)
                                        res = -1;
 
+                               break;
+                       case Token.THROW:
+                               switch (current_token) {
+                               case Token.ARROW:
+                               case Token.OP_COALESCING:
+                               case Token.INTERR:
+                               case Token.COLON:
+                                       res = Token.THROW_EXPR;
+                                       break;
+                               }
+
                                break;
                        }
 
@@ -1345,6 +1356,7 @@ namespace Mono.CSharp
                        case Token.THIS:
                        case Token.NEW:
                        case Token.INTERPOLATED_STRING:
+                       case Token.THROW:
                                next_token = Token.INTERR;
                                break;
                                
index 4d472070a006bf87d04ff839d8260f1a6d20a894..a6c575ecc9e33267efd52365b2cc275d044cb915 100644 (file)
@@ -995,6 +995,11 @@ namespace Mono.CSharp {
                {
                }
 
+               public virtual Reachability MarkReachable (Reachability rc)
+               {
+                       return rc;
+               }
+
                //
                // Special version of flow analysis for expressions which can return different
                // on-true and on-false result. Used by &&, ||, ?: expressions
@@ -1295,10 +1300,6 @@ namespace Mono.CSharp {
        /// </summary>
        public abstract class ExpressionStatement : Expression
        {
-               public virtual void MarkReachable (Reachability rc)
-               {
-               }
-
                public virtual ExpressionStatement ResolveStatement (BlockContext ec)
                {
                        Expression e = Resolve (ec);
@@ -1460,6 +1461,11 @@ namespace Mono.CSharp {
 #endif
                }
 
+               public override Reachability MarkReachable (Reachability rc)
+               {
+                       return child.MarkReachable (rc);
+               }
+
                protected override void CloneTo (CloneContext clonectx, Expression t)
                {
                        // Nothing to clone
@@ -2408,6 +2414,11 @@ namespace Mono.CSharp {
                {
                        return orig_expr.MakeExpression (ctx);
                }
+
+               public override Reachability MarkReachable (Reachability rc)
+               {
+                       return expr.MarkReachable (rc);
+               }
        }
 
        //
index 9042dcdabad8e5405cbbbc086953ade32d7dfc81..d84214302c39f66ec0c01b22efc9020eae8799a1 100644 (file)
@@ -12735,4 +12735,68 @@ namespace Mono.CSharp
                        return value;
                }
        }
+
+       class ThrowExpression : ExpressionStatement
+       {
+               Expression expr;
+
+               public ThrowExpression (Expression expr, Location loc)
+               {
+                       this.expr = expr;
+                       this.loc = loc;
+               }
+
+               protected override void CloneTo (CloneContext clonectx, Expression t)
+               {
+                       var target = (ThrowExpression)t;
+                       target.expr = expr.Clone (clonectx);
+               }
+
+               public override bool ContainsEmitWithAwait ()
+               {
+                       return expr.ContainsEmitWithAwait ();
+               }
+
+               public override Expression CreateExpressionTree (ResolveContext rc)
+               {
+                       rc.Report.Error (8188, loc, "An expression tree cannot not contain a throw expression");
+                       return expr;
+               }
+
+               protected override Expression DoResolve (ResolveContext rc)
+               {
+                       expr = expr.Resolve (rc, ResolveFlags.Type | ResolveFlags.VariableOrValue);
+
+                       if (expr == null)
+                               return null;
+
+                       expr = Throw.ConvertType (rc, expr);
+
+                       eclass = ExprClass.Value;
+                       type = InternalType.ThrowExpr;
+                       return this;
+               }
+
+               public override void Emit (EmitContext ec)
+               {
+                       EmitStatement (ec);
+               }
+
+               public override void EmitStatement (EmitContext ec)
+               {
+                       expr.Emit (ec);
+
+                       ec.Emit (OpCodes.Throw);
+               }
+
+               public override void FlowAnalysis (FlowAnalysisContext fc)
+               {
+                       expr.FlowAnalysis (fc);
+               }
+
+               public override Reachability MarkReachable (Reachability rc)
+               {
+                       return Reachability.CreateUnreachable ();
+               }
+       }
 }
index 8ddef4f36947b630ee655efd11adbe80fa385b5c..6b35de9846c6ba3d0be116b321af98c721297926 100644 (file)
@@ -3091,7 +3091,8 @@ namespace Mono.CSharp {
                        // Some types cannot be used as type arguments
                        //
                        if ((bound.Type.Kind == MemberKind.Void && !voidAllowed) || bound.Type.IsPointer || bound.Type.IsSpecialRuntimeType ||
-                               bound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod || bound.Type == InternalType.VarOutType)
+                           bound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod || bound.Type == InternalType.VarOutType ||
+                           bound.Type == InternalType.ThrowExpr)
                                return;
 
                        var a = bounds [index];
index 754c888e8b1158711b9f4200666e7a22e6ff273f..a679bdbf60c737334209c239a97dcb6f416adbc3 100644 (file)
@@ -1234,6 +1234,11 @@ namespace Mono.CSharp.Nullable
                                        type = ltype;
                                        return this;
                                }
+                       } else if (ltype == InternalType.ThrowExpr) {
+                               //
+                               // LAMESPEC: I am not really sure what's point of allowing throw on left side
+                               //
+                               return ReducedExpression.Create (right, this, false).Resolve (ec);
                        } else {
                                return null;
                        }
index afa4f75bd84865f72666678e53685c0c31df5462..f73bed2b0b0d6b342ceb69dcc362bc54e06adf8e 100644 (file)
@@ -104,6 +104,9 @@ namespace Mono.CSharp {
                        case LanguageVersion.V_6:
                                version = "6.0";
                                break;
+                       case LanguageVersion.V_7:
+                               version = "7.0";
+                               break;
                        default:
                                throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version);
                        }
index a823cd25ea37f0d29feb36d9e3a8de142202f2ab..f3a7bb79b07a9c0edff9f97614d4b57f4b039f45 100644 (file)
@@ -29,9 +29,10 @@ namespace Mono.CSharp {
                V_4 = 4,
                V_5 = 5,
                V_6 = 6,
+               V_7 = 7,
                Experimental = 100,
 
-               Default = LanguageVersion.V_6,
+               Default = V_7,
        }
 
        public enum RuntimeVersion
@@ -1163,15 +1164,15 @@ namespace Mono.CSharp {
                                case "6":
                                        settings.Version = LanguageVersion.V_6;
                                        return ParseResult.Success;
+                               case "7":
+                                       settings.Version = LanguageVersion.V_7;
+                                       return ParseResult.Success;
                                case "experimental":
                                        settings.Version = LanguageVersion.Experimental;
                                        return ParseResult.Success;
-                               case "future":
-                                       report.Warning (8000, 1, "Language version `future' is no longer supported");
-                                       goto case "6";
                                }
 
-                               report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6", value);
+                               report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 7", value);
                                return ParseResult.Error;
 
                        case "/codepage":
index d500eea093d32debf0b5c50349e69d810d8ccd0d..dd02d894a8b480a97188b3d7d53a33f88d17ad2b 100644 (file)
@@ -1114,6 +1114,7 @@ namespace Mono.CSharp {
        public class Return : ExitStatement
        {
                Expression expr;
+               bool expr_returns;
 
                public Return (Expression expr, Location l)
                {
@@ -1339,7 +1340,9 @@ namespace Mono.CSharp {
                        if (expr != null)
                                expr.FlowAnalysis (fc);
 
-                       base.DoFlowAnalysis (fc);
+                       if (!expr_returns)
+                               base.DoFlowAnalysis (fc);
+                       
                        return true;
                }
 
@@ -1352,6 +1355,12 @@ namespace Mono.CSharp {
                public override Reachability MarkReachable (Reachability rc)
                {
                        base.MarkReachable (rc);
+
+                       if (Expr != null) {
+                               rc = Expr.MarkReachable (rc);
+                               expr_returns = rc.IsUnreachable;
+                       }
+
                        return Reachability.CreateUnreachable ();
                }
 
@@ -1767,6 +1776,19 @@ namespace Mono.CSharp {
                        }
                }
 
+               public static Expression ConvertType (ResolveContext rc, Expression expr)
+               {
+                       var et = rc.BuiltinTypes.Exception;
+                       if (Convert.ImplicitConversionExists (rc, expr, et))
+                               expr = Convert.ImplicitConversion (rc, expr, et, expr.Location);
+                       else {
+                               rc.Report.Error (155, expr.Location, "The type caught or thrown must be derived from System.Exception");
+                               expr = EmptyCast.Create (expr, et);
+                       }
+
+                       return expr;
+               }
+
                public override bool Resolve (BlockContext ec)
                {
                        if (expr == null) {
@@ -1790,11 +1812,7 @@ namespace Mono.CSharp {
                        if (expr == null)
                                return false;
 
-                       var et = ec.BuiltinTypes.Exception;
-                       if (Convert.ImplicitConversionExists (ec, expr, et))
-                               expr = Convert.ImplicitConversion (ec, expr, et, loc);
-                       else
-                               ec.Report.Error (155, expr.Location, "The type caught or thrown must be derived from System.Exception");
+                       expr = ConvertType (ec, expr);
 
                        return true;
                }
@@ -2251,11 +2269,8 @@ namespace Mono.CSharp {
 
                public override Reachability MarkReachable (Reachability rc)
                {
-                       var init = initializer as ExpressionStatement;
-                       if (init != null)
-                               init.MarkReachable (rc);
-
-                       return base.MarkReachable (rc);
+                       base.MarkReachable (rc);
+                       return initializer == null ? rc : initializer.MarkReachable (rc);
                }
 
                protected override void CloneTo (CloneContext clonectx, Statement target)
index 696bde556c820ad00f9d206bac897e80c10ee470..53402940dc2dda5959bc5d925cefe29d0701d40c 100644 (file)
@@ -1432,6 +1432,7 @@ namespace Mono.CSharp
                public static readonly InternalType Namespace = new InternalType ("<namespace>");
                public static readonly InternalType ErrorType = new InternalType ("<error>");
                public static readonly InternalType VarOutType = new InternalType ("var out");
+               public static readonly InternalType ThrowExpr = new InternalType ("throw expression");
 
                readonly string name;
 
diff --git a/mcs/tests/test-throw-expr-01.cs b/mcs/tests/test-throw-expr-01.cs
new file mode 100644 (file)
index 0000000..e17fa42
--- /dev/null
@@ -0,0 +1,61 @@
+using System;
+
+class X
+{
+       public static void Main ()
+       {
+               Func<object> f = () => throw null;
+       }
+
+       public int Test () => throw null;
+
+       object Foo ()
+       {
+               return null;
+       }
+
+       public object Test2 () => Foo () ?? throw null;
+
+       static void Test3 (out int z) => throw null;
+
+       int this [int x] {
+               get => throw null;
+       }    
+
+       public event Action Event {
+               add => throw null; 
+               remove => throw null;
+       }
+
+       void TestExpr_1 (bool b)
+       {
+               int x = b ? throw new NullReferenceException () : 1;        
+       }
+
+       void TestExpr_2 (bool b)
+       {
+               int x = b ? 2 : throw new NullReferenceException ();
+       }
+
+       void TestExpr_3 (string s)
+       {
+               s = s ?? throw new NullReferenceException ();
+       }
+
+       void TestExpr_4 ()
+       {
+               throw new ApplicationException () ?? throw new NullReferenceException() ?? throw null;
+       }
+
+       void TestExpr_5 ()
+       {
+               Action a = () => throw new ApplicationException () ?? throw new NullReferenceException() ?? throw null;
+       }
+
+       static int TestExpr_6 (out int z) => throw null;
+
+       int TestExpr_7 (out int z)
+       {
+               return true ? throw new NullReferenceException () : 1;
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-throw-expr-02.cs b/mcs/tests/test-throw-expr-02.cs
new file mode 100644 (file)
index 0000000..515d687
--- /dev/null
@@ -0,0 +1,22 @@
+using System;
+
+class Program
+{
+    public static int Main ()
+    {
+        Console.WriteLine (M (1));
+        try {
+            Console.WriteLine (M (null));
+        } catch (Exception) {
+            Console.WriteLine ("thrown");
+            return 0;
+        }
+
+        return 1;
+    }
+
+    static string M (object data)
+    {
+        return data?.ToString () ?? throw null;
+    }
+}
\ No newline at end of file
index 84e616ca01f884a29f29c11f935c004cb5d9b9be..e2d36914506db3fb8b76725266fe3dda9e7a8412 100644 (file)
       </method>
     </type>
   </test>
+  <test name="test-throw-expr-01.cs">
+    <type name="X">
+      <method name="Void Main()" attrs="150">
+        <size>32</size>
+      </method>
+      <method name="Int32 Test()" attrs="134">
+        <size>10</size>
+      </method>
+      <method name="System.Object Foo()" attrs="129">
+        <size>10</size>
+      </method>
+      <method name="System.Object Test2()" attrs="134">
+        <size>23</size>
+      </method>
+      <method name="Void Test3(Int32 ByRef)" attrs="145">
+        <size>3</size>
+      </method>
+      <method name="Int32 get_Item(Int32)" attrs="2177">
+        <size>10</size>
+      </method>
+      <method name="Void add_Event(System.Action)" attrs="2182">
+        <size>3</size>
+      </method>
+      <method name="Void remove_Event(System.Action)" attrs="2182">
+        <size>3</size>
+      </method>
+      <method name="Void TestExpr_1(Boolean)" attrs="129">
+        <size>21</size>
+      </method>
+      <method name="Void TestExpr_2(Boolean)" attrs="129">
+        <size>21</size>
+      </method>
+      <method name="Void TestExpr_3(System.String)" attrs="129">
+        <size>18</size>
+      </method>
+      <method name="Void TestExpr_4()" attrs="129">
+        <size>16</size>
+      </method>
+      <method name="Void TestExpr_5()" attrs="129">
+        <size>32</size>
+      </method>
+      <method name="System.Object &lt;Main&gt;m__0()" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Void &lt;TestExpr_5&gt;m__1()" attrs="145">
+        <size>3</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+      <method name="Int32 TestExpr_6(Int32 ByRef)" attrs="145">
+        <size>10</size>
+      </method>
+      <method name="Int32 TestExpr_7(Int32 ByRef)" attrs="129">
+        <size>15</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-throw-expr-02.cs">
+    <type name="Program">
+      <method name="Int32 Main()" attrs="150">
+        <size>63</size>
+      </method>
+      <method name="System.String M(System.Object)" attrs="145">
+        <size>33</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-var-01.cs">
     <type name="Test">
       <method name="Int32 Main()" attrs="150">