fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: SELF not available in field declaration

SELF not available in field declaration 7 months 1 day ago #1

Hi,

the following construct compiled and worked in Vulcan.NET:
CLASS GapCockpitShellWindow INHERIT GapShellWindow IMPLEMENTS IGapCockpitShellWindow
        PRIVATE activatedEventHandler := EventHandler{SELF, @ActivatedShell()} AS EventHandler

The X# compiler gives me an error:
Error XS0027 Keyword 'SELF' is not available in the current context

Is this intended?

Please Log in or Create an account to join the conversation.

SELF not available in field declaration 7 months 1 day ago #2

Mathias,
This is a side effect from the fact that we have used Roslyn as compiler engine. C# also does now allow you to use "this" in places like this.
You should have no problem if you move the initialization of the event handler to the constructor of the class.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

SELF not available in field declaration 7 months 1 day ago #3

OK, thanks.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1