Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2014 20:21
Show Gist options
  • Save anonymous/8289216 to your computer and use it in GitHub Desktop.
Save anonymous/8289216 to your computer and use it in GitHub Desktop.
haxe-traits break with this Seems that if you import an "interface A"(IEntity) that has a variable of type "class B"(EntityData) that has a function with return type "class C"(Entity) and "class C" implements the "interface A", then variables from "interface A" simply aren't copied to "class C" or something like this. The same if you import "Cla…
package;
//works
//import world.Entity;
//works
//import world.IEntity;
//import world.Entity;
//not work
//import world.Entity;
//import world.IEntity;
//not work
import world.IEntity;
/**
* @author Joshua Granick
*/
class Main
{
// Entry point
static public function main():Void
{
}
}
package world;
class Entity implements IEntity
{}
package world;
class EntityData
{
//Entity here is important
public function breakAll() : Entity
{
return null;
}
}
package world;
interface IEntity extends traits.ITrait
{
public var x:Float = 0.0;
public var z:Float = 0.0;
public var y:Float = 0.0;
//EntityData here is important
public var entityData:EntityData;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment