-// CS1043: Invalid accessor body `1', expecting `;' or `{'
+// CS1043: Invalid accessor body `1', expecting `;', `{', or `=>'
// Line: 6
class C
;
accessor_body
- : block
+ : block
+ | expression_block
| SEMICOLON
{
// TODO: lbag
}
;
+
interface_declaration
: opt_attributes
opt_modifiers
report.Error (73, lexer.Location, "An add or remove accessor must have a body");
$$ = null;
}
- | block;
+ | block
+ | expression_block
;
attributes_without_members
--- /dev/null
+using System;
+
+class X
+{
+ int v;
+
+ public int Prop {
+ get => 1;
+ set => v = value;
+ }
+
+ public event Action A {
+ add => v = 1;
+ remove => v = 2;
+ }
+
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
</method>
</type>
</test>
+ <test name="test-expression-bodied-03.cs">
+ <type name="X">
+ <method name="Int32 get_Prop()" attrs="2182">
+ <size>9</size>
+ </method>
+ <method name="Void set_Prop(Int32)" attrs="2182">
+ <size>8</size>
+ </method>
+ <method name="Void add_A(System.Action)" attrs="2182">
+ <size>8</size>
+ </method>
+ <method name="Void remove_A(System.Action)" attrs="2182">
+ <size>8</size>
+ </method>
+ <method name="Void Main()" attrs="150">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-externalias-01.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">