fbpx

Compiler warning for missing type in declaration

  • George Theopoulos
  • George Theopoulos's Avatar Topic Author
  • Offline
More
2 years 10 months ago #1 by George Theopoulos
Compiler warning for missing type in declaration was created by George Theopoulos
Hi,

is-there precaution (in X# compiler) to issue a warning that the variable will be USUAL when I write:

LOCAL cVariable := "something"
forgeting the 'AS TYPE' ?

regards
George

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

More
2 years 10 months ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic Compiler warning for missing type in declaration
Hi George!

The current version of the C# compiler does not support USUALs anyway, so your sample is producing an error at this line with a message "Type expected". In future builds, there will be a compiler option with which you'll be able to specify that you want to use the core version of the compiler (so still an error reported in that kind of code), the VO/Vulcan compatibility one (so no error) etc. Even in the case of using the VO compatibility flavor, I think we can also add an optional (via a compiler switch) warning on defining vars without explicitly specifying their type.

Chris

XSharp Development Team
chris(at)xsharp.eu

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

More
2 years 10 months ago #3 by Chris Pyrgas
Replied by Chris Pyrgas on topic Compiler warning for missing type in declaration
> The current version of the C# compiler does ...

That should read "the X# compiler" of course!!

Chris

XSharp Development Team
chris(at)xsharp.eu

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

  • George Theopoulos
  • George Theopoulos's Avatar Topic Author
  • Offline
More
2 years 10 months ago #4 by George Theopoulos
Replied by George Theopoulos on topic Compiler warning for missing type in declaration
Chris,

thank you for your answer.

I just tried the X# in both XIDE and VS2015.

No problem at all with the test App in XIDE (it's a mature product), but in VS2015 a simple WinForms app created using the template, do not run the debugger because the System.Drawing isn't automatically added to the references.

regards
George

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

More
2 years 10 months ago #5 by Chris Pyrgas
Replied by Chris Pyrgas on topic Compiler warning for missing type in declaration
Hi George,

Thanks for your report. I confirm that System.Drawing.dll is not automatically added as a reference, but even so, for some reason in my machine the WinForms app template builds and runs just fine here! Not sure why this is happening, will investigate it. I guess if you manually add the reference the sample works on your machine, too, is that right?

Chris

XSharp Development Team
chris(at)xsharp.eu

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

  • George Theopoulos
  • George Theopoulos's Avatar Topic Author
  • Offline
More
2 years 10 months ago #6 by George Theopoulos
Replied by George Theopoulos on topic Compiler warning for missing type in declaration
Chris,

>I guess if you manually add the reference the sample works on your machine, too, is that right?

True.

regards
George

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