Merge pull request #656 from LogosBible/collection_lock
[mono.git] / mcs / class / System.Core / System.Linq.Expressions / TypeBinaryExpression.cs
index 63188c431b8840a84908bed8aaca5af4dd88c3dc..77f91e044d49a37e4f9d5b5a06f9aa5d58ea9b75 100644 (file)
@@ -27,7 +27,9 @@
 //
 
 using System;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
 
 namespace System.Linq.Expressions {
 
@@ -51,12 +53,19 @@ namespace System.Linq.Expressions {
                        this.type_operand = type_operand;
                }
 
+#if !FULL_AOT_RUNTIME
                internal override void Emit (EmitContext ec)
                {
-                       EmitIsInst (ec, expression, type_operand);
+                       if (expression.Type == typeof (void)) {
+                               ec.ig.Emit (OpCodes.Ldc_I4_0);
+                               return;
+                       }
+
+                       ec.EmitIsInst (expression, type_operand);
 
                        ec.ig.Emit (OpCodes.Ldnull);
                        ec.ig.Emit (OpCodes.Cgt_Un);
                }
+#endif
        }
 }