Indra-db / Flecs-Rust

Rust API for Flecs: A Fast and Flexible Entity Component System (ECS)
MIT License
194 stars 11 forks source link

query fails when omitting $"this" in relationship clause #186

Closed michael-dm closed 1 month ago

michael-dm commented 1 month ago

Omitting $"this" in conjonction with an id causes failure, though it should be assumed by default.

Reproducing code:

// Works
let fruit = world.entity();
query!(world, &Person, Likes($"this", $fruit)).build();

// Fails (should work)
query!(world, &Person, Likes($fruit)).build();

Expected: Both queries should work, with $"this" assumed when omitted. Actual: Query fails when $"this" is omitted.

michael-dm commented 1 month ago

I am stupid, correct syntax is :

query!(world, &Person, (Likes, $fruit)).build();