GNOME Bugzilla – Bug 555754
Valac doesn't check any cast at compile time
Last modified: 2018-05-22 13:10:11 UTC
Please describe the problem: This testcase shows that vala doesn´t check any cast at compile time: public class Test : Object { construct { double g = (double)function; print ("%g\n", g); } public int function () { return 3; } public static void main (string[] args) { var test = new Test (); } } Valac compiles with no errors, but gcc detect the error in the cast. Valac should detect this and notice that error. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 244707 [details] [review] Proposed patch to add error message
As with all kinds of accepted Vala syntax that leads to uncompilable C code, I vote to set this to milestone 1.0.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/16.