Source

cowbel / test / failed-inference-test.cow

Full commit
/* cowbel test suite
 *
 * Written in 2012 by David Given.
 *
 * To the extent possible under law, the author has dedicated all copyright
 * and related and neighboring rights to this software to the public domain
 * worldwide. This software is distributed without any warranty.
 *
 * Please see the file COPYING.CC0 in the distribution package for more
 * information.
 */

#include <SimpleIO.ch>
#include <Application.ch>

type HasA =
{
	function doA(): int;
};

var o1 =
{
	implements HasA;
	
	function doA(): int
	{
		Application.Abort("failed");
	}
};

var o2 =
{
	implements HasA;
	
	function doA(): int
	{
		return 0;
	}
};

var o = o2;
o = o1;

println("start");
var i = o.doA() + 1;
println("end");