Skip to content

Better error messages for IntoSystem and IntoExclusive System #1519

Open
@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

The current error messages for when system parameters is wrong is very opaque. As an example:

 no method named `system` found for fn item `for<'r, 's, 't0, 't1> fn(Query<'r, (bevy::prelude::Entity, &'s AttackBonus, &'t0 Defense, &'t1 Advantage), bevy::prelude::With<(Active, Attack)>>, Commands) {check_attacks}` in the current scope
`check_attacks` is a function, perhaps you wish to call it

This is particularly painful because these mistakes are a common beginner issue and there's no clear path forward.

What solution would you like?

The compiler examines each of your system's parameters, explains which one fails, and ideally makes a simple suggestion on how to correct it.

What alternative(s) have you considered?

None.

Additional context

The relevant macros would be cleaned up substantially if variadic generics ever lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!S-BlockedThis cannot move forward until something else changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions