bevyengine / bevyengine/bevy

Better error messages for IntoSystem and IntoExclusive System

Open
#1,519 8 comments 5 reactions 0 assignees View on GitHub
A-ECS C-Usability D-Complex S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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](https://github.com/rust-lang/rfcs/issues/376) ever lands.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.