Skip to content

Bad error for tag component misuse #175

@Kelwan

Description

@Kelwan

When declaring a tag component, I accidentally made the mistake of declaring it in a system as readonly. The error given doesn't give a good description for the problem:

bazel-out/x64_windows-fastbuild-ST-0c60ee3d0c63/bin\system_impls/generated_sources/main.ecsact.systems.hh:60:15: error: no matching member function for call to 'get'                  
                return _ctx.get<cconf::demo::Player>();                                                                                                                                
                       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                   
external/ecsact_lang_cpp\ecsact/cpp/execution_context.hh:32:4: note: candidate template ignored: constraints not satisfied [with C = cconf::demo::Player]                              
        C get() const {                                                                                                                                                                
          ^
external/ecsact_lang_cpp\ecsact/cpp/execution_context.hh:31:12: note: because '!std::is_empty_v<cconf::demo::Player>' evaluated to false
                requires(!std::is_empty_v<C>)

Ecsact file example:

Component Player;

System DoThingWithPlayer {
    // Causes error above
    readonly Player;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions