| Issue 74: | type parameter contraint + inline | |
| 1 person starred this issue and may be notified of changes. | Back to list |
using latest haXe/hxcpp from svn, the following source does not compile:
---------file Main.hx:
class Main
{
public static function main():Void
{
var foo = new Foo<FooItem>();
foo.foo(); //error C2039: 'compare' : is not a member of 'hx::Object'
}
}
class FooItem implements Comparable<FooItem>
{
public var i:Int;
public function new() {}
public function compare(other:FooItem):Int
{
return other.i - i;
}
}
---------file Comparable.hx:
interface Comparable<T>
{
function compare(other:T):Int;
}
---------file Foo.hx:
class Foo<T:Comparable<T>>
{
var _a:Array<T>;
public function new() {}
inline public function foo():Void //compiles when inline keyword is removed
{
var result = _a[0].compare(_a[1]);
}
}
Jan 17, 2011
Project Member
#1
gameh...@gmail.com
Status:
Fixed
Jan 20, 2011
Sorry, This one is still broken
Status:
Accepted
Jan 22, 2011
Hopefully this is fixed again.
Status:
Fixed
Jan 22, 2011
thanks, I can confirm that it works now :) |