Skip to content

Symbolic macros: Argument of type "rule" cannot be assigned to parameter of type "rule | macro | string | None" #388

@daltonclaybrook

Description

@daltonclaybrook

When creating a Bazel 8 symbolic macro, you can provide an argument called inherit_attrs to indicate that the macro should inherit the attributes of the provided rule.

# macros.bzl

load("@build_bazel_rules_swift//swift:swift_library.bzl", "swift_library")

my_library = macro(
    implementation = _my_library_impl,
    inherit_attrs = swift_library,
    attrs = {
        # my extra attributes
    },
)

However, it seems starpls does not recognize this syntax and emits the following error:

Argument of type "rule" cannot be assigned to parameter of type "rule | macro | string | None"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions