~eda-qa/dhlib/main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* <license>
 * This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
 * For full copyright and license information please refer to doc/license.txt.
 * </license> 
 */
class Game<Round_T> { 
	public function new() { } 
	public function nextRound() : Round_T { return null; }
}

class MyRound { 
	public var value : Int;
	public function new() { 
		value = 5;
	} 
}

class HCGame extends Game<MyRound> { 
	public function new() { 
		super(); 
	}
	//the use of "MyRound" here causes an illegal override in Flash 9
	override public function nextRound() : MyRound {
		return new MyRound();
	}
}

class GenericChain extends haxe.unit.TestCase
{
	public function textBasic() {
		var q = new HCGame();
		assertEquals( 5, q.nextRound().value );
	}
}