using GLib;

public class Test.ValueImplicitConversion
{
	private static string test (Value input)
	{
		var r = input.strdup_contents ();
		return r;
	}	

	public static void main (string[] args)
	{
		/* This isn't implemented yet:
                 * initializers eg. Value b = 1;
		 *
		 * and this: a = test (a);
		 * will generate "wrong" code
		 */

		Value a;

		a = 1;
		stdout.printf ("a type %s value %s\n", a.type_name (), a.strdup_contents ());
		a = 2.5;
		stdout.printf ("a type %s value %s\n", a.type_name (), a.strdup_contents ());
		a = test(4);
		stdout.printf ("a type %s value %s\n", a.type_name (), a.strdup_contents ());

		string b = (string) a;
		stdout.printf ("b value %s\n", b);
	}
}
