class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
(new Stuff().Action)();
}
}
Select 'new Stuff()' and introduce variable 'stuff'. Result:
using System;
class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
Stuff stuff = new Stuff();
(stuff.Action)(); // error CS1525: Invalid expression term ')'
}
}
Expected:
using System;
class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
Stuff stuff = new Stuff();
((stuff).Action)(); // OK
}
}
Description
class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
(new Stuff().Action)();
}
}
Select 'new Stuff()' and introduce variable 'stuff'. Result:
using System;
class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
Stuff stuff = new Stuff();
(stuff.Action)(); // error CS1525: Invalid expression term ')'
}
}
Expected:
using System;
class Stuff
{
public Action Action
{
get { thrownew NotImplementedException(); }
}
publicstatic void Main()
{
Stuff stuff = new Stuff();
((stuff).Action)(); // OK
}
}