After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 555754 - Valac doesn't check any cast at compile time
Valac doesn't check any cast at compile time
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Basic Types
unspecified
Other All
: Normal normal
: 1.2
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 604682
 
 
Reported: 2008-10-10 03:51 UTC by Matias
Modified: 2018-05-22 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to add error message (1.04 KB, patch)
2013-05-19 12:09 UTC, geert jordaens
none Details | Review

Description Matias 2008-10-10 03:51:38 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:
Comment 1 geert jordaens 2013-05-19 12:09:28 UTC
Created attachment 244707 [details] [review]
Proposed patch to add error message
Comment 2 Michael 'Mickey' Lauer 2017-11-27 13:08:28 UTC
As with all kinds of accepted Vala syntax that leads to uncompilable C code, I vote to set this to milestone 1.0.
Comment 3 GNOME Infrastructure Team 2018-05-22 13:10:11 UTC
-- 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.