Skip to content

conditional struct field #27125

@kobyzev

Description

@kobyzev

Describe the feature

struct MainContainer {
   view MainView
$if !no_log ? {
   logger Logger
}
   dev_menu DevMenu @[if !no_dev_menu ?]
}

V has a good feature of conditional compilation, but I see no way to make it inside struct declaration.
Please, give me existing workaround if any.
I know I can wrap by $if whole struct now, but it is painful if I have multiple conditions and vls-like apps going crazy

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