Skip to content

Warn if comptime item doesn't rely on non-comptime types #11720

@asterite

Description

@asterite

Problem

If a type, struct or enum is marked as comptime but doesn't refer to comptime-only types, a warning could be issued because the comptime keyword is not needed.

For example:

comptime type MyField = Field;
^^^^^^^^ unnecessary `comptime`: the type `MyField` doesn't refer to any comptime-only types

Happy Case

The compiler produces a warning in the above case.

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions