Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint against inserting () as a component #193

Open
BD103 opened this issue Dec 7, 2024 · 1 comment · May be fixed by #210
Open

Lint against inserting () as a component #193

BD103 opened this issue Dec 7, 2024 · 1 comment · May be fixed by #210
Labels
A-Linter Related to the linter and custom lints C-Feature Make something new possible X-Uncontroversial This work is generally agreed upon

Comments

@BD103
Copy link
Member

BD103 commented Dec 7, 2024

Please see this message on Discord for context.

commands.spawn((
    Name::new("Decal"),
    ForwardDecal,
    MeshMaterial3d(decal_standard_materials.add(ForwardDecalMaterial {
        base: StandardMaterial {
            base_color_texture: Some(asset_server.load("branding/bevy_logo_dark.png")),
            ..default()
        },
        extension: ForwardDecalMaterialExt {
            depth_fade_factor: 8.0,
        },
    })),
    Transform::from_translation(Vec3::new(0.75, 0.0, 0.0)).rotate_z(PI / 4.0),
));

rotate_z returns (), which is a component
So no compile error
And then because I didn't specify a transform, it silently uses the default one from requirered components
bleh

@BD103 BD103 added A-Linter Related to the linter and custom lints C-Feature Make something new possible labels Dec 7, 2024
@BD103 BD103 added this to the `bevy_lint` 0.2.0 milestone Dec 7, 2024
@janhohenheim
Copy link
Member

Oh wow, that's sneaky!

@janhohenheim janhohenheim added the X-Uncontroversial This work is generally agreed upon label Dec 9, 2024
@DaAlbrecht DaAlbrecht linked a pull request Dec 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Related to the linter and custom lints C-Feature Make something new possible X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants