Page 1 of 1
Compiler warning for missing type in declaration
Posted: Sat Feb 27, 2016 2:23 pm
by George
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
Compiler warning for missing type in declaration
Posted: Sat Feb 27, 2016 11:14 pm
by Chris
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
Compiler warning for missing type in declaration
Posted: Sun Feb 28, 2016 10:37 am
by Chris
> The current version of the C# compiler does ...
That should read "the X# compiler" of course!!
Chris
Compiler warning for missing type in declaration
Posted: Sun Feb 28, 2016 6:57 pm
by George
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
Compiler warning for missing type in declaration
Posted: Sun Feb 28, 2016 8:28 pm
by Chris
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
Compiler warning for missing type in declaration
Posted: Mon Feb 29, 2016 12:34 pm
by George
Chris,
>I guess if you manually add the reference the sample works on your machine, too, is that right?
True.
regards
George