Don't set sequential type attribute for async containers
[mono.git] / mcs / mcs / class.cs
index bd2c129d9e3abdc2828d60f52f8e175e4370cd4c..567b2fadf300ef7e81b7c0345856ef98c8b310b9 100644 (file)
@@ -1218,7 +1218,7 @@ namespace Mono.CSharp
                        //
                        // Sets .size to 1 for structs with no instance fields
                        //
-                       int type_size = Kind == MemberKind.Struct && first_nonstatic_field == null ? 1 : 0;
+                       int type_size = Kind == MemberKind.Struct && first_nonstatic_field == null && !(this is StateMachine) ? 1 : 0;
 
                        var parent_def = Parent as TypeDefinition;
                        if (parent_def == null) {