eliasku / ecx

ECX is Entity Component System framework for Haxe
52 stars 10 forks source link

Fix position to user's code #5

Closed boozook closed 8 years ago

boozook commented 8 years ago

We have a problem if componentClass type is not found or have some errors. Then the position of "type not found"-error will be Haxelibs/ecx/0,0,4/src/ecx/macro/ClassMacroTools.hx:27: characters 31-40 : Type not found : AnyInvalidType but expected a real position in User's code.

See example:

import ecx.Engine;
import ecx.WorldConfig;
class Main
{
    public static function main():Void
    {
        var config = new WorldConfig();
        var world = Engine.initialize().createWorld(config, 1000);
        var game = world.create();
        world.edit(game).create(AnyInvalidType); // <-- error should be there but was in ecx/macro/ClassMacroTools.hx
    }
}

Run: haxe -main Main -lib pcx -dce no -x test


After this fix the error will be there:

Main.hx:10: characters 26-40 : Type not found : AnyInvalidType

eliasku commented 8 years ago

Could you make new pull request for v2 ?

boozook commented 8 years ago

Off course. Soon as possible.

eliasku commented 8 years ago

@fzzr- could you review my latest changes? For new version I've added @:pos almost everywhere. Maybe I missed something important. Just create a new issue or PR if you will found something is missing.