if ($4 == null)
report.Error (1586, GetLocation ($1), "Array creation must have array size or array initializer");
- $$ = new ArrayCreation ((FullNamedExpression) $2, (ComposedTypeSpecifier) $3, (ArrayInitializer) $4, GetLocation ($1));
+ $$ = new ArrayCreation ((FullNamedExpression) $2, (ComposedTypeSpecifier) $3, (ArrayInitializer) $4, GetLocation ($1)) {
+ NoEmptyInterpolation = true
+ };
}
| NEW rank_specifier array_initializer
{
{
}
+ public bool NoEmptyInterpolation { get; set; }
+
public ComposedTypeSpecifier Rank {
get {
return this.rank;
public override void Emit (EmitContext ec)
{
- if (EmitOptimizedEmpty (ec))
+ if (!NoEmptyInterpolation && EmitOptimizedEmpty (ec))
return;
var await_field = EmitToFieldSource (ec);
--- /dev/null
+class X
+{
+ public static int Main ()
+ {
+ var a = new byte[] { };
+ var b = new byte[] { };
+ if (a.Equals (b))
+ return 1;
+
+ if (ReferenceEquals (a, b))
+ return 2;
+
+ b = new byte[0];
+ if (a.Equals (b))
+ return 3;
+
+ if (ReferenceEquals (a, b))
+ return 4;
+
+ return 0;
+ }
+}
\ No newline at end of file
</type>
<type name="ExtensibleTester`1[U]">
<method name="Void Direct()" attrs="134">
- <size>24</size>
+ <size>25</size>
</method>
<method name="Void .ctor(U)" attrs="6278">
<size>15</size>
</type>
<type name="TestIssue.Program">
<method name="Int32 Main()" attrs="150">
- <size>31</size>
+ <size>32</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>7</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>36</size>
+ <size>37</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="test-555.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">
- <size>360</size>
+ <size>361</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</method>
</type>
</test>
+ <test name="test-934.cs">
+ <type name="X">
+ <method name="Int32 Main()" attrs="150">
+ <size>106</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-94.cs">
<type name="Base">
<method name="Int32 IVehicle.Start()" attrs="481">
<size>14</size>
</method>
<method name="Boolean MoveNext()" attrs="486">
- <size>167</size>
+ <size>168</size>
</method>
<method name="Void Dispose()" attrs="486">
<size>15</size>